Bible Network Crypto DeFi Onchain RWA AI Agent Stablecoin Chain SAFU CryptoTax DeFAI AGI Claude Me Claude Skill Claude Design Claude Cowork
Independent Media
Not affiliated with any project
Exploring the Frontier of AI Intelligence
claude-me.com
LATEST
Eight Principles Straight From Anthropic: If Claude Keeps Getting Worse, the Problem Is Probably How You're Using It  ·  Claude Code Can Now 'Loop' Through Work on Its Own: Anthropic Releases Four Loop Mode Guide That Lets AI Run Entire Processes  ·  Claude Cowork Honest Review: Three Months Later — What Actually Saved Time, What Made Me Regret Automating It  ·  Two Major Stories to Open July: Claude Sonnet 5 Launches, Fable 5 Export Controls Lifted and Globally Restored  ·  What Is RAG: Why Claude Can't Read Your Company Intranet — And How to Fix That  ·  Claude Cowork Advanced Workflows: From 'Hand Off One Task' to 'Run an Entire Process' — Three Real-World Templates
Glossary · prompt-techniques

Chain-of-Thought Prompting

prompt-techniques Advanced

30-Second Version · For the impatient
A prompting technique that has AI write out its reasoning step-by-step before giving a final answer. The core approach: add "think step by step" to prompts or provide reasoning step examples. Research shows this seemingly simple technique can dramatically improve large language models' accuracy on math, logical reasoning, and multi-step problems — sometimes from 20% to over 80%.
Full Explanation +
01 · What is this?

Chain-of-Thought (CoT) Prompting is a technique that has large language models explicitly write out intermediate reasoning steps before giving a final answer. Systematically confirmed by Wei et al. (2022) in a Google paper: on math problems, logical reasoning, commonsense reasoning, CoT dramatically improves model accuracy.

Why does CoT work? From the LLM mechanism: the model generates each token by predicting the next most reasonable token from what's already generated. When models output final answers directly, they need to "compress" the entire reasoning process into a few tokens — this often fails for complex problems. When models are asked to reason step-by-step, each intermediate step becomes an "anchor" for subsequent reasoning, allowing it to continue on a correct foundation rather than guessing from scratch.

The simplest Zero-Shot CoT just adds one sentence at the end: "Think step by step." This seemingly ordinary approach was found in 2022 research to improve GPT-3's accuracy on math problems from 17.7% to 78.7% — over 4× improvement, from just this phrase.

02 · Why does it exist?

Differences between Zero-Shot CoT and Few-Shot CoT, and when to use each.

Zero-Shot CoT: directly add "think step by step" or similar instruction to the prompt without providing any reasoning examples. Simplest implementation; effective for most tasks requiring reasoning.

Few-Shot CoT: don't just say "think step by step" — also provide several demonstration examples with complete reasoning processes (problem + step-by-step reasoning + answer), letting the model learn the "format and depth of reasoning." For tasks requiring specific reasoning formats, or where Zero-Shot CoT isn't sufficient, Few-Shot CoT typically further improves accuracy.

Selection guidance: try Zero-Shot CoT first. If the output reasoning is too shallow, skips too many steps, or accuracy is still insufficient, switch to Few-Shot CoT with 2-3 examples of complete reasoning processes.

Important detail: in Few-Shot CoT demonstrations, reasoning step quality matters more than quantity. Two deep reasoning demonstrations typically outperform five shallow ones. Steps should show "how to decompose the problem," "how to identify key information," "how to eliminate wrong options" — not just "list the steps."

03 · How does it affect your decisions?

Several advanced Chain-of-Thought variants suited to different scenarios.

Tree of Thoughts (ToT): lets the model simultaneously explore multiple different reasoning paths (like tree branches), then evaluates which paths are most promising and continues the best one. Suited for problems with multiple possible solutions; better at finding optimal solutions than standard CoT, but higher computational cost.

Self-Consistency CoT: has the model solve the same problem multiple times with CoT (using different random sampling), then takes the most frequently appearing answer as the final answer. More reliable than single CoT; suited for high-importance tasks where errors aren't allowed. Implementation: set Temperature > 0 in API, call 5-10 times, count the most common answer.

Step-Back Prompting: before solving directly, first have the model step back to think "what's the principle behind this problem?" "what knowledge is typically needed to solve this type?" Then use these principles to solve the specific problem. Research shows this can further improve complex problem accuracy by 10-20%.

Claude 4's Extended Thinking is the built-in version of these techniques: lets the model do longer internal reasoning in a "thinking space" before generating the final answer. For Claude API developers, Extended Thinking is currently the easiest high-quality CoT implementation to use.

04 · What should you do?

How to apply CoT in actual Claude usage, and several common misuse patterns.

Using CoT in claude.ai: most direct approach is adding "please think step by step, then give the final answer" to the end of your prompt. For complex problems, be more explicit: "please first list your reasoning steps, confirm each step is correct, then give the final conclusion."

Using CoT in the API: besides adding CoT instructions to System Prompt or User Message, Claude 4 series Extended Thinking is a more direct approach — set thinking: {type: "enabled", budget_tokens: 5000} in API calls; Claude performs CoT reasoning internally and outputs only the final conclusion (or optionally also the thinking process).

Common misuse patterns:

Using CoT on tasks that don't need reasoning — translation, summarization, format conversion don't need CoT; adding it just increases latency and cost.

Few-Shot demonstration reasoning steps too shallow — "first addition, then multiplication" descriptions have limited help; need to write out the details and decision process of reasoning.

Treating CoT as a universal solution — CoT has significant effects on tasks "requiring reasoning," limited effect on tasks "requiring knowledge" (factual queries); for tasks "requiring creativity" (creative writing), CoT may make output overly structured.

What this means for your usage: if you're doing tasks requiring precise reasoning (complex analysis, math calculations, logical judgment), adding "think step by step" typically improves Claude's answer accuracy by 20-50% at almost no cost. This is one of the lowest-effort, highest-impact prompting techniques.

Real-World Example +

A legal analyst needs to judge whether a contract clause meets specific legal requirements — illustrating CoT's practical effect on professional judgment tasks:

Without CoT: "Does the following contract clause meet the legitimacy requirements of GDPR Article 6? [paste clause]" → Claude may say "yes" or "no" directly, but without sufficient reasoning process; the analyst can't assess reliability.

With CoT: "Please analyze step by step whether the following contract clause meets GDPR Article 6 legitimacy requirements. Analysis steps: 1. identify personal data processing activities involved; 2. confirm GDPR Article 6's six legal bases; 3. judge one by one which legal basis might apply; 4. evaluate whether the clause's specific wording sufficiently satisfies that legal basis; 5. give your conclusion and confidence level. [paste clause]"

→ Claude's output progressively shows the reasoning process; the analyst can see what each judgment is based on, identify where uncertainties may lie, and make a more grounded final decision.

This illustrates CoT's core value in professional judgment tasks: not just making answers more accurate, but making the reasoning process "auditable" — you can evaluate whether Claude's judgment is reliable rather than blindly trusting a conclusion without reasoning.

Diagram
Chain-of-Thought 的效果:直接回答 vs 逐步推理的準確率差異對比圖展示同一個多步驟數學問題,「直接回答」模式和「Chain-of-Thought 推理」模式的回答差異——左側是沒有中間推理步驟直接給出的答案(容易出錯),右側是逐步推理後得出的答案(準確率顯著更高),並標注 CoT 在不同任務類型上的效果提升幅度。Chain-of-Thought — Direct Answer vs Step-by-Step ReasoningDirect Answer (No CoT)Q: A store sells apples at $0.30 each.Buy 3 get 1 free. Cost of 12 apples?Answer: $3.60 ✗(Model skipped the promotion logic,charged for all 12)Accuracy on multi-step math:~20-40%errors cluster at intermediate stepsWith Chain-of-ThoughtSame question + "think step by step"Step 1: 12 apples totalStep 2: buy 3 get 1 free → groups of 4Step 3: 12 ÷ 4 = 3 groupsStep 4: pay for 3×3 = 9 applesStep 5: 9 × $0.30 = $2.70Accuracy on multi-step math:~70-90%each step anchors the nextClaude Me · claude-me.com
Feel free to share. Please credit the source.
Common Misconceptions +
✕ Misconception 1
× Misconception 1: Chain-of-Thought only suits math problems; it's useless for language tasks. CoT is most impactful on math and logical reasoning (because these have clear "correct steps"), but it works for any task requiring multi-step judgment: legal analysis (step-by-step confirmation of each legal requirement), business decision analysis (step-by-step evaluation of each option's pros and cons), code debugging (step-by-step narrowing down of problem scope), reading comprehension (step-by-step analysis of argument structure). Any task with a "from information to conclusion" reasoning process benefits from CoT.
✕ Misconception 2
× Misconception 2: Having Claude write out reasoning steps is just to make output longer and look more complete. Longer CoT output isn't the goal — more accuracy is. The confirmed mechanism in research: the "act" of generating intermediate reasoning steps itself makes subsequent answers more accurate — not because steps look more convincing, but because they make the model's "computation process" more reliable. CoT's accuracy improvements are quantifiable and replicable, not just "looking better."
The Missing Link +
Direct Impact

Chain-of-Thought's core trade-off: accuracy vs speed and cost. Enabling CoT has the model generate more tokens (intermediate reasoning steps), meaning more output token costs (typically 2-5× more) and longer response time. For most tasks requiring high accuracy, this cost is worthwhile — spending an extra $0.01 and waiting 2 more seconds to improve accuracy from 40% to 80% is a very favorable exchange. Scenarios not worth using CoT: simple factual queries (no reasoning needed), creative generation tasks (CoT may make output overly structured), real-time applications with extreme speed requirements (can't exceed 1 second per response). Best practice: only enable CoT on tasks that genuinely require reasoning; keep direct answering for others.

Ask a Question
Please enter at least 10 characters
More Related Topics