Lesson 1

Chain of Thought

Think step by step

Chain of Thought — Step-by-Step Reasoning

🔗 Chain of Thought (CoT) — a technique where the model "thinks out loud" step by step. This helps solve complex problems more accurately!

Choose a problem:
Question:

Mary had 5 apples. She gave 2 to Pete, then bought 3 more. How many apples does Mary have?

Direct answer (no CoT)

6 apples

🔗With Chain of Thought
👆 Click "Play" to see the chain of thought

How to write CoT prompts:

1. Zero-shot CoT (simplest way)

Just add the magic phrase at the end of your prompt, and the model will start reasoning step by step

Prompt example:
Solve this problem:

Mary had 5 apples. She gave 2 to Pete, then bought 3 more. How many apples does Mary have?

Let's think step by step.

2. Explicit CoT (with structure)

Provide explicit reasoning structure with numbered steps

Prompt example:
Task: A train travels at 60 km/h. How long will it take to travel 180 km if it stops for 15 minutes every 60 km?

Think step by step:
1. First determine pure travel time
2. Then calculate number of stops
3. Calculate total stop time
4. Add travel time and stop time

Give the final answer.

3. CoT with output format

Specify format to separate reasoning from final answer

Prompt example:
Task: A class has 30 students. 40% are boys. How many boys are present if 3 are absent?

Reason like this:
<thinking>
[your step-by-step reasoning here]
</thinking>

<answer>
[final brief answer here]
</answer>
Key Insight

CoT works because it forces the model to "show its work" — intermediate steps help avoid errors in complex reasoning. Especially useful for math, logic, and multi-step problems.

Try it yourself5 examples