When to reach for it
- The stochastic diversity of models should be leveraged.
- The result must be robust against individual logic errors in single runs.
Vote across many minds. Settle on the majority.
The system generates multiple independent reasoning outputs for the same prompt, and then merges the results via consensus or voting for a final answer.
Several samples vote; the majority answer wins.
| Sample | Reasoning | Answer |
|---|---|---|
| 1 | 3 × 48 = 144 boxes, minus 17 damaged = 127, times 12 | 1,524 |
| 2 | 144 boxes, 127 intact, 127 × 12 | 1,524 |
| 3 | 144 × 12 = 1,728 items, minus 17 × 12 = 204 | 1,524 |
| 4 | 144 × 12, the damaged boxes are forgotten | 1,728 |
| 5 | 1,728 items, minus 17 (boxes mistaken for items) | 1,711 |
from collections import Counter
def self_consistent(question, n=5):
# same prompt, n samples
answers = [extract_answer(model(question, temperature=0.7))
for _ in range(n)]
answer, votes = Counter(answers).most_common(1)[0]
return answer, votes / n # the vote share is a rough confidence signalWhen to reach for it
When it backfires
All reasoners share the same training bias and agree on an incorrect answer. Majority voting amplifies the error.
Countermeasure
Use diverse prompts or models for each reasoner, or add a verifier that checks against an external source.
A 2-2 split leaves the majority node without a clear winner. The system hangs or picks arbitrarily.
Countermeasure
Use an odd number of reasoners, or define a tie-break (e.g., highest-confidence vote, or escalate to human).
Next pattern
Search patterns, frameworks, and pages.