Chain-of-Thought Reasoning

Chain-of-thought prompting means asking the AI to show its work — to reason through a problem step by step instead of jumping straight to an answer. For anything that takes more than one mental hop (math, logic, planning), this simple habit dramatically improves accuracy.

Learn Chain-of-Thought Reasoning in our free Prompt Engineering course — a beginner-friendly interactive lesson with worked examples, a practice exercise and…

Part of the free Prompt Engineering course at LearnCodingFast — hands-on lessons with examples you run in your browser, plus practice exercises and a quick quiz.

Tools like ChatGPT, Claude, and Gemini are far more reliable when you let them think out loud. This lesson teaches you the magic phrases — and when to use them.

When a problem has several steps, an instant answer is a guess. Asking the model to reason step by step lets it build on each intermediate result. Same question, two prompts:

Demanding only the number invites a careless slip on a multi-step calculation.

Reasoning first, answer last — easy to check, far less likely to be wrong.

You don’t have to leave the decomposition to the AI. Listing the sub-tasks yourself produces more complete, better-organised answers:

Naming the steps gives the model a checklist — and gives you a structure you can correct one piece at a time.

Worried that step-by-step answers are too long? Ask for both. You get the accuracy of reasoning plus a clean conclusion you can copy:

This pattern is perfect when you want to trust the answer but also paste it somewhere clean.

📋 Copy-paste chain-of-thought template

⏱ Test Yourself — Timed Quiz

10 quick questions, 12 seconds each. Instant feedback — beat the clock!

Practice quiz

What does 'chain-of-thought' prompting ask the AI to do?

  • Answer faster
  • Use shorter words
  • Show its reasoning step by step
  • Skip the explanation

Answer: Show its reasoning step by step. Chain-of-thought means asking the model to reason through the steps, not just blurt an answer.

Which phrase triggers step-by-step reasoning most reliably?

  • 'let's think step by step'
  • 'be quick'
  • 'just the answer'
  • 'use big words'

Answer: 'let's think step by step'. Phrases like 'think step by step' nudge the model to lay out intermediate steps.

Why does showing the steps often improve accuracy on hard problems?

  • It makes the model run twice
  • It uses a different model
  • It is always slower so more careful
  • Breaking the problem into smaller steps reduces leaps and catches errors

Answer: Breaking the problem into smaller steps reduces leaps and catches errors. Working in small steps lets the model build on intermediate results instead of guessing the final answer.

For a tricky math word problem, the best instruction is…

  • 'give me the number only'
  • 'work through it step by step, then give the final answer'
  • 'guess'
  • 'use a calculator emoji'

Answer: 'work through it step by step, then give the final answer'. Reasoning first, then the final answer, tends to be more reliable on multi-step problems.

When is chain-of-thought LEAST necessary?

  • A simple lookup like 'what is the capital of France'
  • Multi-step logic puzzles
  • Planning a project
  • Debugging tangled logic

Answer: A simple lookup like 'what is the capital of France'. Trivial single-step facts don't need step-by-step reasoning; reserve it for multi-step problems.

What is a good way to break a big request into steps?

  • Ask for everything at once with no structure
  • Use only one word
  • List the sub-tasks and ask the AI to handle them in order
  • Forbid any explanation

Answer: List the sub-tasks and ask the AI to handle them in order. Decomposing into ordered sub-tasks helps the model and you follow the logic.

If you want reasoning but a short final answer, you can…

  • Not possible
  • Say 'reason step by step, then give just the final answer on the last line'
  • Only get one or the other
  • Use all caps

Answer: Say 'reason step by step, then give just the final answer on the last line'. You can ask for visible reasoning plus a clearly separated final answer.

Asking 'explain your reasoning' is useful because…

  • It wastes tokens
  • It changes the model
  • It hides mistakes
  • You can spot where the logic went wrong and correct it

Answer: You can spot where the logic went wrong and correct it. Visible reasoning makes errors easy to catch and correct in a follow-up.

Which prompt best decomposes a planning task?

  • 'plan my trip'
  • 'Plan my trip in steps: 1) pick dates 2) budget 3) flights 4) hotels — do each in order'
  • 'trip???'
  • 'make it good'

Answer: 'Plan my trip in steps: 1) pick dates 2) budget 3) flights 4) hotels — do each in order'. Naming the ordered steps guides a structured, complete response.

A risk of forcing long reasoning on a simple question is…

  • Always better
  • It breaks the AI
  • Slower, wordier answers when a direct reply would do
  • Nothing ever

Answer: Slower, wordier answers when a direct reply would do. Use step-by-step reasoning where it helps; for simple facts it just adds noise.