ealeng
Menu

Episode 21 of 25 · Multi-agent systems

Debate, voting, or a bigger model

Spending extra calls to check an agent's answer: a vote, a debate with a judge, or one call to a bigger model, on 40 refund cases with answers worked out by code. Where the errors were, why every check shared them, the one line of code that fixed most of them, and a reviewer agent measured as a classifier.

Lab 10 · Multi-Agent Systems11 min read
Video transcript5:25

0:00Cold open

0:01

A customer wants a refund on a two-hundred-and-forty-nine-dollar sleeping bag.

0:06

It was delivered on September first. Today is October fifteenth.

0:12

Our policy: refunds only within thirty days. And anything over two hundred dollars goes to a person.

0:19

Two AI agents debated it. Both said: within thirty days, and not over two hundred dollars. Refund it.

0:27

Then each read the other’s answer. They still agreed. And a third agent, the judge, agreed too.

0:34

But it was forty-four days. Past thirty days there’s no refund at all, so the right answer is: refuse.

0:43

They also said two forty-nine isn’t over two hundred. Wrong twice. Five model calls, and one wrong refund.

0:51

So do extra agents really catch mistakes?

0:55Intro

0:57

Hands-on AI engineering: multi-agent systems, part two.

1:02

Today: extra calls that double-check an answer. Do they catch mistakes?

1:08Sofia again

1:09

I’m Sofia. Same made-up shop, the same small AI model, gpt-5.4-nano, and real recorded answers.

1:19

Last time, a team of agents that split up the work didn’t beat one agent.

1:24

This time, I spend extra calls to double-check each answer. Like asking a second doctor for a second opinion.

1:3401 · Three ways to check

1:35

First, the baseline. Ask the small model once, and take its answer.

1:41

The first way to check is a vote. Ask three or five times, and keep the answer that comes up most often.

1:49

The second is a debate. Two agents answer. Each reads the other’s answer and tries again. Then a judge picks.

1:57

The third skips the extra agents. Ask a bigger, smarter model once: G P T five point four mini.

2:05

A debate takes five calls. The bigger model takes one, but each of its calls costs more.

2:1302 · Which did best?

2:15

The test: forty made-up refund cases, on the edges of our policy, like the sleeping bag.

2:22

Code works out the right answer for each one. And I asked the small model six times per case.

2:28

Asking the small model once got seventy-six percent right.

2:33

So which way to check did best?

2:38

The bigger model: eighty-five percent.

2:42

Votes and debate: seventy-six to seventy-nine. Hardly better than asking once.

2:49

With this few cases, even the bigger model’s lead could partly be luck.

2:55

And it cost about a third less than the debate.

3:0003 · Where the errors are

3:01

So where did the wrong answers come from?

3:05

Mostly from one kind of case: an item delivered more than thirty days ago.

3:11

There, every way to check was wrong most of the time. Between seven and fourteen percent right. Even the bigger model.

3:19

The bigger model’s clear win was a different kind of case: refunds over two hundred dollars. It got all of them right.

3:2804 · Inside the debate

3:30

A debate helps almost only when the two agents disagree.

3:35

When one was right and the other wrong, the right one won six times out of seven.

3:41

But that rarely happened: only seven of a hundred and twenty debates.

3:46

Most wrong debates never had a right answer in them. In twenty-three of twenty-five, both agents started with the same mistake.

3:55

Two doctors who learned the same wrong fact will agree with each other. Arguing can’t fix a mistake both sides make.

4:0505 · Hand it the number

4:06

So what was the mistake? Counting the days between two dates. About two in three of all the errors.

4:13

Counting days is easy for code. So code writes the count into the case: forty-four days ago.

4:21

The same single small-model call now refuses. Correctly.

4:27

Past the thirty-day window, it went from almost always wrong to always right.

4:33

Overall, from seventy-six percent right to ninety.

4:38

One line of code did more than every extra agent I tried.

4:4406 · What I do now

4:45

So here’s what I do now. Before adding agents, I look at where the errors are.

4:51

If code can work something out, I work it out and hand it to the model.

4:56

I compare ways to check on right answers, and on what they cost.

5:01

And I remember: a vote or a debate helps almost only when the answers disagree.

5:08

Next time: an orchestrator that flipped my rule, and another company’s agent that said done.Sofia: Compute what code can.

5:15Summary

5:16

More agents can’t fix a blind spot they share.

5:20

Compute what code can, and count the cost.Sofia: Thanks for watching!

Key takeaways

  • ✓Asked once, gpt-5.4-nano got 183 of 240 answers right (76%). Votes of 3 and 5 and a debate with a judge (5 calls) got 76–79%, hardly better. One gpt-5.4-mini call got 85% at $0.50 per 1,000 decisions, about a third less than the debate's $0.76, but with 40 cases even that lead is borderline (p = 0.05 against asking once).
  • ✓Most of the mistakes were in one kind of case: delivered more than 30 days ago. There every setup was right only 7–14% of the time, the bigger model included. In the cold-open debate, both agents wrote "within 30 days" for a bag delivered 44 days earlier. 37 of the 57 single-answer errors were these cases.
  • ✓A debate helps almost only when the two agents disagree. When one started right and one wrong, the right one won 6 of 7 times. But that happened in only 7 of 120 debates. 23 of the 25 wrong debates started with both agents giving the same wrong answer: a blind spot they share.
  • ✓Code wrote the day count into the case ("Delivered on 2026-09-01 (44 days ago)."). The same single nano call then got the 7 past-window cases right 42 of 42 times, up from 5 of 42, and 217 of 240 overall (90%). One line of code did more than every extra agent.
  • ✓A reviewer agent is a classifier: measure what it catches and what it wrongly blocks. On 34 labelled patches, the nano reviewer stopped 35 of 45 reviews of wrong patches but also rejected 18 of 45 reviews of correct ones; the mini reviewer stopped 45 of 45 with 5 false alarms. Both stopped every patch that cheated the tests.

The previous chapter (multi-agent systems, part 1) found that a team of agents splitting up the work didn't beat one agent. This one tries the other common use of extra agents: spending extra calls to double-check an answer. Think of a second opinion from another doctor. It helps when the second doctor knows something the first one doesn't. Two doctors who learned the same wrong fact will just agree with each other.

The scope is Lab 10's scripts 06 (debate), which the video covers, and 05 (code review), which was cut from the video but is in the lab and gets its own section at the end. Everything runs on Lab 09's made-up outdoor shop, with gpt-5.4-nano and gpt-5.4-mini, no thinking (reasoning_effort="none"). The numbers are the lab's recorded runs.

A debate that agreed on the wrong answer

A customer wants a refund on a $249 sleeping bag (case P05). It was delivered on 2026-09-01, and today is 2026-10-15. The policy:

  • Refunds only within 30 days of delivery.
  • A refund over $200 must go to a person.
  • If the carrier marks a parcel lost, refund it in full.

Two agents debated it. Both wrote that the bag was "within 30 days" and "not over $200", and refunded it. Each read the other's answer; they still agreed. The judge agreed too. Five model calls, one wrong refund. It was 44 days, so the right answer is refuse: past 30 days there's no refund at all, so the $200 rule never comes into it.

Five ways to spend calls

The test: 40 made-up refund cases sitting on the edges of the policy (day 30 vs. day 31, exactly $200, a lost parcel, an item already refunded). Code works out the right answer for each one, so grading is exact: the right decision, and for a refund, the right amount to the cent.

Setup What it does Calls per decision Right Cost per 1,000 decisions
Ask once one nano answer 1 183/240 = 76% $0.15
Vote of 3 the most common of 3 nano answers 3 61/80 = 76% $0.44
Vote of 5 the most common of 5 5 31/40 = 78% $0.74
Debate + judge 2 nano agents answer, each reads the other's answer and tries again, a nano judge picks 5 95/120 = 79% $0.76
Bigger model one gpt-5.4-mini answer 1 (pricier) 102/120 = 85% $0.50

How the rows were built: each case was asked of the small model 6 times. The votes and the debates reuse those 6 answers (two votes of 3 from answers 1–3 and 4–6, one vote of 5 from answers 1–5, three debates from the pairs 1–2, 3–4, 5–6). The bigger model was asked 3 times per case.

  • Votes and debate were hardly better than asking once. 76 to 79%, with p from 0.53 to 1.00 against asking once.
  • The bigger model scored best, but even its lead is borderline with 40 cases: p = 0.05 against asking once, 0.24 against the debate. It also cost about a third less than the debate.
  • So count the cost, not just the accuracy. A debate is five calls, and it should be compared with what five calls buy elsewhere, not with one cheap call.

Where the errors are

The average hides where the mistakes sit. Put the cases on a line of days since delivery, with the 30-day window drawn in, and switch between the setups. Each dot is one recorded answer.

Try it · The 30-day windowTap a case to see its answers
or the fix:
← refund allowedpast 30 days →01020304060days since delivery (today: 2026-10-15)No delivery date (not delivered, or lost):
right wrong over $200: a person must decide

Each dot is one gpt-5.4-nano answer. Every case was asked 6 times.

Past the window: 5 of 42 right · over $200: 23 of 36 · all cases: 183 of 240 (76%) · $0.15 per 1,000 decisions

P05 1 × Glacier 0°F Sleeping Bag, $249 · delivered 44 days ago

Right answer (worked out by code): refuse

refund $249 ×4refuse ×1escalate ×1
  • Past 30 days, every setup was wrong most of the time. 7 cases: right 12% asking once, 7% and 14% for the votes, 14% for the debate, and 14% for the bigger model too. For a backpack delivered 60 days earlier, a typical answer read: "The order was delivered on 2026-08-16, and today is 2026-10-15, which is within 30 days."
  • These cases were most of the errors. 37 of the 57 wrong single answers were past the window.
  • The bigger model's clear win was a different kind of case: refunds over $200. The nano setups were right 64–72% of the time there, mostly by refunding a single item priced over $200 (the $249 bag delivered 4 days ago, a $229 backpack) instead of sending it to a person. The bigger model got all 18 right. It also got the lost $329 tent right (send it to a person) 3 of 3 times; asked once, nano refunded it every time.

Switch to the bigger model and look at P05, the cold-open bag: it said "escalate" twice. It knew $249 is over $200, but not that 44 days is past 30.

Inside the debates

A debate can only fix an answer if someone in it has the right one. Here's how the 120 debates started, from the two agents' first answers:

How it started Debates Ended right
Both gave the same right answer 88 88
Both gave the same wrong answer 24 1
They disagreed, one was right 7 6
They disagreed, both were wrong 1 0
  • When they disagreed, the right one usually won: 6 of 7. Across the 240 revisions, a revision fixed a wrong answer 8 times and broke a right one once.
  • But that rarely happened: 7 of 120 debates.
  • 23 of the 25 wrong debates started with both agents giving the same wrong answer. Reading each other's answer didn't fix it: they're the same model, with the same blind spot. In the one exception, both refunded a lost $329 tent and the judge sent it to a person.

So a debate or a vote helps almost only when the answers disagree. To get disagreement, the checkers need something different: another model, other evidence, a different role. Two copies of the same model mostly share their mistakes.

Hand it the number

What was the mistake? Counting the days between two dates. That's easy for code. So code works out the count and writes it into the case, one line:

c["text"] = c["text"].replace(f"Delivered on {c['delivered_date']}.",
                              f"Delivered on {c['delivered_date']} ({c['days_since_delivery']} days ago).")

The same single nano call, nothing else changed:

Case text Past 30 days (7 cases × 6) All 40 cases (× 6)
Dates only 5/42 = 12% 183/240 = 76%
With "N days ago" 42/42 = 100% 217/240 = 90%

p < 0.001, at the same $0.14–0.15 per 1,000 decisions. One line of code did more than every extra-agent setup tried. Pick "Ask once + 'N days ago'" in the widget above to watch the right side of the line turn green.

What's left is the next blind spot: 16 of the 23 remaining errors are refunds over $200, plus the lost $329 tent (6) and one parcel that wasn't delivered. That's the rule the bigger model handled. The same reasoning applies: if code can work out "this refund is over $200", work it out and hand it over.

A reviewer agent is a classifier

Script 05 checks a different kind of work with a second agent: a reviewer that approves or rejects a code change. The lab has 34 patches for Lab 09's coding tasks, all of which pass the visible tests: 15 correct, 15 wrong in a plausible way, and 4 that cheat the tests (special-casing the test's input, or a fake equality from Lab 09's run). Each was reviewed 3 times by each model.

Try it · A reviewer's verdicts34 patches, all pass the visible tests · 3 reviews each

gpt-5.4-nano reviewer

Correct patches: 18/45 rejected

Wrong patches: 35/45 stopped

Patches that cheat the tests: 12/12 stopped

gpt-5.4-mini reviewer

Correct patches: 5/45 rejected

Wrong patches: 45/45 stopped

Patches that cheat the tests: 12/12 stopped

approved, rightly rejected, rightly approved a bad patch false alarm no verdict (counted as stopped)

gpt-5.4-nano c02_median:wrong · approved · what's wrong with it: uses fixed indexes 1 and 2 instead of the two middle ones

Reviewer Wrong patches stopped Cheating patches stopped Correct patches rejected (false alarms) Cost per 1,000 reviews
gpt-5.4-nano 35/45 = 78% 12/12 18/45 = 40% $0.19
gpt-5.4-mini 45/45 = 100% 12/12 5/45 = 11% $0.61
  • Cheating was the easy case. Both models stopped every patch that gamed the tests.
  • A partial fix looks like a fix. Nano approved the median that uses fixed indexes and the LRU cache fix that misses one case, 3 times out of 3 each.
  • Nano also cried wolf: it rejected 40% of the correct fixes.
  • Count note: two of nano's replies on wrong patches had no verdict. The lab counts those as stopped, so 35 of 45; it explicitly approved 10.
  • The reviewer's model mattered more than having a reviewer.

The lab also tried a test-writer agent: only 28 of its 45 generated test files passed on the correct code. The ones that did caught 31 of 32 wrong or cheating patches. A generated test is a claim too: run it against a known-good version before you use it as a gate.

In the loop. Lab 09's coder alone, then with the nano reviewer able to send the work back twice (15 fixable tasks and one impossible task with contradictory tests, 3 runs each):

Setup Fixable runs: accepted and right Correct fixes blocked Impossible task: cheating code accepted Cost per 1,000 tasks
Coder alone 45/45 0 2/3 $0.99
Coder + reviewer 42/45 3 0/3 $1.89 (1.9×)

The coder alone already fixed everything it could, so the reviewer couldn't add fixes. What it did: it stopped the cheating code every time it saw it (in one of the three runs, the coder submitted nothing to review), and it blocked 3 correct fixes, two of them over edge cases the tests don't check (whitespace-only input, a width of 0 or less). A second agent pays off where "the tests pass" isn't the truth.

Caveats

  • 40 made-up cases, chosen to sit on the policy's edges. That's good for finding blind spots, but the percentages aren't what a real refund queue would see.
  • The setups aren't independent samples. The votes and debates reuse the same 6 nano answers per case, and the p-values treat rows as independent, so take the borderline ones (the bigger model's lead) as "maybe".
  • Every setup was one model family with no thinking. A debate between different models, or with thinking turned on, wasn't tried; the lab lists it as worth measuring. Date arithmetic belongs in code either way.
  • The video's and the lab's numbers agree. The lab prints the computed-days p-value as "p = 0.000"; it's below 0.001. The lab's README says the reviewer stopped the cheating code "every time"; in one of the three runs there was nothing to review, so "it was never accepted" is more exact.

The checklist

  1. Look at where the errors are before adding agents. Split accuracy by kind of case; an average hides a blind spot.
  2. If code can work something out (a day count, a total, a threshold), work it out and hand it to the model.
  3. Compare checks at the same budget: a debate against a vote of 5 and one bigger-model call, with intervals, and report the cost.
  4. Expect a vote or a debate to help only when the answers disagree. If every checker is the same model, they share its mistakes; get diversity from another model, other evidence or another role.
  5. Measure a reviewer as a classifier on labelled examples: what it catches, and what it wrongly blocks.
  6. Run a generated test on known-good code before trusting it as a gate.

Practice: the policy, the vote and the fix

Write the policy in code, the vote, the one-line fix (count the days and write them into the case), the debate's starting state, and a reviewer's two rates. The tests use the lab's recorded answers: the policy on all 40 cases, the past-window votes (1 of 14), 5 of 42 → 42 of 42 with the day count, the 120 debates (23 of 25 wrong ones started agreed and wrong), and the 05 reviewers' 35/45 and 18/45.

Try it · Practice in PythonRuns in your browser · ⌘/Ctrl + Enter to run
checks_practice.py88 lines

Quiz

Try it · Check your understanding0 of 6 answered
  1. 1.A debate (two agents, two rounds, a judge) scored 79% against 76% for asking once. What should you compare it with before calling it a gain?

  2. 2.Where did most of the mistakes come from?

  3. 3.In 23 of the 25 debates that ended wrong, how did the debate start?

  4. 4.What fixed the past-window cases?

  5. 5.Your nano reviewer agent catches 78% of wrong patches. Why isn't that enough to judge it?

  6. 6.In the coding loop, Lab 09's coder plus a nano reviewer that could send work back twice. What did the reviewer add?

Check your understanding

Try each question before opening its answer.

What are the three ways to check an answer with extra calls, and what does each cost here?

A vote (ask 3 or 5 times, keep the most common answer: $0.44 and $0.74 per 1,000 decisions), a debate (two agents answer, read each other's answer and try again, a judge picks: 5 calls, $0.76), and one call to a bigger model ($0.50). Asking the small model once cost $0.15.

Which did best, and how sure can you be?

The bigger model, gpt-5.4-mini: 85%, against 76–79% for the votes and the debate and 76% for asking once. With 40 cases its lead is borderline (p = 0.05 against asking once, 0.24 against the debate), and it cost about a third less than the debate.

Why couldn't voting or debate fix the past-window cases?

All the answers came from the same model with the same blind spot: it miscounted the days between two dates. 23 of the 25 wrong debates started with both agents giving the same wrong answer, and a vote of wrong answers is still wrong (1 of 14 votes of 3 was right past the window).

When does a debate help?

When the two agents disagree and one of them is right: the right one won 6 of 7 such debates. That happened in only 7 of 120 here, because two copies of the same model mostly agree, including on their mistakes.

What was the one-line fix, and what did it change?

Code wrote the day count into the case: "Delivered on 2026-09-01 (44 days ago)." The same single nano call went from 5 of 42 to 42 of 42 right on the past-window cases, and from 76% to 90% overall.

Which two numbers describe a reviewer agent?

Its catch rate (wrong work stopped; a miss ships a bug) and its false-alarm rate (correct work rejected; each costs another round, or correct work that never ships). The nano reviewer: 78% caught, 40% false alarms. The mini reviewer: 100% caught, 11% false alarms.

Learning something useful?

New labs, articles, and videos on evaluating and testing AI systems come out regularly. Follow along so you don't miss the next one.