Reasoning
Chain-of-Thought Prompting
Chain-of-thought (CoT) prompting is a technique where you get a language model to write out intermediate reasoning steps before it gives a final answer. Showing worked step-by-step examples, or simply asking the model to reason step by step, measurably improves accuracy on multi-step arithmetic, logic and planning problems.
- Best for
- Multi-step maths, logic and planning on non-reasoning models
- Difficulty
- Beginner
- Updated
What is Chain-of-Thought Prompting?
It works because a model produces text one token at a time. If it has to jump straight to “Answer: 463.68”, all the arithmetic happens in a single step. If it writes the intermediate values first, each step is conditioned on the previous one and is far easier to get right — and far easier for you to check.
There are two flavours. Few-shot CoT (the original) puts two or three solved examples with written reasoning in the prompt. Zero-shot CoT just adds an instruction such as “Let’s think step by step.” Both still matter for standard chat models. For dedicated reasoning models (OpenAI’s o-series and GPT-5 thinking modes, Claude with extended thinking, Gemini thinking models), the reasoning already happens internally, so the vendors’ own guidance is to state the problem clearly and adjust the reasoning-effort setting rather than ask for steps.
When to use it — and when not to
Use it when
- Word problems, pricing and finance calculations, unit conversions, scheduling and anything with several dependent steps.
- Logic puzzles, rule application (“does this claim meet policy section 4.2?”) and multi-hop questions.
- When you need an auditable answer: the steps let a human spot exactly where it went wrong.
- Smaller or cheaper models, where the gain is usually largest relative to cost.
Skip it when
- Dedicated reasoning models: asking them to “think step by step” is redundant and can make answers longer without making them better.
- Simple lookups, classification or rewriting — you pay for extra tokens and latency for no gain.
- When the explanation will be shown as the model’s true reasoning. Written CoT can be a plausible rationalisation rather than the actual cause of the answer.
Copyable template
[TASK OR QUESTION] Work through this step by step before answering: 1. Restate what is being asked and list the facts you are given. 2. Note anything unknown and any assumption you have to make (state it explicitly). 3. Solve it one step at a time, showing each calculation or inference. 4. Check the result against the original question and every constraint. Then give the final answer on its own line, starting with "Answer:".
The fixed “Answer:” line matters: your code (or your eye) can read the result without parsing the reasoning. For a few-shot version, put two solved examples in exactly this structure above the task.
Replace everything in [SQUARE BRACKETS] before you run it.
Worked example: A price rise that looks like a loss
A café owner asks a quick question that many people — and many models answering instantly — get wrong by intuition.
A café sells 140 coffees a day at £3.20. It raises the price by 15% and loses 10% of its daily sales. Is daily coffee revenue up or down, and by how much? Work through this step by step before answering, then give the final answer on its own line starting with "Answer:".
1. Current revenue: 140 × £3.20 = £448.00 2. New price: £3.20 × 1.15 = £3.68 3. New daily sales: 140 × 0.90 = 126 4. New revenue: 126 × £3.68 = £463.68 5. Check: 1.15 × 0.90 = 1.035, so revenue should rise 3.5%. £448 × 1.035 = £463.68 ✓ Answer: Revenue is up £15.68 a day (+3.5%).
Why it works: Every intermediate number is visible, the model checks itself with an independent calculation (step 5), and the answer line is trivial to extract.
Common mistakes
- Using it on reasoning models. They already reason before answering. Spend your words on the problem, constraints and output format instead, and raise the effort setting if you need more depth.
- No clean answer line. If the answer is buried in paragraph four, automated pipelines mis-parse it. Always end with a fixed, labelled line.
- Errors in your few-shot examples. The model copies your reasoning style, including your mistakes. Check every worked example by hand.
- Treating the steps as the true explanation. Research shows CoT text can rationalise an answer that was actually driven by something else, such as the order of options. Verify the answer, not just the story.
- Asking for steps on everything. On simple tasks CoT only adds cost and latency. Reserve it for problems with genuinely dependent steps.
Origin & sources
Introduced by Jason Wei and colleagues at Google in 2022, who showed that adding a few worked reasoning examples to the prompt sharply improved large models on arithmetic, commonsense and symbolic reasoning benchmarks. The same year Takeshi Kojima et al. showed the zero-shot version: just adding “Let’s think step by step” raised one model’s MultiArith accuracy from 17.7% to 78.7%. Turpin et al. (2023) later showed the written reasoning is not always a faithful account of why the model answered as it did.
- Wei et al. (2022), “Chain-of-Thought Prompting Elicits Reasoning in Large Language Models”, NeurIPS 2022 — arXiv:2201.11903
- Kojima et al. (2022), “Large Language Models are Zero-Shot Reasoners” — arXiv:2205.11916
- Turpin et al. (2023), “Language Models Don’t Always Say What They Think: Unfaithful Explanations in Chain-of-Thought Prompting” — arXiv:2305.04388
Try it on The Prompt Index
Frequently asked questions
What is chain-of-thought prompting in simple terms?
Asking an AI model to show its working, one step at a time, before it gives the final answer. Writing the steps out makes multi-step problems more accurate and lets you check where it went wrong.
Does “think step by step” still work in 2026?
On standard chat models, yes, for multi-step problems. On dedicated reasoning models it is unnecessary because they already reason internally; give them a clear problem statement and adjust the reasoning-effort setting instead.
What is the difference between zero-shot and few-shot chain-of-thought?
Zero-shot CoT just adds an instruction such as “Let’s think step by step.” Few-shot CoT includes two or three solved examples with written reasoning, which also teaches the model the exact format and level of detail you want.
Is the model’s chain of thought its real reasoning?
Not necessarily. Studies have shown written reasoning can be a plausible rationalisation of an answer that was influenced by other factors, so check the answer independently when it matters.