Learning Outcome
4
Rewrite prompts with clear reasoning.
3
Know when CoT is useful.
2
Compare reasoning and direct answers.
1
Understand what Chain of Thought means.
Before learning about Chain of Thought Prompting,
let's quickly recall:
Role Playing and System Prompts – assigning the AI an identity shapes tone and perspective, while a systemprompt defines its overall behaviour throughout a conversation.
We know how to shape who the AI is when it answers, but how do we get it to actually reason through a complex problem, rather than jumping straight to a final answer?
Let's understand a technique that guides AI to think step by step.
The Detective Analogy
Imagine a detective investigating a robbery.
Chain of Thought Prompting works the same way, instead of jumping directly to a final answer, the AI is encouraged to work through the problem one logical step at a time.
The detective does not immediately accuse someone, instead they collect evidence, interview witnesses, analyse clues, eliminate suspects, and only then reach a conclusion. Every step builds on the previous one until the truth becomes clear.
Transition to Technical Concept
Think About It
Previously, we imagined a detective who collects evidence and reasons through clues step by step rather than immediately naming a suspect.
A teacher asks a student "What is 25 x 18?" One student replies "450," another shows the full working, 25 x 10 = 250, 25 x 8 = 200, 250 + 200 = 450. Which response would you trust more if you needed to check for mistakes?
Expected Answer: The one showing the working, since the reasoning can be verified step by step.
Exactly! That's the core idea behind Chain of Thought Prompting. Let's look at how to actually trigger this kind of reasoning in AI.
What is Chain of Thought Prompting?
Chain of Thought Prompting is a technique that encourages an AI model to solve a problem by reasoning through it step by step before giving the final answer.
Some questions are simple and need no reasoning,
"What is the capital of India?" can be answered immediately with "New Delhi."
It is especially useful for complex tasks where the reasoning process matters just as much as the result.
Without CoT vs With CoT
model.invoke("A shopkeeper buys a pen for Rs 20
and sells it for Rs 25. What is the profit?");
model.invoke(
"Solve this problem step by step: " +
"A shopkeeper buys a pen for Rs 20 and sells it for Rs 25. " +
"What is the profit?"
);The reasoning becomes visible, clear, and easy to verify.
How Does Chain of Thought Work?
Instead of asking "Explain why renewable energy is important," you ask "Explain step by step why renewable
energy is important."
Step 1: Explain what renewable energy is.
Step 2: Discuss environmental benefits.
Step 3: Explain economic benefits.
Step 4: Discuss long term sustainability.
Step 5: Give the conclusion.
Key Point: The response becomes far more organised and logical.
When Should We Use CoT?
Real Life Examples
Travel Planning: "Help me choose between Goa and Manali for a vacation. Compare the weather, budget,activities, and travel time before giving your recommendation." The AI compares each factor first and then recommends a destination.
Real Life Examples
Career Guidance: "Compare Data Science and Cybersecurity based on job opportunities, salary, required skills, and future demand before suggesting which field is better for a beginner." The AI analyses each criterion beforemaking a recommendation.
Simple Ways to Trigger CoT
You do not always need to mention "Chain of Thought" by name. Use phrases like:
These simple additions encourage the AI to reason in a structured and transparent way.
Think About This: Spotting the Better Prompt
Think About This: Spotting the Better Prompt
Each stronger prompt asks the AI to reason through multiple factors before arriving at a conclusion, rather than jumping straight to an answer.
An Easy Way to Remember
Think of climbing a staircase,
you cannot jump directly to the top floor, you climb Step 1, then Step 2, then Step 3,
until you finally reach the destination.
Each reasoning step is one stair, the final answer is the top floor.
This is Chain of Thought Prompting, one step at a time, all the way to the answer.
Daily Life Applications
Asking an AI to compare laptops based on processor, RAM, battery life, price, and upgrade options before recommending one, rather than just asking "Which laptop should I buy?"
Daily Life Applications
Requesting a step by step explanation of how a vaccine works, rather than a single paragraph summary.
Asking an AI to explain its reasoning before suggesting a business idea, so each step of the logic can be checked.
Summary
4
Use CoT only when reasoning is needed.
3
Simple prompts can trigger reasoning.
2
Best for complex problem solving.
1
AI reasons step by step before answering.
Quiz
Which prompt best demonstrates Chain of Thought Prompting?
A. "Which career should I choose?"
B. "Compare both careers before recommending one."
C. "Tell me about careers."
D. "Suggest a career."
Quiz-Answer
Which prompt best demonstrates Chain of Thought Prompting?
A. "Which career should I choose?"
B. "Compare both careers before recommending one."
C. "Tell me about careers."
D. "Suggest a career."