DX Heroes logo
#ai
#prompting

What is chain-of-thought prompting?

Length: 

3 min

Published: 

June 9, 2026

What is chain-of-thought prompting?

What is chain-of-thought prompting?

Chain-of-thought prompting is a technique where you ask the model to reason through a problem in steps before it commits to an answer. Instead of jumping straight to a result, it writes out the intermediate steps, and that visible reasoning leads to a better final answer on tasks that involve logic, maths, or multiple conditions.

The trigger can be as simple as adding "think step by step" to your prompt. The model then lays out its working, and the act of working through it tends to catch the mistakes a quick guess would miss.

In plain words

Think of a maths problem. Ask someone for the answer instantly and they might blurt out a wrong number. Ask them to show their working and they slow down, check each step, and usually get it right. Chain-of-thought prompting is telling the model to show its working.

When to use it

  • Multi-step reasoning. Word problems, calculations, or anything where the answer depends on a chain of conditions.
  • Decisions with tradeoffs. When the model has to weigh several factors, seeing the reasoning helps it balance them and helps you check its logic.
  • Debugging the model's answers. When a model gets something wrong, the visible steps show you where the reasoning broke, so you can fix the prompt.
  • Tasks where you need to trust the result. Showing the steps makes the answer auditable instead of a black box you have to take on faith.

Common pitfalls

  • Using it everywhere. For simple lookups or formatting, the extra reasoning just adds cost and latency without improving anything. Save it for problems that need thinking.
  • Trusting the explanation blindly. The written reasoning can sound convincing and still be wrong. It reflects how the model arrived at an answer, but it is not proof the answer is correct.
  • Cost and length. Reasoning out loud uses more tokens and takes longer. On high-volume tasks that adds up.
  • Forgetting newer models reason by default. Some current models think internally before answering, so an explicit "step by step" instruction matters less. Test whether it actually helps for your model and task.

Related articles:

  • What is prompt engineering? - The broader discipline that chain-of-thought is one technique within.
  • What is few-shot prompting? - A complementary technique: showing examples rather than asking for reasoning.
  • What is an LLM? - The kind of model you are prompting, and why showing steps changes its output.

Want to stay one step ahead?

Don't miss our best insights. No spam, just practical analyses, invitations to exclusive events, and podcast summaries delivered straight to your inbox.