TAI BUI
Back to curriculum
BuildPython

Society of Mind and Multi-Agent Debate

Minsky's 1986 premise, that intelligence is a society of specialists, keeps getting rediscovered. In 2023 Du et al. turned it into a concrete algorithm: multiple LLM instances propose answers, read each other's answers, critique, and update. Over N rounds they converge on a consensus that beats zero-shot CoT and reflection on six reasoning and factuality tasks. Two findings matter: both **multiple agents** and **multiple rounds** contribute independently. The society beats a single-agent monologue, and the multi-round exchange beats one-shot voting.

TIME: ~60 minutesPREREQUISITES: Phase 16 · 04 (Primitive Model)

Learning Objectives

  • Write out the Du et al. debate loop (propose, read peers' previous-round answers, revise, majority-vote) and say why it beats self-consistency's i.i.d. samples.
  • Separate the agent-count and round-count ablations and say which combination drives the gains.
  • Run main.py and read err-vs-truth next to agreement to see why consensus is not correctness, including how the sequential update departs from the paper.
  • Pick debate settings for a real task (agents, rounds, heterogeneity, adversarial slot) and spot sycophancy cascades, topic drift and compute blowup.

Problem

Self-consistency (sample one model many times and take the majority answer) is the cheapest reasoning improvement you can bolt on. It works, but it saturates fast. Doubling your samples stops buying a meaningful jump.

Debate attacks the saturation. Instead of N independent samples from one model, N agents read each other's reasoning and revise. The samples are no longer i.i.d., so the correlation between them drops, and the convergence point is often correct where i.i.d. voting was confidently wrong.

Warm-up0/3
1. In the primitive model of a multi-agent system, how do agents react to one another's work?Warm-up
Two agent boxes side by side with a dashed question box between them on the connecting line, asking how one reacts to the other.
2. Five agents each take one turn per round for two rounds. How many agent turns happen in total?Warm-up
A grid of blank cells, five rows for five agents and two columns for two rounds, with a dashed box asking for the total number of agent turns.
Grid shows only the given counts: five agents, two rounds.
3. You ask one language model the same question ten times with sampling randomness turned on. What usually happens?Warm-up
A single model box asked the same arithmetic question ten times, with a dashed box asking what the ten answers look like.
Sample values in the explanation are placeholders, not a real run.
Check: Problem0/2
1. What lets debate avoid the saturation that Problem describes for self-consistency?Explain
Two boxes side by side, self-consistency with one model and N samples, and debate with N agents cross-reading, each above a small cluster of dots, with a dashed box asking which avoids saturation.
Dot clusters are illustrative.
2. Going from 20 to 40 self-consistency samples gives no gain on a hard question. Which ingredient explains it?Analyze
One model box above two sample clusters, labelled 20 samples and 40 samples, with a dashed box asking why going from 20 to 40 gives no gain.
Dot positions are illustrative.

Concept

The Du et al. 2023 algorithm

From arXiv:2305.14325 (ICML 2024):

  1. Each of N agents produces an initial answer to the question.
  2. For round r = 2..R: each agent is shown the other agents' round r-1 answers and asked "considering these, give your updated answer."
  3. After R rounds, majority-vote the final answers.

The paper tests on MMLU, GSM8K, biographies, MATH, and factuality benchmarks. Debate consistently beats CoT and Self-Reflection.

Two independent knobs

Ablations from the same paper:

  • Agent count alone (1 round, majority vote of N) beats single-agent on most tasks, but plateaus.
  • Round count alone (1 agent seeing its own prior reasoning) barely helps, which is reflection's known weakness.
  • Both together produces the big jumps. The multi-round exchange between multiple agents drives the gain.

Why it works

Two mechanisms:

  1. Exposure to disagreement. When an agent sees another agent's reasoning chain with a different conclusion, it has to either justify or update. Either way, the context for round r+1 is richer than the context for round r.
  2. Correlated error reduction. In self-consistency, all samples come from the same model, so the errors correlate and you average into a confidently wrong answer. Different models or different seeds decorrelate them. Different debated views decorrelate them further.

Heterogeneous debate

A-HMAD and related follow-ups use different base models for different agents. Llama + Claude + GPT debating reduces monoculture collapse (Lesson 26) because the correlated errors of one model family are not shared by the others.

The downside: a weak model in the debate can drag the consensus toward its wrong answer (see "Should we be going MAD?", arXiv:2311.17371).

NLSOM: the 129-agent extension

Zhuge et al. ("Mindstorms in Natural Language-Based Societies of Mind," arXiv:2305.17066) scaled this idea to 129-member societies. The result: specialization and self-organization emerge with scale, and the system outperforms single-agent on tasks like visual question answering.

Failure modes

  • Sycophancy cascade. Agents defer to whichever agent sounds most confident, and the debate collapses to the loudest voice. Prompting for adversarial roles ("one agent must argue the counter-position") helps.
  • Topic drift. Debates over many rounds drift from the original question. Re-inject the question each round to pull them back.
  • Compute blowup. N agents × R rounds is N·R LLM calls, each with a growing context. A 5-agent, 5-round debate is 25 calls at growing context, and the cost per question can exceed 10× a single CoT call.
Check: Concept0/17
1. What does the Society of Mind idea claim about intelligence?Define
Four small specialist boxes, retrieval, math, critique and planning, connected to each other by two-way arrows, with a dashed box asking what this arrangement is called.
2. What is multi-agent debate in the Du et al. setup?Define
Three agent boxes, A, B and C, each starting with its own initial answer, a dashed box asking what happens next, and a final answer box below.
3. What counts as one round of debate?Define
Three round boxes in a row, Round 1, Round 2 and Round 3, each a dashed question box, joined by arrows.
4. What makes a debate heterogeneous?Define
Three agent boxes named Llama, Claude and GPT, connected by two-way arrows, with a dashed box asking what makes this pool heterogeneous.
Model names are the lesson's own example of a mixed pool.
5. What is correlated error, and why does it limit self-consistency?Define
One model box above a tight cluster of seven dots standing for its samples, with a dashed box asking why they cluster together.
Dot positions are illustrative, not plotted from a real run.
6. What scale does Concept give for the NLSOM extension, and what emerges at that scale?Define
A small group of a few agents next to a much larger group drawn as a grid of dots, with a dashed box asking the size and what emerges at it.
Exact dot count is not the real figure; see the explanation for the number.
7. What is a sycophancy cascade, and how does Concept suggest countering it?Define
One agent drawn speaking with high confidence while two other agents point toward it, with a dashed box asking the failure mode and its fix.
8. In the Du et al. algorithm from Concept, what does each agent see in round r, for r of 2 or more?Explain
A round r minus 1 box holding three written answers next to a dashed box asking what the round r agent sees.
9. Why does seeing another agent's conflicting reasoning improve an agent's next answer?Explain
Agent A's box receiving an arrow from Agent B's box, labelled a different conclusion, with a dashed box asking what happens to A's context.
10. Per the ablations in Concept, what happens when you raise round count alone, with one agent seeing only its own prior reasoning?Explain
One agent box looping back to itself across round labels, with a dashed box asking the effect on accuracy of raising round count alone.
11. Per the ablations in Concept, what happens when you raise agent count alone, using one round and a majority vote?Explain
Four agent boxes in a row above a dashed box asking the effect of adding more agents when there is only one round and one majority vote.
12. What downside does Concept attach to heterogeneous debate, where different base models are mixed?Explain
Three agent boxes, Claude, GPT and a weak model drawn in warning colour, with a dashed box asking the downside of mixing them.
13. Using the cost accounting in Concept, how many LLM calls does a 4-agent, 3-round debate make per question?Apply
A grid of blank cells, four rows for four agents and three columns for three rounds, with a dashed box asking for the total number of LLM calls.
Grid shows only the given counts: four agents, three rounds.
14. Your 5-agent debate uses one model family, and every agent confidently agrees on an answer you know is wrong. Which change from Concept and Ship It is most likely to help?Analyze
Five agent boxes all marked model M pointing to a box reading agreed, known wrong, with a dashed box asking for one change that helps.
Scenario is the stem's own premise: five agents, one family, confidently wrong.
15. A 6-round debate you run starts answering a different question than the one you asked. Which failure mode from Concept is this, and what is the fix?Analyze
A chain of round boxes starting from the asked question, ending in a round 6 box marked different topic, with a dashed box asking the failure mode and its fix.
16. A debate pool has two strong models and one weak model, and the final consensus matches the weak model's wrong answer, which it stated most confidently. What explains this?Analyze
Two strong agent boxes and a weak agent box marked loudest and most confident, with an arrow from the weak box to a final-consensus box that matches the weak model's answer, and a dashed box asking which failure mode this is.
17. Debates over a long multi-part question keep wandering off topic. Which design fixes this without raising cost much?Design
A multi-part question box feeding three round boxes, the last marked drifting off topic, with a dashed box asking for a fix that does not raise cost.

Build It

code/main.py runs a 3-agent × 3-round debate on a numeric question whose true answer is 42. The agents start at 38, 42.5, and 51, each with a scripted confidence. No model is called: each agent "updates" to the confidence-weighted average of its own answer and the others', so the round-by-round log shows the debate dynamics and nothing else. A second run goes to 5 rounds.

The demo shows two effects:

  • A single round of exchange pulls the outliers toward 42, but the best-placed agent drifts away from it, and all three end up close to each other.
  • Extra rounds past round 2 show diminishing returns (matches Du et al.'s plateau).

The log also prints error against the truth, and it does not shrink. The group settles at 44.5, which is further from 42 than the round-0 mean of 43.83. Agreement reaches 1.00 because the update rule averages, not because anyone got closer to being right. The error also drifts the wrong way because each agent revises in sequence and sees its neighbors' new answers (see the Author's Note).

Run:

python3 code/main.py
Check: Build It0/10
1. In this lesson's sense, what does consensus measure?Define
Five agent boxes, four sharing one answer and one showing a different answer, with a dashed box asking what this measures.
Answer values are placeholders to show a majority and a minority.
2. In main.py, why does agreement reach 1.00 by round 3?Explain
A number line with the three round-0 answers, 38, 42.5 and 51, and a dashed box asking why they all agree by round 3.
Round-0 answers are the lesson's own build-it starting values.
3. In the Build It run, agreement reaches 1.00 at round 3. What does the error against the true answer of 42 do over those rounds?Explain
A table of agreement by round, 0.00 for rounds 0 through 2 and 1.00 at round 3, with the error-vs-truth column left as question marks.
Agreement values are the real output of main.py.
4. How does main.py's update order differ from the Du et al. procedure?Explain
A code card showing the round loop from run_debate in main.py, with a dashed box below it asking what this means for update order.
Code is the real run_debate loop from main.py.
5. With TRUE_ANSWER = 42.0, what does `error_vs_truth` return for agents whose answers are 40, 44 and 45?Apply
The source of error_vs_truth from main.py, a note that three agents answer 40, 44 and 45 with TRUE_ANSWER 42.0, and a dashed box asking for the return value.
Function body is the real source from main.py.
6. At round 2 the three agents answer 44.15, 44.56 and 44.59. With `tol = 0.1`, what does `agreement_score` return?Apply
The source of agreement_score from main.py, a note that round 2 answers are 44.15, 44.56 and 44.59 with tol 0.1, and a dashed box asking for the return value.
Function body is the real source from main.py; the three answers are from the lesson's build-it run.
7. In round 1 of `run_debate`, which answer for A does agent B read when it revises?Apply
The same round loop code from run_debate, with a dashed box asking what value for A agent B reads when B revises in round 1.
Code is the real run_debate loop from main.py.
8. Suppose all three agents revise from the same round-0 snapshot (A 38 at 0.6, B 42.5 at 0.8, C 51 at 0.4). What answer do they land on after round 1?Apply
The real revise method from main.py and a note that all three agents apply it from the same round-0 snapshot at once, with a dashed box asking the answer after round 1.
Hypothetical: main.py revises one agent at a time, not all at once from a snapshot.
9. The toy debate is extended from 3 rounds to 5. What does the log show for rounds 4 and 5?Apply
A table of agreement by round for rounds 1 through 3, with the err-vs-truth column left blank throughout and rounds 4 and 5 left as question marks.
Rounds 1 to 3 agreement is the real output of main.py's 3-round run.
10. A teammate reads 1.00 agreement at round 3 of the toy log and calls the debate a success. What is the wrong assumption?Analyze
A box showing agreement 1.00 at round 3 next to a box asking what err-vs-truth is at round 3, a speech bubble saying the debate succeeded, and a dashed box asking the wrong assumption.
Exact error value is intentionally left out; see check-6 for the real numbers.

Use It

outputs/skill-debate-configurator.md configures a debate for a new task: number of agents, number of rounds, heterogeneity (same model vs mixed), role assignment (symmetric vs one-adversarial). It also estimates the token cost before you run.

Ship It

If you ship debate:

  • Cap rounds at 3. Du et al. show 3 rounds capture most of the gain. More is cost, not quality.
  • Cap agents at 5. Beyond 5, context bloat and cost dominate.
  • Heterogeneous by default. At least two different base models in the pool.
  • Adversarial slot. One agent prompted to disagree regardless. Breaks sycophancy.
  • Log each round. Debate systems that hide intermediate rounds are hard to debug or audit.
Check: Ship It0/3
1. Why does Ship It cap debate rounds at 3?Explain
An illustrative curve of the gain contributed by each extra round of debate, tapering off, with a dashed box asking why rounds are capped at 3.
Illustrative shape; Concept gives no numbers for this ablation.
2. A debate service returns only the final answer. After a wrong answer ships, nobody can tell which round went off track. Which Ship It rule was skipped?Analyze
A debate service box producing only a final answer, with a dashed warning box marked no round log, and a note asking which Ship It rule was skipped.
3. A high-stakes factual question has a budget of about 15 LLM calls, and two model families are available. Which debate configuration fits best?Design
A budget box reading about 15 LLM calls next to a box reading 2 model families available, with a dashed box asking which configuration fits best.
Author's Note

I'd run main.py and read the err-vs-truth column before the agreement column. Agreement hits 1.00 at round 3 and looks like success, but the error against 42 climbs from 1.83 to 2.48 over the same rounds. The group settles at 44.5, further from the truth than where it started.

The cause is a detail that's easy to miss. run_debate builds an updates list that looks like a snapshot, but others holds the live agent objects and the revisions happen one agent at a time. So B reads A's already-updated answer within the same round, and C reads both. Du et al. show each agent the previous round's answers. If you update synchronously with the same weights, all three agents land on 42.89 after round 1 and stay there, with error 0.89, better than the 1.83 baseline. So the drift away from 42 is an artifact of the sequential update, and this toy departs from the paper there.

The scripted confidence is the only stand-in for how persuasive an agent sounds, so the adversarial-agent exercise is where I'd start. Try an agent that opposes the majority and see whether the group still lands on a number it agrees on.

Exercises

  1. Run code/main.py, then set the round count to 5 and watch diminishing returns. At which round does additional convergence stop?
  2. Add a fourth agent with an adversarial role: always disagree with the current majority. Does this break or improve convergence?
  3. Plot (print) the agreement score per round (fraction of agents on the majority answer). When does it hit 1.0 and is that equivalent to "correct"?
  4. Read Du et al. Section 4 ablations. Replicate the "agents-only" vs "rounds-only" vs "both" result using this code.
  5. Read "Should we be going MAD?" (arXiv:2311.17371) and list two debate variants beyond round-robin, such as judge-led, chain-of-debate, adversarial.

Key Terms

TermWhat people sayWhat it actually means
Society of Mind"Minsky's idea"Intelligence as interacting specialists; 1986 framing now operationalized via LLM debate.
Multi-agent debate"Agents argue"N agents propose, critique each other, revise over R rounds, majority-vote.
Consensus"They agree"Not epistemic truth, just the fraction on the majority answer. Can be confidently wrong.
Rounds"Exchange steps"One round = each agent reads the others and updates once.
Heterogeneous debate"Mix model families"Using different base models to decorrelate errors.
Sycophancy cascade"Everyone agrees with the loud one"Debate failure where agents defer to the most confident agent regardless of correctness.
NLSOM"129-agent society"Natural-language society of mind; Zhuge et al.'s scaled version.
Correlated error"Same model, same bug"Why self-consistency saturates; debate across different views decorrelates.

Further Reading

Code

Ships With