Chain-of-Thought: Making LLMs 'Show Their Work'
Chain-of-thought prompting makes an LLM 'show its work' by generating intermediate reasoning steps before the final answer. This simple few-shot technique dramatically improves performance on complex tasks like math word problems or commonsense questions, especially for very large models. The common footgun is applying it to smaller models, where it can actually degrade performance instead of helping, as the reasoning ability hasn't yet emerged.
### The Mental Model
Instead of asking a large language model (LLM) for just the final answer, chain-of-thought (CoT) prompting instructs it to 'show its work' first. It's a technique for decomposing a complex problem into a series of intermediate reasoning steps, which the model generates as part of its response. This mimics how a human might work through a problem on paper, leading to more reliable and accurate results for complex tasks.
### How It Works
CoT is a simple prompting method, not a fine-tuning process. You provide the model with a few examples (few-shot exemplars) in the prompt itself. Each example demonstrates the desired format: a question followed by a detailed, step-by-step derivation of the answer, and then the final answer. When presented with a new, similar question, the model follows the pattern, generating its own chain of thought before concluding.
### When to Use It
* **Arithmetic Reasoning:** For multi-step math word problems, CoT allows the model to calculate intermediate values, significantly reducing errors. For instance, a 540B parameter model using just eight CoT examples achieved state-of-the-art accuracy on the GSM8K math benchmark. * **Commonsense Reasoning:** When a question requires connecting multiple pieces of general knowledge, CoT helps the model lay out the logical path. * **Symbolic Reasoning:** For tasks involving manipulating symbols or following a set of abstract rules, generating steps makes the process more robust.
### When NOT to Use It
* **On Smaller Models:** CoT is an emergent ability of scale. On smaller LLMs (e.g., under ~100B parameters), it often provides no benefit and can even degrade performance. * **For Simple, Single-Step Tasks:** If a question is a straightforward fact recall, forcing a chain of thought is unnecessary overhead that might introduce noise.
### One Canonical Example
Imagine a math word problem. A standard prompt might look like this:
`Q: A juggler has 15 balls. He loses 6 and buys 2 new sets of 4 balls each. How many does he have? A: 17`
A chain-of-thought prompt would instead demonstrate the reasoning:
`Q: A juggler has 15 balls. He loses 6 and buys 2 new sets of 4 balls each. How many does he have? A: The juggler starts with 15 balls. He loses 6, so he has 15 - 6 = 9 balls. He buys 2 sets of 4, which is 2 * 4 = 8 new balls. He now has 9 + 8 = 17 balls. The answer is 17.`
By showing this pattern, you teach the model how to reason through the next problem it sees.
Read the original → arxiv.org
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.