Skip to content

Self-Consistency Improves Chain of Thought Reasoning in Language Models

optionalextendedfundamentalpaperrubric 8/122023 · ICLR 2023 · ~30 min

Xuezhi Wang, Jason Wei, Dale Schuurmans, … Denny Zhou

Status

TL;DR. Chain-of-thought prompting decodes one reasoning path greedily. Self-consistency samples many paths at temperature 0.5–0.7, reads off each final answer, and returns the most common one. It is training-free and unsupervised, and on PaLM 540B it lifts GSM8K from 56.5 to 74.4.

Sample mm pairs (ri,ai)(r_i, a_i) of reasoning path and answer from the CoT-prompted model. Return

a^=arg⁡max⁡a∑i=1m1(ai=a).\hat a=\arg\max_{a}\sum_{i=1}^{m}\mathbb{1}(a_i=a).

This approximately marginalises over reasoning paths. Weighting each vote by the length-normalised probability exp⁡(1K∑klog⁡p(tk∣⋅))\exp\big(\tfrac1K\sum_k\log p(t_k\mid\cdot)\big) gives almost the same result, because these probabilities are close to each other.

On PaLM 540B (Table 1), majority vote over 40 paths beats greedy CoT on GSM8K (56.5 → 74.4), MultiArith (94.7 → 99.3), AQuA (35.8 → 48.3), SVAMP (79.0 → 86.6), CSQA (79.0 → 80.7) and ARC-challenge (85.2 → 88.7). The normalised weighted sum is nearly the same (74.1 on GSM8K), while unnormalised weighting (59.9) and a normalised weighted average (22.1) are much worse. Across models, the largest gains include +17.9 on GSM8K, +11.0 on SVAMP, +12.2 on AQuA, +6.4 on StrategyQA and +3.9 on ARC-challenge. Self-consistency also rescues imperfect prompts: for LaMDA 137B, a prompt that drops greedy accuracy from 17.1 to 14.9 gives 23.4 with voting.

Builds directly on Chain-of-Thought. It is the “parallel” knob without a verifier in compute-optimal test-time scaling, which adds PRM-weighted voting and revisions. s1 compares its sequential scaling against majority voting.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    Five sampled chains give answers 18, 18, 26, 18 and 26, with length-normalised probabilities 0.30, 0.28, 0.40, 0.25 and 0.38. Which answer does each rule pick: majority vote, normalised weighted sum, and taking the single most probable chain? Relate your result to why the paper finds the first two nearly identical.

    What a strong answer covers
    • Majority vote: 18 wins 3 to 2.
    • Normalised weighted sum: 18 gets 0.30 + 0.28 + 0.25 = 0.83 and 26 gets 0.40 + 0.38 = 0.78, so 18 wins.
    • Most probable single chain: 0.40, answer 26. This is close to what greedy or sample-and-rank decoding rewards.
    • Normalised probabilities of different chains are close to each other (the model is poorly calibrated about reasoning paths), so weighting barely changes the vote: Table 1 gives 74.4 vs 74.1 on GSM8K. Unnormalised weighting drops to 59.9.
  2. Mechanism

    Explain why voting over final answers improves accuracy when sampled chains differ, and why the method needs a fixed answer set. Use the latent-variable view of reasoning paths.

    What a strong answer covers
    • Treat the chain r as a latent variable: the vote approximates argmax over a of the sum over r of p(r, a | q), instead of the single most likely (r, a) pair.
    • Many different correct chains tend to reach the same answer, while wrong chains scatter over different wrong answers, so correct answers collect more votes.
    • Voting requires answers that can be compared for equality (numbers, options). Free-form text needs a similarity or consistency measure instead.
    • The agreement rate is a by-product: it correlates with accuracy and can serve as an uncertainty estimate.
  3. What if…

    The paper compares self-consistency with sample-and-rank, beam search and prompt ensembles. What does each comparison isolate, and what does the beam-search result say about the role of diversity?

    What a strong answer covers
    • Sample-and-rank uses the same samples but picks the most probable one, isolating the aggregation rule. Voting wins.
    • Beam search (on UL2) produces less diverse outputs; for most numbers of paths, voting over beam outputs is worse than voting over sampled chains, so diversity in reasoning paths drives the gain.
    • Prompt ensembles (different exemplar orders or sets) add diversity through the prompt and help less than sampling diverse chains.
    • In Table 6, accuracy with sampling rises steadily as the number of paths grows toward 40, the number used in the main experiments.

Done with this page?

Status