Paper commentary
Self-Consistency Improves Chain of Thought Reasoning in Language Models
- Problem Greedy decoding keeps one reasoning path per question, so chain-of-thought prompting can miss a correct answer that another path would reach.
- Method Samples several reasoning paths from a language model prompted with chain-of-thought exemplars, then returns the final answer that occurs most often across the sampled paths by majority vote.
- Results Reached 74.4 accuracy on GSM8K with PaLM-540B, against 56.5 for chain-of-thought prompting with greedy decoding.

Figure 1 : The self-consistency method contains three steps: (1) prompt a language model using chain-of-thought (CoT) prompting; (2) replace the “greedy decode” in CoT prompting by sampling from the language model’s decoder to generate a diverse set of reasoning paths; and (3) marginalize out the reasoning paths and aggregate by choosing the most consistent answer in the final answer set.
Original paper · CC BY 4.0 · Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, Sharan Narang, Aakanksha Chowdhery, Denny Zhou · Self-Consistency Improves Chain of Thought Reasoning in Language Models · Original paper figure · Extracted the figure area from page 2 of the original PDF.Why one greedy chain is not enough
Chain-of-thought prompting asks a model to write short intermediate steps before it states an answer, so the reasoning appears in the output itself. The usual decoding for this setup keeps only the greedy path, which means one sequence and one chance to reach the correct answer. A single greedy path can repeat itself or settle into a locally optimal wording, while a single stochastic sample carries its own noise.
The authors start from the observation that a hard problem usually admits several different ways of reasoning that all reach one correct answer. They argue that the more deliberate analysis a problem demands, the more varied the set of reasoning routes that can recover the answer. They hypothesize that correct routes, even when they differ from one another, agree more on their final answers than incorrect routes do.
Sampling and marginalizing reasoning paths
The procedure starts from the same few-shot chain-of-thought prompt, built from manually written exemplars. Instead of one greedy decode, the model is sampled several times to produce a set of candidate outputs, using temperature sampling with top-k truncation or another sampling scheme. The three stages are prompting, sampling several reasoning paths, and marginalizing them out to choose the most consistent answer.
Each sampled output is split into a reasoning path r_i and a final answer a_i, and the path is only a means of reaching that answer. The answer parser depends on the task: for arithmetic it takes the first numerical part after the phrase The answer is, and for commonsense it takes the full string after that phrase. Most generated outputs follow a consistent template, so this parsing step is usually straightforward.
Aggregation marginalizes over the reasoning paths by counting how often each candidate answer appears among the sampled outputs. Written as an argmax over candidate answers of the summed indicator terms, this count is the majority vote, and the method takes the answer that is most consistent among the final answers. The method needs no training, auxiliary model, or human annotation, so it runs on a single off-the-shelf language model.
Majority vote against probability-weighted sums
The authors also weight each path by its probability, normalizing that probability by the output length. The normalized weight is given below, where K is the number of tokens in the path and answer. \[ P(r_i, a_i \mid \text{prompt}, \text{question}) = \exp\left(\frac{1}{K}\sum_{k=1}^{K}\log P(t_k \mid \text{prompt}, \text{question}, t_1, \ldots, t_{k-1})\right) \] The exponent is the average per-token log probability of the path and answer, so the weight does not grow simply because a path is longer.
Table 1 compares these weightings with majority vote on PaLM-540B. Majority vote reaches 74.4 on GSM8K, and the normalized weighted sum reaches 74.1. The unnormalized weighted sum reaches 59.9 on GSM8K, and the normalized sum is higher than the unnormalized sum on every column of the table. The weighted average, which divides each answer's score by its count, falls far below greedy decoding, with 22.1 on GSM8K against 56.5.
The authors explain the near tie between majority vote and the normalized sum by noting that the normalized probabilities of the candidate paths are close to each other, so the model treats those generations as similarly likely. They add that this points to weak calibration, because the model cannot clearly separate correct solutions from wrong ones.
Models, prompts and sampling settings
All experiments use the few-shot setting, with no training or fine-tuning of the models. The GPT-3 runs use two Codex engines, code-davinci-001 and code-davinci-002. UL2 is an encoder-decoder model with 20 billion parameters, while LaMDA-137B and PaLM-540B are dense left-to-right decoder-only models.
The arithmetic benchmarks are AddSub, MultiArith, ASDiv, AQuA, GSM8K and SVAMP, and the commonsense benchmarks are CommonsenseQA, StrategyQA and ARC. The symbolic tasks are last letter concatenation and coin flip. The test split is used by default, with the dev split for CommonsenseQA and a question-only set for StrategyQA.
GPT-3 uses temperature 0.7 without top-k truncation. Arithmetic prompts use the same 8 manually written exemplars, and each commonsense task uses 4 to 7 exemplars chosen at random from the training set. The main results are averages over 10 runs, with 40 outputs sampled independently in each run.
Gains on arithmetic and commonsense benchmarks
The gain over chain-of-thought prompting grows with model scale: it is +3%-6% on UL2-20B and +9%-23% on LaMDA-137B and GPT-3. For the larger models, which already score high on many tasks, the gains are still +12%-18% on AQuA and GSM8K, and +7%-11% on SVAMP and ASDiv. On PaLM-540B, GSM8K accuracy rises from 56.5 under greedy decoding to 74.4, an absolute gain of +17.9%.
On PaLM-540B, AQuA rises from 35.8 to 48.3 and SVAMP from 79.0 to 86.6. On GPT-3 code-davinci-002, GSM8K rises from 60.1 to 78.0. On the commonsense tasks for PaLM-540B, StrategyQA rises from 75.3 to 81.6 and ARC (Challenge) from 85.2 to 88.7.
The authors report state-of-the-art results on 5 of the 6 commonsense and symbolic tasks. The comparison baselines in the table generally require task-specific training or fine-tuning with many examples, whereas self-consistency is unsupervised and task-agnostic. In the out-of-distribution symbolic setting, prompts contain 2-letter or 2-flip examples and the test items use 4-letter and 4-flip inputs, and the gains remain substantial with sufficiently large models.
Against sample-and-rank, beam search and ensembles
Sample-and-rank draws the same number of sequences and returns the answer from the sequence with the highest log probability. On GPT-3 code-davinci-001 with the same number of samples, sample-and-rank improves accuracy, but the gain is much smaller than the one from self-consistency. Figure 3 plots the two methods side by side on GSM8K, MultiArith and ARC (Challenge).
On UL2-20B, beam search and self-consistency are compared under the same number of beams and reasoning paths. On AQuA at 40, the top beam reaches 10.2, self-consistency with beam search reaches 24.2, and self-consistency with sampling reaches 26.9. The authors attribute the weaker beam variant to the lower diversity of beam outputs, while the diversity of reasoning paths is what drives the gain.
The ensemble baselines are prompt-order ensembles over 40 permutations of the exemplars and multi-prompt ensembles over 3 prompt sets, both combined by majority vote over greedy answers. On LaMDA-137B, GSM8K reaches 18.6 with 3 prompt sets and 19.2 with 40 permutations, while self-consistency with 40 sampled paths reaches 27.7, against 17.1 for chain-of-thought prompting.
The authors describe self-consistency as a self-ensemble over a single model, not as an ensemble of trained models.
Sample count, sampling settings and imperfect prompts
The authors vary the number of sampled reasoning paths over 1, 5, 10, 20 and 40 on LaMDA-137B, reporting mean and standard deviation over 10 runs. Accuracy becomes consistently better as the number of sampled paths grows, which the authors link to the value of diversity in the reasoning paths. Figure 2 plots the accuracy against the sample count for four tasks, with greedy decoding as the reference.
The standard deviation of self-consistency stays at or below 0.5 for all tasks in the main table.
On PaLM-540B the authors vary the temperature, the top-k value and the nucleus parameter, and they describe self-consistency as robust to these choices. Figure 4 shows GSM8K accuracy across these sampling settings and across model sizes.
The authors also test prompts whose numbers in the reasoning paths are replaced by random numbers, except for the final answer. Under these imperfect prompts, greedy decoding drops from 17.1 to 14.9 on LaMDA-137B, while self-consistency with 40 paths reaches 23.4. Equation prompts reach 5.0 with greedy decoding and 6.5 with self-consistency, and zero-shot chain-of-thought on PaLM-540B rises from 43.0 to 69.2 with self-consistency.
The gain is smaller for equation prompts than for natural-language paths, since equations are much shorter and leave less room for diversity. Applied to zero-shot chain-of-thought, self-consistency improves GSM8K accuracy by 26.2%.
On GSM8K, the share of decodes that agree with the final aggregated answer is highly correlated with accuracy. The authors read low consistency as a sign that the model has low confidence in its answer.
Tasks where chain-of-thought hurts
Ye & Durrett (2022) report that chain-of-thought prompting can underperform standard prompting in few-shot in-context learning, and the authors test whether sampling closes that gap. The tasks are the closed-book question answering sets BoolQ and HotpotQA, and the natural language inference sets e-SNLI, ANLI and RTE, all run on PaLM-540B.
On ANLI R1, e-SNLI and RTE, chain-of-thought prompting scores 68.8, 81.0 and 79.1, below standard prompting at 69.1, 85.8 and 84.8. Self-consistency reaches 78.5 on ANLI R1, 88.4 on e-SNLI and 86.3 on RTE, above both baselines on each. On BoolQ self-consistency reaches 78.4, against 71.3 for standard prompting and 74.2 for chain-of-thought prompting, and on HotpotQA (EM/F1) it reaches 33.8 / 44.6, against 27.1 / 36.8 and 28.9 / 39.8.
Costs, fixed answer sets and weak paths
Self-consistency costs more computation than a single greedy decode, because many reasoning paths must be sampled. The authors suggest starting with a small number of paths, such as 5 or 10, since most of the gain appears early and accuracy saturates quickly.
The method applies only where the final answer comes from a fixed answer set, and extending it to open-ended text would need a consistency metric between generations, which the authors did not test. Language models can still produce incorrect or nonsensical reasoning paths, so the rationales need further grounding.
The results over the four language models and the arithmetic and commonsense benchmarks rest on the setup described above, and the common NLP tasks were run only on PaLM-540B.
Paper info
- Authors
- Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, Sharan Narang, Aakanksha Chowdhery, Denny Zhou
- Venue
- arXiv · Preprint
- First published
- 2022-3-21
- Added
- 2026-10-20
- Updated
- 2023-3-7
- Version
- v4
- arXiv
- 2203.11171
- Category
- cs.CL · cs.AI
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
Chain-of-thought prompting combined with pre-trained large language models has achieved encouraging results on complex reasoning tasks. In this paper, we propose a new decoding strategy, self-consistency, to replace the naive greedy decoding used in chain-of-thought prompting. It first samples a diverse set of reasoning paths instead of only taking the greedy one, and then selects the most consistent answer by marginalizing out the sampled reasoning paths. Self-consistency leverages the intuition that a complex reasoning problem typically admits multiple different ways of thinking leading to its unique correct answer. Our extensive empirical evaluation shows that self-consistency boosts the performance of chain-of-thought prompting with a striking margin on a range of popular arithmetic and commonsense reasoning benchmarks, including GSM8K (+17.9%), SVAMP (+11.0%), AQuA (+12.2%), StrategyQA (+6.4%) and ARC-challenge (+3.9%).
Quote from the paper
Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, Sharan Narang, Aakanksha Chowdhery, Denny Zhou (2022). Self-Consistency Improves Chain of Thought Reasoning in Language Models. arXiv:2203.11171v4. https://arxiv.org/abs/2203.11171v4
BibTeX
@misc{wang2022self,
title = {{Self-Consistency Improves Chain of Thought Reasoning in Language Models}},
author = {Xuezhi Wang and Jason Wei and Dale Schuurmans and Quoc Le and Ed Chi and Sharan Narang and Aakanksha Chowdhery and Denny Zhou},
year = {2022},
eprint = {2203.11171},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2203.11171v4}
}