Skip to content

CAMEL: Role-Playing Agents and Inception Prompting

optionalextendedfundamentalpaperrubric 7/122023 · NeurIPS 2023 · ~20 min

Guohao Li, Hasan Abed Al Kader Hammoud, Hani Itani, …, Bernard Ghanem

Status

TL;DR. CAMEL (Communicative Agents for “Mind” Exploration of Large Language Model Society) is an early multi-agent framework built on role-playing. A human gives a rough idea and two roles, for example a Python programmer helping a stock trader. A task specifier agent makes the task concrete. Then an AI user agent gives instructions one at a time and an AI assistant agent carries them out, until the user sends <CAMEL_TASK_DONE>. All the prompting happens once, at the start. The paper calls this inception prompting, and uses the framework mainly to generate large conversational datasets and to study how cooperative agents fail.

Three prompts, written once. The inception prompt has a task specifier prompt, an assistant system prompt and a user system prompt. The two system prompts are almost symmetric. They give each agent its role and the other agent’s role, the task, and rules on format and conduct. One rule in the assistant prompt reads: “Never flip roles! Never instruct me!” Other rules make the assistant always begin with a solution, decline harmful or impossible instructions honestly, and stop after the task is done.

Failures it was designed around. The authors list four problems seen in early runs: role flipping (the assistant starts giving orders), the assistant repeating instructions, flake replies (promising to act without acting), and infinite loops of polite messages. The prompt rules, an end-of-task token and a 40-message cap are the fixes. A later section adds an optional critic, either an AI agent or a human, that picks among proposed next steps.

Data generation. For the AI Society dataset, an LLM generates 50 assistant roles and 50 user roles, and 10 tasks for each pair, giving 25,000 conversations with gpt-3.5-turbo. A Code dataset is built the same way, and single-turn Math and Science datasets are also generated. The authors fine-tune LLaMA-7B on these datasets to get CAMEL-7B.

All numbers are from the CAMEL authors. Against single-shot gpt-3.5-turbo, the summarised CAMEL solution wins 76.3% of 453 human votes on AI Society (10.4% for the baseline, 13.3% draws). With GPT-4 as judge it wins 73.0% on AI Society and 76.0% on Code (100 tasks each). Note that GPT-4 summarised each CAMEL conversation before judging. On HumanEval, CAMEL-7B reaches pass@1 of 14.0 against 10.5 for LLaMA-7B and 11.0 for Vicuna-7B, far below gpt-3.5-turbo at 69.4.

  • What goes wrong at scale: MAST turns role confusion, repetition and premature or missing termination into a systematic failure taxonomy.
  • Programmable successor: AutoGen generalises the two-agent loop to conversable agents with code execution and custom reply functions.
  • Single-agent loops: ReAct and Reflexion get a similar iterate-and-revise effect from one agent, which is the baseline CAMEL’s comparison lacks.
  • Judging with an LLM: the GPT-4 evaluation here raises the issues covered in LLM-as-a-judge.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Mechanism

    CAMEL lets an AI user and an AI assistant prompt each other in a loop with no human after the first step. Explain how inception prompting sets up this loop, which failure modes the authors observed, and how specific prompt lines try to prevent them.

    What a strong answer covers
    • A task specifier agent first turns a rough idea into a specific task; then the assistant and user system prompts fix the two roles before the chat starts.
    • After that, the user gives one instruction at a time and the assistant answers with a solution, with no further human prompting.
    • Observed failures include role flipping, the assistant repeating instructions, flake replies that promise but do not act, and infinite message loops.
    • Lines such as telling the assistant never to flip roles or instruct the user, and to always start with a solution, target role flipping and flake replies.
    • An end token, `<CAMEL_TASK_DONE>`, and a 40-message limit stop the conversation and keep cost bounded.
  2. Derive / compute

    In Table 1 of CAMEL, human raters (453 responses) prefer the CAMEL solution 76.3% of the time, gpt-3.5-turbo single-shot 10.4%, with 13.3% draws. GPT-4 as judge gives 73.0%, 23.0% and 4.0%. Compute the CAMEL win share among non-draw votes for each judge and the approximate number of human votes for CAMEL, and comment on how the two judges differ.

    What a strong answer covers
    • Human judges: 76.3 / (76.3 + 10.4) ≈ 0.88, so CAMEL wins about 88% of decisive votes.
    • GPT-4 judge: 73.0 / (73.0 + 23.0) ≈ 0.76, so about 76% of decisive votes.
    • Human votes for CAMEL: 0.763 × 453 ≈ 346.
    • GPT-4 almost never calls a draw (4% vs 13.3%) and gives the single-shot answer more wins, so the two judges agree on direction but not on margin.
  3. Critique

    CAMEL concludes that a cooperative multi-agent approach beats gpt-3.5-turbo single-shot answers. Critique this comparison, considering how the CAMEL solutions were prepared for judging and what the baseline is allowed to do.

    What a strong answer covers
    • GPT-4 summarised each CAMEL conversation into a final solution before judging, so a stronger model edited the CAMEL side but not the baseline.
    • CAMEL uses up to 40 messages per task while the baseline gets one call, so compute and length are not matched.
    • A fairer baseline would be a single agent with the same number of calls, such as self-refinement or chain-of-thought with revision.
    • The two roles are the same model with different prompts, so role labels do not add independent expertise or knowledge.
    • Human evaluation covers only the AI Society data, and the Code result relies only on GPT-4 as judge.

Done with this page?

Status