CAMEL: Communicative Agents for "Mind" Exploration of Large Language Model Society

The rapid advancement of chat-based language models has led to remarkable progress in complex task-solving. However, their success heavily relies on human input to guide the conversation, which can be challenging and time-consuming. This paper explores the potential of building scalable techniques to facilitate autonomous cooperation among communicative agents, and provides insight into their "cognitive" processes. To address the challenges of achieving autonomous cooperation, we propose a novel communicative agent framework named role-playing. Our approach involves using inception prompting to guide chat agents toward task completion while maintaining consistency with human intentions. We showcase how role-playing can be used to generate conversational data for studying the behaviors and capabilities of a society of agents, providing a valuable resource for investigating conversational language models. In particular, we conduct comprehensive studies on instruction-following cooperation in multi-agent settings. Our contributions include introducing a novel communicative agent framework, offering a scalable approach for studying the cooperative behaviors and capabilities of multi-agent systems, and open-sourcing our library to support research on communicative agents and beyond: https://github.com/camel-ai/camel.

Paper

Similar papers

Peer review

Reviewer Z1bn4/10 · confidence 4/52023-07-05

Summary

This paper introduces CAMEL, a role-playing framework involving two LLMs (an AI user and an AI assistant) communicating with each other to finish a specific task prompted by a human. The two agents are supposed to give instructions and provide answers respectively. On complex tasks (including AI society, code, math, and science), the proposed framework achieves better performance than a GPT-3.5-turbo single-shot baseline evaluated by both human and GPT-4. Further analysis involving fine-tuning a LLaMA model suggest the challenges and emerging behaviors in multi-agent multi-turn conversations.

Strengths

1. This paper introduces an interesting framework role-play that instead of requiring delicate human prompting, two agents are auto-prompted each other (Inception prompting) to solve a task by collaboration in a multi-turn conversation. This may add values to the research community studying complicated prompting methods to solve complex tasks. 2. Evaluation and analysis indicate challenges in multi-agent collaboration such as role flipping and conversation deviation. This can be interesting to future research involving multiple language models.

Weaknesses

1. Baseline and evaluation. The proposed method, although sounds promising and conceptually novel, is not very different from previous methods such as chain-of-thought reasoning, especially React and self-critic, where at each turn, new instructions are prompted and can be considered as "AI user" in this context. The main difference if whether one language model is employed, or two agents in a self-play setup. I agree that there may be some values in using multiple agents as shown in recent works, but using gpt-3.5 with single-shot prompting as the only baseline is not convincing. More importantly, it is not clear what prompts are used for the single-shot baseline and how the prompts are constructed. Furthermore, despite the explanation on why GPT-4 is used to summarize CAMEL before evaluation, this evaluation setting is not convincing because 1. there is no analysis on how much "hallucination" or "error propagation" is generated because of using GPT-4. In other words, the summarization may be biased by GPT-4 sampling results rather than from CAMEL itself. 2. GPT-4 is used as the evaluator (this is less an issue). 2. Many details are missing. For example, where the data and tasks are sampled from to construct the dataset and why they are used for evaluation. I would suggest the authors to specify corresponding analysis instead of "is available in the Appendix" when revising the paper.

Questions

1. Is there an inconsistency in naming? I think the proposed method is named as "role-playing" but is also referred to as "CAMEL". 2. In line 277, how do the assistant and the user know that they are stuck in a loop but are unable to break out? 3. Can you clarify the questions raised above?

Rating

4: Borderline reject: Technically solid paper where reasons to reject, e.g., limited evaluation, outweigh reasons to accept, e.g., good evaluation. Please use sparingly.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

2 fair

Limitations

The authors have addressed the limitations and potential societal impact.

Reviewer 6oPa8/10 · confidence 3/52023-07-08

Summary

# Summary ## Motivation Completing tasks by human-in-the-loop is time-consuming. An alternative is to let autonomous agents cooperate to solve tasks. ## Approach This paper propose to let two LLM agents *role-play* a user and an assistant to solve tasks. Their data collection approach follows the following steps: 1. For each dataset, they generate a number of user roles, a number of assistant roles and a number of tasks of each combination. 2. For each user, assistant, task combination, they generate the conversation by prompting both roles to iteratively generating instruction and solutions, and doing critic-in-the-loop to improve generations at each step. They fine-tuned 7B LLaMa models on different combination of datasets. The comparison between models are judged by GPT-4, whose accuracy is validated by small sample human evaluation. ## Results First, CAMEL (the proposed role-play method between two LLMs) works better than gpt-3.5 as a single model. Second, in most cases each generated dataset brings improvement to finetuning. Third, on third-party code datasets HumanEval+, they show that the finetuned small models works better Vicuna. ## Contribution 1. This paper proposes a framework and prompt methods for solving tasks with multiple LLMs with different roles. 2. This paper generates conversation datasets in solving these tasks, which will be helpful for future research. 3. This paper fine-tuned smaller model and showcased the performance on an out-of-domain code generation dataset.

Strengths

# Originality Using a team of LLMs or generally NNs to solve a task is an interesting problem, but understudied in practical applications. This paper is innovative in that the generated tasks are in general domain, but also related to the agent roles engaged in the tasks. # Quality and Clarity As LLMs become accessible, the methods in this can be almost replicated by putting the prompts into the playground. This paper is clearly written, although not self-contained due to the shortage of space, e.g. the description of critic-in-the-loop model is in the appendix, though very important. # Significance The results in this paper are significant, except for the unclear parts in experiments (see questions). Due to the unavailability of good metrics when comparing models for general tasks, this paper uses GPT-4 for evaluation. This practice is widely used and has various issues raised by recent papers. Validating the results by doing small sample human evaluation is a reasonable choice.

Weaknesses

1. The "large scale language model society" can be misleading. In the whole paper, the conversations are between two agents with different roles. Readers might expect more agents to participate in decision-making. 2. It is unclear why this approach is different from hierarchical decision-making with the user as the high-level planner, and assistant as the low-level executor. The planner gives high-level instructions, while the low-level executor generates solutions. It is true that there are not many papers on LLMs for hierarchical decision making, however, there is a recent one [1]. This is not essentially a reason to reject this paper, but the authors should make the connection clearer. [1] Hierarchical Prompting Assists Large Language Model on Web Navigation

Questions

1. Section 5.1, Fig. 4. are the CAMEL agents here GPT-4 based or the fine-tuned model mentioned in 5.2? If it is GPT-4, would the comparison with get-3.5-turbo be unfair? 2. Section 5.3, on which datasets is the CAMEL-7B trained on? All datasets or just code?

Rating

8: Strong Accept: Technically strong paper, with novel ideas, excellent impact on at least one area, or high-to-excellent impact on multiple areas, with excellent evaluation, resources, and reproducibility, and no unaddressed ethical considerations.

Confidence

3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

4 excellent

Presentation

3 good

Contribution

3 good

Limitations

Yes

Reviewer wYFm7/10 · confidence 4/52023-07-08

Summary

This paper attempts to address a dilemma in leveraging large-language models (LLMs) for solving complex tasks in a collaborative setting: the question of oft-needed human intervention in the equation. More specifically, the authors have come up with an intuitive and novel cooperative agent framework called role-playing that supports effective task completions by collaboration dialogues between agents (LLMs) without extensive human interventions except at inception. Their framework also offers a scalable way to investigate and refine the collaborative capacities of multi- agent systems and they provide detailed analysis and resolution strategies for challenges that come up in such a to- and-fro LLM-instruction scenario. They evaluate their agents exhaustively with state-of-the-art LLMs like GPT 4 as well as with human intelligence. Moreover, they demonstrate task-specific emergence capabilities of smaller-sized LLMs like Llama using their generated user-instruction datasets for various scenarios and domains. Contributions: Datasets/Libraries 1. Their publicly available library provides modular functionality and includes implementations of different agents, examples of well-crafted prompts, and data explorers. 2. Two large conversational, task-oriented, and instruction-following datasets: AI Society and Code. 3. Math and Science dataset (QA) and Misalignment dataset (contains simulations of potential risks of such an uncontrolled autonomous system) 4. These datasets will help investigate other larger language models, allowing such LLMs to communicate more effectively with human agents.

Strengths

The proposed method (inception prompting) is intuitive, novel, and well-motivated for a novel collaborative task-solving using LLM-agents. The paper is mostly easy to follow. For instance, Fig. 2 is pretty detailed when it comes to roles and task assignments. The supplementary material, appendices, and the libraries provided can be crucial for future works in this direction. The methods section is scientifically sound with effective strategies being discussed for resolving the unaligned idea flows from a role perspective. The proposed framework can be used to evaluate collaborative problem-solving in crucial domains like classroom learning and education.

Weaknesses

1. Role/task alignment: For the specific task of building an app for stock trading via analyzing sentiments of certain stocks, it seems that the role assigned to the AI user (stock trader) and the message it generates seems counterintuitive since you wouldn’t generally expect stock traders to know environment variables being the first step towards solving this specific task. Instead, a role (like say tech lead/ tech supervisor) seems more fit for the AI user in that example. 2. Fig. 2 confusion: Fig.2 is a little confusing regarding which agent receives the task-specifier prompt (i.e., at the inception level). If I am reading correctly, the multi-agent scenario seems to include two LLMs, but it is not clear who received the starting ‘task-specifier’ prompt immediately. It’ll perhaps improve the readability if the authors can provide some clarity regarding this either in sec. 3.2 or Fig 2 3. Long-distance memory issues: in section 4.1, the authors provide a set of termination conditions that brute- force the collaborative mutual dialogues between the agents. Is it not entirely clear what exactly the authors mean when they claim 40 to be the max-limit of messages to ensure enough length in the conversation history. Was it chosen purely from a pricing perspective? I think the paper can benefit from having some more analysis from a cost/compute perspective. Also, did the authors come across any cases where the agents tended to effectively forget the previous thread of instruction flow (thus leading to sub-optimized task results) because of long-range memory issues that tend to affect such LLM-based agents?

Questions

(Also suggestions) 1. Sec 3.2 makes note of cases of role-switching being observed between the user and the assistant. Are those cases of LLM hallucination anyway correlated with the framing of the prompt? Does it affect certain tasks more than others or is it observed usually at specific points in the sequence of collaborative dialogues? 2. The authors precisely point out challenges such as instruction repetition, flake replies, and infinite loops of messages with examples in the appendices. However, one way of improving the analysis of the paper would be to have a plot/diagram with more details about the distribution of such cases (frequency, places where they tend to occur in the sequence of dialogues, etc). Also, what methods were used to stop/terminate such cases of looping/role-flipping, was it human intervention or did the authors use flags similar to the task termination conditions? 3. On section 5.2, which explains the methods for evaluating ‘emergence’ capacities in smaller LLMs like Llama, what was the motivation behind the sequence of various domains (math, science etc) being a specific way and not any other? Moreover, Table 1 can also benefit from some clarification about what exactly Model 1 and Model 2 are. Although the authors have pointed to sec 5.1 for the evaluation in sec 5.2, it is unclear which one is Llama variant. Also, there might be a case for further experiments with other relatively smaller-sized instruction-based LLMs like T0 [3], FLAN [2] or InstructGPT [3]

Rating

7: Accept: Technically solid paper, with high impact on at least one sub-area, or moderate-to-high impact on more than one areas, with good-to-excellent evaluation, resources, reproducibility, and no unaddressed ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

4 excellent

Contribution

3 good

Limitations

The authors have explicitly mentioned the limitations and have provided reasonable strategies to avoid any harmful (pricing/social or otherwise) consequences of their work. However, the paper might benefit from a cost- compute analysis in generating the collaborative datasets using LLMs, perhaps as a paragraph in the main paper.

Reviewer 6oPa2023-08-16

Reply to authors

Thanks authors for their detailed rebuttal. I think the response answers most questions that I had. I have also read the comments by other reviewers and still lean towards accepting this paper. Is it possible to change the "large-scale language model society" in the title? It is still confusing as whether the language models are large-scale or the society is large-scale. A candidate is "large language model collaboration".

Authorsrebuttal2023-08-19

Dear Reviewer 6oPa, Thank you for your thoughtful feedback and for considering our detailed rebuttal. We're pleased to know that our responses addressed most of your concerns. In regard to your suggestion about the title, we understand your perspective on the ambiguity it presents. We agree that clarity in the title is crucial, and "large language model collaboration" does offer a more direct understanding of the content of the paper. We will ensure that the title is revised to better capture the essence of our work without causing any confusion. Once again, we appreciate your constructive feedback and your inclination toward accepting our paper. Your insights have been invaluable in guiding our revisions, and we are grateful for your continued support. Warm regards, NeurIPS 2023 Conference Submission3376 Authors

Reviewer wYFm2023-08-17

Thank you for the detailed response. I still recommend acceptance for this paper, but I would like to point out that the change to the described workflow could entail a significant rewrite so I would encourage you to make the revisions as surgically as possible. As my recommendation is based on the submitted paper, too significant an overhaul to the framing would invalidate reviews based on the original submission.

Authorsrebuttal2023-08-19

Dear Reviewer wYFm, Thank you for your constructive feedback and your recommendation for acceptance. We deeply appreciate your recognition of our work. We understand and value your concern regarding the extent of revisions. Our intent is to address the comments you and other reviewers have raised without changing the fundamental framing of our paper. We assure you that the core content and essence of the paper will remain intact, and any alterations will be done with precision and caution. Your point about the balance between refining the paper and maintaining its original framing is well-taken. We will add a brief description of the workflow and ensure that our revisions are "surgical", targeting specific areas for improvement while retaining the primary structure and content that formed the basis of the original reviews. Once again, we appreciate your valuable insights and your recommendation. We are committed to ensuring that our paper maintains its integrity while addressing the concerns raised. Warm regards, NeurIPS 2023 Conference Submission3376 Authors

Reviewer Z1bn2023-08-19

Thanks for the response. Regarding baseline and evaluation. I understand that CAMEL is a different framework from React and self-critic. I was mostly pointing out that those methods can be considered as prompting a single language model, whereas CAMEL uses two language models. Therefore, it is necessary to show some comparison in both methods, results, and pros and cons of each, to illustrate why CAMEL is better. Thanks for the updated results on zero-CoT, but the comparison does not seem to be fair (because there is no prompting for CoT). Methods like React are more comparable. I am thus still not convinced how much CAMEL is better than other methods (conceptually it does have benefits though). Furthermore, I agree that using GPT-4 as an evaluation metric is adapted now, but again using GPT-4 to summarize the results before doing evaluation greatly complicates the evaluation.

Authorsrebuttal2023-08-19

Response to comparison between CAMEL and React

Dear Reviewer Z1bn, Thank you for your detailed feedback, particularly your observations regarding React and its comparability with CAMEL. To address your concerns: **Differences between React and CAMEL:** React operates on an "act and environment" paradigm, where it requires specific actions to be taken in a particular environment. In contrast, the primary experiments with CAMEL do not involve such a setup. This foundational difference makes a direct apples-to-apples comparison challenging. While React provides an interface between a language model and an environment to simulate reactions, CAMEL focuses on collaborative interactions between two models without the necessity of an explicit environment. **Possible Integrations:** Indeed, CAMEL could conceptually be comprised of two React agents, signifying that the two methodologies can be seen as orthogonal rather than as direct competitors. CAMEL's approach can be interpreted as a high-level collaborative mechanism that could potentially use React-like structures as its constituents. **Evaluation and Comparison:** We acknowledge the need to provide clearer comparisons between CAMEL and other methodologies, like React, to elucidate the unique benefits and possible drawbacks of our approach. However, we are not sure how to set up a direct apples-to-apples comparison with React. If you have some specific suggestions in this regard, we will be happy to work towards providing a more thorough analysis. Your feedback underscores the importance of making these distinctions clear and motivates us to refine our paper to better articulate these points. We genuinely appreciate your insights and will strive to address them comprehensively in our revisions. Warm regards, NeurIPS 2023 Conference Submission3376 Authors

Program Chairsdecision2023-09-21

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC