Chain-of-Thought Prompting: What It Is and When It Still Helps
How chain-of-thought prompting works, its zero-shot, few-shot and structured forms, and what OpenAI, Anthropic and Google now advise for reasoning models.
On this page11 sections
Chain-of-thought prompting means asking an AI model to work through a problem in steps before it gives the final answer, either by adding a cue such as "think step by step" or by showing worked examples that include the reasoning. It helps most on problems with several dependent steps: arithmetic, logic, planning and multi-part analysis. With today's reasoning models, which already think before they answer, OpenAI and Google say the explicit cue is usually unnecessary, and OpenAI says it can sometimes hurt.
The technique was named in a 2022 Google research paper, "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models". Since then the models have changed more than the idea. This guide explains the three forms of chain-of-thought prompting, what each vendor now recommends, and how to decide whether to use it.
What chain-of-thought prompting is
A plain prompt asks for an answer. A chain-of-thought prompt asks for the steps that lead to it. Compare:
Plain: A shop sells pens at 3 for $4. How much do 12 pens cost?
Chain of thought: A shop sells pens at 3 for $4. How much do 12 pens cost?
Work through it step by step, then give the final answer on its own line.
The second version makes the model write out intermediate results (12 pens is four groups of three, four groups at $4 is $16) before committing to a number. Each step conditions the next, so an error has fewer places to hide.
The three forms
| Form | How you write it | When to use it |
|---|---|---|
| Zero-shot chain of thought | Add a cue such as "think step by step" or "reason through this before answering" | Quick fix for a model that jumps to conclusions |
| Few-shot chain of thought | Include one or more examples that show the problem, the reasoning and the answer | When you need reasoning in a particular shape or method |
| Structured chain of thought | Ask for reasoning in one labelled section and the answer in another | When you need to read or parse the final answer separately |
Zero-shot chain of thought
This is the simplest form: one added sentence. Variants include "explain your reasoning", "show your work" and "consider each option before choosing". It costs nothing to try and is the right first move on a model without built-in reasoning.
Few-shot chain of thought
Here the examples carry the reasoning. Instead of showing only question and answer pairs, each example shows how the answer was reached. Anthropic's guidance for Claude suggests presenting each example as the problem, the method to apply and the expected answer. Plain few-shot examples without reasoning are ordinary few-shot prompting, covered in our few-shot prompting guide.
Structured chain of thought
When a program, or a busy reader, needs only the answer, separate the two parts:
Think through the problem inside <reasoning> tags.
Then give only the final answer inside <answer> tags.
Anthropic describes this pattern as the manual fallback for when Claude's built-in thinking is turned off.
What the vendors recommend now
Most current models can reason internally before replying. That changes the advice.
OpenAI. Its reasoning best practices say that techniques such as instructing the model to "think step by step" may not improve performance and can sometimes hinder it, because reasoning models already reason internally. It recommends keeping prompts simple and direct, trying zero-shot first, and being specific about the end goal instead.
Google. Its Gemini prompting guide says that because Gemini 2.5 and 3 generate internal thinking, it is generally not necessary to have the model outline its reasoning in the response. For hard reasoning tasks, a short instruction such as "Think very hard before answering" can help, at the cost of extra thinking tokens.
Anthropic. Claude's documentation recommends general instructions over prescriptive steps: a request to think thoroughly often works better than a hand-written plan, because the model's own reasoning frequently goes beyond what a person would prescribe. Depth is controlled with the API's thinking and effort settings. Manual chain of thought, with reasoning and answer in separate tags, is the fallback when thinking is off.
The common thread: on a reasoning model, describe the goal and the success criteria clearly and let the model plan. Spell out steps only when the method itself matters, for example when you need a calculation done a specific way.
When to use chain-of-thought prompting
Use it when:
- The model does not have built-in reasoning, or it is switched off.
- The task has several dependent steps and the model keeps skipping one.
- You need to audit the reasoning, for example to check which assumptions a forecast used.
- You want a specific method followed, such as a weighted scoring of options.
Skip it when:
- The task is lookup, rewriting or formatting. There is nothing to reason through.
- You are using a reasoning model and the plain prompt already works.
- Latency or cost matters and the answer quality is already good enough.
Writing a good chain-of-thought prompt
- State the goal and the success criteria first. "Choose the cheapest option that meets all three requirements" gives the reasoning a target.
- Name the method only if it matters. "Score each option from 1 to 5 on cost, risk and speed" is useful. "Think carefully" on its own adds little to a reasoning model.
- Separate reasoning from answer. Use tags or headings so the final answer is easy to find.
- Ask for a check. "Before you finish, verify the total against the figures given" catches arithmetic slips. Anthropic notes that some newer Claude models verify their own work without being asked, so drop the line if you see over-checking.
- Keep the reasoning honest. Ask the model to state assumptions explicitly and to say when information is missing rather than filling the gap.
Our decision-making prompt and data analysis prompt both build these steps in.
Limitations
Written reasoning is not proof. A model can produce plausible steps that lead to a wrong answer, or a right answer with reasoning that does not actually support it. Check the conclusion against the source facts, not just the logic of the steps. For a systematic way to check outputs, see how to test AI prompts. For tasks too large for one reply, split them into separate prompts instead: that is prompt chaining, a different technique with a similar name.
FAQ
What is chain-of-thought prompting in simple terms?
It is asking the AI to show its working. Instead of requesting only the answer, you ask the model to go through the problem step by step first, which tends to reduce skipped steps on multi-part problems such as maths, logic and planning.
Does "think step by step" still work?
On models without built-in reasoning, it remains a cheap and useful cue. On reasoning models, OpenAI says it is unnecessary and can sometimes hinder performance, and Google says it is generally not needed for Gemini 2.5 and 3. Describe the goal clearly instead.
What is the difference between chain-of-thought prompting and prompt chaining?
Chain-of-thought prompting asks for step-by-step reasoning inside one response. Prompt chaining splits a task across several prompts, with each output feeding the next. Use chain of thought for one hard problem and prompt chaining for a long workflow.
What is zero-shot chain-of-thought prompting?
It is chain-of-thought prompting with no examples: you add a cue such as "think step by step" to the prompt. Few-shot chain of thought adds worked examples that show the reasoning as well as the answer.
Can chain-of-thought prompting stop hallucinations?
No. It can reduce reasoning slips, but it does not give the model facts it lacks. To reduce invented facts, supply the source material, tell the model to answer only from it, and ask it to say when the answer is not there.
Prompts that put this into practice
Structured Decision-Making Prompt
A two-round prompt: the model questions you first, then weighs your options against your criteria and argues against the one you already favor.
# Role
You are a thinking partner helping me make a decision. You are not here to reassure me. Your value is in structure, in noticing what I left out, and in a…Show-Your-Working Data Analysis Prompt
Analyzes a pasted table or dataset step by step: data check, calculations with working shown, findings tied to those calculations, and what the data cannot support.
# Role
You are a data analyst. You show your working, you keep observation separate from interpretation, and you say plainly when the data cannot answer the que…Bug Diagnosis Prompt
Give the model the error, the code and what you expected. It ranks likely causes by evidence, tells you how to confirm each, and proposes a minimal fix.
# Role
You are an experienced engineer helping me find the cause of a bug. Diagnose first and fix second. Do not rewrite code that is not part of the problem.…Keep reading
Technical guide
Few-Shot Prompting: How to Use Examples in a Prompt
How to include worked examples in a prompt so the model follows a format, label set or style, and how to choose examples that generalize.
Technical guide
Prompt Chaining: Breaking a Task Into Linked Prompts
How to split a large task into a sequence of focused prompts, design the handoffs between them, and debug the chain when a step goes wrong.
Guide
What Is Prompt Engineering? Core Techniques Explained
What prompt engineering is, the techniques the major model vendors agree on, the working loop behind them, and what prompting cannot fix.
Sources and references
- Reasoning best practices — OpenAI
- Prompt design strategies — Google
- Prompt engineering overview — Anthropic