Chain-of-Thought
Also: CoT, Chain of Thought Prompting, Step-by-Step Reasoning
A prompting technique where a language model is guided to produce intermediate reasoning steps before giving a final answer, improving accuracy on complex tasks.
What It Is
Chain-of-Thought (CoT) is a prompting and reasoning technique used with large language models (LLMs) in which the model generates a sequence of intermediate reasoning steps before producing a final answer. Instead of jumping straight to a conclusion, the model is encouraged to "think out loud," breaking a problem into smaller, logically connected parts.
The technique can be triggered in several ways: by adding instructions like "Let's think step by step," by providing worked examples that include reasoning (few-shot CoT), or through model training that makes step-by-step reasoning a default behavior.
Why it matters
Many tasks, such as multi-step arithmetic, logic puzzles, and complex decision making, are difficult to solve in a single pass. Chain-of-Thought improves performance because it:
- Decomposes complexity: Large problems are split into manageable steps.
- Reduces errors: Each step builds on a verified intermediate result.
- Increases transparency: The visible reasoning trail makes it easier to audit and debug model behavior.
- Improves reliability: Studies consistently show higher accuracy on reasoning benchmarks compared to direct-answer prompting.
How it is used in practice
- Few-shot CoT: Include 2 to 5 examples in the prompt that demonstrate reasoning, then ask the new question.
- Zero-shot CoT: Simply append a cue such as "Explain your reasoning step by step."
- Self-consistency: Generate multiple reasoning paths and take the majority answer to boost robustness.
- Hidden reasoning: In production, the reasoning can be generated internally and stripped from the user-facing output to keep responses clean.
A practical caution: exposed reasoning can leak sensitive logic or be verbose, so teams often separate the reasoning from the final response shown to users.
Concrete Example
Prompt: "A store sells pencils at 3 for $2. How much do 12 pencils cost? Think step by step."
Model output:
1. 12 pencils divided into groups of 3 gives 4 groups.
2. Each group costs $2.
3. 4 groups times $2 equals $8.
Final answer: $8.
Without the steps, a model might guess incorrectly. With Chain-of-Thought, the structured path leads to a correct, verifiable result.