All guides
BeginnerSelf-pacedFree GuideSection 12/50

Chain-of-Thought — Step-by-step reasoning

Explore generative AI through prompts, assistants, multimedia and response checking. Work through sections and exercises at your own pace.

💡

Free content, available without an account. Tools and models change: use the current model guide to check their versions. Models and sources

Section 10.2.4 : Chain-of-Thought — Step-by-step reasoning

🎯 Learning objective

Mastering Chain-of-Thought (CoT) prompting to obtain structured reasoning and more reliable answers on complex problems requiring multi-step thinking. This is the technique that has most improved LLM reasoning capabilities.


The problem: LLMs and reasoning

LLMs excel at text generation but struggle with problems requiring multi-step logical reasoning: calculations, problem-solving, comparative analyses, planning. Why? They predict the next token — they don't naturally "think" step by step. They "think while writing," not "think then write."

Chain-of-Thought prompting (Wei et al., Google Brain, 2022) solves this problem elegantly: by explicitly asking the model to show its reasoning before giving its answer, we force a decomposition that radically improves quality.

The 3 variants of Chain-of-Thought

1. Zero-shot CoT: the magic method (the simplest)

Simply add a "magic" phrase at the end of your prompt. This is the technique with the best effort/result ratio in all of prompt engineering.

Without CoT:

If a train leaves Paris at 2:00 PM at 300 km/h and another 
leaves Lyon (450 km from Paris) at 2:30 PM at 250 km/h toward Paris, 
what time do they cross?

→ "They cross at about 3:00 PM." (often wrong)

With CoT (zero-shot):

If a train leaves Paris at 2:00 PM at 300 km/h and another 
leaves Lyon (450 km from Paris) at 2:30 PM at 250 km/h toward Paris, 
what time do they cross?

Think step by step before giving your answer.

→ The model decomposes: 
  1. Train 1 position at 2:30 PM: 300 × 0.5 = 150 km from Paris
  2. Remaining distance between the two trains: 450 - 150 = 300 km
  3. Closing speed: 300 + 250 = 550 km/h
  4. Time to cross: 300 / 550 ≈ 0.545h ≈ 32 min 44 sec
  5. Crossing time: 2:30 PM + 32min44s ≈ 3:03 PM

CoT magic phrases (all work, choose the one that suits you):

PhraseToneRecommended usage
"Think step by step"NeutralGeneral usage
"Before answering, break down the problem"DirectiveComplex problems
"Show your complete reasoning"AcademicDetailed analyses
"Think out loud then conclude"NaturalBrainstorming
"Let's think step by step"English (original)The most effective in English
"First identify the data, then reason, then conclude"StructuredQuantitative problems

2. Few-shot CoT: reasoning guided by example

For recurring problems, provide examples with the complete reasoning:

Solve these SaaS pricing problems by showing your complete reasoning.

Problem: A SaaS at €49/month has 200 customers. If we increase 
the price by 20%, we lose 15% of customers. Should we increase?

Reasoning:
- Current revenue: 49 × 200 = €9,800/month
- New price: 49 × 1.2 = €58.8 → rounded to €59/month
- Remaining customers: 200 × 0.85 = 170 customers
- New revenue: 59 × 170 = €10,030/month
- Difference: +€230/month (+2.3%)
- But: 30 lost customers = 30 fewer contracts for the future
- Conclusion: YES financially in the short term, but evaluate 
  the impact on churn and word-of-mouth.

Problem: A freelancer charges €500/day and works 20 days/month.
An AI tool at €200/month saves them 2 days/month of billable work.
Should they adopt it?

Reasoning:

3. Structured CoT: imposing a reasoning structure

For complex analyses, impose the steps:

Analyze this investment decision following 
these 5 MANDATORY steps:

STEP 1 — DATA: List all quantitative data 
available in the problem.
STEP 2 — ASSUMPTIONS: Identify implicit assumptions 
and their credibility (strong/medium/weak).
STEP 3 — CALCULATIONS: Perform calculations step by step.
STEP 4 — ANALYSIS: Identify strengths and risks.
STEP 5 — CONCLUSION: Give your recommendation with 
confidence level (1-10).

[Investment description]

Professional applications of CoT

Business analysis

Our landing page conversion rate dropped from 3.2% to 1.8% this month.

Reason step by step to identify the causes:
1. Start with the most likely causes (traffic, offer, technical)
2. For each hypothesis, indicate how to verify it
3. Rank hypotheses by probability
4. Recommend 3 immediate actions in order of priority

Weighted decision-making

I need to choose between 3 AI providers for my company.
Reason step by step using a weighted decision matrix.

Criteria (with weights):
- Price (30%)
- Performance (25%)
- Customer support (20%)
- Ease of integration (15%)
- Scalability (10%)

Provider A: [details]
Provider B: [details]
Provider C: [details]

For each provider, rate each criterion from 1 to 10, 
then calculate the weighted score.

Estimation (Fermi technique)

Estimate the number of pizzas consumed in France per day.

Reason step by step with Fermi estimates:
1. French population
2. % who eat pizza in a given week
3. Average frequency
4. Distribution by day
5. Result with high/low range

2025-2026: native reasoning models

Reasoning models like o3, o4-mini (OpenAI), DeepSeek-R1, and Claude Opus 4.6 (extended thinking) integrate Chain-of-Thought natively. They "think" automatically before responding — you can even see their reasoning "scratchpad."

Practical impact: with these models, you no longer need to add "Think step by step" — they do it by default. However, explicit CoT remains useful for: (1) controlling the reasoning structure, (2) forcing a specific format, (3) using classic models (standard GPT-5, Claude Sonnet 4.6, Gemini 3.1 Flash).

When NOT to use CoT

SituationWhy CoT is unnecessary
Simple factual questions"What's the capital of Japan?" → no reasoning needed
Formatting tasks"Put this text in bullet points" → no reasoning required
Direct translationThe model translates better without decomposing
Free creative generationCoT can constrain creativity

Practical exercise

Duration: 15 minutes

  1. →Take a real professional problem (budget allocation, vendor selection, market size estimation)
  2. →Ask it without CoT → note the quality and depth
  3. →Add "Think step by step" → compare
  4. →Try structured CoT by imposing 5 steps → compare again
Quick Check

What improvement did Chain-of-Thought bring on the GSM8K math benchmark?

Quick Check

Models o3 (OpenAI) and Claude Opus 4.6 (extended thinking) integrate CoT natively. This means that:

Your progress

Progress is self-reported and stored in your browser. The final completion record is not a qualification or an independent assessment.

View progress and completion record

Learn AI, from prompts to agents

15 free guidesQuizzes, diagrams and workshopsNo account needed

One practical AI workflow in your inbox

Methods, resources and new exercises. Free, unsubscribe at any time.