Chain of ThoughtCoT
Prompting a model to reason step-by-step before giving its final answer.
Chain of Thought (CoT) prompting instructs a model to break its reasoning into explicit steps before producing a final answer. This dramatically improves accuracy on multi-step tasks like math, logic puzzles, and complex planning.
How it works: Simply adding "Let's think step by step" or "Explain your reasoning before answering" to a prompt causes most modern LLMs to generate intermediate reasoning steps. These steps then inform the final answer, reducing errors that arise from trying to jump directly to a conclusion.
Variants:
- Zero-shot CoT โ just append "Think step by step" to any prompt
- Few-shot CoT โ provide worked examples showing the reasoning process
- Self-consistency โ sample multiple CoT chains, take the majority answer
- Tree of Thought โ explore multiple reasoning branches simultaneously
- Extended thinking โ Claude and some models support a dedicated reasoning phase
When to use it: Anytime the task requires more than one logical step โ arithmetic, multi-condition decisions, code planning, scientific reasoning. For simple factual recall, CoT adds tokens without benefit.
The tradeoff: More tokens = more cost and latency, but much higher accuracy on hard problems.
In plain terms
Showing your work in a math exam. The process of writing each step forces you to catch errors you'd miss when calculating in your head.