A visual, step-by-step guide to the paper that made LLMs cooperate with each other — an AI user that gives instructions, an AI assistant that executes them, and one carefully engineered prompt that keeps them both on-script with no human in the loop.
CAMEL arrived in March 2023, when LLMs were brilliant solo acts that still needed a human typing every prompt. Here is the road from there to today's agent teams.
2022
Human-prompted LLM workflows
Chat-based models (ChatGPT) solve complex tasks — but every turn depends on a human steering the conversation. Studying "agents talking to agents" means simulating both sides by hand.
2023 · Mar
🚀 CAMEL (Li et al., KAUST)
Two gpt-3.5-turbo agents — an AI user and an AI assistant — role-play autonomously via inception prompting, generating 25,000 conversations and a study of LLM "society" behavior.
2023 · Apr–May
Generative Agents & ChatDev
25 agents live in a simulated town; a chat-powered "software company" writes programs. The communicative-agent idea catches on.
2023 · Aug–Sep
MetaGPT & AutoGen
Production-grade multi-agent frameworks: role specialization, standard operating procedures, and programmable agent conversations — direct descendants of CAMEL's pattern.
2024 →
Multi-agent everywhere
Agent teams become a default architecture for coding, research and workflows — LangGraph, CrewAI and dozens of frameworks ship the "agents talking to agents" primitive.
2025
Societies under the microscope
Multi-agent benchmarks, failure taxonomies and surveys study when agent societies cooperate — and when they collapse. CAMEL's failure phenomena are now standard vocabulary.
Key Insight
Autonomy is not a property of a model — it is a property of the system you wrap around it. A single LLM drifts off-task, flips roles, and loops politely forever. CAMEL's discovery: cooperation between two LLM agents can be engineered with prompts, turning an unreliable improviser into a reliable teammate.
The name CAMEL stands for Communicative Agents for "Mind" Exploration of Large Language Model Society — and the method is inspired by the movie Inception: plant the idea so deeply in the agents' opening prompts that they stay on-mission.
Chapter 01
The Human in the Loop
In 2023, LLMs could solve astonishing tasks — as long as a person kept prompting, correcting, and nudging. That bottleneck blocked both agent research and data generation.
⌨️
One Human, One Chatbot
Task-solving leans on human input to steer every conversation turn
Studying multi-agent behavior means role-playing both sides by hand
Instruction-following data needs slow, expensive human annotation
Each conversation drifts without a script — no reliable replication
You can observe one chat at a time, never a society at scale
🤝
CAMEL's Solution
Two role-locked agents: an AI user who instructs, an AI assistant who executes
Inception prompts bake the rules into both agents' opening messages
Zero human turns — the loop runs until a termination condition fires
Every conversation is recorded, becoming instruction-following data
Think of a two-person improv scene where the director never appears — instead, the entire script is stitched into the actors' opening lines. The AI user walks on stage already knowing it only ever gives instructions; the AI assistant walks on knowing it only ever executes them. Nobody directs the scene, yet it stays on plot, because the rules were planted before the first word — like the dream-within-a-dream of the film Inception that gave the technique its name.
AI user — always instructsAI assistant — always executes1 inception prompt — the invisible script0 human turns
Chapter 02
Two Agents, One Script
The role-playing framework assigns complementary jobs: an AI user that acts as task planner, and an AI assistant that acts as task executor — a task-specifier agent first turns a rough human idea into a concrete task.
AI User — the task planner
Gives instructions to the assistant, one at a time
Provides any necessary input alongside each instruction
Decides when the task is done — and says the one word <CAMEL_TASK_DONE>
Must instruct, never ask questions
Declines morally, legally or physically impossible requests
AI Assistant — the task executor
Executes instructions with specific solutions and examples
Responds in a fixed format, always starting with Solution:
Always ends with Next request. to keep the loop going
Must never instruct the user — that would be a role reversal
Honestly declines instructions it cannot perform
Interactive Demo — Role-Play Player (centerpiece)
The paper's own example: a human idea — "develop a trading bot for the stock market" — becomes a task for a Python Programmer (assistant) helping a Stock Trader (user). Press Play to advance the conversation turn by turn, then switch the run mode to watch failure phenomena strike.
turn 0 / 8
Chapter 03
Inception Prompting
The paper's central technical contribution: instead of fine-tuning or rewards, cooperation is achieved by engineering the agents' initial prompts so precisely that they stay in role, on-task, and inside the interaction format — with zero human turns.
A third agent turns a rough human idea into a concrete, imaginative task ("make it more specific, be creative").
𝒫A
Assistant System Prompt
Locks the assistant's role, forbids instructing, and forces the "Solution: … Next request." format.
𝒫U
User System Prompt
Locks the user's role, forces one instruction at a time, and defines the end-of-task token.
↻
Loop Until Termination
The two prompts each other automatically in a loop — until a termination condition fires.
The Real Prompt Structure (abridged from the paper's Figure 2, AI Society)
ASSISTANT SYSTEM PROMPT
Never forget you are a <ASSISTANT_ROLE> and I am a <USER_ROLE>.Never flip roles! Never instruct me!
Here is the task: <TASK>. Never forget our task!
Unless I say the task is completed, you should always start with: Solution: <YOUR_SOLUTION>Always end <YOUR_SOLUTION> with: Next request.
USER SYSTEM PROMPT
Never forget you are a <USER_ROLE> and I am a <ASSISTANT_ROLE>.Never flip roles! You will always instruct me.You should instruct me not ask me questions.Keep giving me instructions until you think the task is completed.When the task is completed, you must only reply with a single word <CAMEL_TASK_DONE>
Every sentence is a guardrail: the format rule ("Solution: …") prevents vague flake replies like "I will do something"; "Next request." keeps the assistant from stopping the conversation; and the single-word end token stops the agents from politely thanking each other forever.
Interactive Demo — Inception Prompt Builder
Toggle the guardrail groups on and off, watch the live prompt weaken, and then run a 3-turn simulation to see which failure phenomenon strikes a prompt without that rule.
ROBUSTNESS METER — FRAGILE
Chapter 04
When Agents Misbehave
Run 25,000 conversations and you discover how LLM agents fail to cooperate. The paper names the phenomena it found — they became the field's standard vocabulary for multi-agent failure modes.
🔄 Role Flipping
The assistant starts giving instructions or commands — and the user starts executing them. Roles reverse mid-conversation, derailing cooperation. Countermeasure: "Never flip roles! Never instruct me!" plus a tripwire that ends the chat the instant the assistant issues an instruction.
🔁 Assistant Repeats Instruction
Without any role flip, the assistant simply echoes the user's instruction back instead of executing it — motion without progress. Countermeasure: the forced "Solution: …" response format.
💤 Flake Replies
The assistant promises action — "I will…" — without doing anything. The message contributes nothing to the task. Countermeasure: solutions must be specific, with implementations and examples.
♾️ Infinite Loop of Messages
The agents thank each other or say goodbye repeatedly, without progressing. Strikingly, they are sometimes aware they are stuck in a loop. Countermeasure: the end-of-task token, a 3-round no-instruction rule, and a hard 40-message cap.
🧭 Conversation Deviation
Chats drift away from the original human intention — the agents stay busy but stop working on your task. The task spec and "Never forget our task!" lines anchor the conversation.
🛑 Termination Trouble
Deciding when to stop is its own problem. The paper needs five conditions: the end-of-task token, the assistant-instruct flag, the 3-round no-instruction rule, token limits, and the 40-message cap.
Why These Matter
These are not exotic bugs — they are the default physics of LLM agents. In the paper's own 25,000-conversation dataset, the most common reason an AI Society chat ended was the Assistant-Instruct flag — i.e., role flipping — and in the Code dataset, the token limit, because code answers run long. Every later multi-agent framework inherited this exact problem list.
Chapter 05
From Two Agents to a Society
One pair of agents is a demo. CAMEL generated role pools and task ideas with LLMs too, scaled the pattern mechanically, and studied what happens — producing both datasets and findings.
20 programming languages × 50 domains of task-oriented coding chats.
➗
Math
50K problem–solution pairs, single-turn, for knowledge-emergence study.
🔬
Science
20K pairs each for Physics, Biology, Chemistry (60K total).
⚠️
Misalignment
Simulations of risky applications — a probe of unaligned autonomous systems.
Interactive Demo — Society Network
Click a role-pair node to inspect its task and how the conversation ended. Outcomes are illustrative, but the termination reasons are the paper's real categories — and the paper-scale stat is exact.
Paper scale: 50 assistant roles × 50 user roles × 10 tasks = 25,000 conversations (AI Society).
Does It Work?
The authors sampled 100 AI Society tasks and 100 Code tasks, had GPT-4 summarize each CAMEL conversation into a final solution, and compared it against a single-shot gpt-3.5-turbo solution of the same task — judged by both humans (453 votes) and a GPT-4 evaluator.
HUMAN EVAL · AI SOCIETY
76.3%
CAMEL wins vs 10.4% single-shot (13.3% draw) · 453 votes
GPT-4 EVAL · AI SOCIETY
73.0%
CAMEL wins vs 23.0% single-shot (4.0% draw) · n=100
GPT-4 EVAL · CODE
76.0%
CAMEL wins vs 24.0% single-shot (0% draw) · every task decided
GPT-4 EVAL · VS ZERO-COT
68.0%
CAMEL wins vs 28.0% "think step-by-step" (4.0% draw)
The Data Also Trains Models — CAMEL-7B (LLaMA-7B fine-tuned on the CAMEL datasets) on HumanEval
Model
HumanEval pass@1
HumanEval pass@100
gpt-3.5-turbo (reference)
69.4
94.0
Vicuna-7B
11.0
42.9
LLaMA-7B
10.5
36.5
CAMEL-7B (fine-tuned on CAMEL data)
14.0
57.9
A 7B model fine-tuned on CAMEL-generated conversations beats both LLaMA-7B and Vicuna-7B on code generation — evidence that self-generated agent conversations are genuinely useful training data.
What It Did NOT Solve
Autonomy is still brittle: the top termination reason in AI Society was the role-flip tripwire — prompts reduce misbehavior, they don't eliminate it.
Hard caps do the stopping: the 40-message limit, token limits, and tripwires — not the agents' own judgment — end most conversations.
Only two agents: true N-agent societies (agent teams, not pairs) are explicitly left as future work.
Single model family: both agents are gpt-3.5-turbo; GPT-4 is used only to summarize and judge, and evaluation covers 100 sampled tasks per dataset.
LLM-generated data: the datasets carry the errors and biases of their generator — a research resource, not a gold standard.
Legacy
The Multi-Agent Wave
CAMEL was one of the first scalable, open-source frameworks for autonomous LLM cooperation. Its role-play pattern and failure vocabulary spread through the entire field.
🧬 Framework lineage
AutoGen, ChatDev and MetaGPT build directly on the communicative-agents idea: role-assigned agents that cooperate through conversation.
🏭 Synthetic data generation
Self-instructing agent pairs turned data generation from a human-annotation problem into a compute problem — bootstrapping instruction data from models themselves.
🏙️ Society research
A scalable way to study "cognitive" processes and cooperative behavior of an LLM society — 25,000 conversations as a behavioral dataset.
📜 Prompt-engineering-for-cooperation
The lasting lesson: alignment between agents can be engineered via carefully structured prompts — role locks, formats, and termination tokens.
🎭 Role-play as a probe
The Misalignment dataset showed role-playing doubles as a safety instrument — simulating what unaligned autonomous agents might attempt.
🌊 The multi-agent default
Today's agent teams, coding crews and research crews all descend from the same primitive: two LLMs, locked in roles, talking it out.
Deep Dive
The Failure Taxonomy Nobody Had Written Down
CAMEL's lasting contribution isn't the role-play framework — it's the failure catalog. When two LLMs are locked into instructing and executing with zero human turns, they fail in specific, repeatable ways: role flipping, instruction echoing, flake replies, infinite pleasantries. Once named, those failure modes became the design checklist every later framework answers.
🎭
The Four Named Failure Modes
Role flipping — the executor starts giving instructions; hierarchy silently inverts
Instruction echoing — the assistant repeats the request as if it were progress
Flake replies — "Sure! What would you like?" — turns that carry zero information
Infinite loops — pleasantries cycling until the token budget dies
🛡️
The Guardrail Stack
<CAMEL_TASK_DONE> — an explicit termination token, not a vibe
Assistant-instruct tripwire — the moment roles flip, the system intervenes
40-message hard cap — the infinite loop dies by timeout, by design
Interactive Demo — Failure Theater
A CAMEL-style task attempt, replayed twice. First run: no guardrails — watch the conversation decay through the named failure modes; call each failure as you see it. Second run: the guardrail stack armed — same model, same task, clean termination.
task: "draft a press release for a new product"
VERDICT
Two agents beating one — barely, and only with rules
Humans preferred CAMEL's two-agent solutions over single-shot gpt-3.5-turbo 76.3% of the time; GPT-4 agreed at 73.0%. That margin was bought entirely by the guardrails — remove them and the same setup produces the theater above. At scale: 25,000 conversations across 50 × 50 AI-society role pairs, open-sourced for behavior research. The lineage: MetaGPT answers CAMEL's chaos with SOPs, Magentic-One answers it with an orchestrator, and the survey names the whole design space.
🔁 The tripwire idea
Detect role inversion by structure (who is issuing instructions?) not semantics. Cheap, deterministic, and the ancestor of today's orchestrator health checks.
🛑 Termination as a first-class problem
LLM loops do not converge on their own — task-done tokens, round caps and stall budgets appear in every serious framework since. CAMEL named the problem first.
📊 Behavior at scale
25K open conversations turned role-play from demo into dataset — later papers on emergent behavior and misalignment mine it.
🪞 The mirror result
GPT-4 as evaluator agreeing with human preference (73.0 vs 76.3) was an early, quiet win for LLM-as-judge — before the judging paper formalized it.
Test Yourself
Quick Quiz
Check your understanding of the key concepts from the CAMEL paper.
Reference
Key Takeaways
Everything you need to remember about this paper.
✅ Two role-locked agents — an instructing AI user and an executing AI assistant — cooperate with zero human turns in the loop.
✅ Inception prompting is the control system: task specifier + assistant rules + user rules, looping until a termination condition.
✅ The named failure modes: role flipping, instruction echoing, flake replies, and infinite loops of pleasantries.
✅ Guardrails: <CAMEL_TASK_DONE>, the assistant-instruct tripwire, the 3-round no-instruction rule, and the 40-message cap.
✅ At scale: 25,000 AI Society conversations (50 × 50 roles) plus Code, Math, Science and Misalignment datasets — all open-sourced.
✅ Humans (76.3%) and GPT-4 (73.0%) both preferred CAMEL's two-agent solutions over single-shot gpt-3.5-turbo.