liveBook · Manning

Chapter 6: Voter: Leveraging stochasticity for improved outputs

What you will learn in chapter 6 of Agent Design Patterns

This introduction shows how the Voter pattern turns variable model outputs into a more robust answer and a signal of uncertainty.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction shows how the Voter pattern turns variable model outputs into a more robust answer and a signal of uncertainty.

Key terms: stochasticity, generation temperature, probabilistic engines, distribution, Voter pattern, ensemble, voting trajectories, majority vote, mode, probability weight

6.1 To quickly summarize the above: By running an ensemble of probabilistic model instances on the same problem, one can arrive at a distribution of outcomes or results. This distribution can then be leveraged to explore the set of possible answers, find the most favored answer, or to estimate the confidence one should place in any given answer. This approach is captured by the Voter pattern. The pain point: Stochastic inference producing variable outputs

The section introduces the Voter pattern as a way to turn variable inference outputs into either a favored answer or a distribution of possible outcomes.

Key terms: IE, worker IE, Voter pattern, stochasticity, popularity vote, execution IE, probability distribution, distribution entropy, confidence

6.2 How the Voter pattern works

This section explains how a Voter dispatches diverse, independent runs of a worker, treats their answers as votes, and reconciles those votes into a result.

Key terms: Voter, dispatch element, worker IE, voting trajectory, vote, reconciliation procedure, explicit solicitation of diversity, independence of IE invocations, natural stochasticity, seeded differently

6.2.1 Tradeoffs

Adding a Voter can improve an agent’s capability and robustness, but increases the cost of the IE it wraps and reduces efficiency.

Key terms: Voter, IE, capability, robustness, efficiency

6.2.2 Implementation sketch

This subsection sketches a Voter implementation that runs multiple worker trajectories, collects their results, and reconciles them, with an optional early-stop optimization.

Key terms: Voter class, input perturbation, worker IE, voting trajectories, reconciliation element, reconciliation mechanism, abort voting trajectories, majority

6.2.3 When and where to use the Voter pattern

This section identifies three situations for using the Voter pattern: stabilizing a single answer, exploring multiple possible outcomes, and estimating confidence from an ensemble of results.

Key terms: answer robustness, ensemble of executions, outcome set, exploring outcomes, outcome space, agentic ideation, IE, reconciliation mechanism, probability distribution, most likely choice

6.2.4 How Voter works with other patterns

This section distinguishes Voter from Resampler, coordinated agent teams, and DPR by how their executions relate to one another and how their outputs are combined.

Key terms: Voter, Resampler, independent, parallel execution, operational intelligence, IE, random seed, perturbed input, Orchestrator, Agent Swarm

6.3.1 Committee

This subsection explains how a Voter committee uses different inference elements across voting trajectories while keeping a shared objective for reconciliation.

Key terms: Voter, IEs, committee, voting trajectory, underlying model, same objective, reconciliation, final output, on the fly, agents execution

6.3.2 Divergent Committee (“Loose Ensemble”)

This subsection explains how a Divergent Committee uses deliberately different inference engines to explore the range of possible outcomes for the same task.

Key terms: Voter, Divergent Committee, Loose Ensemble, IE's

6.4.1 Simple test-time compute scaling (TTCS) of mathematical reasoning

This subsection shows how a Voter can improve mathematical reasoning by running multiple solver instances and selecting the most common final answer.

Key terms: test-time compute scaling, solver IE, Voter instance, reasoning chains, simple-majority voting reconciliation, stochasticity, mathematical reasoning errors, inference compute

6.4.2 Committee of judges

This section applies the Voter pattern to subjective text evaluation by using diverse judges and averaging their scores.

Key terms: Voter pattern, committee of judges, worker IEs, reconciliation, low-variance quality estimate

6.4.3 Automatic travel safety assessment

This section applies an aggregative Voter committee to travel safety assessment, combining specialist risk assessments into a comprehensive report rather than a single safe-or-unsafe verdict.

Key terms: calibration, multi-element analysis, severity, Committee, aggregative reconciliation, union operation, distinct specialists, confidence

6.5 Summary

The section recaps how the Voter pattern turns stochastic variation into more robust outputs and interpretable distributions, while trading additional inference compute for those benefits.

Where this is used later

Concepts explained in this chapter

← Chapter 5: Resampler: Reliability through repeated sampling Chapter 7: Retriever: Returning more relevant results →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.