What Is Chain-of-Thought Prompting?
Chain-of-thought (CoT) prompting is a technique where you instruct an AI model to reason through a problem step by step before delivering its final answer. Instead of jumping directly to a conclusion, the model "shows its work" — making its reasoning process transparent and, crucially, more accurate.
The core insight: language models that are asked to explain their reasoning as they go tend to arrive at better answers than models asked for direct responses. It's similar to asking a student to show their work on a math test — the process of writing out the steps catches errors and leads to more reliable results.
Response: "39 apples" (Incorrect — the model skipped steps and got it wrong)
Response: "Step 1: Start with 52 apples. Step 2: Sell 28: 52 - 28 = 24. Step 3: Receive 15 more: 24 + 15 = 39. The store has 39 apples." (Correct)
Why Chain-of-Thought Prompting Works
Research from Google Brain (Wei et al., 2022) first formally demonstrated CoT prompting's power. The paper showed that for problems requiring multiple reasoning steps, models using chain-of-thought outperformed direct-answer models by significant margins — sometimes dramatically.
The mechanism is thought to work because:
- Decomposition: Breaking a complex problem into steps makes each individual step easier to solve correctly
- Error catching: When a model writes out intermediate steps, it can "catch" logical errors that would otherwise propagate to the final answer
- Attention focusing: The act of generating reasoning tokens may cause the model to allocate more computational attention to relevant parts of the problem
- Training alignment: Models trained on human-generated reasoning naturally follow similar patterns when prompted to reason
Key finding: CoT prompting provides the biggest improvement on tasks requiring 3+ logical steps. For simple 1-step questions, the benefit is minimal or even slightly negative (adds unnecessary tokens without improving accuracy).
Zero-Shot Chain-of-Thought
The simplest form of CoT prompting requires no examples at all — just add a reasoning trigger to your prompt. The discovery that simply adding "Let's think step by step" dramatically improves accuracy was a significant breakthrough in AI research.
Zero-Shot CoT Trigger Phrases
These phrases trigger step-by-step reasoning in most modern AI models:
Zero-Shot CoT Math Example
Few-Shot Chain-of-Thought Prompting
Few-shot CoT provides 2-3 worked examples before asking your actual question. This shows the model exactly what kind of reasoning format you want, and can significantly outperform zero-shot CoT on complex or domain-specific tasks.
Advanced CoT Variations
Tree of Thoughts (ToT)
An extension of CoT where the model explores multiple reasoning branches simultaneously and evaluates which path to continue. Useful for problems where the first approach might not work.
Self-Consistency CoT
Ask the model to solve the problem multiple times independently and take the majority answer. Research shows this significantly improves accuracy over single-run CoT.
Chain-of-Thought Examples by Category
Math & Quantitative Reasoning
Logic & Reasoning
Business Decision Making
Code Debugging
When to Use Chain-of-Thought (and When Not To)
Use CoT prompting when:
- The task requires 3+ logical steps
- Math, arithmetic, or quantitative reasoning is involved
- You're doing logical deduction or inference
- Planning or sequencing tasks
- You want the AI to check its own work
- Accuracy matters more than speed/tokens
Don't use CoT when:
- The task is simple and single-step
- You need a short, fast response
- Creative generation (stories, poetry) — CoT can make outputs more mechanical
- You have very limited token budget
Frequently Asked Questions
What is chain-of-thought prompting?
Chain-of-thought prompting is a technique where you ask an AI model to show its reasoning step by step before delivering a final answer. This improves accuracy on complex tasks by making the reasoning process explicit and allowing the model to catch errors in intermediate steps.
Does chain-of-thought prompting work on all AI models?
CoT prompting works best on large language models (100B+ parameters) that have been instruction-tuned. It works well on GPT-4, Claude 3.5, Gemini 1.5 Pro, and similar flagship models. On smaller or older models, the benefit is less consistent.
What is the difference between zero-shot and few-shot CoT?
Zero-shot CoT adds a phrase like "think step by step" to your prompt without examples. Few-shot CoT provides 2-3 worked examples showing the exact reasoning format you want before asking your question. Few-shot CoT generally produces more consistent results but requires more prompt engineering effort.
Practice CoT Prompting with Our Free Tool
Build custom chain-of-thought prompts for any use case with our AI-powered generator.
Try the Free Prompt Generator ↗