GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
ICLR 2023

Self-Consistency Improves Chain of Thought Reasoning in Language Models

Sample many chain-of-thought answers and take the majority vote. A one-line change that added up to 17.9 points on GSM8K, and whose agreement rate doubles as a confidence score.

Breakdown by FDE Interviews · 12 min read · Updated

About the original · 2022
AUTHORS
Wang, Wei, Schuurmans, Le, Chi, Narang, Chowdhery, Zhou
FROM
Google Research, Brain Team
PUBLISHED
Mar 2022 · ICLR 2023
CITED BY
8,017Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 19% of this breakdown.

01

The paper in one minute

Chain-of-thought prompting gets a model to write out its reasoning before answering, and it is usually decoded greedily: one path, the most likely token at each step. Xuezhi Wang, Jason Wei, Denny Zhou and colleagues at Google Research noticed that a reasoning problem can usually be solved several ways that reach the same answer, while mistakes tend to land on different wrong answers. So they replaced greedy decoding with sample and marginalize: sample many reasoning paths, parse the final answer from each, and return the most frequent one.

That is the whole method. It uses the same few-shot chain-of-thought prompt, any standard sampling scheme (they used temperature 0.5 to 0.7, top-k 40 for most models), and a parser that reads the text after "The answer is". The reasoning path is a hidden variable that gets summed out; only the answers vote.

They tested it on four models (UL2 20B, LaMDA 137B, PaLM 540B, and GPT-3's code-davinci-001 and -002) across arithmetic benchmarks (GSM8K, SVAMP, AQuA, ASDiv, MultiArith, AddSub) and commonsense ones (CommonsenseQA, StrategyQA, ARC). With 40 sampled paths, self-consistency improved on greedy chain of thought for every model on every arithmetic and commonsense task. GSM8K with PaLM 540B rose from 56.5% to 74.4%; AQuA with code-davinci-002 from 39.8% to 52.0%.

The paper also showed that voting beat ranking samples by the model's own probability, beam search, and ensembles of prompts; that it rescued tasks where chain of thought had hurt; and that the share of paths agreeing with the winner tracks accuracy closely enough to serve as a confidence score. It appeared at ICLR 2023.

THE IDEA, VISUALLY
SAMPLE, PARSE, VOTE CoT prompt + question path 1: … 9 × $2 = $18 18 path 2: … 13 × $2 = $26 26 path 3: … 16 − 7 = 9 → $18 18 18 vote temperature 0.5 to 0.7 · 40 paths · answer parsed after “The answer is” WHY VOTING BEATS RANKING Wrong paths scatter across many answers; right ones converge. Ranking paths by the model's own probability does little, because the model rates its paths as about equally likely. BEAM SEARCH GETS WORSE (TABLE 6, UL2-20B, AQUA) 1 beam 23.6 19.7 5 beams 19.3 24.9 10 beams 16.1 25.3 20 beams 15 26.7 40 beams 10.2 26.9 top beam self-consistency, same number of paths One sampled path (19.7) is worse than greedy (23.6); the gain comes from voting over many. Most of it arrives by 5 to 10 paths. PALM 540B, ARITHMETIC (TABLE 2) AddSub +1.8 91.9 93.7 MultiArith +4.6 94.7 99.3 ASDiv +7.9 74 81.9 AQuA +12.5 35.8 48.3 SVAMP +7.6 79 86.6 GSM8K +17.9 56.5 74.4 CoT, greedy self-consistency, 40 paths Gains are percentage points, mean of 10 runs (std ≤ 0.5). The price is 40 decodes per question instead of one. Ensembles of 3 prompts or 40 prompt orders gained far less.
Self-consistency samples many reasoning paths and keeps the most common final answer. Wrong paths scatter while right ones converge, so voting beat greedy decoding, beam search, ranking by probability and prompt ensembles, at the price of many decodes per question.
Research notes: the problem, approach and results
+17.9

GSM8K points over greedy chain of thought with PaLM 540B (56.5% to 74.4%) and with code-davinci-002 (60.1% to 78.0%)

40

reasoning paths sampled per question, averaged over 10 runs, with run-to-run spread of half a point or less

≈ equal

majority vote against voting weighted by the model's normalized probabilities: 74.4% and 74.1% on GSM8K

THE PROBLEM

Chain-of-thought prompting decodes one reasoning path greedily. If that path slips once, the answer is wrong, and greedy decoding has no way to notice, because it never considers another way of solving the problem.

THE IDEA

Sample a diverse set of reasoning paths from the same prompt, parse each final answer, and return the answer most paths agree on. No training, no verifier, no extra data: a change to decoding alone.

THE RESULT

Across four models and ten reasoning benchmarks, voting over 40 paths beat greedy chain of thought on every arithmetic and commonsense task, by up to 23.9 points. With PaLM 540B, GSM8K rose from 56.5% to 74.4%.

02

Why it matters to an FDE

Self-consistency is often the first thing to try when a customer's extraction or reasoning task is close to good enough. It needs no new data and no new model, only a parser for the final answer.

It costs one decode per path. Forty paths is forty times the output tokens and, unless you batch, more latency. The authors suggest starting with 5 or 10 paths, where most of the gain arrives.

The agreement rate is a free confidence score. If 9 of 10 paths agree, the answer is very likely right; if they split 4, 3 and 3, it is not. That is the signal for routing a case to a person, retrying with a stronger model, or asking for more information.

It needs answers that can be compared. Numbers, labels, yes or no, a field value. For free-form text you need a way to decide when two answers say the same thing before you can vote.

It is the baseline for anything fancier. Tree search, self-refinement and LLM critics all spend extra compute. A vote over the same number of samples is what they must beat.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 99 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦2 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    How the vote works, the results by model, the comparisons, and misreadings to avoid

    Free account
  2. 04How it works

    The decoding procedure, the aggregation rules tested, and the experimental settings

    Premium
  3. 05The numbers that matter

    The size of each gain by model and task, the comparisons, and what the agreement signal predicts

    Premium
  4. 06Try it yourself

    Votes by number of paths, agreement as a routing score, and an early stop that saves 40% of decodes

    Premium
  5. 07Where it breaks

    Where voting does not help, costs too much, or needs work you have to do yourself

    Premium
  6. 08Using it on a deployment

    Adding voting to a customer pipeline with a budget, a parser and a routing rule

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →