AI State of the Art
SOTA/Reasoning Models/20 min
Section 168

Self-consistency and Majority Voting

Listen as a podcast →

The Problem: A Single Reasoning Chain Can Fail

A single Chain-of-Thought, even well-structured, can be wrong. The model can make a calculation error, skip a step, or head in the wrong direction. A single reasoning chain is like a single dice roll: sometimes it lands right, sometimes it doesn't.

But here's the elegant idea behind self-consistency: ask the same question 10 times and see what the majority says. If 8 out of 10 answers say "42" and 2 say "37," the correct answer is probably "42." Random errors scatter, truth converges.

It's the principle of the wisdom of crowds, applied to a single model.

Self-Consistency Improves Chain of Thought Reasoning in Language Models (Wang et al., 2022)
Majority voting: simple and powerful

Instead of generating a single answer (greedy decoding, temperature 0), generate N independent answers with temperature (> 0). Each answer takes a different reasoning path, but correct paths converge to the same destination. You select the most frequent answer.

How It Works in Practice

Step 1: Generate N Reasoning Chains

With a temperature of 0.5 to 0.7 (enough randomness to diversify without descending into chaos), you generate 10 or 20 independent CoT reasoning chains.

Each one will take a slightly different path. One might start by calculating the unit price, another by setting up a ratio, a third by using proportionality. But if the problem has a unique solution, the correct paths converge to the same final answer.

Step 2: Extract the Answers

From each reasoning chain, you extract the final answer. A structured format ("Answer: X") makes this step much easier. Without reliable extraction, everything else falls apart.

Step 3: Majority Vote

You count: which answer comes up most often? That's the one you keep. Simple, effective, mathematically grounded.

Concrete Example

Q: 3 apples cost 6 euros. How much do 5 apples cost?

Answer 1: 3=63 = 6, so 1=21 = 2, so 5=105 = 10 → 10 euros Answer 2: Price/apple =6/3=2= 6/3 = 2. 5×2=105 \times 2 = 10 → 10 euros Answer 3: 5/3×6=105/3 \times 6 = 10 → 10 euros Answer 4: 3 apples =6= 6, so 5=6+2×2=105 = 6 + 2 \times 2 = 10 → 10 euros Answer 5: 6÷3=26 \div 3 = 2/apple, 2×5=102 \times 5 = 10 → 10 euros

Vote: 10 euros (5/5) → Final answer: 10 euros

Five different paths, same destination. That's the strength of self-consistency: the diversity of reasoning chains reinforces confidence in the answer.

Impressive Gains

On GSM8K (elementary/middle school math problems):

ModelCoT aloneSelf-consistency (N=40)Gain
PaLM 540B56.5%74.4%+17.9 points

(The 56.5% starting point is Wang et al.'s own measurement; the CoT lesson quotes 56.9% from the Wei et al. paper, same model, slightly different re-evaluation.)

Nearly 18 points of improvement just by asking multiple times and voting (the +17.9-point gain on GSM8K is the one announced in the abstract of the Wang et al. paper). No new training, no additional model, just intelligent redundancy.

Vocabulary: pass@1 and maj@N

These two ways of measuring a model have names you will meet throughout this module. pass@1: generate one answer and check whether it is correct, the "first try" score. maj@N (also written cons@N, for majority or consensus): generate N answers and count the majority answer as the model's, which is exactly the self-consistency of this page. The same model on the same benchmark can therefore show two very different scores depending on the protocol; a score quoted without its protocol means nothing.

Consistent and predictable gains

Self-consistency improves performance on all tested reasoning benchmarks. The gains are particularly significant on math and logic tasks, where different reasoning paths naturally converge toward the correct answer. It's one of the most reliable techniques for improving an LLM without retraining it.

The Parameters That Change Everything

How Many Samples (N)?

NEffect
5Already visible and significant improvement
10-20Sweet spot for cost/quality in most use cases
40Strongly diminishing returns
> 100Almost no measurable improvement

The gains follow a logarithmic curve: the first doubling (from 1 to 2 samples) brings a huge gain. The fifth doubling (from 16 to 32) brings very little. This is important for calibrating the budget.

Three plots (GSM8K, MultiArith, ARC Challenge) showing accuracy in percent against the number of sampled reasoning paths, from 1 to 40, for self-consistency, sample-and-rank and greedy decoding.
Three benchmarks, one and the same curve shape. The x axis is the number of sampled chains, the y axis is accuracy. The blue self-consistency curve rises steeply between 1 and 10 samples, then flattens out past 20, exactly the logarithmic curve described above. The flat orange line is greedy decoding, which never moves because it only ever produces one answer.Source : Self-Consistency paper, Wang et al. (figure 3), via Semantic Scholar

Temperature (T)

TemperatureEffect
T=0.5-0.7T = 0.5\text{-}0.7The sweet spot: enough diversity to explore different paths, enough coherence to stay logical
T<0.3T < 0.3Answers too similar to each other, voting serves no purpose
T>1.0T > 1.0Too much chaos, answers become nonsensical

The balance is crucial: enough randomness for each sample to explore a genuinely different path, but not so much that each path becomes nonsensical.

Plot of GSM8K accuracy for the Cohere Command model against the number of sampled reasoning paths, with one curve per temperature (0.5, 0.7 and 1.0) and a flat line for greedy decoding.
The same experiment rerun at three temperatures. The three curves end up almost on top of each other and all far above the blue greedy-decoding line: within the 0.5 to 1.0 range, the exact value matters far less than the fact of sampling several times. Telling detail on the far left: with a single sample, sampling is worse than greedy. The gain does not come from the temperature, it comes from the vote.Source : AWS Machine Learning Blog (Lucia Santamaria)

Answer Extraction

The often underestimated link: how do you extract the final answer from each reasoning chain?

Common techniques:

  • Parse the last line containing a number
  • Enforced structured format ("Answer: X")
  • Regex on the expected pattern

Bad extraction makes the entire vote useless. If you extract "10 euros" from one chain and "10" from another, the vote will count them as two different answers. Normalize your answers.

Advanced Variants

Weighted Self-Consistency

Instead of giving each answer an equal vote, you weight by the probability of the reasoning chain. A reasoning chain that the model generates with high confidence (high log-likelihood) weighs more than a hesitant one. This uses information that's free (the probabilities are already computed).

Universal Self-Consistency (USC)

For free-text answers (not a simple number), raw voting doesn't work. USC uses an LLM to compare and aggregate the answers: "Here are 10 answers to the same question. What is the consensus answer?" It's more expensive but extends self-consistency to open-ended tasks.

Diagram showing a maths question sent to an LLM that produces three free-text answers, then a USC output stating that the most consistent response is response 0.
Why raw voting breaks down here: the three answers do not end on a bare number but on full sentences, each worded differently. A string counter would treat them as three distinct answers. USC therefore hands the three texts back to the model and asks which one is the most consistent.Source : Universal Self-Consistency paper (Chen et al.), via PromptHub

Self-Consistency + Verification

You can combine voting with a verification step: after identifying the majority answer, you ask the model to explicitly verify it. Belt and suspenders.

In practice: N=5 is often enough

Start with N=5. The gains diminish quickly beyond that. For a critical task, go up to N=10 or N=20, but rarely more. Important point: a small model with many samples can beat a large model with a single sample, which changes the economic calculus, that is the subject of the test-time compute lesson.

When to Use Self-Consistency

Ideal Use Cases

  • Unique verifiable answer: math, logic, code with precise output
  • Critical reliability: diagnostics, compliance, financial decisions
  • Inconsistent results with CoT alone: if the model gives a different answer each time, voting stabilizes it

Use Cases to Avoid

  • Creative answers: there is no "right" answer, voting doesn't make sense
  • Simple classification: CoT alone suffices, no need for redundancy
  • Tight token budget: N=5 means 5 times the cost, it needs to be worth it
The majority can be systematically wrong

Self-consistency relies on the assumption that errors are random and independent. If the model has a systematic bias (it always confuses two concepts, it always applies the wrong formula), voting doesn't correct the bias, it reinforces it. 10 answers wrong in the same way give a unanimous vote... for the wrong answer.

Self-consistency eliminates random noise, not systematic bias. That's a crucial distinction.

The Historical Impact

Self-consistency was the first concrete step toward test-time compute scaling. Instead of improving the model itself, you improve its results by investing more computation at query time. This seemingly modest idea directly inspired reasoning models like o1 and DeepSeek-R1, which push the concept much further: not just voting among multiple answers, but truly thinking longer and deeper.

Check your understanding0 / 4

1. A model generates 10 independent reasoning chains and all 10 arrive at the same answer. The vote is unanimous. Can you be certain the answer is correct?

2. Why not generate the N answers with greedy decoding (temperature 0), since that is the setting that picks the most probable token at every step?

3. Two papers report very different scores for the same model on the same math benchmark. What is the most likely explanation according to this page?

4. During the vote, three reasoning chains end respectively with '10 euros', '10' and '10.00'. What is the risk?