Chain-of-Thought Prompting

What Is Chain-of-Thought Prompting?

Chain-of-thought prompting instructs the model to reason through a problem step by step before giving a final answer. A single instruction transforms a direct question into an explicit reasoning process.

Direct question

"What is 15% of 240?"

The model generates an answer in one step. For multi-step math, it often makes arithmetic errors that are invisible in the output.

With chain-of-thought

"Think through this step by step. What is 15% of 240?"

The model first writes: "15% = 15/100 = 0.15. 0.15 × 240 = 36." Then gives: 36. Each step feeds the next.

Why It Works

The Mechanism

When a model generates an answer directly, it makes a single forward pass and produces the most statistically likely response for the whole answer at once. For multi-step problems, this often fails — the correct final answer requires correct intermediate steps, and the model has no working memory to verify them.

When you ask for step-by-step reasoning, the intermediate steps appear as tokens in the context. Each step is visible and informs the next. The model is doing the work out loud — and visible work is self-correcting in a way that hidden work is not.

Where It Helps Most
  • Math problems — arithmetic, percentages, multi-step calculations
  • Multi-step logic — if-then chains, deduction, constraint satisfaction
  • Analytical reasoning — comparing options, evaluating tradeoffs
  • Information synthesis — tasks that require combining multiple pieces of context

Techniques

01

Simple instruction — "Think step by step before answering." — the most basic form; works well for most analytical tasks with minimal prompt overhead

02

Explicit reasoning request — "Show your reasoning before giving the final answer." — useful when you need to inspect or verify the logic, not just the conclusion

03

Few-shot chain-of-thought — provide examples that show the full step-by-step reasoning process, not just the final answer; the model learns to follow that structure

04

Self-check instruction — "After reasoning through the problem, check your answer before responding." — adds a verification step that catches errors in the generated reasoning

Few-Shot Chain-of-Thought Example

Input: A train travels 60 km/h for 2 hours. How far does it go?
Reasoning: Distance = speed × time. Speed = 60 km/h. Time = 2 hours. Distance = 60 × 2 = 120 km.
Answer: 120 km.

Input: [Your question here]
Reasoning: [Model fills this in]
Answer: [Model fills this in]

When to Use Chain-of-Thought

Use it when

The task requires more than one reasoning step.

The final answer depends on intermediate calculations or logical deductions.

The model produces consistently wrong or inconsistent answers on direct prompting.

You need to inspect or verify the reasoning, not just accept the answer.

Skip it when

The task is a simple factual lookup — no reasoning chain needed.

The task is format transformation: translation, rewriting, classification.

Latency is critical and the task does not benefit from step-by-step reasoning.

Limitations

What Chain-of-Thought Does Not Guarantee

Chain-of-thought generates more tokens — it increases latency and cost. The intermediate steps are generated by the same model, so a flawed reasoning step leads to a flawed conclusion. The model can generate plausible-sounding but logically incorrect reasoning chains. Asking the model to think step by step makes errors visible, but does not prevent them. For high-stakes reasoning, always verify the intermediate steps, not just the final answer.

Summary

Key Takeaways
  • Chain-of-thought prompting asks the model to reason step by step before giving a final answer
  • Intermediate reasoning tokens appear in context and inform subsequent tokens — making reasoning visible and self-correcting
  • Dramatically improves accuracy on math, multi-step logic, and analytical reasoning
  • Techniques: simple instruction, explicit reasoning request, few-shot chain-of-thought, self-check
  • Chain-of-thought adds tokens and latency — use it when accuracy matters more than speed
  • It makes errors visible but does not prevent them — incorrect reasoning chains are still possible

Need Help?

Ask the AI if you need help understanding chain-of-thought prompting, why step-by-step reasoning improves accuracy, which technique to use for a specific task, or what the limitations of chain-of-thought are in practice.