Lil'Log ยท 2023-06-23

LLM Powered Autonomous Agents

<p>Building agents with LLM (large language model) as its core controller is a cool concept. Several proof-of-concepts demos, such as <a href=&#34;https://github.com/Significant-Gravitas/Auto-GPT&#34;>AutoGPT</a>, <a href=&#34;https://github.com/AntonOsika/gpt-engineer&#34;>GPT-Engineer</a> and <a href=&#34;https://github.com/yoheinakajima/babyagi&#34;>BabyAGI</a>, serve as inspiring examples. The potentiality of LLM extends beyond generating well-written copies, stories, essays and programs; it can be framed as a powerful general problem solver.</p> <h1 id=&#34;agent-system-overview&#34;>Agent System Overview</h1> <p>In a LLM-powered autonomous agent system, LLM functions as the agent&rsquo;s brain, complemented by several key components:</p> <ul> <li><strong>Planning</strong> <ul> <li>Subgoal and decomposition: The agent breaks down large tasks into smaller, manageable subgoals, enabling efficient handling of complex tasks.</li> <li>Reflection and refinement: The agent can do self-criticism and self-reflection over past actions, learn from mistakes and refine them for future steps, thereby improving the quality of final results.</li> </ul> </li> <li><strong>Memory</strong> <ul> <li>Short-term memory: I would consider all the in-context learning (See <a href=&#34;https://lilianweng.github.io/posts/2023-03-15-prompt-engineering/&#34;>Prompt Engineering</a>) as utilizing short-term memory of the model to learn.</li> <li>Long-term memory: This provides the agent with the capability to retain and recall (infinite) information over extended periods, often by leveraging an external vector store and fast retrieval.</li> </ul> </li> <li><strong>Tool use</strong> <ul> <li>The agent learns to call external APIs for extra information that is missing from the model weights (often hard to change after pre-training), including current information, code execution capability, access to proprietary information sources and more.</li> </ul> </li> </ul> <figure> <img src=&#34;agent-overview.png&#34; style=&#34;width: 100%;&#34; /> <figcaption>Overview of a LLM-powered autonomous agent system.</figcaption> </figure> <h1 id=&#34;component-one-planning&#34;>Component One: Planning</h1> <p>A complicated task usually involves many steps. An agent needs to know what they are and plan ahead.</p>

Open original