Duration: 75 minutes
Introduction
In 2022, researchers discovered something remarkable: simply asking an LLM to “think step-by-step” dramatically improved its reasoning abilities. This breakthrough, called Chain of Thought (CoT) prompting, transformed how we approach complex reasoning tasks. In this lesson, you’ll learn why CoT works and how to apply it effectively.The CoT Breakthrough
Research Impact: Wei et al.’s 2022 paper “Chain-of-Thought Prompting Elicits Reasoning in Large Language Models” showed that CoT improved accuracy on math word problems from 17% to 58% on some benchmarks.
Why CoT Works
Chain of Thought prompting works because it:Decomposition
Breaks complex problems into manageable steps
Error Correction
Allows the model to catch and fix mistakes mid-reasoning
Transparency
Makes the reasoning process visible and verifiable
Working Memory
Provides space to track intermediate results
Before vs. After CoT
- Without CoT
- With CoT
Prompt:Output:❌ Incorrect - No reasoning shown, wrong answer
Few-Shot CoT Pattern
Provide examples that demonstrate step-by-step reasoning.Basic Few-Shot CoT
Multi-Domain Few-Shot CoT
Show CoT works across different problem types.Zero-Shot CoT: The Magic Phrase
The simplest and most powerful CoT technique.The Basic Pattern
Variations That Work
Different phrasings that trigger CoT reasoning:Research Finding: “Let’s think step-by-step” is the most consistently effective phrase across different models and tasks.
Zero-Shot CoT in Action
CoT Across Different Tasks
Arithmetic Problems
Commonsense Reasoning
Symbolic Reasoning
Word Problems with Multiple Steps
When CoT Helps Most
Multi-Step Problems
Multi-Step Problems
Best for: Problems requiring 2+ intermediate calculations or logical stepsExample: “If a car travels 60 mph for 2 hours, then 80 mph for 3 hours, what’s the average speed?”
Counter-Intuitive Problems
Counter-Intuitive Problems
Best for: Problems where the obvious answer is wrongExample: “A bat and ball cost 1 more than the ball. How much does the ball cost?”
Problems Requiring Tracking
Problems Requiring Tracking
Best for: Scenarios where you need to track changing statesExample: “John has 5 apples. He gives 2 to Mary, who gives 1 to Tom. Tom gives 1 back to John. How many does each person have?”
Logical Reasoning
Logical Reasoning
Best for: Deductive or inductive reasoning tasksExample: “All birds can fly. Penguins are birds. Can penguins fly?” (Requires recognizing the faulty premise)
Advanced CoT Patterns
CoT with Verification
Add a verification step to catch errors.CoT with Explicit Sub-Goals
Break the problem into clear sub-goals.CoT with Alternative Approaches
Consider multiple solution paths.Best Practices
Be Explicit
Use clear trigger phrases like “Let’s think step-by-step”
Show All Steps
Don’t skip intermediate calculations or logical steps
Label Steps
Number or label steps for clarity
Verify When Critical
Add verification for high-stakes problems
Common Pitfalls
Practice Exercises
Exercise 1: Math Word Problem
Apply CoT to this problem: “A store has a sale: Buy 2 items, get 25% off the total. Buy 4+ items, get 40% off. If shirts cost $20 each, how much do 5 shirts cost?”Sample Solution
Sample Solution
Exercise 2: Logic Problem
Use CoT for this reasoning task: “In a family of 5, there are 2 parents and 3 children. The oldest child is twice the age of the youngest. The middle child is 3 years older than the youngest. If the youngest is 5, what is the total age of all children?”Sample Solution
Sample Solution
Exercise 3: Commonsense Reasoning
Apply CoT to this scenario: “You have a 3-gallon jug and a 5-gallon jug. How can you measure exactly 4 gallons of water?”Sample Solution
Sample Solution
Real-World Application: Math Tutor System
Build a complete math tutoring system using CoT:Key Takeaways
Use “Let’s think step-by-step” to activate CoT reasoning
Show all intermediate steps explicitly
CoT improves accuracy by 30-50% on reasoning tasks
Works across math, logic, and commonsense reasoning
Add verification steps for critical problems
Label and number steps for clarity
Next Steps
You’ve mastered Chain of Thought prompting. Now learn to decompose even more complex problems into manageable sub-problems.Next: Lesson 3.2 - Problem Decomposition
Break complex problems into solvable pieces