Chain-of-thought prompting
Chain-of-thought prompting asks the model to work through its reasoning step by step before giving a final answer, rather than jumping straight to a conclusion. On multi-step problems, that simple instruction often turns a wrong answer into a right one.
The technique has changed shape recently. The newest reasoning models do a lot of this internally, so the explicit "think step by step" trick matters less for them than it once did. Knowing when it still earns its keep is the useful part.
Last reviewed
How does chain-of-thought prompting work?
Chain-of-thought works by adding one instruction that asks the model to show its working before it commits to an answer. The classic phrasing is "Let's think step by step", but anything that invites intermediate reasoning works: "Walk through this one step at a time before answering" or "Show your reasoning, then give the final answer."
The gain comes from the model committing to intermediate steps it can build on, instead of guessing a final answer in one leap. It is the difference between doing arithmetic on paper and doing it in your head.
A shop sells pens at 3 for 2 GBP. How much for 17 pens?
A shop sells pens at 3 for 2 GBP. Work through this step by step, then give the total for 17 pens.
What is the difference between zero-shot and few-shot chain-of-thought?
Zero-shot chain-of-thought is the one-liner above: you just ask for step-by-step reasoning. Few-shot chain-of-thought goes further by showing the model one or two fully worked examples, reasoning included, before posing your actual question. The worked examples teach the model the style and depth of reasoning you want.
Few-shot is more powerful and more expensive in tokens. Use zero-shot first; reach for few-shot when the zero-shot reasoning is shallow or skips the steps that matter for your problem.
When does chain-of-thought help?
Chain-of-thought earns its keep on problems with several dependent steps, where an early mistake wrecks the final answer.
- Arithmetic and word problems with multiple operations.
- Logic puzzles and constraint satisfaction.
- Multi-hop questions that require combining several facts.
- Decisions with trade-offs where you want the reasoning visible so you can check it.
- Debugging, where the value is in the diagnosis as much as the fix.
When should you skip chain-of-thought?
Skip it for simple lookups, single-step tasks, and creative writing, where asking for step-by-step reasoning adds latency and tokens without improving the answer, and can make the output clumsier. It can also pad responses you wanted to be tight.
There is a second consideration now. Dedicated reasoning models already reason internally before they answer, so explicitly instructing them to think step by step is often redundant and occasionally counterproductive. For those models, ask for the depth of answer you want and let them handle the reasoning. Save explicit chain-of-thought for standard, non-reasoning models on genuinely multi-step problems.
How do you get a clean final answer?
Tell the model exactly where to put the final answer. Chain-of-thought produces a lot of intermediate text, so ask it to reason first and then end with the answer on its own line, or under a heading like "Final answer", where you can find it without reading the whole trace.
Solve the problem below. First reason through it step by step. Then, on a new line beginning with "Answer:", give only the final result.
Key takeaways
- Chain-of-thought asks the model to reason step by step before answering, which lifts accuracy on multi-step problems.
- Zero-shot is a single instruction; few-shot adds fully worked examples and is stronger but costs more tokens.
- It helps on maths, logic, multi-hop questions, and debugging; it adds noise to simple or creative tasks.
- Modern reasoning models do this internally, so explicit chain-of-thought matters most for standard models.
See how your prompt scores
Paste any prompt into the free Promptrace scorer and get an instant breakdown across all seven dimensions. No signup.
Open the prompt scorer →Frequently asked questions
What is chain-of-thought prompting?
Chain-of-thought prompting is a technique where you ask a model to work through its reasoning step by step before giving a final answer. Committing to intermediate steps improves accuracy on problems that have several dependent parts, such as maths or logic.
Does chain-of-thought still work with reasoning models?
Reasoning models already reason internally before they respond, so an explicit instruction to think step by step is usually redundant for them and can occasionally hurt. Chain-of-thought is most useful with standard, non-reasoning models on multi-step problems.
What is the difference between zero-shot and few-shot chain-of-thought?
Zero-shot chain-of-thought simply asks the model to reason step by step. Few-shot chain-of-thought also shows one or two fully worked examples, reasoning included, before your real question, which teaches the model the style and depth of reasoning you want.
Sources and further reading
Related guides
Few-shot prompting
Show the model one or two worked examples of what good looks like. The most reliable steering technique.
FundamentalsZero-shot vs few-shot
What the terms mean, and a simple rule for deciding how many examples to include.
FrameworksRACE
Role, Action, Context, Expectation. The four-part framework Promptrace is named after.