RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Fredoline Eruo
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
  1. >
  2. Home
  3. /Learn
  4. /Courses
  5. /Multi-Agent Systems
  6. /Ch. 3
Multi-Agent Systems

03. Debate Pattern

Chapter 3 of 24 · 15 min
KEY INSIGHT

Adversarial evaluation beats unilateral confidence—structured debate catches errors that solo reasoning misses by exposing hidden assumptions and contradictory conclusions. The debate pattern pits agents against each other, forcing explicit argumentation for and against positions. Rather than one agent producing a answer, opposing agents argue from different perspectives, expose weaknesses, and highlight contradictions. A judge or aggregator evaluates the debate and selects the strongest position. This pattern proves effective for high-stakes decisions where errors carry significant cost. Legal reasoning, strategic planning, and safety evaluation benefit from multiple viewpoints challenging assumptions. The adversarial structure prevents premature consensus and surfaces edge cases. Agents in debate mode need distinct roles: one argues the proposition, another argues negation, a third synthesizes or judges. These roles require different instruction sets—arguers maximize their position's strength, judges evaluate evidence quality and argument validity. Debate introduces latency—multiple agents must complete reasoning before resolution. Round-based debates multiply this cost. Design decisions about round count, whether arguments are simultaneous or sequential, and how judges weight evidence shape system behavior. Hidden assumptions surface through opposition. An agent defending a position encounters questions its creator never considered. The defending agent either constructs valid responses (exposing its reasoning) or fails (exposing a flaw). Either outcome improves output quality. Implementation requires balancing thoroughness against response time. Some systems use preliminary confidence scores to skip debate for obvious cases—only low-confidence answers undergo full adversarial evaluation. ```python from enum import Enum from dataclasses import dataclass from typing import Optional class Verdict(Enum): AFFIRMATIVE = "affirmative" NEGATIVE = "negative" INCONCLUSIVE = "inconclusive" @dataclass class DebateResult: verdict: Verdict affirmative_arguments: list[str] negative_arguments: list[str] confidence: float class Debater: """Base class for debate participants""" def __init__(self, name: str, stance: str, model): self.name = name self.stance = stance self.model = model async def argue(self, topic: str, opposing_arguments: list[str]) -> str: prompt = f"""Topic: {topic} Your stance: {self.stance} Opposing arguments to rebut: {opposing_arguments} Present your strongest arguments.""" return self.model.generate(prompt) class Judge: def __init__(self, model): self.model = model async def evaluate(self, topic: str, affirmative: str, negative: str) -> DebateResult: prompt = f"""Debate Topic: {topic} Affirmative position: {affirmative} Negative position: {negative} Evaluate both positions. Consider: - Logical consistency - Evidence quality - Completeness of reasoning Output a structured verdict with confidence score (0-1).""" response = self.model.generate(prompt) # Parse structured response return self._parse_verdict(response) async def run_debate(topic: str, model) -> DebateResult: pro = Debater("Advocate", "support", model) con = Debater("Critic", "oppose", model) judge = Judge(model) # Round 1: Initial arguments pro_arg = await pro.argue(topic, []) con_arg = await con.argue(topic, []) # Round 2: Rebuttals pro_rebuttal = await pro.argue(topic, [con_arg]) con_rebuttal = await con.argue(topic, [pro_arg]) # Final judgment return await judge.evaluate(topic, pro_rebuttal, con_rebuttal) ```

EXERCISE

Design a debate system for evaluating product feature decisions. The system should include advocates for and against proposed features, plus a judge. Specify the information structure each agent receives, how many debate rounds occur, and how the judge weights different argument types (cost estimates, user research, competitive analysis). Implement the core message-passing logic. (15 minutes)

← Chapter 2
Orchestrator-Worker Pattern
Chapter 4 →
Agent Communication Protocols