Overview

6 Voter: Leveraging stochasticity for improved outputs

The chapter explains that language models are probabilistic rather than purely deterministic, so repeated runs on the same prompt can yield different reasoning paths and answers. In ordinary chat use, that variability is often a drawback, but in agentic workflows it can be exploited instead of feared. By treating multiple runs as samples from a distribution, the system can search across possible outcomes, reduce the impact of one bad reasoning chain, and estimate how confident the agent should be in a given result.

The core idea of the Voter pattern is to invoke the same worker multiple times, usually in parallel, and then reconcile the outputs with a simple aggregation rule such as majority vote, mode selection, averaging, or union. The architecture centers on a dispatcher that creates distinct voting trajectories, a worker IE that produces each vote, and a reconciliation step that normalizes and combines the results. Because the reconciliation is intentionally simple, the pattern assumes the worker is independently capable of finding correct solutions when sampled repeatedly, while the ensemble dampens noise and exposes uncertainty through measures like vote frequency, entropy, or semantic variance.

The chapter also presents variants and applications. A committee uses different worker IEs, often to reduce bias or create a diverse panel of judges, while a divergent committee is deliberately designed to surface different outcomes and map an answer space. Example uses include test-time compute scaling for math reasoning, committees of judges for subjective evaluation, and safety analysis where distinct specialists contribute complementary risk findings. Across these cases, the main tradeoff is clear: better robustness and richer insight come at the cost of greater compute and coordination overhead.

The sketch AFD of the Voter pattern. The input initially makes its way through the dispatcher, which starts multiple instances of the worker IE. Each worker IE instance produces an intermediate “voting trajectory'” output, which is then gathered by a reconciliation procedure such as majority voting. The reconciliation procedure then yields the final output (the “voting result”).
The AFD of the simplest possible TTCS math reasoner. The dispatcher launches multiple parallel instances of the same solver IE with identical inputs but different random seeds. The reconciliation unit extracts the numerical answer from each trajectory and returns the mode (most frequent) value.
The AFD of a committee of judges. The dispatcher routes the input content to C distinct IEs, each representing a different judge. The reconciliation element aggregates their individual numerical scores into a final average.
The AFD of the travel safety committee example. Note that the worker IEs are intended to be distinct specialists (Crime IE, Health IE, etc.). The reconciliation element is non-reductive: it aggregates the outputs of all workers into a single list rather than selecting a single majority winner.

Summary

  • The natural stochasticity of probabilistic engines can lead to logic flaws and failures, but an ensemble of such trajectories can be leveraged as a benefit within agentic workflows.
  • The Voter pattern is a sampling mechanism consisting of a dispatch element, a worker IE, and a reconciliation procedure that invokes a process multiple times in parallel and aggregates the diverse outputs.
  • The Voter pattern can be used to reconcile different answers into a single robust prediction, explore the space of possible outcomes, or quantify an agent’s internal confidence through distribution entropy.
  • Voters depend on the independence of IE invocations and typically utilize an unintelligent reconciliation mechanism, making them effective at dampening noise at the cost of increased inference compute.
  • Two practical variants, Committee and Divergent Committee, utilize distinct models, personas, or objectives to reduce bias and map out complex outcome spaces.
  • Practical applications of Voter include test-time compute scaling for math reasoning, committees of judges for text evaluation, and aggregative travel safety assessments, showing how Voter can be an essential design pattern for turning stochastic variability into a source of robustness and interpretability.

FAQ

What is the Voter pattern in agent design?The Voter pattern is a sampling mechanism that runs the same worker IE multiple times, treats each run as a vote, and then reconciles the votes into a final result. It is used to turn stochastic variability into a useful signal for improving robustness, exploring outcomes, or estimating confidence.
Why does the Voter pattern help with stochastic LLM outputs?Because language models are probabilistic and can produce different answers on repeated runs, especially at non-zero temperature. Voter leverages that randomness by sampling multiple outputs and combining them, which can filter out noisy reasoning errors and produce a more reliable answer.
What are the main components of a Voter?A Voter consists of a dispatch element, a worker IE, and a reconciliation procedure. The dispatcher launches multiple independent voting trajectories, the worker produces outputs, and the reconciler aggregates those outputs into the final result.
How does the reconciliation step work in Voter?The reconciliation procedure normalizes and combines the votes. Depending on the use case, it may return the majority winner, a probability distribution over outcomes, a subset of favorable outcomes, or an aggregate such as an average score.
What is the role of diversity in Voter?Voter explicitly encourages diverse trajectories so that the ensemble explores different possible outcomes. This diversity increases the chance that at least some runs find better solutions and gives the reconciler more useful information to work with.
When should the Voter pattern be used?It is useful when a task should have one correct answer, when you want to explore multiple possible outcomes, or when you want to estimate confidence or likelihood. Common examples include mathematical reasoning, judge-style evaluation, and safety analysis.
What tradeoff does Voter introduce?Voter typically improves robustness and accuracy, but it increases compute cost because the underlying IE must be run multiple times. It can also add latency unless the voting trajectories are executed in parallel.
What is the difference between a standard Voter and a Committee?In a standard Voter, the same IE is run multiple times with different seeds or perturbed inputs. In a Committee, the votes come from different IEs, such as different models or different personas, but they still share the same overall objective.
What is a Divergent Committee?A Divergent Committee is a special Voter variant where the workers are intentionally designed to produce different outputs for the same task. It is used to map the space of possible outcomes rather than to converge on a single majority answer.
How is Voter used in the chapter’s examples?The chapter shows Voter applied to math reasoning with majority vote, a committee of judges that averages scores, and a travel safety assessment that aggregates risks from multiple specialists. These examples illustrate how Voter can improve robustness, evaluate quality, and build more comprehensive analyses.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Agent Design Patterns ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Agent Design Patterns ebook for free