What Is Chain-of-Thought Prompting? Examples and When It Helps
Discover what is chain of thought prompting, its benefits, and practical examples to enhance your understanding and application in various contexts.
what is chain of thought prompting | Updated October 2026 | 10 min read | hyperank Editorial Team
What is chain-of-thought prompting? It's a technique where you prompt an AI model to work through a problem in intermediate steps before giving its final answer, either by showing worked examples (few-shot) or by adding an instruction such as "Let's think step by step" (zero-shot). It was introduced in a 2022 paper by Wei and colleagues and can significantly improve accuracy on math, logic and multi-step reasoning tasks. It helps less with simple factual questions, and modern reasoning models already reason internally, so providers such as OpenAI now advise against adding step-by-step instructions to those models. This guide, What Is Chain-of-Thought Prompting? Examples and When It Helps, explains its origins, zero-shot and few-shot versions with examples, where it works, how it relates to reasoning models, and how it differs from prompt chaining.
Chain-of-thought prompting doesn't make a model smarter. It gives the model room to show its work, which often leads to a better answer.
What Is Chain-of-Thought Prompting?
Chain-of-thought (CoT) prompting asks a language model to generate a series of reasoning steps on the way to an answer. In the words of the original paper by Wei and colleagues, a chain of thought is "a series of intermediate reasoning steps," and generating one "significantly improves the ability of large language models to perform complex reasoning."
| Prompt style | Example | Typical result |
|---|---|---|
| Standard prompt | "A store had 23 apples, used 20 and bought 6 more. How many now?" | The model answers directly, sometimes wrongly |
| Chain-of-thought prompt | Same question, plus "Let's think step by step." | The model works out 23 minus 20 is 3, plus 6 is 9, then answers 9 |
- Intermediate steps: The model writes out its reasoning before the answer.
- Better on multi-step problems: Each step builds on the previous one.
- Easier to check: You can see where the reasoning went wrong.
Where Chain-of-Thought Prompting Came From
Chain-of-thought prompting was introduced by Jason Wei and colleagues at Google in a 2022 paper, "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models." They showed that giving a model a few worked examples with step-by-step reasoning improved performance on arithmetic, commonsense and symbolic reasoning tasks.
- Headline result: The paper reports that prompting a 540-billion-parameter model with just eight chain-of-thought examples achieved state-of-the-art accuracy on the GSM8K math word problem benchmark, surpassing even a fine-tuned GPT-3 with a verifier.
- Scale mattered: The authors found the reasoning benefits emerged in sufficiently large models.
- Zero-shot follow-up: Later in 2022, Kojima and colleagues showed that simply adding "Let's think step by step" before the answer also improved reasoning, without any examples.
The zero-shot result
Kojima and colleagues reported that their zero-shot chain-of-thought prompt increased accuracy on the MultiArith benchmark from 17.7% to 78.7%, and on GSM8K from 10.4% to 40.7%, with a large InstructGPT model (text-davinci-002). That single phrase became one of the best-known prompting techniques.
Zero-Shot vs Few-Shot Chain-of-Thought, With Examples
There are two main ways to use chain-of-thought prompting. Few-shot CoT shows the model worked examples; zero-shot CoT just asks it to reason step by step.
| Type | How it works | Pros | Cons |
|---|---|---|---|
| Zero-shot CoT | Add "Let's think step by step" or similar | Quick, no examples needed | Less control over reasoning style |
| Few-shot CoT | Include one or more worked examples with reasoning | Guides format and approach | Longer prompts; examples take effort |
Zero-shot example
"A team publishes 3 blog posts a week for 8 weeks, then 5 a week for 4 weeks. How many posts in total? Let's think step by step."
A typical response: "First period: 3 times 8 equals 24. Second period: 5 times 4 equals 20. Total: 24 plus 20 equals 44 posts."
Few-shot example
- Example given: "Q: A shop sells 4 boxes of 6 pens. How many pens? A: Each box has 6 pens. 4 boxes times 6 pens is 24. The answer is 24."
- New question: "Q: A cafe orders 7 crates of 12 bottles and uses 30. How many are left? A:"
- Expected reasoning: "7 crates times 12 bottles is 84. 84 minus 30 is 54. The answer is 54."
For more on zero-shot and few-shot prompting in general, see our guide to what AI prompts are.
Tasks Where Chain-of-Thought Helps, and Where It Doesn't
Chain-of-thought prompting helps most on tasks that genuinely require several reasoning steps. On simple lookups or creative writing, it adds length without much benefit.
| Task | Does CoT help? | Why |
|---|---|---|
| Math word problems | Often, significantly | Each calculation step matters |
| Logic puzzles and planning | Often | Requires tracking constraints |
| Multi-step analysis (comparing options) | Often | Breaks a judgment into criteria |
| Simple factual questions | Rarely | One step; extra text adds little |
| Creative writing | Rarely | Quality depends on style, not logic |
| Classification with clear labels | Sometimes | Helps on borderline cases |
- Visible reasoning isn't proof: A written chain can look convincing and still contain errors, so check the steps.
- Costs more: Longer outputs mean more tokens and slower responses.
- Format the final answer: Ask for the answer on its own line so it's easy to extract.
Key Takeaway: Use chain-of-thought when you'd want a human to show their working. Skip it when the answer is a single fact.
Chain-of-Thought and Reasoning Models
Newer reasoning models are trained to work through problems internally before answering, so explicit chain-of-thought instructions are often unnecessary. As of October 2026, OpenAI's reasoning best practices advise: "Avoid chain-of-thought prompts: Since these models perform reasoning internally, prompting them to 'think step by step' or 'explain your reasoning' is unnecessary."
- OpenAI's guidance: The same page notes that instructing reasoning models to "think step by step" may not enhance performance and can sometimes hinder it, and recommends simple, direct prompts.
- Anthropic's approach: Claude models offer an extended thinking feature that lets the model reason before responding, controlled through settings rather than prompt wording.
- Standard models: For non-reasoning models, chain-of-thought prompting can still help on multi-step tasks.
What to do in practice
| Model type | Recommended approach |
|---|---|
| Reasoning models | Give clear, direct instructions; skip "think step by step" |
| Models with a thinking setting | Turn on the thinking feature for hard problems |
| Standard chat models | Use zero-shot or few-shot CoT for multi-step tasks |
With reasoning models, the reasoning happens whether you ask for it or not. Your job is to state the problem clearly.
Chain-of-Thought vs Prompt Chaining
Chain-of-thought and prompt chaining sound similar but work differently. Chain-of-thought asks for step-by-step reasoning inside one response; prompt chaining splits a task into separate prompts, passing each output into the next.
| Feature | Chain-of-thought | Prompt chaining |
|---|---|---|
| Number of prompts | One | Several |
| Where reasoning happens | Inside a single answer | Across separate steps |
| Best for | Math, logic, analysis | Multi-stage workflows such as research, brief, draft, review |
| Checkpoints | Read the reasoning after | Review each step's output |
- They combine: One step in a prompt chain can use chain-of-thought for a reasoning-heavy task.
- Learn more: See our guide to prompt chaining.
- Write prompts faster: The free AI prompt generator helps structure prompts for either approach.
Prompting techniques also shape how AI assistants answer questions about brands. hyperank tracks what ChatGPT, Perplexity, Gemini and other engines actually say about your brand, regardless of how users phrase their prompts.
Chain-of-Thought Prompting FAQ
The most common questions are what the magic phrase is, whether it still works, and whether it's the same as prompt chaining. Short answers are below, followed by the full FAQ.
- The phrase: "Let's think step by step," from Kojima and colleagues (2022).
- Still works? Yes for standard models; often unnecessary for reasoning models.
- Same as chaining? No; CoT is one prompt, chaining is several.
Conclusion
Chain-of-thought prompting asks a model to reason through intermediate steps before answering, through worked examples or a simple "Let's think step by step." It improves results on multi-step problems for standard models, while reasoning models now handle this internally, so match the technique to the model and the task.
Key Takeaways
- Definition: Prompting a model to show intermediate reasoning steps.
- Origins: Wei et al. (2022) for few-shot; Kojima et al. (2022) for zero-shot.
- Where it helps: Math, logic and multi-step analysis.
- Reasoning models: OpenAI advises skipping step-by-step instructions.
- Versus chaining: One prompt with reasoning vs several linked prompts.
Structure better prompts with the free AI prompt generator.
FAQ
What is chain-of-thought prompting, with examples, and when does it help?
Chain-of-thought prompting asks an AI model to work through intermediate reasoning steps before answering, either with worked examples (few-shot) or by adding "Let's think step by step" (zero-shot). It helps on math, logic and multi-step analysis, for example breaking "3 posts a week for 8 weeks, then 5 a week for 4 weeks" into 24 plus 20 equals 44. It helps less on simple facts, and reasoning models usually don't need it.
Who invented chain-of-thought prompting?
It was introduced by Jason Wei and colleagues at Google in a 2022 paper.
What does "Let's think step by step" do?
It triggers zero-shot chain-of-thought reasoning; Kojima and colleagues showed it raised MultiArith accuracy from 17.7% to 78.7% with InstructGPT.
Should I use chain-of-thought with reasoning models?
Usually not. OpenAI advises against "think step by step" prompts for its reasoning models, since they reason internally.
What's the difference between chain-of-thought and prompt chaining?
Chain-of-thought reasons within one response; prompt chaining splits a task into several prompts.
Does chain-of-thought prompting always improve answers?
No. It helps on multi-step reasoning but adds little to simple questions, and visible reasoning can still contain mistakes.
Methodology: This article draws on Wei et al. (2022), "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models," Kojima et al. (2022), "Large Language Models are Zero-Shot Reasoners," OpenAI's reasoning best practices and Anthropic's extended thinking documentation, as checked in October 2026.
See where your brand stands
How six AI engines describe you, next to your competitors. About two minutes.