Last updated:
Self-Consistency Improves Chain of Thought Reasoning in LLMs
Xuezhi Wang et al.
In collections: Reasoning Hallucinations & reliability
Chain-of-thought prompting combined with pretrained large language models has achieved promising results on complex tasks that require reasoning. 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 choosing only a single greedy one, and then selects the most consistent answer by marginalizing out the generated reasoning paths. Self-consistency is based on the intuition that a complex decision problem usually admits many different ways of thinking that lead to the same, unique, correct answer. Our extensive empirical evaluations show that self-consistency significantly boosts the performance of chain-of-thought prompting 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%).
Strategies from the report
Self-Consistency: The model generates many different paths leading to a solution and picks the final result by voting for the most frequent answer. This draws on the human intuition that many correct lines of thought should lead to the same conclusion.
Greedy Decoding Replacement: Instead of always choosing the "most probable" next word (which promotes formulaic output), the model samples different paths and produces unique analyses of the same problem.
Path Marginalization: A strategy of separating the "thinking process" from the final answer in order to count statistical agreement. The model ignores differences in how it arrived at the result and focuses only on whether the number or fact at the end converges.
Best practices:
Combining with Chain-of-Thought (CoT Synergy): The self-consistency method was designed to amplify the power of "step by step" prompting. Always combine the two techniques for the best results.
Using it for tasks with one specific answer (Fixed-answer tasks): The technique works best in areas where the final result can be unambiguously extracted and mathematically counted (e.g. math, advanced logic, closed true/false questions).
Scaling the sampling for harder tasks (Scaling samples): Research shows that the harder and more complex the problem, the more paths you should have the model generate. Generating a dozen or so variants increases the chance of filtering out hallucinations.
What to avoid
Excessive use of computational resources (Overcomputing): Do not ask the model to generate a dozen lines of thought for simple, trivial factual questions. It needlessly burns tokens and your time (and budget).
Using the technique for open-ended text generation (Open-ended tasks): Avoid forcing self-consistency on creative writing, generating poems or essays, because there is no consistent, closed solution there for the model to clearly "vote" on.
Blind trust in a single path (Single-path reliance): If the task has a large margin of error inside the AI, avoid relying on the first and only answer the model generates. Greedy algorithms can easily "get stuck" in a bad line of thought.
Video description
Support this project by buying me a coffee ;)