liveBook · Manning

Mode

As explained in AI Agents in Action, Second Edition

Majority voting is a selection technique that chooses the answer receiving the greatest number of votes among candidate outputs.

Suppose several agents assess the same case and return different answers. Majority voting selects the answer that receives the most votes. In a voting/best-of-N ensemble, the candidates can come from several agents or repeated runs of one agent. section 4.1.3

Voting differs from iterative debate: candidates need not discuss and revise their answers before selection. The selection rule can also change: a weighted vote gives some agents more influence, while a judge agent chooses an answer. section 4.1.3

A diagnostic decision

Several agents assess one input in a diagnostic system. If most return the same answer, a majority vote selects it rather than relying on one agent’s judgment. This can outvote an isolated error, but agreement is not proof: agents with the same mistaken information may vote for the same wrong answer. section 4.1.3

Before adding a vote, check the trade-offs:

  • Use it when a problem is ambiguous or multiple assessments could improve reliability. section 4.1.3 section 4.1.3
  • Seek genuinely different viewpoints; repeated, near-identical agents can repeat the same mistake. section 4.1.3
  • Skip it when one agent can easily produce the correct answer, or when extra runs cost too much time or computation. section 4.1.3
Table 4.4 Architectural patterns overview

Pattern

When to use

When not to use

Sequential pipeline, agent to agent

Well-defined, ordered tasks need to be executed in sequence.

Not all agents need to be executed every time.

Parallel delegation

Multiple tasks or agents can be executed in parallel to improve performance.

Hierarchical coordination

The user interface agent delegates to multiple agents on behalf of the user.

No need for complex decision-­making or command of agents

Iterative debate and refinement

You want to review and double- or triple-check responses.

The problem is trivial or aligns well with simple execution.

Voting/best-of-N (ensemble)

Ambiguous problems that may have multiple interpretations or facets

Unambiguous problems

Role-playing collaboration

High creativity and novel outputs are desired and align well with the principal goals.

Real-time systems or cases with low desired creativity

Conditional routing (branching)

Customer support systems that may require human approvals or intervention

Peer-to-peer network

Decentralized command increases system robustness and reduces or eliminates complete failure.

The architectural patterns table places voting/best-of-N alongside other coordination options and contrasts ambiguous problems with unambiguous ones. section 4.1.3

How AI Agents in Action, Second Edition covers it

How deep it goes
Defines candidate generation and selection alternatives, then explains benefits and failure conditions without specifying an implementation.
Examples
Uses diagnostic systems and evaluations where multiple agents assess the same input.
What you can do after
Evaluate/understand when voting can reduce isolated errors and when shared bias or extra cost makes it unsuitable.
How it connects
Connects majority voting to ensembles, weighted voting, judge agents, iterative debate, and agent diversity.

Also explained in

Compare how 8 books explain mode →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Agents in Action, Second Edition. The section links point to the parts of the book it draws on.