When a Few Examples Changed AI
In 2022, researchers at Google Brain (Wei et al.) did something almost absurdly simple: instead of showing the model examples of the form "question → answer", they showed it examples of the form "question → written-out reasoning → answer". The result? The model suddenly solved problems it had been systematically failing at before.
It's simple, it's almost trivial, and yet it's revolutionary. Chain-of-Thought (CoT) was born, and with it an entirely new era of LLM reasoning. This page picks up where the fundamentals lesson on chain-of-thought leaves off: same ideas, seen this time as the starting point of reasoning models.
Chain-of-Thought Prompting Elicits Reasoning in Large Language Models (Wei et al., 2022)LLMs have latent reasoning capabilities that direct prompting doesn't trigger. CoT unlocks them by forcing the model to show its work, exactly like a math teacher asking "show me your work, not just the answer." By transforming a complex problem into a series of simple steps, each step becomes individually solvable.
Showing Your Work: Why It's Better
Without CoT: The "gut feeling" answer
Q: Roger has 5 tennis balls. He buys 2 cans of 3 balls. How many does he have now?
A: 11
The model "feels" the answer. Sometimes it's right, sometimes not. On simple problems, it works. On more complex problems (multiple steps, conditions, traps), the model makes frequent mistakes because it tries to jump straight to the conclusion.
With CoT: Explicit reasoning
Q: Roger has 5 tennis balls. He buys 2 cans of 3 balls. How many does he have now?
A: Roger starts with 5 balls. 2 cans of 3 = 2 x 3 = 6 balls. Total: 5 + 6 = 11 balls.
Same answer here, but the path is explicit. And it's this path that makes all the difference on harder problems. Like a student showing their work on an exam: not only can the teacher follow the reasoning, but more importantly, the student themselves makes fewer mistakes when writing out each step.
Two Variants: Few-shot and Zero-shot
Few-shot CoT: Learning by example
You show the model a few examples of step-by-step reasoning, then give it the new problem:
Example 1: Q: [problem] A: [step by step] -> [answer]
Example 2: Q: [problem] A: [step by step] -> [answer]
Q: [new problem] A:
The model recognizes the pattern and applies it to the new problem. The examples act as a mold: they show the model the expected structure of the reasoning.
Zero-shot CoT: The magic phrase
Even simpler, and surprisingly effective:
Q: [problem] A: Let's think step by step.
No examples, just this instruction. And it works remarkably well.
The "magic phrase" was discovered by Kojima et al. (2022), not by Wei et al. Their abstract gives the numbers, measured on InstructGPT (text-davinci-002): simply adding "Let's think step by step" lifts accuracy from 17.7% to 78.7% on MultiArith and from 10.4% to 40.7% on GSM8K. No examples needed. It's one of the most powerful prompting techniques ever discovered, and certainly the simplest to implement.
Large Language Models are Zero-Shot Reasoners (Kojima et al., 2022)Why It Works: Four Mechanisms
1. Problem Decomposition
A complex 5-step problem is essentially 5 simple sub-problems that the model knows how to solve. "Calculate the total price with 20% tax on 150 euros" is hard in a single mental leap. But "calculate 150 x 0.2 = ?" (answer: 30) then "150 + 30 = ?" (answer: 180) is trivial. CoT transforms a difficult leap into a series of small steps.

2. Externalized Working Memory
When the model writes "first, the unit price is 2 euros," those tokens stay in the context. At the next step, it can re-read that information to continue its reasoning. It's like taking notes on scratch paper: without scratch paper, you have to keep everything in your head. With scratch paper, each intermediate result is accessible. CoT turns the context into working memory.
3. Complexity Reduction
Solving a 5-step problem in a single pass exposes the model to potentially exponential combinatorics (each intermediate choice multiplies). In 5 sequential passes, complexity becomes linear. Mathematically, it's just much easier, and the model mechanically makes fewer errors.
4. Emergence Based on Model Size
Important point: CoT only works well on sufficiently large models. The threshold reported in the Wei et al. paper is high: around 100 billion parameters. It's an emergent capability (a capability that only appears beyond a certain model size, small models don't benefit from it, then it "emerges" suddenly past a threshold): below this threshold, CoT doesn't help, and can even degrade performance. Recent models cross this threshold much earlier, because their training explicitly prepares them for reasoning, but the paper's figure remains the 2022 one. Details in the fundamentals lesson.

The Numbers: The Gain is Massive
| Model | Without CoT | With CoT | Gain |
|---|---|---|---|
| PaLM 540B | 17.9% | 56.9% | +39.0 points |
| GPT-3 175B | 15.6% | 46.9% | +31.3 points |
| Codex | 19.7% | 63.1% | +43.4 points |
Figures from table 2 of the Wei et al. paper, on GSM8K (elementary school math problems), with the same protocol in both columns: 8 exemplars in the prompt, a single generated answer per problem. The gain is staggering: PaLM goes from 18% to 57%, a tripling of performance, just by asking the model to show its work.
Zero additional training. It's pure prompting. The only cost: a few more tokens in the response. For any reasoning task, it's almost always an excellent investment. The gain-to-cost ratio is unbeatable.
How to Structure Reasoning Well
Good structure:
- Step 1: Identify known variables
- Step 2: Set up the equation
- Step 3: Solve
- Step 4: Verify the result
Bad structure:
- "Let's see... hmm... I think that..."
Explicit labels ("Step 1", "Data", "Conclusion") greatly help the model organize its reasoning. A well-structured CoT is significantly more reliable than a CoT that rambles.
Best Practices
1. Structure Explicitly
Use clear labels: "Step 1:", "First...", "Known data:" The model performs better when the structure is explicit.
2. Ask for Verification
Add "Verify your reasoning" or "Recalculate to confirm" at the end of the prompt. This encourages the model to re-read its own answer and catch obvious errors.
3. Separate Reasoning and Answer
Enforce a clear output format: reasoning on one side, then "Final answer: X" on the other. This is essential if you need to extract the answer programmatically.
4. Don't Use CoT Everywhere
CoT is made for reasoning: math, logic, multi-step analysis. For "What is the capital of France?", CoT is useless and can even degrade performance. The model "thinks" too much and ends up overcomplicating a trivial question.

A CoT can be beautifully articulated, with each step seemingly following logically from the previous one, while being mathematically incorrect. LLMs are excellent at generating text that sounds logical. Never blindly trust a model's reasoning: verify the results, especially on problems that matter.
The Legacy of Chain-of-Thought
CoT opened up an entire lineage of techniques: self-consistency (voting among multiple reasoning chains), Tree of Thoughts (exploring a tree of reasoning paths), Graph of Thoughts, and ultimately reasoning models like o1 and DeepSeek-R1 that internalize CoT directly into their generation process.
Chain-of-Thought is the foundation. Everything that came after, from the simplest techniques to the most sophisticated, is a refinement of this disarmingly simple idea: show your work.
1. A model produces a beautifully articulated step-by-step reasoning chain, where each step seems to follow logically from the previous one. What can you conclude about the final answer?
2. Why does the Wei et al. paper call Chain-of-Thought an emergent capability?
3. What role do the already-written steps (like 'first, the unit price is 2 euros') play for the rest of the generation?
4. According to the meta-analysis of over a hundred studies cited on this page, on which kinds of tasks does CoT deliver a real gain?