id
stringlengths
12
15
title
stringlengths
8
162
content
stringlengths
1
17.6k
prechunk_id
stringlengths
0
15
postchunk_id
stringlengths
0
15
arxiv_id
stringlengths
10
10
references
listlengths
1
1
2308.08285#35
Pre-training with Large Language Model-based Document Expansion for Dense Passage Retrieval
Ernie-search: Bridging cross-encoder with dual-encoder via self on-the- fly distillation for dense passage retrieval. arXiv preprint arXiv:2205.09153. Ma, X.; Guo, J.; Zhang, R.; Fan, Y.; and Cheng, X. 2022. Pre-train a Discriminative Text Encoder for Dense Re- arXiv preprint trieval via Contrastive Span Prediction. arXiv:2204.10641. Nguyen, T.; Rosenberg, M.; Song, X.; Gao, J.; Tiwary, S.; Majumder, R.; and Deng, L. 2016. MS MARCO: A Hu- man Generated MAchine Reading COmprehension Dataset.
2308.08285#34
2308.08285#36
2308.08285
[ "2203.05765" ]
2308.08285#36
Pre-training with Large Language Model-based Document Expansion for Dense Passage Retrieval
In Besold, T. R.; Bordes, A.; dâ Avila Garcez, A. S.; and Wayne, G., eds., Proceedings of the Workshop on Cognitive Computation: Integrating neural and symbolic approaches 2016 co-located with the 30th Annual Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain, December 9, 2016, volume 1773 of CEUR Workshop Proceedings. CEUR-WS.org. Nogueira, R. F.; Yang, W.; Lin, J.; and Cho, K. 2019. CoRR, Document Expansion by Query Prediction. abs/1904.08375. Ouyang, L.; Wu, J.; Jiang, X.; Almeida, D.; Wainwright, C. L.; Mishkin, P.; Zhang, C.; Agarwal, S.; Slama, K.; Ray, A.; Schulman, J.; Hilton, J.; Kelton, F.; Miller, L.; Simens, M.; Askell, A.; Welinder, P.; Christiano, P. F.; Leike, J.; and Lowe, R. 2022. Training language models to follow instruc- tions with human feedback. In NeurIPS.
2308.08285#35
2308.08285#37
2308.08285
[ "2203.05765" ]
2308.08285#37
Pre-training with Large Language Model-based Document Expansion for Dense Passage Retrieval
Qu, Y.; Ding, Y.; Liu, J.; Liu, K.; Ren, R.; Zhao, W. X.; Dong, D.; Wu, H.; and Wang, H. 2021. RocketQA: An Op- timized Training Approach to Dense Passage Retrieval for Open-Domain Question Answering. In Proceedings of the 2021 Conference of the North American Chapter of the As- sociation for Computational Linguistics: Human Language Technologies, 5835â 5847. Online: Association for Compu- tational Linguistics. Ren, R.; Qu, Y.; Liu, J.; Zhao, W. X.; She, Q.; Wu, H.; Wang, H.; and Wen, J.-R. 2021. RocketQAv2: A Joint Train- ing Method for Dense Passage Retrieval and Passage Re- ranking. In Proceedings of the 2021 Conference on Empir- ical Methods in Natural Language Processing, 2825â 2835.
2308.08285#36
2308.08285#38
2308.08285
[ "2203.05765" ]
2308.08285#38
Pre-training with Large Language Model-based Document Expansion for Dense Passage Retrieval
Online and Punta Cana, Dominican Republic: Association for Computational Linguistics. Robertson, S.; Zaragoza, H.; et al. 2009. The probabilistic relevance framework: BM25 and beyond. Foundations and Trends® in Information Retrieval, 3(4): 333â 389. Sakata, W.; Shibata, T.; Tanaka, R.; and Kurohashi, S. 2019. FAQ Retrieval using Query-Question Similarity and BERT- Based Query-Answer Relevance. In Piwowarski, B.; Cheva- lier, M.; Gaussier, ´E.; Maarek, Y.; Nie, J.; and Scholer, F., eds., Proceedings of the 42nd International ACM SI- GIR Conference on Research and Development in Informa- tion Retrieval, SIGIR 2019, Paris, France, July 21-25, 2019, 1113â
2308.08285#37
2308.08285#39
2308.08285
[ "2203.05765" ]
2308.08285#39
Pre-training with Large Language Model-based Document Expansion for Dense Passage Retrieval
1116. ACM. Santhanam, K.; Khattab, O.; Saad-Falcon, J.; Potts, C.; and Zaharia, M. 2022. ColBERTv2: Effective and Efficient Re- In Proceedings trieval via Lightweight Late Interaction. of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Lan- guage Technologies, 3715â 3734. Seattle, United States: As- sociation for Computational Linguistics.
2308.08285#38
2308.08285#40
2308.08285
[ "2203.05765" ]
2308.08285#40
Pre-training with Large Language Model-based Document Expansion for Dense Passage Retrieval
Thakur, N.; Reimers, N.; R¨uckl´e, A.; Srivastava, A.; and Gurevych, I. 2021. BEIR: A Heterogenous Benchmark for Zero-shot Evaluation of Information Retrieval Models. CoRR, abs/2104.08663. Touvron, H.; Lavril, T.; Izacard, G.; Martinet, X.; Lachaux, M.; Lacroix, T.; Rozi`ere, B.; Goyal, N.; Hambro, E.; Azhar, F.; Rodriguez, A.; Joulin, A.; Grave, E.; and Lample, G. 2023. LLaMA: Open and Efficient Foundation Language Models. CoRR, abs/2302.13971. Wang, L.; Yang, N.; Huang, X.; Jiao, B.; Yang, L.; Jiang, D.; Majumder, R.; and Wei, F. 2022a. SimLM:
2308.08285#39
2308.08285#41
2308.08285
[ "2203.05765" ]
2308.08285#41
Pre-training with Large Language Model-based Document Expansion for Dense Passage Retrieval
Pre-training with Representation Bottleneck for Dense Passage Retrieval. CoRR, abs/2207.02578. Query2doc: Wang, L.; Yang, N.; and Wei, F. 2023. Query Expansion with Large Language Models. CoRR, abs/2303.07678. Wang, Y.; Kordi, Y.; Mishra, S.; Liu, A.; Smith, N. A.; Khashabi, D.; and Hajishirzi, H. 2023.
2308.08285#40
2308.08285#42
2308.08285
[ "2203.05765" ]
2308.08285#42
Pre-training with Large Language Model-based Document Expansion for Dense Passage Retrieval
Self-Instruct: Align- ing Language Models with Self-Generated Instructions. In Rogers, A.; Boyd-Graber, J. L.; and Okazaki, N., eds., Pro- ceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), ACL 2023, Toronto, Canada, July 9-14, 2023, 13484â 13508. As- sociation for Computational Linguistics. Wang, Y.; Mishra, S.; Alipoormolabashi, P.; Kordi, Y.; Mirzaei, A.; Naik, A.; Ashok, A.; Dhanasekaran, A. S.; Arunkumar, A.; Stap, D.; Pathak, E.; Karamanolakis, G.; Lai, H. G.; Purohit, I.; Mondal, I.; Anderson, J.; Kuznia, K.; Doshi, K.; Pal, K. K.; Patel, M.; Moradshahi, M.; Par- mar, M.; Purohit, M.; Varshney, N.; Kaza, P. R.; Verma, P.; Puri, R. S.; Karia, R.; Doshi, S.; Sampat, S. K.; Mishra, S.; A, S. R.; Patro, S.; Dixit, T.; and Shen, X. 2022b.
2308.08285#41
2308.08285#43
2308.08285
[ "2203.05765" ]
2308.08285#43
Pre-training with Large Language Model-based Document Expansion for Dense Passage Retrieval
Super- NaturalInstructions: Generalization via Declarative Instruc- tions on 1600+ NLP Tasks. In Goldberg, Y.; Kozareva, Z.; and Zhang, Y., eds., Proceedings of the 2022 Confer- ence on Empirical Methods in Natural Language Process- ing, EMNLP 2022, Abu Dhabi, United Arab Emirates, De- cember 7-11, 2022, 5085â 5109. Association for Computa- tional Linguistics. Wenzek, G.; Lachaux, M.; Conneau, A.; Chaudhary, V.; Guzm´an, F.; Joulin, A.; and Grave, E. 2020. CCNet: Extract- ing High Quality Monolingual Datasets from Web Crawl In Calzolari, N.; B´echet, F.; Blache, P.; Choukri, Data. K.; Cieri, C.; Declerck, T.; Goggi, S.; Isahara, H.; Mae- gaard, B.; Mariani, J.; Mazo, H.; Moreno, A.; Odijk, J.; and Piperidis, S., eds., Proceedings of The 12th Language Re- sources and Evaluation Conference, LREC 2020, Marseille, France, May 11-16, 2020, 4003â
2308.08285#42
2308.08285#44
2308.08285
[ "2203.05765" ]
2308.08285#44
Pre-training with Large Language Model-based Document Expansion for Dense Passage Retrieval
4012. European Language Resources Association. Wu, X.; Ma, G.; and Hu, S. 2022. Query-as- context Pre-training for Dense Passage Retrieval. CoRR, abs/2212.09598. Wu, X.; Ma, G.; Lin, M.; Lin, Z.; Wang, Z.; and Hu, S. 2023a. ConTextual Masked Auto-Encoder for Dense Pas- sage Retrieval. In Williams, B.; Chen, Y.; and Neville, J., eds., Thirty-Seventh AAAI Conference on Artificial Intelli- gence, AAAI 2023, Thirty-Fifth Conference on Innovative Applications of Artificial Intelligence, IAAI 2023, Thirteenth Symposium on Educational Advances in Artificial Intelli- gence, EAAI 2023, Washington, DC, USA, February 7-14, 2023, 4738â 4746. AAAI Press. Wu, X.; Ma, G.; Wang, P.; Lin, M.; Lin, Z.; Zhang, F.; and Hu, S. 2023b. CoT-MAE v2: Contextual Masked Auto- Encoder with Multi-view Modeling for Passage Retrieval. arXiv:2304.03158. Yu, W.; Iter, D.; Wang, S.; Xu, Y.; Ju, M.; Sanyal, S.; Zhu, C.; Zeng, M.; and Jiang, M. 2023. Generate rather than Re- trieve: Large Language Models are Strong Context Gener- ators. In The Eleventh International Conference on Learn- ing Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023.
2308.08285#43
2308.08285#45
2308.08285
[ "2203.05765" ]
2308.08285#45
Pre-training with Large Language Model-based Document Expansion for Dense Passage Retrieval
OpenReview.net. Zhou, K.; Liu, X.; Gong, Y.; Zhao, W. X.; Jiang, D.; Duan, N.; and Wen, J.-R. 2022. MASTER: Multi-task Pre-trained Bottlenecked Masked Autoencoders are Better Dense Re- trievers. arXiv preprint arXiv:2212.07841. Zou, L.; Lu, W.; Liu, Y.; Cai, H.; Chu, X.; Ma, D.; Shi, D.; Sun, Y.; Cheng, Z.; Gu, S.; Wang, S.; and Yin, D. 2023. Pre- trained Language Model-based Retrieval and Ranking for Web Search.
2308.08285#44
2308.08285#46
2308.08285
[ "2203.05765" ]
2308.08285#46
Pre-training with Large Language Model-based Document Expansion for Dense Passage Retrieval
ACM Trans. Web, 17(1): 4:1â 4:36.
2308.08285#45
2308.08285
[ "2203.05765" ]
2308.08155#0
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
3 2 0 2 t c O 3 ] I A . s c [ 2 v 5 5 1 8 0 . 8 0 3 2 : v i X r a # AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation Qingyun Wuâ , Gagan Bansalâ , Jieyu Zhang±, Yiran Wuâ , Beibin Liâ Erkang Zhuâ , Li Jiangâ , Xiaoyun Zhangâ , Shaokun Zhangâ , Jiale Liuâ Ahmed Awadallahâ , Ryen W. Whiteâ , Doug Burgerâ , Chi Wangâ 1 â Microsoft Research, â Pennsylvania State University ±University of Washington,â Xidian University
2308.08155#1
2308.08155
[ "2103.03874" ]
2308.08155#1
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
° Plot a chart of nS SD wera ond TESLA BD] Wirt: stock price change ZA » vo. s| J Execute the following code... â = Month Multi-Agent Conversations @&@D Error package 2a GD No, please plot % yfinance is not ~ change! installed Got it! Here is the @my Sorry! Please first revised code. ~ pip install yfinance ® ouput â and then execute hopen BO Frtaling.
2308.08155#0
2308.08155#2
2308.08155
[ "2103.03874" ]
2308.08155#2
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
E a Month chat Hierarchi Flexible Conversation Patterns Example Agent Chat Figure 1: AutoGen enables diverse LLM-based applications using multi-agent conversations. (Left) AutoGen agents are conversable, customizable, and can be based on LLMs, tools, humans, or even a combination of them. (Top-middle) Agents can converse to solve tasks. (Right) They can form a chat, potentially with humans in the loop. (Bottom-middle) The framework supports flexible conversation patterns. # Abstract AutoGen2 is an open-source framework that allows developers to build LLM ap- plications via multiple agents that can converse with each other to accomplish tasks. AutoGen agents are customizable, conversable, and can operate in vari- ous modes that employ combinations of LLMs, human inputs, and tools. Using AutoGen, developers can also flexibly define agent interaction behaviors. Both natural language and computer code can be used to program flexible conversation patterns for different applications. AutoGen serves as a generic framework for building diverse applications of various complexities and LLM capacities. Em- pirical studies demonstrate the effectiveness of the framework in many example applications, with domains ranging from mathematics, coding, question answer- ing, operations research, online decision-making, entertainment, etc.
2308.08155#1
2308.08155#3
2308.08155
[ "2103.03874" ]
2308.08155#3
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
1Corresponding author. Email: [email protected] 2https://github.com/microsoft/autogen # 1 Introduction Large language models (LLMs) are becoming a crucial building block in developing powerful agents that utilize LLMs for reasoning, tool usage, and adapting to new observations (Yao et al., 2022; Xi et al., 2023; Wang et al., 2023b) in many real-world tasks. Given the expanding tasks that could benefit from LLMs and the growing task complexity, an intuitive approach to scale up the power of agents is to use multiple agents that cooperate. Prior work suggests that multiple agents can help encourage divergent thinking (Liang et al., 2023), improve factuality and reasoning (Du et al., 2023), and provide validation (Wu et al., 2023). In light of the intuition and early evidence of promise, it is intriguing to ask the following question: how can we facilitate the development of LLM applications that could span a broad spectrum of domains and complexities based on the multi-agent approach? Our insight is to use multi-agent conversations to achieve it. There are at least three reasons con- firming its general feasibility and utility thanks to recent advances in LLMs: First, because chat- optimized LLMs (e.g., GPT-4) show the ability to incorporate feedback, LLM agents can cooperate through conversations with each other or human(s), e.g., a dialog where agents provide and seek rea- soning, observations, critiques, and validation. Second, because a single LLM can exhibit a broad range of capabilities (especially when configured with the correct prompt and inference settings), conversations between differently configured agents can help combine these broad LLM capabilities in a modular and complementary manner. Third, LLMs have demonstrated ability to solve complex tasks when the tasks are broken into simpler subtasks. Multi-agent conversations can enable this partitioning and integration in an intuitive manner. How can we leverage the above insights and support different applications with the common requirement of coordinating multiple agents, poten- tially backed by LLMs, humans, or tools exhibiting different capacities? We desire a multi-agent conversation framework with generic abstraction and effective implementation that has the flexibil- ity to satisfy different application needs.
2308.08155#2
2308.08155#4
2308.08155
[ "2103.03874" ]
2308.08155#4
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Achieving this requires addressing two critical questions: (1) How can we design individual agents that are capable, reusable, customizable, and effective in multi-agent collaboration? (2) How can we develop a straightforward, unified interface that can accommodate a wide range of agent conversation patterns? In practice, applications of varying complexities may need distinct sets of agents with specific capabilities, and may require different conversation patterns, such as single- or multi-turn dialogs, different human involvement modes, and static vs. dynamic conversation. Moreover, developers may prefer the flexibility to program agent interactions in natural language or code. Failing to adequately address these two questions would limit the frameworkâ s scope of applicability and generality. While there is contemporaneous exploration of multi-agent approaches,3 we present AutoGen, a generalized multi-agent conversation framework (Figure 1), based on the following new concepts. 1 Customizable and conversable agents. AutoGen uses a generic design of agents that can lever- age LLMs, human inputs, tools, or a combination of them. The result is that developers can easily and quickly create agents with different roles (e.g., agents to write code, execute code, wire in human feedback, validate outputs, etc.) by selecting and configuring a subset of built-in capabilities. The agentâ s backend can also be readily extended to allow more custom behaviors. To make these agents suitable for multi-agent conversation, every agent is made conversable â they can receive, react, and respond to messages. When configured properly, an agent can hold multiple turns of conversations with other agents autonomously or solicit human inputs at cer- tain rounds, enabling human agency and automation. The conversable agent design leverages the strong capability of the most advanced LLMs in taking feedback and making progress via chat and also allows combining capabilities of LLMs in a modular fashion. (Section 2.1) 2 Conversation programming. A fundamental insight of AutoGen is to simplify and unify com- plex LLM application workflows as multi-agent conversations. So AutoGen adopts a program- ming paradigm centered around these inter-agent conversations. We refer to this paradigm as conversation programming, which streamlines the development of intricate applications via two primary steps: (1) defining a set of conversable agents with specific capabilities and roles (as described above); (2) programming the interaction behavior between agents via conversation- centric computation and control.
2308.08155#3
2308.08155#5
2308.08155
[ "2103.03874" ]
2308.08155#5
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Both steps can be achieved via a fusion of natural and pro- gramming languages to build applications with a wide range of conversation patterns and agent behaviors. AutoGen provides ready-to-use implementations and also allows easy extension and experimentation for both steps. (Section 2.2) 3We refer to Appendix A for a detailed discussion. 2 AutoGen also provides a collection of multi-agent applications created using conversable agents and conversation programming. These applications demonstrate how AutoGen can easily support applications of various complexities and LLMs of various capabilities. Moreover, we perform both evaluation on benchmarks and a pilot study of new applications. The results show that AutoGen can help achieve outstanding performance on many tasks, and enable innovative ways of using LLMs, while reducing development effort. (Section 3 and Appendix D) # 2 The AutoGen Framework To reduce the effort required for developers to create complex LLM applications across various do- mains, a core design principle of AutoGen is to streamline and consolidate multi-agent workflows using multi-agent conversations. This approach also aims to maximize the reusability of imple- mented agents. This section introduces the two key concepts of AutoGen: conversable agents and conversation programming. # 2.1 Conversable Agents In AutoGen, a conversable agent is an entity with a specific role that can pass messages to send and receive information to and from other conversable agents, e.g., to start or continue a conversation. It maintains its internal context based on sent and received messages and can be configured to possess a set of capabilities, e.g., enabled by LLMs, tools, or human input, etc. The agents can act according to programmed behavior patterns described next. Agent capabilities powered by LLMs, humans, and tools. Since an agentâ s capabilities directly influence how it processes and responds to messages, AutoGen allows flexibility to endow its agents with various capabilities. AutoGen supports many common composable capabilities for agents, including 1) LLMs. LLM-backed agents exploit many capabilities of advanced LLMs such as role playing, implicit state inference and progress making conditioned on conversation history, providing feedback, adapting from feedback, and coding. These capabilities can be combined in different ways via novel prompting techniques4 to increase an agentâ s skill and autonomy.
2308.08155#4
2308.08155#6
2308.08155
[ "2103.03874" ]
2308.08155#6
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
AutoGen also offers enhanced LLM inference features such as result caching, error handling, message templating, etc., via an enhanced LLM inference layer. 2) Humans. Human involvement is desired or even essential in many LLM applications. AutoGen lets a human participate in agent conversation via human- backed agents, which could solicit human inputs at certain rounds of a conversation depending on the agent configuration. The default user proxy agent allows configurable human involvement levels and patterns, e.g., frequency and conditions for requesting human input including the option for humans to skip providing input. 3) Tools. Tool-backed agents have the capability to execute tools via code execution or function execution. For example, the default user proxy agent in AutoGen is able to execute code suggested by LLMs, or make LLM-suggested function calls. Agent customization and cooperation. Based on application-specific needs, each agent can be configured to have a mix of basic back-end types to display complex behavior in multi-agent con- versations. AutoGen allows easy creation of agents with specialized capabilities and roles by reusing or extending the built-in agents. The yellow-shaded area of Figure 2 provides a sketch of the built-in agents in AutoGen. The ConversableAgent class is the highest-level agent abstraction and, by default, can use LLMs, humans, and tools. The AssistantAgent and UserProxyAgent are two pre-configured ConversableAgent subclasses, each representing a common usage mode, i.e., act- ing as an AI assistant (backed by LLMs) and acting as a human proxy to solicit human input or execute code/function calls (backed by humans and/or tools). In the example on the right-hand side of Figure 1, an LLM-backed assistant agent and a tool- and human-backed user proxy agent are deployed together to tackle a task. Here, the assistant agent generates a solution with the help of LLMs and passes the solution to the user proxy agent. Then, the user proxy agent solicits human inputs or executes the assistantâ s code and passes the results as feedback back to the assistant. 4Appendix C presents an example of such novel prompting techniques which empowers the default LLM- backed assistant agent in AutoGen to converse with other agents in multi-step problem solving. 3 ConversableAgent Unified Conversation Interfaces: + send + receive + generate_reply Agent Customization: human_input_mode = â NEVERâ
2308.08155#5
2308.08155#7
2308.08155
[ "2103.03874" ]
2308.08155#7
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
code_execution_config = False DEFAULT_SYSTEM_MESSAGE = â You are a helpful AI assistant. a human_input_mode = â NEVERâ In the following cases, suggest _ =| Y = AutoGen python code..â = human input_rjode = â ALWAYSâ pareup_chat -@Weoee! Agents r= 1 el | @2 | 1 1 - 1 1 1 '@} 0 AssistantAgent UserProxyAgent GroupChatManager 1.2 Register a Custom Reply Func: 1.1 Define Agents: # This func will be invoked in po2esrn generate_reply 1 A.register_reply(B, 1 func is registered, a reply_func_A2B) 0 1 list of de ly def reply_func_A2B(msg) 1 functions will be used ouput = input_from_humanC) Developer i i . User Proxy A Assistant B Code c 1 ncludes code 2 Initiate Conversations: 0 A.initiate_chat(â
2308.08155#6
2308.08155#8
2308.08155
[ "2103.03874" ]
2308.08155#8
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Plot a chart of META and return output TESLA stock price change YTD.â , B) Fi] â , The Resulting Automated Agent Chat: Conversation-Driven . Control Flow Plot a chart of META and foci Se generate_reply TESLA stock price change YTD. necetve Execute the following , Send Program ae aieâ LUD sesso Execution Error: package yfinance is not » installed generate_reply Conversation-Centric Sorry! Please first pip install | Computation yfinance and then execute
2308.08155#7
2308.08155#9
2308.08155
[ "2103.03874" ]
2308.08155#9
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Figure 2: Illustration of how to use AutoGen to program a multi-agent conversation. The top sub- figure illustrates the built-in agents provided by AutoGen, which have unified conversation interfaces and can be customized. The middle sub-figure shows an example of using AutoGen to develop a two-agent system with a custom reply function. The bottom sub-figure illustrates the resulting automated agent chat from the two-agent system during program execution. By allowing custom agents that can converse with each other, conversable agents in AutoGen serve as a useful building block. However, to develop applications where agents make meaningful progress on tasks, developers also need to be able to specify and mold these multi-agent conversations. # 2.2 Conversation Programming As a solution to the above problem, AutoGen utilizes conversation programming, a paradigm that considers two concepts: the first is computation â the actions agents take to compute their response in a multi-agent conversation. And the second is control flow â the sequence (or conditions) un- der which these computations happen. As we will show in the applications section, the ability to program these helps implement many flexible multi-agent conversation patterns. In AutoGen, these computations are conversation-centric. An agent takes actions relevant to the conversations it is involved in and its actions result in message passing for consequent conversations (unless a termina- tion condition is satisfied). Similarly, control flow is conversation-driven â the participating agentsâ decisions on which agents to send messages to and the procedure of computation are functions of the inter-agent conversation. This paradigm helps one to reason intuitively about a complex workflow as agent action taking and conversation message-passing between agents. Figure 2 provides a simple illustration. The bottom sub-figure shows how individual agents perform their role-specific, conversation-centric computations to generate responses (e.g., via LLM inference calls and code execution). The task progresses through conversations displayed in the dialog box. The middle sub-figure demonstrates a conversation-based control flow. When the assistant receives a message, the user proxy agent typically sends the human input as a reply. If there is no input, it executes any code in the assistantâ s message instead.
2308.08155#8
2308.08155#10
2308.08155
[ "2103.03874" ]
2308.08155#10
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
4 AutoGen features the following design patterns to facilitate conversation programming: 1. Unified interfaces and auto-reply mechanisms for automated agent chat. Agents in AutoGen have unified conversation interfaces for performing the corresponding conversation- centric computation, including a send/receive function for sending/receiving messages and a generate reply function for taking actions and generating a response based on the received message. AutoGen also introduces and by default adopts an agent auto-reply mechanism to realize conversation-driven control: Once an agent receives a message from another agent, it au- tomatically invokes generate reply and sends the reply back to the sender unless a termination condition is satisfied. AutoGen provides built-in reply functions based on LLM inference, code or function execution, or human input. One can also register custom reply functions to customize the behavior pattern of an agent, e.g., chatting with another agent before replying to the sender agent. Under this mechanism, once the reply functions are registered, and the conversation is initialized, the conversation flow is naturally induced, and thus the agent conversation proceeds naturally without any extra control plane, i.e., a special module that controls the conversation flow. For example, with the developer code in the blue-shaded area (marked â Developer Codeâ ) of Figure 2, one can readily trigger the conversation among the agents, and the conversation would proceed automatically, as shown in the dialog box in the grey shaded area (marked â Pro- gram Executionâ ) of Figure 2. The auto-reply mechanism provides a decentralized, modular, and unified way to define the workflow. 2. Control by fusion of programming and natural language. AutoGen allows the usage of programming and natural language in various control flow management patterns: 1) Natural- language control via LLMs. In AutoGen, one can control the conversation flow by prompting the LLM-backed agents with natural language. For instance, the default system message of the built-in AssistantAgent in AutoGen uses natural language to instruct the agent to fix errors and generate code again if the previous result indicates there are errors. It also guides the agent to confine the LLM output to certain structures, making it easier for other tool-backed agents to consume. For example, instructing the agent to reply with â TERMINATEâ when all tasks are completed to terminate the program.
2308.08155#9
2308.08155#11
2308.08155
[ "2103.03874" ]
2308.08155#11
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
More concrete examples of natural language controls can be found in Appendix C. 2) Programming-language control. In AutoGen, Python code can be used to specify the termination condition, human input mode, and tool execution logic, e.g., the max number of auto replies. One can also register programmed auto-reply functions to control the conversation flow with Python code, as shown in the code block identified as â Conversation- Driven Control Flowâ in Figure 2. 3) Control transition between natural and programming language. AutoGen also supports flexible control transition between natural and programming language. One can achieve transition from code to natural-language control by invoking an LLM inference containing certain control logic in a customized reply function; or transition from nat- ural language to code control via LLM-proposed function calls (Eleti et al., 2023). In the conversation programming paradigm, one can realize multi-agent conversations of diverse patterns. In addition to static conversation with predefined flow, AutoGen also supports dynamic conversation flows with multiple agents. AutoGen provides two general ways to achieve this: 1) Customized generate reply function: within the customized generate reply function, one agent can hold the current conversation while invoking conversations with other agents depending on the content of the current message and context. 2) Function calls: In this approach, LLM decides whether or not to call a particular function depending on the conversation status. By messaging additional agents in the called functions, the LLM can drive dynamic multi-agent conversation. In addition, AutoGen supports more complex dynamic group chat via built-in GroupChatManager, which can dynamically select the next speaker and then broadcast its response to other agents. We elaborate on this feature and its application in Section 3. We provide implemented working systems to showcase all these different patterns, with some of them visualized in Figure 3. # 3 Applications of AutoGen We demonstrate six applications using AutoGen (see Figure 3) to illustrate its potential in simplify- ing the development of high-performance multi-agent applications. These applications are selected based on their real-world relevance (A1, A2, A4, A5, A6), problem difficulty and solving capabil- ities enabled by AutoGen (A1, A2, A3, A4), and innovative potential (A5, A6). Together, these criteria showcase AutoGenâ s role in advancing the LLM-application landscape.
2308.08155#10
2308.08155#12
2308.08155
[ "2103.03874" ]
2308.08155#12
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
5 Retrieval-augmented Retrieval-augmented Assistant A3. ALF Chat A1. Math Problem Solving Commande! Chess Board i Human/Al Chess Human/Al Chess Writer Player A Player B A4. Multi-agent Coding A5. Dynamic Group Chat A6. Conversational Chess Figure 3: Six examples of diverse applications built using AutoGen. Their conversation patterns show AutoGenâ s flexibility and power. # A1: Math Problem Solving Mathematics is a foundational discipline and the promise of leveraging LLMs to assist with math problem solving opens up a new plethora of applications and avenues for exploration, including per- sonalized AI tutoring, AI research assistance, etc. This section demonstrates how AutoGen can help develop LLM applications for math problem solving, showcasing strong performance and flexibility in supporting various problem-solving paradigms. (Scenario 1) We are able to build a system for autonomous math problem solving by directly reusing two built-in agents from AutoGen. We evaluate our system and several alternative approaches, including open-source methods such as Multi-Agent Debate (Liang et al., 2023), LangChain Re- Act (LangChain, 2023), vanilla GPT-4, and commercial products ChatGPT + Code Interpreter, and ChatGPT + Plugin (Wolfram Alpha), on the MATH (Hendrycks et al., 2021) dataset and summarize the results in Figure 4a. We perform evaluations over 120 randomly selected level-5 problems and on the entire5 test dataset from MATH. The results show that the built-in agents from AutoGen al- ready yield better performance out of the box compared to the alternative approaches, even including the commercial ones. (Scenario 2) We also showcase a human-in-the-loop problem-solving process with the help of AutoGen. To incorporate human feedback with AutoGen, one only needs to set human input mode=â ALWAYSâ in the UserProxyAgent of the system in scenario 1. We demon- strate that this system can effectively incorporate human inputs to solve challenging problems that cannot be solved without humans. (Scenario 3) We further demonstrate a novel scenario where multiple human users can participate in the conversations during the problem-solving process. Our experiments and case studies for these scenarios show that AutoGen enables better performance or new experience compared to other solutions we experimented with.
2308.08155#11
2308.08155#13
2308.08155
[ "2103.03874" ]
2308.08155#13
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Due to the page limit, details of the evaluation, including case studies in three scenarios are in Appendix D. # A2: Retrieval-Augmented Code Generation and Question Answering Retrieval augmentation has emerged as a practical and effective approach for mitigating the intrinsic limitations of LLMs by incorporating external documents. In this section, we employ AutoGen to build a Retrieval-Augmented Generation (RAG) system (Lewis et al., 2020; Parvez et al., 2021) named Retrieval-augmented Chat. The system consists of two agents: a Retrieval-augmented User Proxy agent and a Retrieval-augmented Assistant agent, both of which are extended from built-in agents from AutoGen. The Retrieval-augmented User Proxy includes a vector database (Chroma, 5We did not evaluate ChatGPT on the whole dataset since it requires substantial manual effort and is re- stricted by its hourly message-number limitation. Multi-agent debate and LangChain ReAct were also not evaluated since they underperformed vanilla GPT-4 on the smaller test set.
2308.08155#12
2308.08155#14
2308.08155
[ "2103.03874" ]
2308.08155#14
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
6 (a) A1: Performance on MATH (w/ GPT-4). (b) A2: Q&A tasks (w/ GPT-3.5). # (c) A3: Performance on ALFWorld. # (d) A4: Performance on OptiGuide. Figure 4: Performance on four applications A1-A4. (a) shows that AutoGen agents can be used out of the box to achieve the most competitive performance on math problem solving tasks; (b) shows that AutoGen can be used to realize effective retrieval augmentation and realize a novel interactive retrieval feature to boost performance on Q&A tasks; (c) shows that AutoGen can be used to introduce a three-agent system with a grounding agent to improve performance on ALFWorld; (d) shows that a multi-agent design is helpful in boosting performance in coding tasks that need safeguards. 2023) with SentenceTransformers (Reimers & Gurevych, 2019) as the context retriever. A detailed workflow description of the Retrieval-augmented Chat is provided in Appendix D. We evaluate Retrieval-augmented Chat in both question-answering and code-generation scenarios. (Scenario 1) We first perform an evaluation regarding natural question answering on the Natural Questions dataset (Kwiatkowski et al., 2019) and report results in Figure 4b. In this evaluation, we compare our system with DPR (Dense Passage Retrieval) following an existing evaluation6 prac- tice (Adlakha et al., 2023). Leveraging the conversational design and natural-language control, AutoGen introduces a novel interactive retrieval feature in this application: whenever the retrieved context does not contain the information, instead of terminating, the LLM-based assistant would reply â
2308.08155#13
2308.08155#15
2308.08155
[ "2103.03874" ]
2308.08155#15
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Sorry, I cannot find any information about... UPDATE CONTEXT.â which will invoke more retrieval attempts. We conduct an ablation study in which we prompt the assistant agent to say â I donâ t knowâ instead of â UPDATE CONTEXT.â in cases where relevant information is not found, and report results in Figure 4b. The results show that the interactive retrieval mechanism indeed plays a non-trivial role in the process. We give a concrete example and results using this appealing feature in Appendix D. (Scenario 2) We further demonstrate how Retrieval-augmented Chat aids in generating code based on a given codebase that contains code not included in GPT-4â s training data. Evaluation and demonstration details for both scenarios are included in Appendix D. 6The results of DPR with GPT-3.5 shown in Figure 4b are from (Adlakha et al., 2023). We use GPT-3.5 as a shorthand for GPT-3.5-turbo.
2308.08155#14
2308.08155#16
2308.08155
[ "2103.03874" ]
2308.08155#16
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
7 # A3: Decision Making in Text World Environments In this subsection, we demonstrate how AutoGen can be used to develop effective applications that involve interactive or online decision making. We perform the study using the ALFWorld (Shridhar et al., 2021) benchmark, which includes a diverse collection of synthetic language-based interactive decision-making tasks in household environments. With AutoGen, we implemented a two-agent system to solve tasks from ALFWorld. It consists of an LLM-backed assistant agent responsible for suggesting plans to conduct a task and an executor agent responsible for executing actions in the ALFWorld environments. This system integrates Re- Act prompting (Yao et al., 2022), and is able to achieve similar performance. A common challenge encountered in both ReAct and the AutoGen-based two-agent system is their occasional inability to leverage basic commonsense knowledge about the physical world. This deficiency can lead to the system getting stuck in a loop due to repetitive errors. Fortunately, the modular design of AutoGen allows us to address this issue effectively: With AutoGen, we are able to introduce a grounding agent, which supplies crucial commonsense knowledgeâ
2308.08155#15
2308.08155#17
2308.08155
[ "2103.03874" ]
2308.08155#17
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
such as â You must find and take the object before you can examine it. You must go to where the target object is before you can use it.â â whenever the system exhibits early signs of recurring errors. It significantly enhances the systemâ s ability to avoid getting entangled in error loops. We compare the task-solving performance of the two variants of our system with GPT-3.5-turbo and ReAct7 on the 134 unseen tasks from ALFWorld and report results in Figure 4c. The results show that introducing a grounding agent could bring in a 15% performance gain on average. Upon examining the systemsâ outputs, we observe that the grounding agent, by delivering background commonsense knowledge at the right junctures, significantly miti- gated the tendency of the system to persist with a flawed plan, thereby avoiding the creation of error loops. For an example trajectory comparing the systems see Appendix D, Figure 10. # A4: Multi-Agent Coding In this subsection, we use AutoGen to build a multi-agent coding system based on OptiGuide (Li et al., 2023a), a system that excels at writing code to interpret optimization solutions and answer user questions, such as exploring the implications of changing a supply-chain decision or under- standing why the optimizer made a particular choice. The second sub-figure of Figure 3 shows the AutoGen-based implementation.
2308.08155#16
2308.08155#18
2308.08155
[ "2103.03874" ]
2308.08155#18
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
The workflow is as follows: the end user sends questions, such as â What if we prohibit shipping from supplier 1 to roastery 2?â to the Commander agent. The Com- mander coordinates with two assistant agents, including the Writer and the Safeguard, to answer the question. The Writer will craft code and send the code to the Commander. After receiving the code, the Commander checks the code safety with the Safeguard; if cleared, the Commander will use external tools (e.g., Python) to execute the code, and request the Writer to interpret the execution results. For instance, the writer may say â
2308.08155#17
2308.08155#19
2308.08155
[ "2103.03874" ]
2308.08155#19
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
if we prohibit shipping from supplier 1 to roastery 2, the total cost would increase by 10.5%.â The Commander then provides this concluding answer to the end user. If, at a particular step, there is an exception, e.g., security red flag raised by Safeguard, the Commander redirects the issue back to the Writer with debugging information. The process might be repeated multiple times until the userâ s question is answered or timed-out. With AutoGen the core workflow code for OptiGuide was reduced from over 430 lines to 100 lines, leading to significant productivity improvement. We provide a detailed comparison of user expe- rience with ChatGPT+Code Interpreter and AutoGen-based OptiGuide in Appendix D, where we show that AutoGen-based OptiGuide could save around 3x of userâ s time and reduce user interac- tions by 3 - 5 times on average. We also conduct an ablation showing that multi-agent abstraction is necessary. Specifically, we construct a single-agent approach where a single agent conducts both the code-writing and safeguard processes. We tested the single- and multi-agent approaches on a dataset of 100 coding tasks, which is crafted to include equal numbers of safe and unsafe tasks. Evaluation results as reported in Figure 4d show that the multi-agent design boosts the F-1 score in identifying unsafe code by 8% (with GPT-4) and 35% (with GPT-3.5-turbo). 7Results of ReAct are obtained by directly running its official code with default settings. The code uses text-davinci-003 as backend LM and does not support GPT-3.5-turbo or GPT-4.
2308.08155#18
2308.08155#20
2308.08155
[ "2103.03874" ]
2308.08155#20
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
8 # A5: Dynamic Group Chat AutoGen provides native support for a dynamic group chat communication pattern, in which par- ticipating agents share the same context and converse with the others in a dynamic manner instead of following a pre-defined order. Dynamic group chat relies on ongoing conversations to guide the flow of interaction among agents. These make dynamic group chat ideal for situations where col- laboration without strict communication order is beneficial. In AutoGen, the GroupChatManager class serves as the conductor of conversation among agents and repeats the following three steps: dynamically selecting a speaker, collecting responses from the selected speaker, and broadcasting the message (Figure 3-A5). For the dynamic speaker-selection component, we use a role-play style prompt. Through a pilot study on 12 manually crafted complex tasks, we observed that compared to a prompt that is purely based on the task, utilizing a role-play prompt often leads to more effec- tive consideration of both conversation context and role alignment during the problem-solving and speaker-selection process.
2308.08155#19
2308.08155#21
2308.08155
[ "2103.03874" ]
2308.08155#21
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Consequently, this leads to a higher success rate and fewer LLM calls. We include detailed results in Appendix D. # A6: Conversational Chess Using AutoGen, we developed Conversational Chess, a natural language interface game shown in the last sub-figure of Figure 3. It features built-in agents for players, which can be human or LLM, and a third-party board agent to provide information and validate moves based on standard rules. With AutoGen, we enabled two essential features: (1) Natural, flexible, and engaging game dynam- ics, enabled by the customizable agent design in AutoGen. Conversational Chess supports a range of game-play patterns, including AI-AI, AI-human, and human-human, with seamless switching between these modes during a single game. An illustrative example of these entertaining game dy- namics can be found in Figure 15, Appendix D. (2) Grounding, which is a crucial aspect to maintain game integrity. During gameplay, the board agent checks each proposed move for legality; if a move is invalid, the agent responds with an error, prompting the player agent to re-propose a legal move before continuing. This process ensures that only valid moves are played and helps maintain a con- sistent gaming experience. As an ablation study, we removed the board agent and instead only relied on a relevant prompt â you should make sure both you and the opponent are making legal movesâ to ground their move. The results highlighted that without the board agent, illegitimate moves caused game disruptions. The modular design offered flexibility, allowing swift adjustments to the board agent in response to evolving game rules or varying chess rule variants.
2308.08155#20
2308.08155#22
2308.08155
[ "2103.03874" ]
2308.08155#22
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
A comprehensive demon- stration of this ablation study is in Appendix D. # 4 Discussion We introduced an open-source library, AutoGen, that incorporates the paradigms of conversable agents and conversation programming. This library utilizes capable agents that are well-suited for multi-agent cooperation. It features a unified conversation interface among the agents, along with an auto-reply mechanisms, which help establish an agent-interaction interface that capitalizes on the strengths of chat-optimized LLMs with broad capabilities while accommodating a wide range of applications. AutoGen serves as a general framework for creating and experimenting with multi- agent systems that can easily fulfill various practical requirements, such as reusing, customizing, and extending existing agents, as well as programming conversations between them. Our experiments, as detailed in Section 3, demonstrate that this approach offers numerous benefits. The adoption of AutoGen has resulted in improved performance (over state-of-the-art approaches), reduced development code, and decreased manual burden for existing applications. It offers flex- ibility to developers, as demonstrated in A1 (scenario 3), A5, and A6, where AutoGen enables multi-agent chats to follow a dynamic pattern rather than fixed back-and-forth interactions. It allows humans to engage in activities alongside multiple AI agents in a conversational manner. Despite the complexity of these applications (most involving more than two agents or dynamic multi-turn agent cooperation), the implementation based on AutoGen remains straightforward. Dividing tasks among separate agents promotes modularity. Furthermore, since each agent can be developed, tested, and maintained separately, this approach simplifies overall development and code management.
2308.08155#21
2308.08155#23
2308.08155
[ "2103.03874" ]
2308.08155#23
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
9 Although this work is still in its early experimental stages, it paves the way for numerous future directions and research opportunities. For instance, we can explore effective integration of existing agent implementations into our multi-agent framework and investigate the optimal balance between automation and human control in multi-agent workflows. As we further develop and refine AutoGen, we aim to investigate which strategies, such as agent topology and conversation patterns, lead to the most effective multi-agent conversations while optimizing the overall efficiency, among other fac- tors. While increasing the number of agents and other degrees of freedom presents opportunities for tackling more complex problems, it may also introduce new safety challenges that require additional studies and careful consideration. We provide more discussion in Appendix B, including guidelines for using AutoGen and direction of future work. We hope AutoGen will help improve many LLM applications in terms of speed of development, ease of experimentation, and overall effectiveness and safety. We actively welcome contributions from the broader community. # Ethics statement There are several potential ethical considerations that could arise from the development and use of the AutoGen framework.
2308.08155#22
2308.08155#24
2308.08155
[ "2103.03874" ]
2308.08155#24
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
â ¢ Privacy and Data Protection: The framework allows for human participation in conversations between agents. It is important to ensure that user data and conversations are protected, and that developers use appropriate measures to safeguard privacy. â ¢ Bias and Fairness: LLMs have been shown to exhibit biases present in their training data (Navigli et al., 2023). When using LLMs in the AutoGen framework, it is crucial to address and mitigate any biases that may arise in the conversations between agents. Developers should be aware of potential biases and take steps to ensure fairness and inclusivity.
2308.08155#23
2308.08155#25
2308.08155
[ "2103.03874" ]
2308.08155#25
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
â ¢ Accountability and Transparency: As discussed in the future work section, as the framework in- volves multiple agents conversing and cooperating, it is important to establish clear accountability and transparency mechanisms. Users should be able to understand and trace the decision-making process of the agents involved in order to ensure accountability and address any potential issues or biases. Trust and Reliance: AutoGen leverages human understanding and intelligence while providing automation through conversations between agents. It is important to consider the impact of this interaction on user experience, trust, and reliance on AI systems. Clear communication and user education about the capabilities and limitations of the system will be essential (Cai et al., 2019). â ¢ Unintended Consequences: As discussed before, the use of multi-agent conversations and automa- tion in complex tasks may have unintended consequences. In particular, allowing LLM agents to make changes in external environments through code execution or function calls, such as installing packages, could be risky. Developers should carefully consider the potential risks and ensure that appropriate safeguards are in place to prevent harm or negative outcomes. # Acknowledgements
2308.08155#24
2308.08155#26
2308.08155
[ "2103.03874" ]
2308.08155#26
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
The work presented in this report was made possible through discussions and feedback from Peter Lee, Johannes Gehrke, Eric Horvitz, Steven Lucco, Umesh Madan, Robin Moeur, Piali Choud- hury, Saleema Amershi, Adam Fourney, Victor Dibia, Guoqing Zheng, Corby Rosset, Ricky Loynd, Ece Kamar, Rafah Hosn, John Langford, Ida Momennejad, Brian Krabach, Taylor Webb, Shanka Subhra Mondal, Wei-ge Chen, Robert Gruen, Yinan Li, Yue Wang, Suman Nath, Tanakorn Leesat- apornwongsa, Xin Wang, Shishir Patil, Tianjun Zhang, Saehan Jo, Ishai Menache, Kontantina Mel- lou, Runlong Zhou, Feiran Jia, Hamed Khanpour, Hamid Palangi, Srinagesh Sharma, Julio Albinati Cortez, Amin Saied, Yuzhe Ma, Dujian Ding, Linyong Nan, Prateek Yadav, Shannon Shen, Ankur Mallick, Mark Encarnaci´on, Lars Liden, Tianwei Yue, Julia Kiseleva, Anastasia Razdaibiedina, and Luciano Del Corro. Qingyun Wu would like to acknowledge the funding and research support from the College of Information Science and Technology at Penn State University.
2308.08155#25
2308.08155#27
2308.08155
[ "2103.03874" ]
2308.08155#27
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
10 # References Vaibhav Adlakha, Parishad BehnamGhader, Xing Han Lu, Nicholas Meade, and Siva Reddy. Eval- uating correctness and faithfulness of instruction-following models for question answering. arXiv preprint arXiv:2307.16877, 2023. Saleema Amershi, Dan Weld, Mihaela Vorvoreanu, Adam Fourney, Besmira Nushi, Penny Col- lisson, Jina Suh, Shamsi Iqbal, Paul N Bennett, Kori Inkpen, et al. Guidelines for human-ai interaction. In Proceedings of the 2019 chi conference on human factors in computing systems, 2019.
2308.08155#26
2308.08155#28
2308.08155
[ "2103.03874" ]
2308.08155#28
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Dario Amodei, Chris Olah, Jacob Steinhardt, Paul Christiano, John Schulman, and Dan Man´e. Con- crete problems in ai safety, 2016. # AutoGPT. Documentation â auto-gpt. https://docs.agpt.co/, 2023. BabyAGI. Github â babyagi. https://github.com/yoheinakajima/babyagi, 2023. Carrie J. Cai, Samantha Winter, David F. Steiner, Lauren Wilcox, and Michael Terry. â hello aiâ : Uncovering the onboarding needs of medical practitioners for human-ai collaborative decision- making. Proceedings of the ACM on Human-Computer Interaction, 2019. Tianle Cai, Xuezhi Wang, Tengyu Ma, Xinyun Chen, and Denny Zhou. Large language models as tool makers. arXiv preprint arXiv:2305.17126, 2023.
2308.08155#27
2308.08155#29
2308.08155
[ "2103.03874" ]
2308.08155#29
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
# Chroma. Chromadb. https://github.com/chroma-core/chroma, 2023. Victor Dibia. LIDA: A tool for automatic generation of grammar-agnostic visualizations and info- graphics using large language models. In Proceedings of the 61st Annual Meeting of the Associ- ation for Computational Linguistics (Volume 3: System Demonstrations), Toronto, Canada, July 2023. Association for Computational Linguistics. Yihong Dong, Xue Jiang, Zhi Jin, and Ge Li. Self-collaboration code generation via chatgpt. arXiv preprint arXiv:2304.07590, 2023. Improv- ing factuality and reasoning in language models through multiagent debate. arXiv preprint arXiv:2305.14325, 2023.
2308.08155#28
2308.08155#30
2308.08155
[ "2103.03874" ]
2308.08155#30
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Atty Eleti, Jeff Harris, and Logan Kilpatrick. Function calling and other api updates. https: //openai.com/blog/function-calling-and-other-api-updates, 2023. # Guidance. Guidance. https://github.com/guidance-ai/guidance, 2023. Dan Hendrycks, Collin Burns, Saurav Kadavath, Akul Arora, Steven Basart, Eric Tang, Dawn Song, and Jacob Steinhardt. Measuring mathematical problem solving with the math dataset. arXiv preprint arXiv:2103.03874, 2021. Sirui Hong, Xiawu Zheng, Jonathan Chen, Yuheng Cheng, Ceyao Zhang, Zili Wang, Steven Ka Shing Yau, Zijuan Lin, Liyang Zhou, Chenyu Ran, et al.
2308.08155#29
2308.08155#31
2308.08155
[ "2103.03874" ]
2308.08155#31
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Metagpt: Meta programming for multi-agent collaborative framework. arXiv preprint arXiv:2308.00352, 2023. Eric Horvitz. Principles of mixed-initiative user interfaces. In Proceedings of the SIGCHI conference on Human Factors in Computing Systems, 1999. HuggingFace. Transformers agent. https://huggingface.co/docs/transformers/ transformers_agents, 2023. Geunwoo Kim, Pierre Baldi, and Stephen McAleer. Language models can solve computer tasks. arXiv preprint arXiv:2303.17491, 2023. Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, et al. Natural questions: a benchmark for question answering research. Transactions of the Association for Computational Linguistics, 2019.
2308.08155#30
2308.08155#32
2308.08155
[ "2103.03874" ]
2308.08155#32
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
11 LangChain. Introduction â langchain. https://python.langchain.com/en/latest/index. html, 2023. Mike Lewis, Denis Yarats, Yann N Dauphin, Devi Parikh, and Dhruv Batra. Deal or no deal? end- to-end learning for negotiation dialogues. arXiv preprint arXiv:1706.05125, 2017. Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich K¨uttler, Mike Lewis, Wen-tau Yih, Tim Rockt¨aschel, et al. Retrieval-augmented gen- eration for knowledge-intensive nlp tasks. Advances in Neural Information Processing Systems, 2020. Beibin Li, Konstantina Mellou, Bo Zhang, Jeevan Pathuri, and Ishai Menache. Large language models for supply chain optimization. arXiv preprint arXiv:2307.03875, 2023a. Guohao Li, Hasan Abed Al Kader Hammoud, Hani Itani, Dmitrii Khizbullin, and Bernard Ghanem.
2308.08155#31
2308.08155#33
2308.08155
[ "2103.03874" ]
2308.08155#33
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Camel: Communicative agents for â mindâ exploration of large scale language model society, 2023b. Tian Liang, Zhiwei He, Wenxiang Jiao, Xing Wang, Yan Wang, Rui Wang, Yujiu Yang, Zhaopeng Tu, and Shuming Shi. Encouraging divergent thinking in large language models through multi- agent debate, 2023. Evan Zheran Liu, Kelvin Guu, Panupong Pasupat, Tianlin Shi, and Percy Liang. Reinforcement learning on web interfaces using workflow-guided exploration. arXiv preprint arXiv:1802.08802, 2018. Jerry Liu. LlamaIndex, November 2022. URL https://github.com/jerryjliu/llama_index.
2308.08155#32
2308.08155#34
2308.08155
[ "2103.03874" ]
2308.08155#34
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wier- stra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013. Roberto Navigli, Simone Conia, and Bj¨orn Ross. Biases in large language models: Origins, inven- tory and discussion. ACM Journal of Data and Information Quality, 2023. OpenAI. ChatGPT plugins. https://openai.com/blog/chatgpt-plugins, 2023.
2308.08155#33
2308.08155#35
2308.08155
[ "2103.03874" ]
2308.08155#35
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Joon Sung Park, Joseph C Oâ Brien, Carrie J Cai, Meredith Ringel Morris, Percy Liang, and Michael S Bernstein. Generative agents: Interactive simulacra of human behavior. arXiv preprint arXiv:2304.03442, 2023. Md Rizwan Parvez, Wasi Uddin Ahmad, Saikat Chakraborty, Baishakhi Ray, and Kai-Wei Chang. Retrieval augmented code generation and summarization. arXiv preprint arXiv:2108.11601, 2021. Shishir G. Patil, Tianjun Zhang, Xin Wang, and Joseph E. Gonzalez. Gorilla:
2308.08155#34
2308.08155#36
2308.08155
[ "2103.03874" ]
2308.08155#36
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Large language model connected with massive apis. arXiv preprint arXiv:2305.15334, 2023. Nils Reimers and Iryna Gurevych. Sentence-bert: Sentence embeddings using siamese bert- networks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, 11 2019. URL https://arxiv.org/ abs/1908.10084. Semantic-Kernel. Semantic kernel. https://github.com/microsoft/semantic-kernel, 2023.
2308.08155#35
2308.08155#37
2308.08155
[ "2103.03874" ]
2308.08155#37
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Bokui Shen, Fei Xia, Chengshu Li, Roberto Mart´ın-Mart´ın, Linxi Fan, Guanzhi Wang, Claudia P´erez-Dâ Arpino, Shyamal Buch, Sanjana Srivastava, Lyne Tchapmi, et al. igibson 1.0: A simu- lation environment for interactive tasks in large realistic scenes. In 2021 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 2021. Tianlin Shi, Andrej Karpathy, Linxi Fan, Jonathan Hernandez, and Percy Liang. World of bits: An open-domain platform for web-based agents. In International Conference on Machine Learning. PMLR, 2017.
2308.08155#36
2308.08155#38
2308.08155
[ "2103.03874" ]
2308.08155#38
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
12 Mohit Shridhar, Xingdi Yuan, Marc-Alexandre CË ot´e, Yonatan Bisk, Adam Trischler, and Matthew Hausknecht. ALFWorld: Aligning Text and Embodied Environments for Interactive Learning. In Proceedings of the International Conference on Learning Representations (ICLR), 2021. URL https://arxiv.org/abs/2010.03768. Oriol Vinyals, Timo Ewalds, Sergey Bartunov, Petko Georgiev, Alexander Sasha Vezhnevets, Michelle Yeo, Alireza Makhzani, Heinrich K¨uttler, John Agapiou, Julian Schrittwieser, et al.
2308.08155#37
2308.08155#39
2308.08155
[ "2103.03874" ]
2308.08155#39
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Starcraft ii: A new challenge for reinforcement learning. arXiv preprint arXiv:1708.04782, 2017. Chi Wang, Qingyun Wu, Markus Weimer, and Erkang Zhu. Flaml: A fast and lightweight automl library. Proceedings of Machine Learning and Systems, 2021. Guanzhi Wang, Yuqi Xie, Yunfan Jiang, Ajay Mandlekar, Chaowei Xiao, Yuke Zhu, Linxi Fan, and Anima Anandkumar.
2308.08155#38
2308.08155#40
2308.08155
[ "2103.03874" ]
2308.08155#40
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Voyager: An open-ended embodied agent with large language models. arXiv preprint arXiv:2305.16291, 2023a. Lei Wang, Chen Ma, Xueyang Feng, Zeyu Zhang, Hao Yang, Jingsen Zhang, Zhiyuan Chen, Jiakai Tang, Xu Chen, Yankai Lin, et al. A survey on large language model based autonomous agents. arXiv preprint arXiv:2308.11432, 2023b.
2308.08155#39
2308.08155#41
2308.08155
[ "2103.03874" ]
2308.08155#41
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Daniel S. Weld and Oren Etzioni. The first law of robotics (a call to arms). In AAAI Conference on Artificial Intelligence, 1994. Max Woolf. Langchain problem. https://minimaxir.com/2023/07/langchain-problem/, 2023. Yiran Wu, Feiran Jia, Shaokun Zhang, Qingyun Wu, Hangyu Li, Erkang Zhu, Yue Wang, Yin Tat Lee, Richard Peng, and Chi Wang. An empirical study on challenging math problem solving with gpt-4. arXiv preprint arXiv:2306.01337, 2023. Zhiheng Xi, Wenxiang Chen, Xin Guo, Wei He, Yiwen Ding, Boyang Hong, Ming Zhang, Junzhe Wang, Senjie Jin, Enyu Zhou, et al. The rise and potential of large language model based agents: A survey. arXiv preprint arXiv:2309.07864, 2023. Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao. React: Synergizing reasoning and acting in language models. arXiv preprint arXiv:2210.03629, 2022.
2308.08155#40
2308.08155#42
2308.08155
[ "2103.03874" ]
2308.08155#42
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
13 # A Related Work We examine existing LLM-based agent systems or frameworks that can be used to build LLM appli- cations. We categorize the related work into single-agent and multi-agent systems and specifically provide a summary of differentiators comparing AutoGen with existing multi-agent systems in Ta- ble 1. Note that many of these systems are evolving open-source projects, so the remarks and statements about them may only be accurate as of the time of writing. We refer interested readers to detailed LLM-based agent surveys (Xi et al., 2023; Wang et al., 2023b) # Single-Agent Systems:
2308.08155#41
2308.08155#43
2308.08155
[ "2103.03874" ]
2308.08155#43
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
AutoGPT: AutoGPT is an open-source implementation of an AI agent that attempts to au- tonomously achieve a given goal (AutoGPT, 2023). It follows a single-agent paradigm in which it augments the AI model with many useful tools, and does not support multi-agent collaboration. â ¢ ChatGPT+ (with code interpreter or plugin): ChatGPT, a conversational AI service or agent, can now be used alongside a code interpreter or plugin (currently available only under the pre- mium subscription plan ChatGPT Plus) (OpenAI, 2023). The code interpreter enables ChatGPT to execute code, while the plugin enhances ChatGPT with a wide range of curated tools.
2308.08155#42
2308.08155#44
2308.08155
[ "2103.03874" ]
2308.08155#44
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
â ¢ LangChain Agents: LangChain is a general framework for developing LLM-based applica- tions (LangChain, 2023). LangChain Agents is a subpackage for using an LLM to choose a sequence of actions. There are various types of agents in LangChain Agents, with the ReAct agent being a notable example that combines reasoning and acting when using LLMs (mainly designed for LLMs prior to ChatGPT) (Yao et al., 2022). All agents provided in LangChain Agents fol- low a single-agent paradigm and are not inherently designed for communicative and collaborative modes.
2308.08155#43
2308.08155#45
2308.08155
[ "2103.03874" ]
2308.08155#45
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
A significant summary of its limitations can be found in (Woolf, 2023). Due to these lim- itations, even the multi-agent systems in LangChain (e.g., re-implementation of CAMEL) are not based on LangChain Agents but are implemented from scratch. Their connection to LangChain lies in the use of basic orchestration modules provided by LangChain, such as AI models wrapped by LangChain and the corresponding interface. â ¢ Transformers Agent: Transformers Agent (HuggingFace, 2023) is an experimental natural- language API built on the transformers repository. It includes a set of curated tools and an agent to interpret natural language and use these tools. Similar to AutoGPT, it follows a single-agent paradigm and does not support agent collaboration. AutoGen differs from the single-agent systems above by supporting multi-agent LLM applications. # Multi-Agent Systems:
2308.08155#44
2308.08155#46
2308.08155
[ "2103.03874" ]
2308.08155#46
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
â ¢ BabyAGI: BabyAGI (BabyAGI, 2023) is an example implementation of an AI-powered task man- agement system in a Python script. In this implemented system, multiple LLM-based agents are used. For example, there is an agent for creating new tasks based on the objective and the result of the previous task, an agent for prioritizing the task list, and an agent for completing tasks/sub-tasks. As a multi-agent system, BabyAGI adopts a static agent conversation pattern, i.e., a predefined order of agent communication, while AutoGen supports both static and dynamic conversation patterns and additionally supports tool usage and human involvement. It demonstrates how role playing can be used to let chat agents communicate with each other for task comple- tion. It also records agent conversations for behavior analysis and capability understanding. An Inception-prompting technique is used to achieve autonomous cooperation between agents. Un- like AutoGen, CAMEL does not natively support tool usage, such as code execution. Although it is proposed as an infrastructure for multi-agent conversation, it only supports static conversation patterns, while AutoGen additionally supports dynamic conversation patterns.
2308.08155#45
2308.08155#47
2308.08155
[ "2103.03874" ]
2308.08155#47
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
â ¢ Multi-Agent Debate: Two recent works investigate and show that multi-agent debate is an effec- tive way to encourage divergent thinking in LLMs (Liang et al., 2023) and to improve the factuality and reasoning of LLMs (Du et al., 2023). In both works, multiple LLM inference instances are constructed as multiple agents to solve problems with agent debate. Each agent is simply an LLM inference instance, while no tool or human is involved, and the inter-agent conversation needs to follow a pre-defined order. These works attempt to build LLM applications with multi-agent conversation, while AutoGen, designed as a generic infrastructure, can be used to facilitate this development and enable more applications with dynamic conversation patterns.
2308.08155#46
2308.08155#48
2308.08155
[ "2103.03874" ]
2308.08155#48
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
14 â ¢ MetaGPT: MetaGPT (Hong et al., 2023) is a specialized LLM application based on a multi-agent conversation framework for automatic software development. They assign different roles to GPTs to collaboratively develop software. They differ from AutoGen by being specialized solutions to a certain scenario, while AutoGen is a generic infrastructure to facilitate building applications for various scenarios. There are a few other specialized single-agent or multi-agent systems, such as Voyager (Wang et al., 2023a) and Generative Agents (Park et al., 2023), which we skip due to lower relevance. In Table 1, we summarize differences between AutoGen and the most relevant multi-agent systems. Table 1: Summary of differences between AutoGen and other related multi-agent systems. infras- tructure: whether the system is designed as a generic infrastructure for building LLM applications. conversation pattern: the types of patterns supported by the implemented systems. Under the â staticâ
2308.08155#47
2308.08155#49
2308.08155
[ "2103.03874" ]
2308.08155#49
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
pattern, agent topology remains unchanged regardless of different inputs. AutoGen allows flexible conversation patterns, including both static and dynamic patterns that can be customized based on different application needs. execution-capable: whether the system can execute LLM- generated code; human involvement: whether (and how) the system allows human participation during the execution process of the system. AutoGen allows flexible human involvement in multi- agent conversation with the option for humans to skip providing inputs. Aspect Infrastructure Conversation pattern Execution-capable Human involvement AutoGen Multi-agent Debate â flexible â chat/skip â static â â CAMEL BabyAGI MetaGPT â static â â â static â â â static â â 15 # B Expanded Discussion The applications in Section 3 show how AutoGen not only enables new applications but also helps renovate existing ones. For example, in A1 (scenario 3), A5, and A6, AutoGen enabled the cre- ation of multi-agent conversations that follow a dynamic pattern instead of a fixed back-and-forth. And in both A5 and A6, humans can participate in the activities together with multiple other AI agents in a conversational manner. Similarly, A1-A4 show how popular applications can be reno- vated quickly with AutoGen. Despite the complexity of these applications (most of them involve more than two agents or dynamic multi-turn agent cooperation), our AutoGen-based implementa- tion remains simple, demonstrating promising opportunities to build creative applications and a large space for innovation. In reflecting on why these benefits can be achieved in these applications with AutoGen, we believe there are a few reasons:
2308.08155#48
2308.08155#50
2308.08155
[ "2103.03874" ]
2308.08155#50
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
â ¢ Ease of use: The built-in agents can be used out-of-the-box, delivering strong performance even without any customization. (A1, A3) â ¢ Modularity: The division of tasks into separate agents promotes modularity in the system. Each agent can be developed, tested, and maintained independently, simplifying the overall develop- ment process and facilitating code management. (A3, A4, A5, and A6) â ¢ Programmability: AutoGen allows users to extend/customize existing agents to develop systems satisfying their specific needs with ease. (A1-A6). For example, with AutoGen, the core workflow code in A4 is reduced from over 430 lines to 100 lines, for a 4x saving. Allowing human involvement: AutoGen provides a native mechanism to achieve human partici- pation and/or human oversight. With AutoGen, humans can seamlessly and optionally cooperate with AIs to solve problems or generally participate in the activity. AutoGen also facilitates inter- active user instructions to ensure the process stays on the desired path. (A1, A2, A5, and A6) â ¢ Collaborative/adversarial agent interactions: Like many collaborative agent systems (Dong et al., 2023), agents in AutoGen can share information and knowledge, to complement each otherâ s abilities and collectively arrive at better solutions. (A1, A2, A3, and A4). Analogously, in certain scenarios, some agents are required to work in an adversarial way. Relevant information is shared among different conversations in a controlled manner, preventing distraction or hallucination. (A4, A6). AutoGen supports both patterns, enabling effective utilization and augmentation of LLMs. # B.1 General Guidelines for Using AutoGen Below we give some recommendations for using agents in AutoGen to accomplish a task. 1. Consider using built-in agents first. For example, AssistantAgent is pre-configured to be backed by GPT-4, with a carefully designed system message for generic problem-solving via code. The UserProxyAgent is configured to solicit human inputs and perform tool execution. Many problems can be solved by simply combining these two agents.
2308.08155#49
2308.08155#51
2308.08155
[ "2103.03874" ]
2308.08155#51
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
When customizing agents for an application, consider the following options: (1) human input mode, termination condition, code execution configuration, and LLM configuration can be specified when constructing an agent; (2) AutoGen supports adding instructions in an initial user message, which is an effective way to boost performance without needing to modify the system message; (3) UserProxyAgent can be extended to handle different execution environments and exceptions, etc.; (4) when sys- tem message modification is needed, consider leveraging the LLMâ s capability to program its conversation flow with natural language. 2. Start with a simple conversation topology. Consider using the two-agent chat or the group chat setup first, as they can often be extended with the least code. Note that the two-agent chat can be easily extended to involve more than two agents by using LLM-consumable functions in a dynamic way. 3. Try to reuse built-in reply methods based on LLM, tool, or human before implementing a custom reply method because they can often be reused to achieve the goal in a simple way (e.g., the built-in agent GroupChatManagerâ s reply method reuses the built-in LLM-based reply function when selecting the next speaker, ref.
2308.08155#50
2308.08155#52
2308.08155
[ "2103.03874" ]
2308.08155#52
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
A5 in Section 3). 4. When developing a new application with UserProxyAgent, start with humans always in the loop, i.e., human input mode=â ALWAYSâ , even if the target operation mode is more au- tonomous. This helps evaluate the effectiveness of AssistantAgent, tuning the prompt, dis- covering corner cases, and debugging. Once confident with small-scale success, consider setting 16 human input mode = â NEVERâ . This enables LLM as a backend, and one can either use the LLM or manually generate diverse system messages to simulate different use cases. 5. Despite the numerous advantages of AutoGen agents, there could be cases/scenarios where other libraries/packages could help. For example: (1) For (sub)tasks that do not have requirements for back-and-forth trouble-shooting, multi-agent interaction, etc., a unidirectional (no back-and- forth message exchange) pipeline can also be orchestrated with LangChain (LangChain, 2023), LlamaIndex (Liu, 2022), Guidance (Guidance, 2023), Semantic Kernel (Semantic-Kernel, 2023), Gorilla (Patil et al., 2023) or low-level inference API (â autogen.oaiâ provides an enhanced LLM inference layer at this level) (Dibia, 2023). (2) When existing tools from LangChain etc. are helpful, one can use them as tool backends for AutoGen agents. For example, one can readily use tools, e.g., Wolfram Alpha, from LangChain in AutoGen agent. (3) For specific applications, one may want to leverage agents implemented in other libraries/packages. To achieve this, one could wrap those agents as conversable agents in AutoGen and then use them to build LLM applications through multi-agent conversation. (4) It can be hard to find an optimal operating point among many tunable choices, such as the LLM inference configuration. Blackbox optimization packages like â flaml.tuneâ (Wang et al., 2021) can be used together with AutoGen to automate such tuning. # B.2 Future Work This work raises many research questions and future directions and . Designing optimal multi-agent workflows:
2308.08155#51
2308.08155#53
2308.08155
[ "2103.03874" ]
2308.08155#53
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Creating a multi-agent workflow for a given task can involve many decisions, e.g., how many agents to include, how to assign agent roles and agent capabilities, how the agents should interact with each other, and whether to automate a particular part of the workflow. There may not exist a one-fits-all answer, and the best solution might depend on the specific application. This raises important questions: For what types of tasks and applications are multi-agent workflows most useful? How do multiple agents help in different applications? For a given task, what is the optimal (e.g., cost-effective) multi-agent workflow? Creating highly capable agents: AutoGen can enable the development of highly capable agents that leverage the strengths of LLMs, tools, and humans. Creating such agents is crucial to ensuring that a multi-agent workflow can effectively troubleshoot and make progress on a task. For example, we observed that CAMEL, another multi-agent LLM system, cannot effectively solve problems in most cases primarily because it lacks the capability to execute tools or code. This failure shows that LLMs and multi-agent conversations with simple role playing are insufficient, and highly capable agents with diverse skill sets are essential. We believe that more systematic work will be required to develop guidelines for application-specific agents, to create a large OSS knowledge base of agents, and to create agents that can discover and upgrade their skills (Cai et al., 2023). Enabling scale, safety, and human agency: Section 3 shows how complex multi-agent workflows can enable new applications, and future work will be needed to assess whether scaling further can help solve extremely complex tasks. However, as these workflows scale and grow more complex, it may become difficult to log and adjust them. Thus, it will become essential to develop clear mechanisms and tools to track and debug their behavior. Otherwise, these techniques risk resulting in incomprehensible, unintelligible chatter among agents (Lewis et al., 2017). Our work also shows how complex, fully autonomous workflows with AutoGen can be useful, but fully autonomous agent conversations will need to be used with care. While the autonomous mode AutoGen supports could be desirable in many scenarios, a high level of autonomy can also pose potential risks, especially in high-risk applications (Amodei et al., 2016; Weld & Etzioni, 1994).
2308.08155#52
2308.08155#54
2308.08155
[ "2103.03874" ]
2308.08155#54
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
As a result, building fail-safes against cascading failures and exploitation, mitigating reward hacking, out of control and undesired behaviors, maintaining effective human oversight of applications built with AutoGen agents will become important. While AutoGen provides convenient and seamless involvement of humans through a user proxy agent, developers and stakeholders still need to under- stand and determine the appropriate level and pattern of human involvement to ensure the safe and ethical use of the technology (Horvitz, 1999; Amershi et al., 2019).
2308.08155#53
2308.08155#55
2308.08155
[ "2103.03874" ]
2308.08155#55
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
17 # C Default System Message for Assistant Agent { System Message suggest python code (in a python coding block) or shell script (in a sh coding block) for the user to execute. (â >) 1. RSREVSORREEENES] collect info, use the code to output the info you need, for example, browse or search the web, download/read a file, print the content of a webpage or a file, get the current date/time. [AEBEE] sufficient info is printed and the task is ready to be solved based on your language skill, you can solve the task by yourself. 2. (HRERUVSUNRSSENED perform some task with code, use the code to perform the task and [output the Yésult. Finish the task smartly. Solve the task step by step . explain your plan first. Be clear which step uses code, and which step uses your language skill. you must indicate the script type in the code block. The user cannot provide any other feedback or perform any other action beyond executing the code you suggest. The user canâ t modify your code. So do not suggest incomplete code which requires users to modify.
2308.08155#54
2308.08155#56
2308.08155
[ "2103.03874" ]
2308.08155#56
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Donâ t use a code block be executed by the user. save the code in a file before executing it, |put # filename: <filename> inside the code block as the first line. Donâ t include multiple code blocks in one response. Do not ask users to copy and paste the result. Instead, use â printâ function for the output when relevant. Check the execution result returned by the user. there is an error, fix the error and output the code again. Suggest the full code instead of partial code or code changes. not solved even after the code is executed successfully, analyze the problem, revisit your assumption, collect additional info you need, and think of a different approach to try. | verify the answer carefully. Include verifiable evidence in your response Ne wy Prompting techniques color code: Rolé)Play; Control|FI6W; Output Confine; Facilitate Automation; Grounding | Figure 5: Default system message for the built-in assistant agent in AutoGen (v0.1.1). This is an example of conversation programming via natural language. It contains instructions of different types, including role play, control flow, output confine, facilitate automation, and grounding. Figure 5 shows the default system message for the built-in assistant agent in AutoGen (v0.1.1), where we introduce several new prompting techniques and highlight them accordingly. When com- bining these new prompting techniques together, we can program a fairly complex conversation even with the simplest two-agent conversation topology. This approach tries to exploit the capability of LLMs in implicit state inference to a large degree. LLMs do not follow all the instructions perfectly, so the design of the system needs to have other mechanisms to handle the exceptions and faults. Some instructions can have ambiguities, and the designer should either reduce them for preciseness or intentionally keep them for flexibility and address the different situations in other agents. In general, we observe that GPT-4 follows the instructions better than GPT-3.5-turbo.
2308.08155#55
2308.08155#57
2308.08155
[ "2103.03874" ]
2308.08155#57
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
18 # D Application Details # A1: Math Problem Solving Scenario 1: Autonomous Problem Solving. We perform both qualitative and quantitative eval- uations in this scenario. For all evaluations, we use GPT-4 as the base model, and pre-install the â sympyâ package in the execution environment. We compare AutoGen with the following LLM- based agent systems: â ¢ AutoGPT: The out-of-box AutoGPT is used. We initialize AutoGPT by setting the purpose to â
2308.08155#56
2308.08155#58
2308.08155
[ "2103.03874" ]
2308.08155#58
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
solve math problemsâ , resulting in a â MathSolverGPTâ with auto-generated goals. â ¢ ChatGPT+Plugin: We enable the Wolfram Alpha plugin (a math computation engine) in the Ope- nAI web client. â ¢ ChatGPT+Code Interpreter: This is a recent feature in OpenAI web client. Note that the above two premium features from ChatGPT require a paid subscription to be accessed and are the most competitive commercial systems. â ¢ LangChain ReAct+Python: We use Python agent from LangChain. To handle parsing errors, we set â handle parsing errors=Trueâ
2308.08155#57
2308.08155#59
2308.08155
[ "2103.03874" ]
2308.08155#59
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
, and use the default zero-shot ReAct prompt. â ¢ Multi-Agent Debate (Liang et al., 2023): We modified the code of the multi-agent debate to per- form evaluation. By default, there are three agents: an affirmative agent, a negative agent, and a moderator. We also conducted preliminary evaluations on several other multi-agent systems, including BabyAGI, CAMEL, and MetaGPT. The results indicate that they are not suitable choices for solving math problems out of the box. For instance, when MetaGPT is tasked with solving a math problem, it begins developing software to address the problem, but most of the time, it does not actually solve the problem.
2308.08155#58
2308.08155#60
2308.08155
[ "2103.03874" ]
2308.08155#60
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
We have included the test examples in Appendix E. Table 2: Qualitative evaluation of two math problems from the MATH dataset within the autonomous problem-solving scenario. Each LLM-based system is tested three times on each of the problems. This table reports the problem-solving correctness and summarizes the reasons for failure. AutoGen AutoGPT ChatGPT+Plugin ChatGPT+Code Interpreter LangChain ReAct Multi-Agent Debate Correctness 3/3 0/3 1/3 2/3 0/3 0/3 Failure Reason N/A. The LLM gives code without the print function so the result is not printed. The return from Wolfram Alpha contains 2 simplified results, including the correct answer, but GPT-4 always chooses the wrong answer. Returns a wrong decimal result. LangChain gives 3 different wrong answers. It gives 3 different wrong answers due to calculation errors. (a) Evaluation on the first problem that asks to simplify a square root fraction. AutoGen AutoGPT ChatGPT+Plugin ChatGPT+Code Interpreter LangChain ReAct Multi-Agent Debate Correctness 2/3 0/3 1/3 0/3 0/3 0/3 Failure Reason The final answer from code execution is wrong. The LLM gives code without the print function so the result is not printed. For one trial, GPT-4 got stuck because it keeps giving wrong queries and has to be stopped. Another trial simply gives a wrong answer. It gives 3 different wrong answers. LangChain gives 3 different wrong answers. It gives 3 different wrong answers. (b) Evaluation on the second number theory problem. For the qualitative evaluation, we utilize two level-5 problems from the MATH dataset, testing each problem three times. The first problem involves simplifying a square root fraction, and the second
2308.08155#59
2308.08155#61
2308.08155
[ "2103.03874" ]
2308.08155#61
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
19 problem involves solving a number theory issue. The correctness counts and reasons for failure are detailed in Table 2. For the quantitative evaluation, we conduct two sets of experiments on the MATH dataset to assess the correctness of these systems: (1) an experiment involving 120 level-5 (the most challenging level) problems, including 20 problems from six categories, excluding geometry, and (2) an experiment on the entire test set, which includes 5000 problems. We exclude AutoGPT from this evaluation as it cannot access results from code executions and does not solve any problems in the qualitative evaluation. Our analysis of the entire dataset reveals that AutoGen achieves an overall accuracy of 69.48%, while GPT-4â s accuracy stands at 55.18%. From these evaluations, we have the following observations regarding the problem-solving success rate and user experience of these systems: Problem-solving success rate: Results from the quantitative evaluations show that AutoGen can help achieve the highest problem-solving success rate among all the compared methods. The qual- itative evaluations elucidate common failure reasons across several alternative approaches. Chat- GPT+Code Interpreter fails to solve the second problem, and ChatGPT+Plugin struggles to solve both problems. AutoGPT fails on both problems due to code execution issues. The LangChain agent also fails on both problems, producing code that results in incorrect answers in all trials. â ¢ Based on the qualitative evaluation, we analyze the user experience concerning the verbosity of the response and the ability of the LLM-based system to run without unexpected behaviors. Chat- GPT+Plugin is the least verbose, mainly because Wolfram queries are much shorter than Python code. AutoGen, ChatGPT+Code Interpreter, and LangChain exhibit similar verbosity, although LangChain is slightly more verbose due to more code execution errors. AutoGPT is the most verbose system owing to predefined steps like THOUGHTS, REASONING, and PLAN, which it includes in replies every time. Overall, AutoGen and ChatGPT+Code Interpreter operate smoothly without exceptions. We note the occurrences of undesired behaviors from other LLM-based sys- tems that could affect user experience: AutoGPT consistently outputs code without the printâ
2308.08155#60
2308.08155#62
2308.08155
[ "2103.03874" ]
2308.08155#62
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
statement and cannot correct this, requiring the user to run them manually; ChatGPT with Wol- fram Alpha plugin has the potential to become stuck in a loop that must be manually stopped; and Langchain ReAct could exit with a parse error, necessitating the passing of a â handle parse errorâ parameter. Expert Assistant Student Student Proxy Assistant i Ask for expert a Enable Autonomous and Human-in-the-loop Problem Solving Y Enable Multi-User Problem Solving Via Student @ and Expert @ a a Figure 6: Examples of three settings utilized to solve math problems using AutoGen: (Gray) En- ables a workflow where a student collaborates with an assistant agent to solve problems, either autonomously or in a human-in-the-loop mode. (Gray + Orange) Facilitates a more sophisticated workflow wherein the assistant, on the fly, can engage another user termed â expertâ , who is in the loop with their own assistant agent, to aid in problem-solving if its own solutions are not satisfactory. Scenario 2: Human-in-the-loop Problem Solving. For challenging problems that these LLM systems cannot solve autonomously, human feedback during the problem-solving process can be
2308.08155#61
2308.08155#63
2308.08155
[ "2103.03874" ]
2308.08155#63
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
20 helpful. To incorporate human feedback with AutoGen, one can set human input mode=â ALWAYSâ in the user proxy agent. We select one challenging problem that none of these systems can solve autonomously across three trials. We adhere to the process outlined below to provide human inputs for all the compared methods: 1. Input the problem: Find the equation of the plane which bisects the angle between the planes 3x â 6y + 2z + 5 = 0 and 4x â 12y + 3z â 3 = 0, and which contains the point (â 5, â 1, â 5). Enter your answer in the form Ax + By + Cz + D = 0, where A, B, C, D are integers such that A gcd(|A|, |B|, |C|, |D|) = 1. > 0 and
2308.08155#62
2308.08155#64
2308.08155
[ "2103.03874" ]
2308.08155#64
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
2. The response from the system does not solve the problem correctly. We then give a hint to the model: Your idea is not correct. Letâ s solve this together. Suppose P = (x, y, z) is a point that lies on a plane that bisects the angle, the distance from P to the two planes is the same. set up this equation first. 3. We expect the system to give the correct distance equation. Since the equation involves an absolute sign that is hard to solve, we would give the next hint: Consider the two cases to remove the abs sign and get two possible solutions. 4. If the system returns the two possible solutions and doesnâ t continue to the next step, we give the last hint: Use point (-5,-1,-5) to determine which is correct and give the final answer. 5. Final answer is 11x+6y+5z+86=0 . We observed that AutoGen consistently solved the problem across all three trials. ChatGPT+Code Interpreter and ChatGPT+Plugin managed to solve the problem in two out of three trials, while Au- toGPT failed to solve it in all three attempts. In its unsuccessful attempt, ChatGPT+Code Interpreter failed to adhere to human hints. In its failed trial, ChatGPT+Plugin produced an almost correct solu- tion but had a sign discrepancy in the final answer. AutoGPT was unable to yield a correct solution in any of the trials. In one trial, it derived an incorrect distance equation. In the other two trials, the final answer was incorrect due to code execution errors. Scenario 3: Multi-User Problem Solving. Next-generation LLM applications may necessitate the involvement of multiple real users for collectively solving a problem with the assistance of LLMs. We showcase how AutoGen can be leveraged to effortlessly construct such a system. Specif- ically, building upon scenario 2 mentioned above, we aim to devise a simple system involving two human users: a student and an expert. In this setup, the student interacts with an LLM assistant to address some problems, and the LLM automatically resorts to the expert when necessary. The overall workflow is as follows: The student chats with the LLM-based assistant agent through a student proxy agent to solve problems.
2308.08155#63
2308.08155#65
2308.08155
[ "2103.03874" ]
2308.08155#65
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
When the assistant cannot solve the problem satisfactorily, or the solution does not match the expectation of the student, it would automatically hold the con- versation and call the pre-defined ask for expert function via the function call feature of GPT in order to resort to the expert. Specifically, it would automatically produce the initial message for the ask for expert function, which could be the statement of the problem or the request to verify the solution to a problem, and the expert is supposed to respond to this message with the help of the expert assistant. After the conversation between the expert and the expertâ s assistant, the final message would be sent back to the student assistant as the response to the initial message. Then, the student assistant would resume the conversation with the student using the response from the expert for a better solution.
2308.08155#64
2308.08155#66
2308.08155
[ "2103.03874" ]
2308.08155#66
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
A detailed visualization is shown in Figure 6. With AutoGen, constructing the student/expert proxy agent and the assistant agents is straight- forward by reusing the built-in UserProxyAgent and AssistantAgent through appropriate configurations. The only development required involves writing several lines of code for the ask for expert function, which then becomes part of the configuration for the assistant. Ad- ditionally, itâ s easy to extend such a system to include more than one expert, with a specific ask for expert function for each, or to include multiple student users with a shared expert for consultation.
2308.08155#65
2308.08155#67
2308.08155
[ "2103.03874" ]
2308.08155#67
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
21 A2: Retrieval-Augmented Code Generation and Question Answering 1 1. Question and Contexts I 2. Satisfied Answers or â Update Contextâ lq 1 1 3. Terminate, feedbacks or â Update Contextâ 4. Satisfied Answers or Terminate Retrieval-augmented Retrieval-augmented User Proxy Assistant Figure 7: Overview of Retrieval-augmented Chat which involves two agents, including a Retrieval- augmented User Proxy and a Retrieval-augmented Assistant. Given a set of documents, the Retrieval-augmented User Proxy first automatically processes documentsâ splits, chunks, and stores them in a vector database. Then for a given user input, it retrieves relevant chunks as context and sends it to the Retrieval-augmented Assistant, which uses LLM to generate code or text to answer questions. Agents converse until they find a satisfactory answer.
2308.08155#66
2308.08155#68
2308.08155
[ "2103.03874" ]
2308.08155#68
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Detailed Workflow. The workflow of Retrieval-Augmented Chat is illustrated in Figure 7. To use Retrieval-augmented Chat, one needs to initialize two agents including Retrieval-augmented User Proxy and Retrieval-augmented Assistant. Initializing the Retrieval-Augmented User Proxy necessitates specifying a path to the document collection. Subsequently, the Retrieval-Augmented User Proxy can download the documents, segment them into chunks of a specific size, compute embeddings, and store them in a vector database. Once a chat is initiated, the agents collaboratively engage in code generation or question-answering adhering to the procedures outlined below: 1. The Retrieval-Augmented User Proxy retrieves document chunks based on the embedding simi- larity, and sends them along with the question to the Retrieval-Augmented Assistant. 2. The Retrieval-Augmented Assistant employs an LLM to generate code or text as answers based on the question and context provided. If the LLM is unable to produce a satisfactory response, it is instructed to reply with â Update Contextâ to the Retrieval-Augmented User Proxy. 3. If a response includes code blocks, the Retrieval-Augmented User Proxy executes the code and sends the output as feedback. If there are no code blocks or instructions to update the context, it terminates the conversation. Otherwise, it updates the context and forwards the question along with the new context to the Retrieval-Augmented Assistant. Note that if human input solicitation is enabled, individuals can proactively send any feedback, including Update Contextâ , to the Retrieval-Augmented Assistant. 4. If the Retrieval-Augmented Assistant receives â Update Contextâ , it requests the next most similar chunks of documents as new context from the Retrieval-Augmented User Proxy. Otherwise, it generates new code or text based on the feedback and chat history. If the LLM fails to generate an answer, it replies with â Update Contextâ
2308.08155#67
2308.08155#69
2308.08155
[ "2103.03874" ]
2308.08155#69
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
again. This process can be repeated several times. The conversation terminates if no more documents are available for the context. We utilize Retrieval-Augmented Chat in two scenarios. The first scenario aids in generating code based on a given codebase. While LLMs possess strong coding abilities, they are unable to utilize packages or APIs that are not included in their training data, e.g., private codebases, or have trouble using trained ones that are frequently updated post-training. Hence, Retrieval-Augmented Code Generation is considered to be highly valuable. The second scenario involves question-answering on the Natural Questions dataset (Kwiatkowski et al., 2019), enabling us to obtain comparative evaluation metrics for the performance of our system. Scenario 1: Evaluation on Natural Questions QA dataset. In this case, we evaluate the Retrieval-Augmented Chatâ s end-to-end question-answering performance using the Natural Ques- tions dataset (Kwiatkowski et al., 2019). We collected 5,332 non-redundant context documents and 6,775 queries from HuggingFace. First, we create a document collection based on the entire context corpus and store it in the vector database. Then, we utilize Retrieval-Augmented Chat to answer the questions. An example (Figure 8) from the NQ dataset showcases the advantages of the interactive retrieval feature: â
2308.08155#68
2308.08155#70
2308.08155
[ "2103.03874" ]
2308.08155#70
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
who carried the usa flag in opening ceremonyâ . When attempting to answer this question, the context with the highest similarity to the question embedding does not contain the 22 Task description who carried the usa flag in opening ceremony? { (a) W/o Interactive Retrieval | { (b) W/ Interactive Retrieval Assistant: You're a retrie chatbot. You â lag in opening ceremony under ... The Astros . </P> information about who the usa flag in opening 7, 1899, under ...
2308.08155#69
2308.08155#71
2308.08155
[ "2103.03874" ]
2308.08155#71
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
The bi he Â¥. s that night, 2-1. </P> UserProxy: Sorry, I cannot find any information about who carried) the USA flag in the opening ceremony. Sorry, I donâ t know # Figure 8: Retrieval-augmented Chat without (W/O) and with (W/) interactive retrieval. required information for a response. As a result, the LLM assistant (GPT-3.5-turbo) replies â Sorry, I cannot find any information about who carried the USA flag in the opening ceremony.
2308.08155#70
2308.08155#72
2308.08155
[ "2103.03874" ]
2308.08155#72
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
UPDATE CONTEXT.â With the unique and innovative ability to update context in Retrieval-Augmented Chat, the user proxy agent automatically updates the context and forwards it to the assistant agent again. Following this process, the agent is able to generate the correct answer to the question. In addition, we conduct an experiment using the same prompt as illustrated in (Adlakha et al., 2023) to investigate the advantages of AutoGen W/O interactive retrieval. The F1 score and Recall for the first 500 questions are 23.40% and 62.60%, respectively, aligning closely with the results reported in Figure 4b. Consequently, we assert that AutoGen W/O interactive retrieval outperforms DPR due to differences in the retrievers employed. Specifically, we utilize a straightforward vector search retriever with the all-MiniLM-L6-v2 model for embeddings. Furthermore, we analyze the number of LLM calls in experiments involving both AutoGen and AutoGen W/O interactive retrieval, revealing that approximately 19.4% of questions in the Natural Questions dataset trigger an â
2308.08155#71
2308.08155#73
2308.08155
[ "2103.03874" ]
2308.08155#73
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Update Contextâ operation, resulting in additional LLM calls. Scenario 2: Code Generation Leveraging Latest APIs from the Codebase. In this case, the ques- tion is â How can I use FLAML to perform a classification task and use Spark for parallel training? Train for 30 seconds and force cancel jobs if the time limit is reached.â . FLAML (v1) (Wang et al., 2021) is an open-source Python library designed for efficient AutoML and tuning. It was open- sourced in December 2020, and is included in the training data of GPT-4. However, the question necessitates the use of Spark-related APIs, which were added in December 2022 and are not encom- passed in the GPT-4 training data. Consequently, the original GPT-4 model is unable to generate the correct code, due to its lack of knowledge regarding Spark-related APIs. Instead, it erroneously cre- ates a non-existent parameter, spark, and sets it to Trueâ
2308.08155#72
2308.08155#74
2308.08155
[ "2103.03874" ]
2308.08155#74
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
. Nevertheless, with Retrieval-Augmented Chat, we provide the latest reference documents as context. Then, GPT-4 generates the correct code blocks by setting use spark and f orce cancel to Trueâ . 23 # A3: Decision Making in Text World Environments ALFWorld Executor Action Decision i Action decision: Pick up pencil 2 from desk 2 Reward & State Observation: On the desk 2, you see an alarmclock 3, a bowl 3, a creditcard 2, a mug 1, and a pencil 2. Assistant GroundingAgent ALFChat (two agents) ALFChat (three agents) Figure 9: We use AutoGen to solve tasks in the ALFWorld benchmark, which contains household tasks described in natural language. We propose two designs: a two-agent design where the assistant agent suggests the next step, and the Executor executes actions and provides feedback. The three- agent design adds a grounding agent that supplies commonsense facts to the executor when needed. ALFWorld (Shridhar et al., 2021) is a synthetic language-based interactive decision-making task. It comprises textual environments that aim to simulate real-world household scenes. Given a high- level goal (e.g., putting a hot apple in the fridge) and the description of the household environment, the agent needs to explore and interact with the simulated household environment through a textual interface. A typical task environment contains various types of locations and could require more than 40 steps to finish, which highlights the need for agents to decompose the goal into subtasks and tackle them one by one, while effectively exploring the environments. Detailed Workflow. We first propose a straightforward two-agent system with AutoGen, illustrated on the left-hand side of Figure 9, to tackle tasks from this benchmark. The system consists of an assistant agent and an executor agent. The assistant agent generates plans and makes action decisions to solve the tasks. The executor agent is tailored specifically for ALFWorld. It performs actions proposed by the assistant and reports action execution results in the household environment as feedback to the assistant. Due to the strict format requirements for the output format, we use the BLEU metric to evaluate the similarity of the output to all valid action options. The option with the highest similarity will be chosen as the action for this round. One major challenge encompassed in ALFWorld is commonsense reasoning.
2308.08155#73
2308.08155#75
2308.08155
[ "2103.03874" ]
2308.08155#75
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
The agent needs to extract patterns from the few-shot examples provided and combine them with the agentâ s general knowledge of household environments to fully understand task rules. More often than not, the as- sistant tends to neglect some basic knowledge of the household environment. Thanks to the easy-to- implement multi-agent conversational feature of AutoGen, enhancing the assistant agentâ s reason- ing ability by adding a new grounding agent to provide commonsense facts for the decision-making agentâ s reference becomes straightforward. By scrutinizing the failed attempts and summarizing the reasons for failure, we obtained a holistic understanding of the commonsense knowledge that the assistant agent lacks. Then, we set a grounding agent to provide this general knowledge when the task begins and whenever the assistant outputs the same action three times in a row. This ensures the assistant takes this commonsense knowledge into consideration and prevents it from getting stuck in outputting the same content or constantly apologizing. We compare our systemâ s performance with ReAct, which treats ALFWorld as a text-completion task. ReAct (Yao et al., 2022) is a few-shot prompting technique that interleaves reasoning and acting, allowing for greater synergy between the two and significantly improving performance on both language and decision-making tasks. We integrate ReAct into AutoGen by modifying the prompts in a conversational manner. Following ReAct, we employ a two-shot setting. The few- shot prompts are obtained from the corresponding repository. As shown in Table 3, the two-agent
2308.08155#74
2308.08155#76
2308.08155
[ "2103.03874" ]
2308.08155#76
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
24 Task description . Looking quickly around you, you see a bed 1, a desk 2, a desk 1, a safe 1, a drawer 2, a drawer 1, a / the desklamp at desk 1, then goes to desk 2.) stant falls into the same loop as (a)) cant finds the desklamp at desk 2, Executor (to Assistant): On the desk 2, you s ed 3.. Assistant (to Executor) : |BHOUGHIll[NOw lilli=iNellal/BSwilll(i)jlllmAeeal a bowl 1, and a GroundingAgent (to Executor) st go to where the target to use the desklamp to look at the bowl. I'11 go to the desklamp object is before you cai now.] ACTION [go to desk 1] Executor (to Assistant): You turn on the amp 1. Hint: You must Executor (to Assistant): On the desk 1, you see a desklamp 1, a find and take the object before you can examine it. pencil 2... Assistant (to Executor) : Assistant: ACTION [use desklamp 1] Exacutor{to Assistant) : On the desk 2, you see a bowl 1, a ed Aésistant (to Executor) Executor (to Aswistant) Resistant (to Executor): Aaaietant (to Executor): ACTION [3 ere 1] Executor (to Aseistant) ty TERMINATE. WA (aseistant (to Executor) Executor (to Assistant): You turn on the desklamp 1. Assistant (to Executor): [HOUGHM [Now that (the) deSiclanp)|ils|EUEReE on, T can use it to look at the bowl (1) that I found earlier.] ACTION [look at bowl 1 under the desklamp 1] Executor (to Assistant) turn on (Assistant falls into an infinite loop turning o: Executor (to Assistant) iled. Reply TERMINATE. Assistant (to Executor) TE Figure 10: Comparison of results from two designs: (a) Two-agent design which consists of an assistant and an executor, (b) Three-agent design which adds a grounding agent that serves as a knowledge source.
2308.08155#75
2308.08155#77
2308.08155
[ "2103.03874" ]
2308.08155#77
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
For simplicity, we omit the in-context examples and part of the exploration trajectory, and only show parts contributing to the failure/success of the attempt. Method Pick Clean Heat Cool Look Pick 2 | All ReAct (avg) 63 52 48 71 61 24 54 ALFChat (2 agents)(avg) 61 58 57 67 50 19 54 ALFChat (3 agents)(avg) 79 64 70 76 78 41 69 ReAct (best of 3) TS 62 61 81 78 35 66 ALFChat (2 agents)(best of 3) | 71 61 65 716 67 35 63 AFLChat (3 agents)(best of 3) | 92 74 78 86 83 41 77 52 58 64 62 61 74 Table 3: Comparisons between ReAct and the two variants of ALFChat on the ALFWorld bench- mark. For each task, we report the success rate out of 3 attempts. Success rate denotes the number of tasks successfully completed by the agent divided by the total number of tasks. The results show that adding a grounding agent significantly improves the task success rate in ALFChat. design matches the performance of ReAct, while the three-agent design significantly outperforms ReAct. We surmise that the performance discrepancy is caused by the inherent difference between dialogue-completion and text-completion tasks. On the other hand, introducing a grounding agent as a knowledge source remarkably advances performance on all types of tasks. Case study. Figure 10 exemplifies how a three-agent design eliminates one root cause for failure cases. Most of the tasks involve taking an object and then performing a specific action with it (e.g., finding a vase and placing it on a cupboard). Without a grounding agent, the assistant frequently conflates finding an object with taking it, as illustrated in Figure 10a). This leads to most of the failure cases in â pickâ and â lookâ type tasks. With the introduction of a grounding agent, the assistant can break out of this loop and successfully complete the task Takeaways. We introduced a grounding agent to serve as an external commonsense knowledge source, which significantly enhanced the assistantâ s ability to make informed decisions.
2308.08155#76
2308.08155#78
2308.08155
[ "2103.03874" ]
2308.08155#78
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
This proves that providing necessary commonsense facts to the decision-making agent can assist it in making more informed decisions, thus effectively boosting the task success rate. AutoGen brings both simplicity and modularity when adding the grounding agent. 25 A4: Multi-Agent Coding @ @ User © User auestion| to Final Answer Repeat until answering the userâ s question or timeout Ve Figure 11: Our re-implementation of OptiGuide with AutoGen streamlining agentsâ interactions. The Commander receives user questions (e.g., What if we prohibit shipping from supplier 1 to roastery 2?) and coordinates with the Writer and Safeguard. The Writer crafts the code and inter- pretation, the Safeguard ensures safety (e.g., not leaking information, no malicious code), and the Commander executes the code. If issues arise, the process can repeat until resolved. Shaded circles represent steps that may be repeated multiple times. Detailed Workflow. The workflow can be described as follows. The end user initiates the in- teraction by posing a question, such as â What if we prohibit shipping from supplier 1 to roastery 2?â , marked by to the Commander agent. The Commander manages and coordinates with two LLM-based assistant agents: the Writer and the Safeguard. Apart from directing the flow of commu- nication, the Commander has the responsibility of handling memory tied to user interactions. This capability enables the Commander to capture and retain valuable context regarding the userâ
2308.08155#77
2308.08155#79
2308.08155
[ "2103.03874" ]
2308.08155#79
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
s ques- tions and their corresponding responses. Such memory is subsequently shared across the system, empowering the other agents with context from prior user interactions and ensuring more informed and relevant responses. In this orchestrated process, the Writer, who combines the functions of a â Coderâ and an â Inter- preterâ as defined in (Li et al., 2023a), will craft code and also interpret execution output logs. For in- stance, during code writing ( ), the Writer may craft code â model.addConstr(x[â supplier1â , â roastery2â ] == 0, â prohibitâ )â to add an additional constraint to answer the userâ s question. After receiving the code, the Commander will communicate with the Safeguard to screen the code and ascertain its safety ( , the Commander will use external tools (e.g., Python) to execute the code and request the Writer to interpret the execution results for the userâ s question ( ). For instance, the writer may say â if we prohibit shipping from supplier 1 to roastery 2, the total cost would increase by 10.5%.â Bringing this intricate process full circle, the Commander furnishes the user with the concluding answer ( If at a point there is an exception - either a security red flag raised by Safeguard (in ) or code execution failures within Commander, the Commander redirects the issue back to the Writer with essential information in logs ( might be repeated multiple times, until each user query receives a thorough and satisfactory resolution or until the timeout. This entire complex workflow of multi-agent interaction is elegantly managed via AutoGen. The core workflow code for OptiGuide was reduced from over 430 lines to 100 lines using AutoGen, leading to significant productivity improvement. The new agents are customizable, conversable, and can autonomously manage their chat memories. This consolidation allows the coder and interpreter roles to merge into a single â Writerâ agent, resulting in a clean, concise, and intuitive implementation that is easier to maintain.
2308.08155#78
2308.08155#80
2308.08155
[ "2103.03874" ]
2308.08155#80
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
26 Manual Evaluation Comparing ChatGPT + Code Interpreter and AutoGen-based OptiGuide. ChatGPT + Code Interpreter is unable to execute code with private or customized dependencies (e.g., Gurobi), which means users need to have engineering expertise to manually handle multiple steps, disrupting the workflow and increasing the chance for mistakes. If users lack access or expertise, the burden falls on supporting engineers, increasing their on-call time. We carried out a user study that juxtaposed OpenAIâ s ChatGPT coupled with a Code Interpreter against AutoGen-based OptiGuide. The study focused on a coffee supply chain scenario, and an expert Python programmer with proficiency in Gurobi participated in the test. We evaluated both systems based on 10 randomly selected questions, measuring time and accuracy. While both sys- tems answered 8 questions correctly, the Code Interpreter was significantly slower than OptiGuide because the former requires more manual intervention. On average, users needed to spend 4 minutes and 35 seconds to solve problems with the Code Interpreter, with a standard deviation of approxi- mately 2.5 minutes. In contrast, OptiGuideâ s average problem-solving time was around 1.5 minutes, most of which was spent waiting for responses from the GPT-4 model. This indicates a 3x saving on the userâ s time with AutoGen-based OptiGuide. While using ChatGPT + Code Interpreter, users had to read through the code and instructions to know where to paste the code snippets. Additionally, running the code involves downloading it and executing it in a terminal, a process that was both time-consuming and prone to errors. The response time from the Code Interpreter is also slower, as it generates lots of tokens to read the code, read the variables line-by-line, perform chains of thought analysis, and then produce the final answer code. In contrast, AutoGen integrates multiple agents to reduce user interactions by 3 - 5 times on average as reported in Table 4, where we evaluated our system with 2000 questions across five OptiGuide applications and measured how many prompts the user needs to type. Table 4: Manual effort saved with OptiGuide (W/ GPT-4) while preserving the same coding perfor- mance is shown in the data below. The data include both the mean and standard deviations (indicated in parentheses). Dataset
2308.08155#79
2308.08155#81
2308.08155
[ "2103.03874" ]
2308.08155#81
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
netflow facility tsp coffee diet Saving Ratio 3.14x (0.65) 3.14x (0.64) 4.88x (1.71) 3.38x (0.86) 3.03x (0.31) Table 13 and 15 provide a detailed comparison of user experience with ChatGPT+Code Interpreter and AutoGen-based OptiGuide. ChatGPT+Code Interpreter is unable to run code with private pack- ages or customized dependencies (such as Gurobi); as a consequence, ChatGPT+Code Interpreter requires users to have engineering expertise and to manually handle multiple steps, disrupting the workflow and increasing the chance for mistakes. If customers lack access or expertise, the bur- den falls on supporting engineers, increasing their on-call time. In contrast, the automated chat by AutoGen is more streamlined and autonomous, integrating multiple agents to solve problems and address concerns. This results in a 5x reduction in interaction and fundamentally changes the over- all usability of the system. A stable workflow can be potentially reused for other applications or to compose a larger one. Takeaways: The implementation of the multi-agent design with AutoGen in the OptiGuide appli- cation offers several advantages. It simplifies the Python implementation and fosters a mixture of collaborative and adversarial problem-solving environments, with the Commander and Writer work- ing together while the Safeguard acts as a virtual adversarial checker. This setup allows for proper memory management, as the Commander maintains memory related to user interactions, provid- ing context-aware decision-making. Additionally, role-playing ensures that each agentâ s memory remains isolated, preventing shortcuts and hallucinations
2308.08155#80
2308.08155#82
2308.08155
[ "2103.03874" ]
2308.08155#82
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
27 # A5: Dynamic Group Chat Manager a weneeee, @ | i '@! | ' H f 1 a a G) | Response; | 1 @) a (ees) Alice User Proxy Bob Bob Manager 3. Broadcast 2. Ask the Speaker to Respond Figure 12: A5: Dynamic Group Chat: Overview of how AutoGen enables dynamic group chats to solve tasks. The Manager agent, which is an instance of the GroupChatManager class, performs the following three stepsâ select a single speaker (in this case Bob), ask the speaker to respond, and broadcast the selected speakerâ s message to all other agents To validate the necessity of multi-agent dynamic group chat and the effectiveness of the role-play speaker selection policy, we conducted a pilot study comparing a four-agent dynamic group chat system with two possible alternatives across 12 manually crafted complex tasks. An example task is â
2308.08155#81
2308.08155#83
2308.08155
[ "2103.03874" ]
2308.08155#83
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
How much money would I earn if I bought 200 $AAPL stocks at the lowest price in the last 30 days and sold them at the highest price? Save the results into a file.â The four-agent group chat system comprised the following group members: a user proxy to take human inputs, an engineer to write code and fix bugs, a critic to review code and provide feedback, and a code executor for executing code. One of the possible alternatives is a two-agent system involving an LLM-based assistant and a user proxy agent, and another alternative is a group chat system with the same group members but a task-based speaker selection policy. In the task-based speaker selection policy, we simply ap- pend role information, chat history, and the next speakerâ s task into a single prompt. Through the pilot study, we observed that compared with a task-style prompt, utilizing a role-play prompt in dy- namic speaker selection often leads to more effective consideration of both conversation context and role alignment during the process of generating the subsequent speaker, and consequently a higher success rate as reported in Table 5, fewer LLM calls and fewer termination failures, as reported in Table 6. # Table 5: Number of successes on the 12 tasks (higher the better). Model GPT-3.5-turbo 8 9 7 GPT-4 9 11 8 Table 6: Average # LLM calls and number of termination failures on the 12 tasks (lower the better). Model GPT-3.5-turbo 9.9, 9 5.3, 0 4, 0 GPT-4 6.8, 3 4.5, 0 4, 0
2308.08155#82
2308.08155#84
2308.08155
[ "2103.03874" ]
2308.08155#84
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
28 Task description Write a script to download all the pdfs from arxiv in last three days and save them under /arxiv folder. (a) two-agent chat User: A Write a script to download all the pdfs from arxiv in last three days an d save them under /arxiv folder. Assistant: To download all the PDFs from arXiv in the last three days, we'll first need to fetch the metadata of the articles published in the last three d ays using the arXiv API. Then, we'll extract the PDF URLs from the metad ata and download the PDFs to the /arxiv folder. Here's a Python script that does this. Save the script as â download arxi v_pdfs.py* and execute it. ~ â python (python code) After executing the script, all the PDFs from arXiv in the last three da ys will be downloaded and saved under the /arxiv folder. User: exitcode: 1 (execution failed) Code output: Traceback (most recent call last):
2308.08155#83
2308.08155#85
2308.08155
[ "2103.03874" ]
2308.08155#85
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
File â download _arxiv_pdfs.py", line 3, in <module> import requests ModuleNotFoundError: No module named 'requestsâ Assistant: I apologize for the oversight. It seems that the â requests' library is n ot installed on your system. Please install the 'requests' library by ru nning the following command: sh pip install requests sae After installing the 'requests' library, please run the â download arxiv_ pdfs.py* script again. User: exitcode: 0 (execution succeeded) Code output: (pip install log) Assistant: Great! Now that you have installed the 'requests' library, please run th e â download_arxiv_pdfs.py* script again. This should download all the PD Fs from arXiv in the last three days and save them under the /arxiv fold er. User: exitecode: 0 (execution succeeded) Code output: (pip install log) Assistant: It seems you've executed the command to install the 'requests' library a gain. Please run the â download_arxiv_pdfs.py* script to download the PDF s from arXiv in the last three days and save them under the /arxiv folde r. User: (no output) Assistant User (mo output) Assistant User (no output) . repeat until max_auto_reply hit (b) group chat Welcome to the group chat!
2308.08155#84
2308.08155#86
2308.08155
[ "2103.03874" ]
2308.08155#86
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Work together to resolve my task. I'll reply [TERMINATE] when converstion ended. Admin: Critic, if code running fail, you ask engineer to rewrite code. n: engineer, you write python code step by step to resolve my task. in: executor, you run python code from enginnerand report bug Admin: Write a script to download all the pdfs from arxiv in last three d ays and save them under /arxiv folder. pip install arxiv pip install requests « (rest of code) . Executor: exitcode: 1 (execution failed) Code output: Collecting arxiv // pip install log .. Traceback (most recent call last}: File "", line 15, in <module> results - arxiv.query(query-query, max_results-100) AA RAARAARAAN AttributeError: module â arxiv' has no attribute 'query Critic: â * "sh (updated code) Executor: . (pip log) Traceback (most recent call last): File "", line 3, in <module> import arxiv_api ModuleNotFoundError: No module named â arxiv_apiâ
2308.08155#85
2308.08155#87
2308.08155
[ "2103.03874" ]
2308.08155#87
AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Critic: I apologize for the confusion. It seems that there is no package n amed â arxiv- api' available. I made a mistake in my previous response. Let's re vert to the 'arxiv' package and modify the code accordingly. . (modified code) Executor: exitcode: 0 (execution) in: (Terminate) Figure 13: Comparison of two-agent chat (a) and group chat (b) on a given task. The group chat resolves the task successfully with a smoother conversation, while the two-agent chat fails on the same task and ends with a repeated conversation.
2308.08155#86
2308.08155#88
2308.08155
[ "2103.03874" ]