Chain of Thought
Make the model think out loud before it answers.
Intent & Description
π― Intent
Elicit step-by-step reasoning in the model’s output so it decomposes a problem before answering it.
π Context
LLMs trained to predict the next token tend to shortcut to answers. On multi-step math, logic, or planning tasks, this produces confident wrong answers. CoT sidesteps this by forcing the model to externalize its work.
π‘ Solution
Add “think step by step” or equivalent to your prompt, or use few-shot examples that demonstrate step-by-step reasoning. The model’s scratchpad becomes part of the output before the final answer token. For API use, some models support a native thinking block (e.g. Claude extended thinking) that keeps the trace separate from the user-facing response. See also: zero-shot-chain-of-thought, extended-thinking, scratchpad.
Real-world Use Case
- Math and logic problems where intermediate steps determine correctness.
- Any task where auditability of reasoning matters (compliance, medical, legal).
- Debugging model failures β the trace shows exactly where reasoning went wrong.
Source
π TL;DR
Tell the model to show its work β it gets the right answer more often and you can see why.
Advantages
- Measurably improves accuracy on multi-step tasks with no fine-tuning required.
- Makes model reasoning auditable and debuggable.
- Works zero-shot with modern models β just ask.
Disadvantages
- Increases output token count and therefore cost and latency.
- The reasoning trace can be wrong and still lead to a correct answer (or vice versa).
- Verbose traces can fill context windows on long pipelines.