Chain-of-Thought Prompting: How and When to Make AI Reason Step by Step
The technique that improves reasoning on hard tasks — plus when to use it, when to hide the reasoning, and when to skip it.
6 min read · Updated
Quick answer
Chain-of-thought prompting is a technique where you instruct an AI model to work through its reasoning step by step before giving a final answer. It measurably improves accuracy on maths, logic, planning, and other multi-step problems, because the model commits to intermediate steps instead of jumping to a conclusion. The simplest version is adding “think step by step”; more controlled versions ask the model to reason inside tags and then give the answer separately.
Ask a model a hard multi-step question and demand the answer immediately, and it will often guess. Ask it to reason step by step first, and accuracy jumps. That, in one sentence, is chain-of-thought prompting — one of the best-documented techniques in prompt engineering.
Why it works
A language model generates one token at a time, conditioning each on what came before. When you force it to produce intermediate reasoning, those steps become context the model can build on, rather than leaping straight to a conclusion it then has to justify. In effect, you give the model room to “work” before it commits.
How to do it
The simple version
Append a single instruction:
{your question}
Think step by step, then give your final answer.The controlled version
When you want the reasoning but not in the final output, separate them so you can show the user only the answer:
Reason through the problem inside <scratchpad></scratchpad>.
Then give only the final answer inside <answer></answer>.
Problem: {problem}This pairs especially well with Claude’s tag handling — see best Claude prompts.
The example-led version
Combine with few-shot: show one worked example that includes the reasoning, and the model will imitate both the reasoning style and the answer format.
When to use it — and when not to
- Use it for: arithmetic and maths, logic, planning, debugging, multi-criteria decisions, anything with intermediate steps.
- Skip it for: simple lookups, short factual answers, and creative tasks where step-by-step reasoning adds cost without improving the result.
Combining with other techniques
Chain-of-thought is strongest stacked with grounding (“reason only from the supplied text”) and self-critique (“check your reasoning for errors before answering”). See the full set in our prompt engineering techniques reference, and browse reasoning-heavy prompts that already apply it on GeraPrompts.
Frequently asked questions
- What is chain-of-thought prompting?
- Chain-of-thought prompting instructs an AI model to reason through a problem step by step before answering. By making the intermediate steps explicit, it improves accuracy on maths, logic, and multi-step tasks compared with asking for the answer directly.
- When should I use chain-of-thought prompting?
- Use it for tasks with multiple reasoning steps: arithmetic and maths, logic puzzles, planning, debugging, and any decision that depends on intermediate conclusions. For simple lookups or short factual answers it adds cost without benefit.
- Does chain-of-thought slow down or cost more?
- Yes — generating reasoning uses more tokens, so it costs and takes more. The trade-off is usually worth it for hard tasks. When you only want the final answer, ask the model to reason internally and return just the conclusion.
Put it into practice
GeraPrompts is a marketplace of vetted, benchmarked prompts you can run on any model — and where creators keep 85% of every sale.