StudyAIStudyAI
Pro
Lesson 48 min

Chain-of-Thought

Ask the model to reason step by step for harder problems.

What you will learn
  • What chain-of-thought prompting is
  • When it helps (and when it is overkill)
  • How to combine it with format instructions

Explanation

For multi-step problems — maths, logic, planning — asking the model to reason step by step before answering improves accuracy. The phrase 'Let's work through this step by step' is a classic trigger.

The idea is that forcing intermediate steps gives the model 'room to think', reducing careless jumps to a wrong final answer.

For simple lookups it is unnecessary and just adds length. A practical combo: ask it to reason, then give the final answer in a clearly labelled, structured format.

Code Example

text
1
Question: A shirt is $40 with a 25% discount, then 8% tax.
2
Think step by step, then give the final price as 'Total: $X'.
Real-world use

Analysts use chain-of-thought to make models show their working, which makes answers easier to trust and check.

Common mistakes
  • Using chain-of-thought for trivial questions, which wastes tokens and time.
Practice

Give the model a word problem twice — once plainly, once with 'think step by step' — and compare the answers.

Knowledge check
0/1 answered

1. Chain-of-thought prompting helps most with...

Answer all questions to check.