Learn Prompting 101 Chain-of-Thought Prompting

Chain-of-Thought Prompting

Beginner 🕐 13 min Lesson 9 of 10
What you'll learn
  • Understand what chain-of-thought prompting is and why it improves reasoning tasks
  • Use the trigger phrase 'think step by step' to activate chain-of-thought
  • Identify which types of tasks benefit most from chain-of-thought
  • Ask AI to show its working for auditable, checkable reasoning
  • Combine chain-of-thought with structured format instructions for complex analysis

When Answers Alone Are Not Enough

For simple factual questions, you want a direct answer. "What is the capital of France?" does not need to be reasoned through step by step. But for complex problems — decisions with multiple factors, multi-step calculations, logical analysis, planning — the AI performs significantly better when it is asked to think out loud rather than jump straight to a conclusion.

This technique is called chain-of-thought prompting, and it is one of the most well-researched improvements in prompting practice. The core idea is simple: ask the AI to show its reasoning, not just its answer.

The Magic Phrase

The most commonly used chain-of-thought trigger is simply:

"Think step by step."

That is it. Add those four words to almost any reasoning-heavy prompt and the quality of the output improves measurably — especially for tasks involving logic, maths, or multi-step analysis.

Why does it work? When the AI generates its reasoning in sequence, each step informs the next. Errors that would go unnoticed in a direct answer become visible mid-chain, allowing the AI to self-correct. The process of articulating reasoning also constrains the AI away from plausible-but-wrong shortcuts.

When to Use Chain-of-Thought

Chain-of-thought is most valuable for tasks that involve:

  • Multi-step reasoning — logic puzzles, debugging, root cause analysis
  • Decision-making — weighing trade-offs between multiple options
  • Mathematical problems — any calculation with more than one step
  • Planning — sequencing tasks, identifying dependencies
  • Analysis — interpreting data, evaluating arguments, critiquing work

You do not need it for simple lookups, writing tasks, or straightforward instructions. Use it when the quality of the reasoning process matters as much as the final answer.

Practical Examples

Here is the same request with and without chain-of-thought:

Without:

"Should I hire a full-time developer or use a freelancer for this project?"

With:

"I need to decide whether to hire a full-time developer or use a freelancer for a six-month e-commerce project. Budget is £40,000 total. Timeline is fixed. The codebase is straightforward and well-documented. Think step by step through the trade-offs and give me a recommendation."

The second prompt will walk through cost analysis, risk factors, timeline implications, and ongoing maintenance before arriving at a recommendation — making the reasoning auditable and the conclusion more trustworthy.

Asking AI to Show Its Work

Related to chain-of-thought is explicitly asking the AI to show its work — particularly useful for calculations or structured analysis:

  • "Show your working."
  • "Explain your reasoning at each step."
  • "Walk me through how you reached that conclusion."

This serves a dual purpose: it produces a better answer, and it lets you check the reasoning. If a step is wrong, you can spot it and correct it — something you cannot do when you only see the final output.

Structured Chain-of-Thought

For complex decisions, you can guide the reasoning process more explicitly by providing a structure:

"Analyse this business decision using the following steps: (1) List the key factors at play. (2) Identify the risks for each option. (3) Weigh which factors matter most given our situation. (4) Give a clear recommendation with your reasoning."

This structured version combines chain-of-thought with format instructions — you get organised reasoning in a predictable format that is easy to review and act on.

A Note on Length

Chain-of-thought prompting produces longer output. The AI writes out its reasoning in full, which takes space. This is a feature, not a bug — for complex decisions, you want to see the thinking. But for tasks where accuracy matters less than brevity, skip chain-of-thought and ask for the direct answer. Use it intentionally, where the reasoning itself is valuable.

Key takeaways
  • 'Think step by step' is the most reliable chain-of-thought trigger
  • Chain-of-thought works best for multi-step reasoning, decisions, maths, and analysis
  • Showing work makes reasoning auditable — you can catch errors mid-chain
  • Structured prompts (step 1, step 2...) combine chain-of-thought with format control
  • Chain-of-thought produces longer output — use it intentionally where reasoning matters