Chain-of-thought prompting
Ask for the working, not just the answer. Writing out intermediate steps gives a model room to reason, and gives you a way to see where it went wrong.
The bat-and-ball problem
Typical fast answer
Wrong. $0.10 “feels” right because $1.10 minus $1.00 is $0.10, and a model answering in one go can make the same intuitive leap people do. (Psychologist Shane Frederick used this puzzle in his 2005 Cognitive Reflection Test for exactly that reason.) If the ball were $0.10, the bat would be $1.10 and the total $1.20.
Three ways to use it
- Zero-shot CoT. Add “Think step by step before answering.” Simple and surprisingly effective (Kojima et al., 2022).
- Few-shot CoT. Include one or two examples that show the reasoning written out, the approach from Wei et al. (2022). Combine with few-shot prompting.
- Structured thinking. Ask for reasoning in one place and the answer in another, e.g.
<thinking>and<answer>tags, so you can hide the working from end users. The Claude prompt generator adds this for you.
Limits
A written chain of reasoning is not a guarantee: models can produce plausible-looking steps that still reach a wrong answer, so check the steps on anything important. And for models with built-in reasoning, keep prompts simple; they already think before answering.
See all the options side by side on prompt engineering techniques.
Questions
What is chain-of-thought prompting?
Chain-of-thought (CoT) prompting asks a model to write out intermediate reasoning steps before giving its final answer. It was introduced by Wei et al. (Google, 2022), who showed that including step-by-step reasoning in examples improved accuracy on arithmetic, commonsense and symbolic reasoning tasks.
What is zero-shot chain-of-thought?
Adding a phrase like “Let’s think step by step” without any worked examples. Kojima et al. (2022) found this simple addition substantially improved reasoning accuracy on several benchmarks.
Does chain-of-thought work with reasoning models?
Models with built-in reasoning (such as OpenAI’s o-series and GPT-5 thinking modes, or Claude with extended thinking) already reason internally. For them, OpenAI recommends simple, direct prompts; explicitly asking for step-by-step reasoning adds little.
When should I not use it?
For simple lookups, rewriting or creative tasks, step-by-step reasoning adds length and cost without improving the result. Use it for problems with several dependent steps.