Chain of Thought Prompting — Get Better AI Reasoning

Last updated: June 23, 2026 · 10 min read

Chain of thought prompting is one of the most powerful techniques for improving AI reasoning. By asking the model to "think step by step," you can dramatically improve accuracy on complex tasks.

What is Chain of Thought?

Chain of Thought (CoT) prompting is a technique where you instruct an AI language model to show its reasoning process step by step before arriving at a final answer. Instead of jumping directly to a conclusion, the model breaks down the problem and thinks through each step sequentially.

The concept was introduced in a 2022 Google Research paper titled "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models." The researchers found that simply asking models to reason step by step significantly improved their performance on math, logic, and commonsense reasoning tasks.

Here's a simple illustration:

Without CoT: "What is 15% of 80?" → "12"
With CoT: "What is 15% of 80? Think step by step." → "First, 10% of 80 is 8. Then, 5% of 80 is half of 10%, which is 4. So 15% of 80 is 8 + 4 = 12."

The final answer is the same, but the reasoning process makes the model's thinking transparent and, more importantly, more accurate for complex problems.

Why CoT Works

Understanding why CoT works helps you use it more effectively.

Decomposition of Complex Problems

Language models process information in a single forward pass — they don't naturally "think" through problems sequentially. CoT forces the model to decompose complex problems into smaller, manageable steps. Each step becomes a simpler sub-problem that the model can handle more reliably.

Working Memory Emulation

Humans have working memory that lets us hold intermediate results while solving problems. LLMs don't have this — they generate one token at a time. By writing down intermediate steps, CoT effectively creates an external working memory that the model can reference.

Error Detection

When reasoning is explicit, both the model and the human can spot errors. If a model makes a mistake in step 2 of a 5-step solution, the error is visible and can be corrected. Without CoT, errors are hidden in the model's internal processing.

Better Calibration

CoT helps models "calibrate" their confidence. When forced to reason explicitly, models are less likely to make confident but wrong assertions. The act of explaining reasoning naturally leads to more careful, accurate outputs.

Zero-Shot CoT

Zero-shot CoT is the simplest form — you just add "Think step by step" (or similar phrases) to your prompt without providing any examples.

How to Use It

Append a reasoning instruction to your prompt:

"[Your question or task]
Think step by step."

Alternative phrases that work:

Example

"A farmer has 17 sheep. All but 9 die. How many are left? Think step by step."

Without CoT: The model might say "8" (17 - 9), which is wrong.
With CoT: The model reasons: "All but 9 die means 9 survive. So 9 sheep are left."

Effectiveness

Zero-shot CoT is surprisingly effective for many tasks. Research shows it improves accuracy by 10-40% on reasoning benchmarks, depending on the task and model. It's the easiest CoT technique to implement — just add one sentence to your prompt.

Few-Shot CoT

Few-shot CoT provides examples of step-by-step reasoning before asking the model to solve a new problem. This is more reliable than zero-shot CoT for complex tasks.

How to Use It

Include 2-5 examples with explicit reasoning chains:

"Solve each problem step by step.

Problem: A store sells apples for $2 each. If you buy 5, you get 10% off. How much do 5 apples cost?
Reasoning: First, the regular price for 5 apples is 5 × $2 = $10. Then, 10% off means $10 × 0.9 = $9. So 5 apples cost $9.
Answer: $9

Problem: A train travels 60 mph for 2.5 hours. How far does it go?
Reasoning: Distance = speed × time. So 60 mph × 2.5 hours = 150 miles.
Answer: 150 miles

Problem: [Your new problem]
Reasoning:"

Tips for Effective Few-Shot CoT

Practical Examples

Here are real-world examples of CoT prompting across different domains.

Math Word Problems

"A coffee shop sells lattes for $4.50 and cappuccinos for $3.75. On Monday, they sold 40 lattes and 25 cappuccinos. On Tuesday, they sold 30 lattes and 35 cappuccinos. What was the total revenue for both days? Think step by step."

Logic Puzzles

"Three friends — Alice, Bob, and Carol — each have a different pet (cat, dog, fish). Alice doesn't have the cat. Bob has the dog. Who has the fish? Think step by step."

Code Debugging

"This Python function should return the sum of all even numbers in a list, but it's returning wrong results. Debug it step by step:
def sum_even(nums): return sum(n for n in nums if n % 2 == 0)"

Business Analysis

"A SaaS company has 1000 customers paying $50/month. Their churn rate is 5% monthly. They acquire 50 new customers per month. Will they have more or fewer customers after 6 months? Think through this step by step."

Causal Reasoning

"A company's sales dropped 20% in Q3. They launched a new product in Q2, hired 10 new salespeople in Q1, and a competitor lowered prices in Q3. Analyze the likely causes step by step."

When to Use CoT

CoT is powerful but not always necessary. Here's when to use it.

Use CoT When:

Skip CoT When:

For simple tasks, CoT adds unnecessary verbosity without improving quality. Use it when the task genuinely requires reasoning.

Limitations

CoT isn't perfect. Understanding its limitations helps you use it effectively.

Increased Token Usage

CoT responses are longer, which means higher API costs and slower responses. For simple tasks, this overhead isn't worth it.

Reasoning Errors

CoT doesn't guarantee correct reasoning. Models can still make logical errors, especially in steps that require precise calculation or specialized knowledge. The reasoning chain might sound convincing but contain subtle mistakes.

Model Size Matters

CoT works best with larger, more capable models (GPT-4, Claude, Gemini Ultra). Smaller models may produce unreliable or nonsensical reasoning chains. If you're using a smaller model, test CoT effectiveness before relying on it.

Not a Substitute for Tools

For tasks that require precise calculation, real-time information, or code execution, CoT is not a substitute for proper tools. Use CoT for reasoning, but combine it with calculators, code interpreters, or search tools when needed.

Advanced CoT Techniques

Beyond basic CoT, these advanced variations can further improve results.

Self-Consistency

Generate multiple CoT solutions and take the majority vote:

"Solve this problem three different ways, showing your reasoning for each. Then determine which solution is most likely correct."

Tree of Thought

Explore multiple reasoning paths and evaluate each:

"Consider three different approaches to this problem. For each approach:
1. Outline the reasoning steps
2. Identify potential issues
3. Evaluate likelihood of success
Then choose the best approach and explain why."

Structured CoT

Provide a specific reasoning framework:

"Analyze this problem using the following structure:
1. Identify the key information
2. List the constraints
3. Consider possible approaches
4. Evaluate each approach
5. Execute the best approach
6. Verify the result"

Frequently Asked Questions

What is chain of thought prompting?

Chain of thought (CoT) prompting is a technique where you ask an AI model to show its reasoning process step by step before giving a final answer. Instead of jumping to a conclusion, the model breaks down the problem and thinks through each step, which significantly improves accuracy on complex reasoning tasks.

When should I use chain of thought prompting?

Use CoT for tasks that require reasoning, logic, math, multi-step problem solving, or complex analysis. It's especially helpful when the task has multiple steps, requires weighing different factors, or involves calculations. For simple, straightforward tasks, CoT may add unnecessary complexity.

Does chain of thought work with all AI models?

CoT works best with larger, more capable models (GPT-4, Claude, Gemini Ultra). Smaller models may not benefit as much or may produce unreliable reasoning chains. The technique is most effective with models that have strong reasoning capabilities built in.

What is the difference between zero-shot and few-shot CoT?

Zero-shot CoT simply adds "Think step by step" to the prompt without examples. Few-shot CoT provides examples of step-by-step reasoning before asking the model to solve a new problem. Few-shot CoT is more reliable for complex tasks but requires more prompt space. Zero-shot CoT is simpler and often sufficient.