Home›
Knowledge Base›
is the discovery that large language models solve hard problems far more reliably when they are prompted to reason step by step instead of blurting out an answer. Asking a model to "think it through" before answering — or simply appending "Let's think step by step" — can turn a wrong response into a right one on math, logic, and multi-step questions, with no change to the model's weights. This simple idea grew into an entire class of reasoning models that are explicitly trained to produce long internal reasoning before their final answer, and it reframed a key lever of AI capability: how much computation a model spends at inference time.\n\n```svg\n\n \n Chain-of-Thought & Reasoning Models\n let the model think in steps before committing to an answer — and spend more compute on harder problems\n DIRECT — answer immediately\n \n question\n \n answer\n ✗ often wrong\n \n \n CHAIN-OF-THOUGHT — reason first, answer last\n \n question\n \n step 1\n reasoning\n \n step 2\n reasoning\n \n step 3\n reasoning\n \n answer\n ✓ correct\n \n \n \n \n \n \n \n \n \n More thinking → higher accuracy\n \n \n \n thinking tokens (test-time compute)\n acc\n \n Reasoning models take this further\n • trained with RL to reason before answering\n • generate a long hidden “thinking” trace, then a final answer\n • spend variable compute — harder problem, longer thinking\n • e.g. o-series / R1-style “thinking” models\n\n```\n\n
<svg viewBox="0 0 760 470" xmlns="http://www.w3.org/2000/svg" font-family="-apple-system,Segoe UI,Roboto,sans-serif">
<rect x="0" y="0" width="760" height="470" fill="#0d1117"/>
<text x="380" y="28" fill="#e6edf3" font-size="21" font-weight="700" text-anchor="middle">Chain of Thought — Reasoning Step by Step</text>
<text x="380" y="48" fill="#8b98a5" font-size="12" text-anchor="middle">prompting the model to show its work unlocks multi-step reasoning that direct answers miss</text>
<!-- === TOP: Direct vs CoT comparison === -->
<rect x="25" y="62" width="340" height="135" rx="6" fill="#080d14" stroke="#233043" stroke-width="1.2"/>
<text x="195" y="80" fill="#e6edf3" font-size="11" text-anchor="middle" font-weight="600">Without CoT (direct answer)</text>
<rect x="40" y="92" width="310" height="35" rx="3" fill="#0f1a2a" stroke="#60a5fa" stroke-width="0.7"/>
<text x="50" y="110" fill="#93c5fd" font-size="8">Q: If 3 shirts take 2 hours to dry, how long for 9 shirts?</text>
<text x="50" y="122" fill="#6b7684" font-size="7.5">A: 6 hours ✗ (wrong — drying is parallel!)</text>
<text x="45" y="148" fill="#f87171" font-size="8.5">The model pattern-matches: 3×3 = 9, so 2×3 = 6</text>
<text x="45" y="164" fill="#f87171" font-size="8.5">No reasoning → no chance to catch the error</text>
<text x="45" y="182" fill="#6b7684" font-size="8">Accuracy on GSM8K (direct): ~50-60%</text>
<!-- Right: With CoT -->
<rect x="385" y="62" width="350" height="135" rx="6" fill="#080d14" stroke="#233043" stroke-width="1.2"/>
<text x="560" y="80" fill="#e6edf3" font-size="11" text-anchor="middle" font-weight="600">With CoT (step-by-step)</text>
<rect x="400" y="92" width="320" height="70" rx="3" fill="#14261f" stroke="#34d399" stroke-width="0.7"/>
<text x="410" y="108" fill="#34d399" font-size="8">Q: Same question. "Let's think step by step."</text>
<text x="410" y="122" fill="#6ee7b7" font-size="7.5">Step 1: Shirts dry in parallel, not sequential.</text>
<text x="410" y="136" fill="#6ee7b7" font-size="7.5">Step 2: All shirts fit on the line simultaneously.</text>
<text x="410" y="150" fill="#6ee7b7" font-size="7.5">Step 3: Answer = 2 hours ✓</text>
<text x="405" y="178" fill="#34d399" font-size="8.5">The reasoning trace catches the parallel insight</text>
<text x="405" y="192" fill="#6b7684" font-size="8">Accuracy on GSM8K (CoT): ~90-95%</text>
<!-- === MIDDLE LEFT: CoT variants === -->
<rect x="25" y="205" width="350" height="120" rx="6" fill="#0b1220" stroke="#233043" stroke-width="1"/>
<text x="200" y="223" fill="#e6edf3" font-size="10" text-anchor="middle" font-weight="600">Prompting Variants</text>
<text x="45" y="243" fill="#34d399" font-size="8.5" font-weight="600">Zero-shot CoT</text>
<text x="155" y="243" fill="#8b98a5" font-size="8.5">"Let's think step by step" (Wei et al.)</text>
<text x="45" y="261" fill="#60a5fa" font-size="8.5" font-weight="600">Few-shot CoT</text>
<text x="145" y="261" fill="#8b98a5" font-size="8.5">provide examples with reasoning traces</text>
<text x="45" y="279" fill="#fbbf24" font-size="8.5" font-weight="600">Self-consistency</text>
<text x="155" y="279" fill="#8b98a5" font-size="8.5">sample N chains, majority vote on answer</text>
<text x="45" y="297" fill="#c4b5fd" font-size="8.5" font-weight="600">Tree-of-Thought</text>
<text x="155" y="297" fill="#8b98a5" font-size="8.5">explore multiple reasoning branches</text>
<text x="45" y="315" fill="#f87171" font-size="8.5" font-weight="600">ReAct</text>
<text x="95" y="315" fill="#8b98a5" font-size="8.5">interleave reasoning with tool actions</text>
<!-- === MIDDLE RIGHT: Where CoT helps === -->
<rect x="390" y="205" width="345" height="120" rx="6" fill="#0b1220" stroke="#233043" stroke-width="1"/>
<text x="562" y="223" fill="#e6edf3" font-size="10" text-anchor="middle" font-weight="600">When CoT Helps Most</text>
<text x="410" y="243" fill="#34d399" font-size="8.5">✓ Math / arithmetic (GSM8K: +35% accuracy)</text>
<text x="410" y="261" fill="#34d399" font-size="8.5">✓ Multi-step logic / planning</text>
<text x="410" y="279" fill="#34d399" font-size="8.5">✓ Code debugging (trace execution)</text>
<text x="410" y="297" fill="#f87171" font-size="8.5">✗ Simple factual recall (no reasoning needed)</text>
<text x="410" y="315" fill="#f87171" font-size="8.5">✗ Small models (< 10B — they confabulate steps)</text>
<!-- === BOTTOM: o1 / reasoning models === -->
<rect x="25" y="335" width="710" height="68" rx="5" fill="#0b1220" stroke="#233043" stroke-width="1"/>
<text x="380" y="353" fill="#e6edf3" font-size="10" text-anchor="middle" font-weight="600">Reasoning Models (trained to think, not just prompted)</text>
<text x="105" y="377" fill="#c4b5fd" font-size="9.5" text-anchor="middle" font-weight="600">o1 / o1-pro</text>
<text x="105" y="391" fill="#8b98a5" font-size="8" text-anchor="middle">hidden chain, test-time compute</text>
<text x="270" y="377" fill="#fbbf24" font-size="9.5" text-anchor="middle" font-weight="600">DeepSeek-R1</text>
<text x="270" y="391" fill="#8b98a5" font-size="8" text-anchor="middle">open-source reasoning</text>
<text x="435" y="377" fill="#34d399" font-size="9.5" text-anchor="middle" font-weight="600">Claude 3.5 (extended)</text>
<text x="435" y="391" fill="#8b98a5" font-size="8" text-anchor="middle">thinking tokens visible</text>
<text x="610" y="377" fill="#60a5fa" font-size="9.5" text-anchor="middle" font-weight="600">QwQ / Gemini Flash</text>
<text x="610" y="391" fill="#8b98a5" font-size="8" text-anchor="middle">thinking + speed</text>
<!-- Key insight -->
<rect x="25" y="411" width="710" height="22" rx="3" fill="#0b1220" stroke="#233043" stroke-width="0.8"/>
<text x="380" y="426" fill="#fbbf24" font-size="9" text-anchor="middle">CoT works because it converts a hard one-step problem into many easy steps — each step is within the model's ability.</text>
<text x="380" y="460" fill="#6b7684" font-size="11" text-anchor="middle">Chain of thought proved that LLMs can reason — they just need to be asked to show their work.</text>
</svg>
```ain-of-thought (CoT)** is the discovery that large language models solve hard problems far more reliably when they are prompted to reason step by step instead of blurting out an answer. Asking a model to "think it through" before answering — or simply appending "Let's think step by step" — can turn a wrong response into a right one on math, logic, and multi-step questions, with no change to the model's weights. This simple idea grew into an entire class of reasoning models that are explicitly trained to produce long internal reasoning before their final answer, and it reframed a key lever of AI capability: how much computation a model spends at inference time.\n\n```svg\n<svg viewBox="0 0 760 400" xmlns="http://www.w3.org/2000/svg" font-family="-apple-system,Segoe UI,Roboto,sans-serif">\n <rect x="0" y="0" width="760" height="400" fill="#0d1117"/>\n <text x="380" y="30" fill="#e6edf3" font-size="21" font-weight="700" text-anchor="middle">Chain-of-Thought & Reasoning Models</text>\n <text x="380" y="52" fill="#8b98a5" font-size="12.5" text-anchor="middle">let the model think in steps before committing to an answer — and spend more compute on harder problems</text>\n <text x="40" y="86" fill="#f87171" font-size="12" font-weight="700">DIRECT — answer immediately</text>\n <rect x="40" y="100" width="96" height="40" rx="7" fill="#151b23" stroke="#8b98a5" stroke-width="1.5"/>\n <text x="88" y="125" fill="#c9d4e0" font-size="13" text-anchor="middle">question</text>\n <rect x="190" y="100" width="120" height="40" rx="7" fill="#2a1420" stroke="#f87171" stroke-width="1.5"/>\n <text x="250" y="120" fill="#fca5a5" font-size="13" text-anchor="middle">answer</text>\n <text x="250" y="134" fill="#f87171" font-size="13" text-anchor="middle">✗ often wrong</text>\n <line x1="136" y1="120" x2="190" y2="120" stroke="#3f5169" stroke-width="1.8"/>\n <path d="M183 123 L190 120 L183 117" stroke="#3f5169" stroke-width="1.8" fill="none"/>\n <text x="40" y="166" fill="#34d399" font-size="12" font-weight="700">CHAIN-OF-THOUGHT — reason first, answer last</text>\n <rect x="40" y="180" width="96" height="40" rx="7" fill="#151b23" stroke="#8b98a5" stroke-width="1.5"/>\n <text x="88" y="205" fill="#c9d4e0" font-size="13" text-anchor="middle">question</text>\n <rect x="190" y="180" width="120" height="40" rx="7" fill="#141a2e" stroke="#818cf8" stroke-width="1.5"/>\n <text x="250" y="198" fill="#a5b4fc" font-size="12" text-anchor="middle">step 1</text>\n <text x="250" y="212" fill="#8b98a5" font-size="12" text-anchor="middle">reasoning</text>\n <rect x="330" y="180" width="120" height="40" rx="7" fill="#141a2e" stroke="#818cf8" stroke-width="1.5"/>\n <text x="390" y="198" fill="#a5b4fc" font-size="12" text-anchor="middle">step 2</text>\n <text x="390" y="212" fill="#8b98a5" font-size="12" text-anchor="middle">reasoning</text>\n <rect x="470" y="180" width="120" height="40" rx="7" fill="#141a2e" stroke="#818cf8" stroke-width="1.5"/>\n <text x="530" y="198" fill="#a5b4fc" font-size="12" text-anchor="middle">step 3</text>\n <text x="530" y="212" fill="#8b98a5" font-size="12" text-anchor="middle">reasoning</text>\n <rect x="610" y="180" width="110" height="40" rx="7" fill="#0f1c17" stroke="#34d399" stroke-width="1.5"/>\n <text x="665" y="200" fill="#6ee7b7" font-size="13" text-anchor="middle">answer</text>\n <text x="665" y="214" fill="#34d399" font-size="13" text-anchor="middle">✓ correct</text>\n <line x1="136" y1="200" x2="190" y2="200" stroke="#3f5169" stroke-width="1.8"/>\n <path d="M183 203 L190 200 L183 197" stroke="#3f5169" stroke-width="1.8" fill="none"/>\n <line x1="310" y1="200" x2="330" y2="200" stroke="#3f5169" stroke-width="1.8"/>\n <path d="M323 203 L330 200 L323 197" stroke="#3f5169" stroke-width="1.8" fill="none"/>\n <line x1="450" y1="200" x2="470" y2="200" stroke="#3f5169" stroke-width="1.8"/>\n <path d="M463 203 L470 200 L463 197" stroke="#3f5169" stroke-width="1.8" fill="none"/>\n <line x1="590" y1="200" x2="610" y2="200" stroke="#3f5169" stroke-width="1.8"/>\n <path d="M603 203 L610 200 L603 197" stroke="#3f5169" stroke-width="1.8" fill="none"/>\n <rect x="440" y="270" width="280" height="110" rx="8" fill="#0b1220" stroke="#233043" stroke-width="1.2"/>\n <text x="580.0" y="290" fill="#cbd5e1" font-size="13" font-weight="700" text-anchor="middle">More thinking → higher accuracy</text>\n <line x1="470" y1="364" x2="695" y2="364" stroke="#3f5169" stroke-width="1.2"/>\n <line x1="470" y1="364" x2="470" y2="300" stroke="#3f5169" stroke-width="1.2"/>\n <polyline points="470,364 481,357 492,350 504,345 515,340 526,335 538,331 549,328 560,325 571,322 582,319 594,317 605,315 616,313 628,312 639,311 650,309 661,308 672,307 684,307 695,306" fill="none" stroke="#34d399" stroke-width="2"/>\n <text x="582.5" y="378" fill="#6b7684" font-size="13" text-anchor="middle">thinking tokens (test-time compute)</text>\n <text x="464" y="300" fill="#6b7684" font-size="13" text-anchor="end">acc</text>\n <rect x="40" y="270" width="378" height="110" rx="8" fill="#0b1220" stroke="#233043" stroke-width="1.2"/>\n <text x="58" y="292" fill="#cbd5e1" font-size="13" font-weight="700">Reasoning models take this further</text>\n <text x="58" y="312" fill="#9fb4c6" font-size="12">• trained with RL to reason before answering</text>\n <text x="58" y="330" fill="#9fb4c6" font-size="12">• generate a long hidden “thinking” trace, then a final answer</text>\n <text x="58" y="348" fill="#9fb4c6" font-size="12">• spend variable compute — harder problem, longer thinking</text>\n <text x="58" y="366" fill="#9fb4c6" font-size="12">• e.g. o-series / R1-style “thinking” models</text>\n</svg>\n```\n\n**Why it works: hard problems need intermediate steps.** A single forward pass has a fixed amount of computation, and some problems genuinely require a sequence of dependent deductions that cannot be reached in one leap. Writing the reasoning out gives the model "scratch space" — each generated step becomes context the next step can build on, so the model effectively computes longer on harder inputs. The visible reasoning is not decoration; it is the mechanism by which extra computation happens.\n\n**Prompted CoT was the first form.** Few-shot chain-of-thought puts worked examples in the prompt showing the reasoning, and zero-shot CoT simply instructs the model to reason step by step. Both dramatically improved performance on benchmarks like grade-school and competition math, revealing that the capability was latent in the model all along and just needed to be elicited.\n\n**Reasoning models bake it in with reinforcement learning.** Rather than relying on the user to ask for reasoning, models like the o-series and R1-style systems are trained — often with RL that rewards correct final answers — to generate a long hidden "thinking" trace before responding. They learn to plan, check their work, backtrack, and try alternative approaches, and they allocate more thinking to harder problems. The reasoning trace may be hidden from the user, but it is where the real work happens.\n\n**This introduced test-time (inference-time) scaling.** For most of deep learning, capability came from scaling training — more data, more parameters, more pretraining compute. Reasoning models opened a second axis: spend more compute at inference by thinking longer, and accuracy keeps climbing on reasoning-heavy tasks. A single model can now be "turned up" for a hard problem by letting it think for longer, a fundamentally different cost and capability trade-off than picking a bigger model.\n\n**The trade-offs are latency, cost, and honesty.** Thinking tokens are generated tokens — they cost time and money, so reasoning models are slower and pricier per query, and are usually reserved for problems that need them. There is also an active question of faithfulness: the written reasoning does not always reflect the true computation that produced the answer, so a plausible-looking chain of thought is not a guarantee of a sound one.\n\n| Approach | How reasoning is triggered | Cost profile | Best for |\n|---|---|---|---|\n| Direct answer | none | cheapest, one pass | easy, factual, or lookup questions |\n| Prompted CoT | prompt asks for steps | a few extra tokens | many tasks, no special model |\n| Reasoning model | RL-trained to think first | variable, can be large | math, code, planning, hard logic |\n\nRead chain-of-thought through a *compute-you-spend-at-inference* lens rather than a *prompt-trick* lens: the deep shift is not the phrase "think step by step" but the realization that a model's answer quality on hard problems is a dial you can turn by letting it compute longer. Reasoning models productize that dial — trading tokens, latency, and dollars for accuracy — and add a second scaling axis to AI alongside the older one of simply training bigger.\n
chain of thoughtcotreasoning
Explore 500+ Semiconductor & AI Topics
From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.