Skip to content

Commit

Permalink
Replace an old model with a stable version on "How to use functions w…
Browse files Browse the repository at this point in the history
…ith a knowledge base" (#1556)
  • Loading branch information
ishida-openai authored Nov 8, 2024
1 parent 45a11fc commit 74b0969
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 70 deletions.
5 changes: 5 additions & 0 deletions authors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,8 @@ gbergengruen:
name: "Guillermo Bergengruen"
website: "https://github.com/gbergengruen"
avatar: "https://avatars.githubusercontent.com/u/140010883"

ishida-openai:
name: "Shuhei Ishida"
website: "https://www.linkedin.com/in/shuhei-i/"
avatar: "https://avatars.githubusercontent.com/u/186007001"
105 changes: 35 additions & 70 deletions examples/How_to_call_functions_for_knowledge_retrieval.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"from tqdm import tqdm\n",
"from termcolor import colored\n",
"\n",
"GPT_MODEL = \"gpt-3.5-turbo-0613\"\n",
"GPT_MODEL = \"gpt-4o-mini\"\n",
"EMBEDDING_MODEL = \"text-embedding-ada-002\"\n",
"client = OpenAI()"
]
Expand Down Expand Up @@ -192,10 +192,10 @@
{
"data": {
"text/plain": [
"{'title': 'Quantum types: going beyond qubits and quantum gates',\n",
" 'summary': 'Quantum computing is a growing field with significant potential applications.\\nLearning how to code quantum programs means understanding how qubits work and\\nlearning to use quantum gates. This is analogous to creating classical\\nalgorithms using logic gates and bits. Even after learning all concepts, it is\\ndifficult to create new algorithms, which hinders the acceptance of quantum\\nprogramming by most developers. This article outlines the need for higher-level\\nabstractions and proposes some of them in a developer-friendly programming\\nlanguage called Rhyme. The new quantum types are extensions of classical types,\\nincluding bits, integers, floats, characters, arrays, and strings. We show how\\nto use such types with code snippets.',\n",
" 'article_url': 'http://arxiv.org/abs/2401.15073v1',\n",
" 'pdf_url': 'http://arxiv.org/pdf/2401.15073v1'}"
"{'title': 'Long-range entanglement from spontaneous non-onsite symmetry breaking',\n",
" 'summary': \"We explore the states of matter arising from the spontaneous symmetry\\nbreaking (SSB) of $\\\\mathbb{Z}_2$ non-onsite symmetries. In one spatial\\ndimension, we construct a frustration-free lattice model exhibiting SSB of a\\nnon-onsite symmetry, which features the coexistence of two ground states with\\ndistinct symmetry-protected topological (SPT) orders. We analytically prove the\\ntwo-fold ground-state degeneracy and the existence of a finite energy gap.\\nFixing the symmetry sector yields a long-range entangled ground state that\\nfeatures long-range correlations among non-invertible charged operators. We\\nalso present a constant-depth measurement-feedback protocol to prepare such a\\nstate with a constant success probability in the thermodynamic limit, which may\\nbe of independent interest. Under a symmetric deformation, the SSB persists up\\nto a critical point, beyond which a gapless phase characterized by a conformal\\nfield theory emerges. In two spatial dimensions, the SSB of 1-form non-onsite\\nsymmetries leads to a long-range entangled state (SPT soup) - a condensate of\\n1d SPT along any closed loops. On a torus, there are four such locally\\nindistinguishable states that exhibit algebraic correlations between local\\noperators, which we derived via a mapping to the critical $O(2)$ loop model.\\nThis provides an intriguing example of `topological quantum criticality'. Our\\nwork reveals the exotic features of SSB of non-onsite symmetries, which may lie\\nbeyond the framework of topological holography (SymTFT).\",\n",
" 'article_url': 'http://arxiv.org/abs/2411.05004v1',\n",
" 'pdf_url': 'http://arxiv.org/pdf/2411.05004v1'}"
]
},
"execution_count": 6,
Expand Down Expand Up @@ -368,7 +368,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 6/6 [00:06<00:00, 1.08s/it]\n"
"100%|██████████| 18/18 [00:13<00:00, 1.37it/s]\n"
]
},
{
Expand All @@ -394,25 +394,21 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Core Argument:\n",
"- The academic paper explores the connection between the transverse field Ising (TFI) model and the ϕ4 model, highlighting the analogy between topological solitary waves in the ϕ4 model and the effect of the transverse field on spin flips in the TFI model.\n",
"- The study reveals regimes of memory/loss of memory and coherence/decoherence in the classical ϕ4 model subjected to periodic perturbations, which are essential in annealing phenomena.\n",
"- The exploration of the analogy between lower-dimensional linear quantum systems and higher-dimensional classical nonlinear systems can lead to a deeper understanding of information processing in these systems.\n",
"### Core Argument\n",
"- The paper presents a novel approach to quantum error correction (QEC) through the development of topological stabilizer codes based on continuous variable (CV) systems.\n",
"- It introduces a family of two-dimensional topological stabilizer codes that leverage boson condensation, generalizing existing models and addressing limitations in current QEC codes.\n",
"\n",
"Evidence:\n",
"- The authors analyze the dynamics and relaxation of weakly coupled ϕ4 chains through numerical simulations, observing kink and breather excitations and investigating the structural phase transition associated with the double well potential.\n",
"- The critical temperature (Tc) approaches zero as the inter-chain coupling strength (C⊥) approaches zero, but there is a finite Tc for C⊥>0.\n",
"- The spectral function shows peaks corresponding to particle motion across the double-well potential at higher temperatures and oscillations in a single well at lower temperatures.\n",
"- The soft-mode frequency (ωs) decreases as temperature approaches Ts, the dynamical crossover temperature.\n",
"- The relaxation process of the average displacement (QD) is controlled by spatially extended vibrations and large kink densities.\n",
"- The mean domain size (⟨DS⟩) exhibits an algebraic decay for finite C⊥>0.\n",
"- The probability of larger domain sizes is higher before a kick compared to after a kick for C⊥>0.\n",
"### Evidence\n",
"- **Topological Stabilizer Codes**: The authors construct codes that utilize continuous variable degrees of freedom, extending models like homological rotor codes and the toric-GKP code.\n",
"- **Boson Condensation**: The codes are derived from a parent stabilizer code based on Rgauge theory, demonstrating the creation of a broad class of topological CV stabilizer codes.\n",
"- **Anyons and Theories**: The codes are characterized by anyon theories from U(1) 2n×U(1)−2m Chern-Simons theories, some of which are non-chiral and do not support gapped boundaries, indicating their unique properties.\n",
"- **Hamiltonian Analysis**: The paper examines Hamiltonians associated with these codes, revealing that they can transition from a gapless to a gapped spectrum through quadratic perturbations.\n",
"- **Scalability**: The research emphasizes the potential for scalable QEC codes that are intrinsic to CV systems, which is crucial for reducing logical error rates in complex quantum computations.\n",
"\n",
"Conclusions:\n",
"- The authors suggest further exploration of the crossover between decoherence and finite coherence in periodic-kick strength space.\n",
"- They propose extending the study to different kick profiles, introducing kink defects, and studying weakly-coupled chains in higher dimensions.\n",
"- Recognizing similarities between classical nonlinear equations and quantum linear ones in information processing is important.\n",
"- Future research directions include investigating the dynamics of quantum annealing, measurement and memory in the periodically driven complex Ginzburg-Landau equation, and the behavior of solitons and domain walls in various systems.\n"
"### Conclusions\n",
"- The introduction of topological stabilizer codes based on continuous variables represents a significant advancement in the field of quantum error correction, providing a framework for developing fault-tolerant codes that can protect against logical errors.\n",
"- The findings suggest that these codes may not be realizable through traditional concatenation methods, indicating the potential for new classes of QEC codes that are fundamentally different from existing finite-dimensional systems.\n",
"- Future research directions include exploring many-body generalizations of quantum codes and the practical implementation of these theoretical models in experimental platforms, such as superconducting qubits.\n"
]
}
],
Expand Down Expand Up @@ -637,21 +633,19 @@
{
"data": {
"text/markdown": [
"PPO (Proximal Policy Optimization) is a reinforcement learning algorithm that aims to find the optimal policy for an agent by optimizing the policy parameters in an iterative manner. Here are a few papers that discuss PPO in more detail:\n",
"It looks like none of the listed papers directly address Proximal Policy Optimization (PPO) in reinforcement learning. However, if you are looking for a summary of how PPO works, I can provide that information based on general knowledge.\n",
"\n",
"1. Title: \"Proximal Policy Optimization Algorithms\"\n",
" Article URL: [arxiv.org/abs/1707.06347v2](http://arxiv.org/abs/1707.06347v2)\n",
" Summary: This paper introduces two algorithms, PPO (Proximal Policy Optimization) and TRPO (Trust Region Policy Optimization), that address the issue of sample efficiency and stability in reinforcement learning. PPO uses a surrogate objective function that makes smaller updates to the policy parameters, resulting in more stable and efficient learning.\n",
"PPO is a popular reinforcement learning algorithm that seeks to optimize an agent's policy in a way that is both effective and stable. The key ideas behind PPO include:\n",
"\n",
"2. Title: \"Emergence of Locomotion Behaviours in Rich Environments with PPO\"\n",
" Article URL: [arxiv.org/abs/1707.02286v3](http://arxiv.org/abs/1707.02286v3)\n",
" Summary: This paper explores the use of PPO in training agents to learn locomotion behaviors in complex and dynamic environments. The authors demonstrate the effectiveness of PPO in learning a variety of locomotion skills, such as walking, jumping, and climbing.\n",
"1. **Clipping Objective**: PPO modifies the objective function using a clipped surrogate objective. This avoids excessively large updates, which can destabilize training. The clipped objective restricts how much the probability ratio between the new and old policies can differ, allowing for better control over policy updates.\n",
"\n",
"3. Title: \"Proximal Policy Optimization for Multi-Agent Systems\"\n",
" Article URL: [arxiv.org/abs/2006.14171v2](http://arxiv.org/abs/2006.14171v2)\n",
" Summary: This paper extends PPO to the domain of multi-agent systems, where multiple agents interact and learn together. The authors propose a decentralized version of PPO that allows each agent to update its policy independently based on its local observations, resulting in more scalable and efficient learning in multi-agent environments.\n",
"2. **Policy Gradient**: PPO uses policy gradient methods, where the focus is on directly adjusting the policy based on the agent's performance after taking actions in the environment.\n",
"\n",
"These papers provide detailed explanations of the PPO algorithm, its advantages, and its applications in different scenarios. Reading them can give you a deeper understanding of how PPO reinforcement learning works."
"3. **Multiple Epochs**: PPO often utilizes multiple epochs of training on the same batch of data, which improves sample efficiency as it allows the agent to learn from the same data multiple times.\n",
"\n",
"4. **Generalized Advantage Estimation (GAE)**: To reduce the variance of the policy gradient estimates, PPO frequently employs GAE, which provides a more stable estimate of returns.\n",
"\n",
"If you have specific questions about reinforcement learning or want references to further reading, feel free to ask!"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
Expand Down Expand Up @@ -683,47 +677,18 @@
"output_type": "stream",
"text": [
"Function generation requested, calling function\n",
"Finding and reading paper\n",
"Chunking text from paper\n",
"Summarizing each chunk of text\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 6/6 [00:07<00:00, 1.19s/it]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Summarizing into overall summary\n"
"Getting search results\n",
"Got search results, summarizing content\n"
]
},
{
"data": {
"text/markdown": [
"Core Argument:\n",
"- The academic paper explores the connection between the transverse field Ising (TFI) model and the ϕ4 model, highlighting the analogy between the coupling of topological solitary waves in the ϕ4 model and the effect of the transverse field on spin flips in the TFI model.\n",
"- The study reveals regimes of memory/loss of memory and coherence/decoherence in the classical ϕ4 model subjected to periodic perturbations, which are essential in annealing phenomena.\n",
"- The exploration of the analogy between lower-dimensional linear quantum systems and higher-dimensional classical nonlinear systems can lead to a deeper understanding of information processing in these systems.\n",
"It seems that I couldn't find any specific paper that discusses \"PPO sequence generation.\" If you meant a particular paper on PPO in reinforcement learning, please provide its title or broad topic. Alternatively, if you want to know about PPO in the context of generating sequences or trajectories, I can provide a detailed explanation based on existing knowledge in reinforcement learning.\n",
"\n",
"Evidence:\n",
"- The authors analyze the dynamics and relaxation of weakly coupled ϕ4 chains through numerical simulations, studying the behavior of kink and breather excitations and the structural phase transition associated with the double well potential.\n",
"- The critical temperature (Tc) approaches zero as the inter-chain coupling strength (C⊥) approaches zero, but there is a finite Tc for C⊥>0.\n",
"- The spectral function shows peaks corresponding to particle motion across the double-well potential at higher temperatures and oscillations in a single well at lower temperatures.\n",
"- The soft-mode frequency (ωs) decreases as temperature approaches Ts, the dynamical crossover temperature.\n",
"- The relaxation process of the average displacement (QD) is controlled by spatially extended vibrations and large kink densities.\n",
"- The mean domain size (⟨DS⟩) exhibits an algebraic decay for finite C⊥>0.\n",
"- The probability of larger domain sizes is higher before a kick compared to after a kick for C⊥>0.\n",
"If you are referring to a specific recent study, I recommend checking relevant platforms like arXiv or Google Scholar for the latest publications on PPO and sequence generation.\n",
"\n",
"Conclusions:\n",
"- The study of weakly-coupled classical ϕ4 chains provides insights into quantum annealing architectures and the role of topological excitations in these systems.\n",
"- The equilibration of the system is faster for higher kick strengths, and the mean domain size increases with higher final temperatures.\n",
"- Further exploration of the crossover between decoherence and finite coherence in periodic-kick strength space is suggested.\n",
"- The paper highlights the importance of recognizing similarities between classical nonlinear equations and quantum linear ones in information processing and suggests future research directions in this area."
"Let me know how you'd like to proceed!"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
Expand All @@ -748,7 +713,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "openai-cookbook",
"language": "python",
"name": "python3"
},
Expand All @@ -762,7 +727,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.1"
"version": "3.12.7"
}
},
"nbformat": 4,
Expand Down
1 change: 1 addition & 0 deletions registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
date: 2023-06-14
authors:
- colin-openai
- ishida-openai
tags:
- completions
- functions
Expand Down

0 comments on commit 74b0969

Please sign in to comment.