Learning how to build an AI debate bot takes about forty lines of code and about two weeks of finding out why the debates are boring.
The code is the easy half. Two model calls in a loop, each one seeing the other's output — you can have that working in an afternoon. What takes longer is stopping the two sides from politely agreeing by turn five, which is what every naive implementation does, because agreeableness is what the underlying models are tuned for.
This covers both halves, and spends more time on the second.
The loop
At its core the thing is trivial:
history = [motion]
for turn in range(N):
speaker = models[turn % len(models)]
reply = speaker.generate(
system = persona[speaker],
messages = history
)
history.append(reply)
Three decisions inside that skeleton determine whether the output is worth reading.
What each model sees. The simplest version passes the full transcript to everyone. That works up to a point and then degrades — as the history grows, later turns become summaries of earlier turns. Passing the motion plus the last two or three exchanges produces sharper argument than passing everything.
Whether models know who said what. Labelling turns with the speaker's identity keeps positions distinct. Passing an unlabelled blob causes models to lose track of which side they are on, and you will see a model argue against its own previous point without noticing.
Whose turn it is. Strict alternation is fine for two. For three or more, strict round-robin produces a rhythm that reads mechanically; letting a moderator model choose the next speaker based on who was just challenged reads much better and costs one extra call per turn.
The system prompts are the whole product
This is the part that separates a debate bot from two chatbots taking turns.
A working adversarial persona needs four elements:
Position, stated absolutely. "You argue FOR the motion. You do not acknowledge merit in the opposing case." Any softer phrasing and the model will hedge.
A ban on summarising. "Never restate the opponent's argument before responding. Never summarise the debate so far. Respond only with new argument." Summarising is how models fill turns while advancing nothing, and it is the single biggest cause of a debate that looks long and says little.
A ban on concession language. "Do not use phrases such as 'that's a fair point', 'I agree', 'both sides', or 'ultimately'." Naming the specific phrases works far better than a general instruction not to concede.
A length constraint. "Maximum 150 words. One argument per turn." Unconstrained turns sprawl, and a sprawling turn gives the opponent five things to answer, which guarantees they answer the easiest one.
Optionally, a distinct argumentative style per side — one that attacks premises, one that attacks consequences — which makes the transcript read as two personalities rather than one model in two hats.
Making it never-ending, and why you probably should not
A common goal is a debate bot that runs indefinitely. It is achievable, with caveats.
The naive infinite loop fails for a specific reason: context grows without bound, so either you hit the window limit or you truncate and the debate loses its thread. Both produce the same visible symptom — after enough turns the two sides are having a different, vaguer argument than the one they started.
Two things fix it:
Rolling context with a pinned motion. Keep the motion and the last N exchanges. Drop the middle. The motion must never be dropped or the debate drifts topic entirely.
Periodic re-anchoring. Every ten turns, inject a short reminder of the original motion and each side's position. Cheap, and it is the difference between a debate that holds for fifty turns and one that dissolves at twenty.
The caveat is that indefinite debates are rarely worth reading past the first fifteen or twenty exchanges. The genuinely new arguments arrive early. What comes after is recombination — the same points in different orders, with diminishing returns and undiminished token cost. Build the termination logic before you build the infinite loop.
Termination logic
Four options, roughly in order of usefulness:
| Approach | How it works | Good for |
|---|---|---|
| Fixed turn count | Stop at N | Predictable cost; almost always sufficient |
| Novelty check | A judge model scores each turn for new content; stop after 2 consecutive lows | Best quality-per-token |
| Convergence check | Stop when both sides state substantially the same position | Catches the classic failure |
| Human interrupt | Runs until stopped | Interactive use |
The novelty check is worth the extra call. A small model asked "Does this turn introduce an argument not already made? Yes or no." costs very little and reliably identifies the point where a debate stopped being productive — usually earlier than you would guess.
Choosing participants
The single highest-leverage decision, and the one most builds get wrong by default.
Use different providers. Two models from the same family share training data, share tuning philosophy, and share blind spots. They will disagree fluently about phrasing and agree silently about substance, which produces a debate that reads well and teaches nothing. A model from one lab against a model from another disagrees about things that actually matter — what counts as evidence, how much weight to give a downside, whether a question is even well-posed.
Do not automatically pick the two strongest models. Capability is not the variable that makes a debate interesting; disposition is. A model that tends to attack premises paired with one that tends to attack consequences produces a more useful transcript than two premise-attackers, regardless of which scores higher on benchmarks.
Match rough capability levels. A large model against a small one is not a debate, it is a demonstration. The small model gets outmanoeuvred and the transcript teaches you nothing except which model is bigger, which you already knew.
Three is a different problem from two. With two participants, alternation is obvious. With three, you need to decide whether the third is a genuine third position or a moderator, and the answer changes the whole design. Three genuine positions on a binary motion produces an awkward transcript where two participants are effectively on the same side; either pick motions with three real positions or make the third a judge. The dynamics shift enough that how to make 3 AI debate is worth reading before you add the third participant, and AI debate system covers what the assembled thing looks like from the outside.
Temperature, tokens and the settings that matter
Most parameters do not matter much here. Three do.
Temperature. Counter-intuitively, lower is usually better for adversarial debate. High temperature produces variety in wording, not variety in position, and it makes models more prone to drifting off their assigned side. Somewhere in the low-to-middle range keeps positions stable while leaving enough variation that turns do not read identically.
Max output tokens. Set it low and enforce the word limit in the prompt as well. Models comply with word limits imperfectly, so the hard token cap is the backstop that stops one participant monopolising the transcript.
Stop sequences. If your persona prompt labels turns, a stop sequence on the opponent's label prevents a model from helpfully generating both sides of the exchange — a failure that looks bizarre the first time you see it and is entirely predictable in hindsight.
Four failure modes you will hit
Convergence. Both sides drift toward agreement. Cause: models tuned for agreeableness, plus system prompts that were too polite. Fix: the explicit banned-phrase list above, and lower the temperature slightly — high temperature makes models more agreeable, not less, in practice.
Mirror-arguing. Both sides make the same argument from opposite directions and neither notices. Cause: using the same base model for both sides. Fix: use models from different providers. Two models from different labs disagree about substance; two from the same family disagree about wording.
Escalating length. Each turn is longer than the last until you hit the token limit. Cause: no length constraint, plus models mirroring the length of what they were shown. Fix: hard word limit in the persona, enforced by truncation if necessary.
The judge that agrees with whoever spoke last. If you add a judge model, it exhibits a strong recency bias. Fix: give the judge the transcript with speaker labels stripped and turn order shuffled, or ask it to score each side's strongest single argument rather than the debate overall.
What it costs
Two models, twenty turns, roughly 150 words each with a rolling three-turn context window: you are looking at something in the region of 40,000–60,000 tokens total, most of it input, because every turn re-sends context.
The dominant cost is context re-sending, not generation. That means the rolling window is not only a quality decision — halving the context window roughly halves the bill. Anyone who has built one of these and been surprised by the invoice built it with full-history context.
Building versus using
Worth being honest about the trade, since this site offers the hosted version.
Build it yourself if you want custom personas, non-standard termination logic, integration into something else, or you are learning. The problem is well-scoped and genuinely instructive — the failure modes above teach you more about how these models behave than any amount of reading.
Use a hosted version if what you want is the output rather than the system. The debate bot page covers what that looks like here, and AI debate bot covers the general category; the arguments about context windows, banned phrases and provider mixing have already been had.
For the multi-agent architecture questions that come up once you go past two participants — moderator patterns, role assignment, judge design — see multi-agent AI debate systems. The relevant academic grounding is the work on multiagent debate improving reasoning, which is where the "different providers disagree more usefully" result comes from.
Common questions
Which models work best as opponents? Different providers matters more than which specific models. Any two capable models from different labs will produce a better debate than the two strongest models from the same family.
Can I do this with one model playing both sides? Yes, and it is cheaper, but you get mirror-arguing almost immediately. The single model has one set of blind spots and both personas inherit them.
How many turns before it stops being useful? In practice, twelve to twenty. Novelty scoring usually flags the drop-off somewhere in the low teens.
Do I need a moderator model? Not for two participants. For three or more it substantially improves readability, because round-robin ordering with three voices reads mechanically.
Why does my bot keep agreeing despite the prompt? Almost always because the prompt bans concession in general terms rather than banning specific phrases. Models route around general instructions and comply with concrete ones.
Should the motion be phrased as a question or a proposition? A proposition — "this house would X" — works far better than an open question. Questions invite exploration, which is the opposite of what you want; propositions force a side.
How do I stop it repeating the same three arguments? Pass a running list of arguments already made and instruct each turn to introduce one not on the list. It costs a few tokens and it is the most effective single fix for a debate that loops.
Can I let a user join the debate mid-way? Yes, and it is worth building — a human turn appended to the history with a clear speaker label works exactly like a model turn. The one thing to handle is that models tend to defer to the human participant, so the persona needs an explicit instruction that the human is another debater, not the principal.