Chain-of-Thought prompting is the technique of asking an AI to show its reasoning step by step before giving a final answer. It sounds almost too simple — but it is one of the highest-impact improvements you can make to any prompt that involves logic, calculation, or multi-step decisions.
If you have ever asked an AI a maths question and gotten a confident wrong answer, you have experienced what happens when a model leaps straight to a conclusion. Large language models are extremely good at pattern-matching — but that same strength becomes a weakness when a problem actually requires careful step-by-step reasoning. The shortcut instinct fires and produces a plausible-sounding but incorrect result.
Chain-of-Thought (CoT) prompting was introduced in a landmark 2022 paper by Wei et al. at Google Brain. The insight was simple: if you ask a model to write down intermediate reasoning steps, accuracy on complex tasks jumps dramatically. In some benchmarks, adding "Let's think step by step." to a prompt improved accuracy from 18% to 79% on grade-school math problems.
We touched on CoT in Foundations Topic 4 (Zero-Shot, Few-Shot, Chain-of-Thought). This tutorial goes deeper — covering zero-shot CoT, few-shot CoT, self-ask variants, and when not to use it.
There are two main flavours of Chain-of-Thought prompting:
The mechanism is subtle but powerful. By generating intermediate tokens that represent reasoning steps, the model builds up context that influences later tokens. The reasoning acts as a scratchpad — it forces the model to slow down and commit to intermediate conclusions before reaching the final one.
Consider this prompt without any chain-of-thought instruction:
Without CoT
A shop sells apples for £0.40 each and oranges
for £0.60 each. Sara buys 7 apples and 4 oranges.
She pays with a £10 note. How much change does
she get?
The model often answers directly — and occasionally gets the arithmetic wrong, especially in more complex variants. Even when correct, there is no way to audit the reasoning.
With Zero-Shot CoT
A shop sells apples for £0.40 each and oranges
for £0.60 each. Sara buys 7 apples and 4 oranges.
She pays with a £10 note. How much change does
she get?
Think step by step before giving the final answer.
The model now writes: 7 apples × £0.40 = £2.80. 4 oranges × £0.60 = £2.40. Total = £5.20. Change = £10.00 − £5.20 = £4.80. Each step is checkable.
The magic phrase is simple. Any of these trigger chain-of-thought reasoning:
Think step by step.Let's reason through this carefully.Walk me through your reasoning before giving the final answer.Work this out step by step, then state the answer clearly at the end.Here is a richer real-world example — a business decision prompt:
You are a senior product manager. Our SaaS product has two pricing options:
Option A: £29/month, no contract, 3,000 monthly active users, 8% monthly churn.
Option B: £49/month, annual contract, 1,200 monthly active users, 2% monthly churn.
Which option generates more revenue after 12 months, assuming no new customers
are acquired in either scenario?
Think step by step. Show all calculations. Then give a clear recommendation.
A model given this prompt will compute monthly retention for both options, project user counts month by month, multiply by price, and sum the revenue — producing a transparent, auditable analysis rather than a gut-feel recommendation.
When you need consistent reasoning in a particular domain or format, provide worked examples where the reasoning is shown explicitly:
Answer each word problem by reasoning step by step,
then stating the answer on its own line starting with "Answer:".
---
Problem: A train travels at 80 km/h for 2.5 hours. How far does it go?
Reasoning: Distance = speed × time = 80 × 2.5 = 200 km.
Answer: 200 km
---
Problem: A recipe uses 3 eggs per batch and makes 24 cookies. How many eggs
are needed to make 84 cookies?
Reasoning: First find the ratio: 84 ÷ 24 = 3.5 batches.
Eggs needed = 3 × 3.5 = 10.5 eggs, so round up to 11 eggs.
Answer: 11 eggs
---
Problem: A cinema has 320 seats. It was 75% full on Friday and 90% full on
Saturday. How many more people attended on Saturday than Friday?
Reasoning:
The model follows the pattern: reason through each step, then output Answer: on its own line. This makes the output easy to parse programmatically.
| Task type | Use CoT? | Why |
|---|---|---|
| Multi-step maths / logic | Yes | Accuracy jumps significantly |
| Code debugging / analysis | Yes | Surfaces assumptions and checks |
| Complex scheduling or planning | Yes | Keeps the model on track |
| Simple translation | No | Adds tokens with no accuracy gain |
| Sentiment classification | No | Zero-shot is usually sufficient |
| Creative writing | Optional | Useful for plot logic, not prose style |
Note: Modern reasoning models (like OpenAI o1, o3, and Claude's extended thinking mode) perform CoT automatically and internally. Even so, explicitly requesting step-by-step reasoning in your prompt still helps — it signals to the model what type of task you expect, and it ensures the reasoning is surfaced in the response where you can read and verify it.
Take a maths or logic word problem — a real one from your work or studies. Run it twice: once with a plain request, once with "Think step by step before answering." Compare accuracy and the ability to spot any errors in the reasoning.
Build a few-shot CoT prompt for a classification task that matters to you — for example, classifying customer support tickets by urgency. Show two or three examples with explicit reasoning, then test it on five new cases. Does the consistency improve?
Try the "self-ask" variant: add the instruction "Before answering, write down the sub-questions you need to answer first, then answer each one in order." This is especially powerful for research and analysis tasks where the problem has many moving parts.
Sign in to join the discussion and post comments.
Sign inPrompt Engineering for Specific AI Tools
Tool-by-tool mastery — deep dives into ChatGPT, Claude, Gemini, GitHub Copilot, Midjourney, Stable Diffusion, and more. Learn the exact prompting techniques each platform rewards.
Prompt Engineering for Education & Learning
Use AI as your personal tutor. Learn how to study faster, create lesson plans, generate practice questions, master languages, and prepare for competitive exams with smart prompts.
Foundations of Prompt Engineering
The must-know basics of prompt engineering. Learn what prompts are, how AI models read them, and how to write clear instructions that get great results.
Prompt Engineering for Content & Copywriting
Write blogs, ads, emails, and social media content ten times faster with AI. 13 practical tutorials on prompt engineering for content creators and copywriters.
Prompt Engineering for Business & Productivity
Use AI to work smarter — automate tasks, make better decisions, and communicate professionally. 12 practical business prompt tutorials for professionals.
Prompt Engineering Projects & Real-World Applications
Twelve hands-on projects that turn prompt engineering theory into a portfolio. Build chatbots, content generators, RAG systems, and more.