Chain-of-thought prompting: make the model show its reasoning

How to elicit step-by-step reasoning to improve accuracy on complex tasks.

Last updated: · Markdown version

When it helps

  • Multi-step math, logic, or planning where errors compound.
  • Any task where intermediate steps matter, not just the final answer.
  • Debugging decisions: seeing the chain lets you spot exactly where reasoning broke.

How to trigger it

  • Add 'Think step by step before answering.' to any prompt.
  • Or ask for a scratchpad: 'First, reason through it. Then give the final answer.'
  • For structured output, separate the reasoning block from the answer block with tags.
  • Ask it to check its own reasoning before committing to the answer.

Before → after: a multi-step problem

  • Before: "A subscription costs 12 per month with a 25% discount on annual billing. Is annual cheaper over 18 months?" The model may answer in one hop and slip on the arithmetic.
  • After: "...Work through it step by step inside <reasoning>: price per month, annual price after discount, cost of each option over 18 months. Then give only the comparison inside <answer>. Re-check the arithmetic before answering."
  • What changed: the intermediate quantities are computed explicitly and the answer is kept apart from the working, so errors are visible and the answer is easy to read.

When not to use it

  • Simple lookups, classification and rewriting rarely benefit: the steps add length and cost without improving the answer.
  • Models that reason internally often need no 'think step by step' instruction, and heavy process instructions can interfere. Check the provider's guidance and the guide on reasoning models.
  • Do not treat the written reasoning as a faithful trace of what the model computed. It is useful for spotting mistakes, not a guarantee of correctness: verify the final answer independently when it matters.

Templates

Step-by-step reasoning (general)

Problem: [describe the task or question]

Think step by step:
1. Restate what is being asked.
2. Identify what information is known vs. what is missing.
3. Work through the logic in small steps.
4. State your conclusion.

Format:
<reasoning>
[steps here]
</reasoning>
<answer>
[final answer only]
</answer>
Opens the analyzer with the prompt prefilled.
Open in Promptea

Decision audit (spot the error)

Review this decision chain and find the first point where the reasoning breaks down.

Decision:
"""[paste reasoning or plan]"""

Do this:
1. Restate each step in one sentence.
2. Mark the first step you believe is wrong or unsupported.
3. Explain why and propose a fix.
Opens the analyzer with the prompt prefilled.
Open in Promptea

FAQ

Does chain-of-thought always help?
No. For simple tasks it adds noise and wastes tokens. Use it for tasks with multiple logical steps where order matters.
What if I need a short final answer?
Separate reasoning from the answer with tags or sections. Ask for the reasoning first, then a single-sentence conclusion.
Should I show the reasoning to my users?
Usually not. Keep reasoning and answer in separate blocks, show only the answer, and use the reasoning for debugging and review.
Is chain-of-thought the same as prompt chaining?
No. Chain-of-thought happens inside one response; prompt chaining splits a task across several requests that you control. See the prompt chaining guide.