Chain-of-Thought Prompting
Ask a capable model a multi-step question and demand only the final number, and it will frequently guess. Ask the same model to work through the steps first, and it gets the answer right. Chain-of-thought prompting is the discovery that this difference is yours to control, from the prompt alone.
How it is doneThe original form is few-shot: you put two or three worked examples in the prompt, each showing not just a question and its answer but the reasoning in between. The model imitates the format and produces its own intermediate steps before committing to an answer. A zero-shot variant needs no examples at all — appending "Let's think step by step" triggers the same behaviour on most instruction-tuned models.
Why it worksA transformer performs a fixed amount of computation per token it generates. Pushing the reasoning into the output buys more tokens, and therefore more computation, for the problem; each intermediate result also stays in the context where the next step can read it, instead of having to survive inside a single forward pass. On GSM8K grade-school word problems the gain for a large model is dramatic, lifting accuracy from the teens to well over half.
What it costs- Tokens and latency: answers run several times longer, and the user waits for reasoning they may not want to read.
- Scale dependence: it does almost nothing for small models, appearing only in the largest ones.
- Faithfulness: the stated reasoning is a plausible narrative, not a transcript — a model can show sound steps and still answer wrongly.
Reasoning models now bake the habit into training, so the prompt no longer has to ask for it.
Chain-of-thought prompting makes a model produce its intermediate reasoning steps before its final answer, either by showing worked examples in the prompt or by instructing it to think step by step. Because a transformer computes per token generated, those extra steps buy extra computation and keep partial results in context, sharply improving arithmetic and multi-step reasoning in large models. The cost is longer, slower, more expensive output.
Think of a student doing arithmetic in their head versus one allowed to write out the working. Same student, far fewer mistakes with a pencil. Chain-of-thought prompting is the trick of asking an AI to show its working. Instead of demanding the answer straight away, you ask it to go step by step, or you show it an example of someone doing exactly that. The system then reasons out loud, and because each step it writes stays in front of it while it writes the next one, it gets many more multi-step questions right. The catch is that answers become longer and slower.