Pick a concrete input and say what the equation should give before you read the math.
Foundation reference
Chain-of-Thought Prompting
Chain-of-thought prompting asks a language model to write intermediate reasoning before its final answer. With eight worked examples in the prompt, PaLM 540B went from 17.9% to 56.9% on the GSM8K grade-school math benchmark (Wei et al., 2022).
Study guide
Where to start
Why does writing out intermediate steps help a model that does a fixed amount of computation per token, and which kinds of problem benefit most (Nye et al., 2021; Feng et al., 2023)?
How to study this pagePredict · Check · Generalize · Continue
Work through the math, then read the cited papers for the original argument.
Identify the part of the idea that survives a change of notation or model, so you can recognize it in another paper or system.
Use the prerequisites and related concepts at the end of the page to fill the next gap.
Why It Matters for Modern Models
- Chain-of-thought prompting asks a language model to write intermediate reasoning before its final answer. With eight worked examples in the prompt, PaLM 540B went from 17.9% to 56.9% on the GSM8K grade-school math benchmark (Wei et al., 2022).
- Wei et al. (2022) saw the gains only in models of about 100 billion parameters and above, and called the ability emergent; whether such abilities really appear suddenly with scale, or only look sudden under some evaluation metrics, is contested (Schaeffer et al., 2023).
- Reasoning models extend the idea by training the chain of thought with reinforcement learning instead of only prompting for it; OpenAI describes its o1 models this way (OpenAI, 2024).
Questions to Think About
- Does the written chain of thought show how the model actually reached its answer, given that Turpin et al. (2023) found explanations that leave out the real cause of a prediction and Lanham et al. (2023) found that how much answers depend on the stated reasoning varies widely across tasks?
- Why does sampling several reasoning paths and taking a majority vote over their final answers beat decoding a single greedy path (Wang et al., 2023)?
Core Math
Chain-of-thought prompting asks a language model to write out intermediate reasoning before its final answer , either by including a few worked examples in the prompt (Wei et al., 2022) or simply by adding "Let's think step by step" (Kojima et al., 2022). The model generates the reasoning token by token, and each step conditions on the question and the steps before it:
A transformer does a fixed amount of computation per token, so writing the steps out gives it more sequential computation before it commits to an answer (Nye et al., 2021; Feng et al., 2023).
Self-consistency samples reasoning paths at a positive temperature, reads off their final answers , and returns the most common one (Wang et al., 2023):
This approximates choosing the answer with the highest total probability over reasoning paths, , instead of trusting a single greedy path.