Skip to main content
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

Prompt:
Output:
Incorrect - No reasoning shown, wrong answer

Few-Shot CoT Pattern

Provide examples that demonstrate step-by-step reasoning.

Basic Few-Shot CoT

Output:
Pro Tip: Include 1-3 examples with complete reasoning chains. More examples improve performance but use more tokens.

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

That’s it! This simple phrase activates reasoning capabilities.

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

Output:

CoT Across Different Tasks

Arithmetic Problems

Output:

Commonsense Reasoning

Output:

Symbolic Reasoning

Output:

Word Problems with Multiple Steps

Output:

When CoT Helps Most

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?”
Best for: Problems where the obvious answer is wrongExample: “A bat and ball cost 1.10total.Thebatcosts1.10 total. The bat costs 1 more than the ball. How much does the ball cost?”
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?”
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.
Example:

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

Pitfall 1: Skipping CoT for Simple ProblemsDon’t use CoT for trivial questions like “What is 2+2?” It adds unnecessary overhead.Use CoT when: The problem requires 2+ steps or non-obvious reasoning
Pitfall 2: Vague Reasoning StepsBad: “Then we calculate the result”
Good: “Then we multiply 5 × 3 = 15”
Be specific in each step.
Pitfall 3: Not Checking the Final AnswerAlways include a clear final answer statement: “The answer is: [ANSWER]“

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?”

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?”

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?”

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