Overview
- chain-of-thought (CoT) prompting asks the model to write its steps before the final answer
- two forms: few-shot CoT (worked examples in the prompt) and zero-shot CoT ("Let's think step by step")
- it is an emergent ability that helps only beyond about 100B parameters
- main point: nothing is retrained, the prompt only unlocks reasoning the weights already have
Chain-of-thought (CoT) prompting asks a language model to write its intermediate reasoning steps before it gives the final answer. The model weights do not change. Only the prompt changes, but the same weights can then solve problems they could not solve before.
Standard prompt against CoT prompt
With a standard prompt, the model answers at once:
Q: ... A: 27The model has one shot at the answer, and here it is wrong.
With a chain-of-thought prompt, the model shows its working:
Q: ... A: There were 5, then 6x3 more, so 5 + 18 = 23. The answer is 23.The model does the computation before it commits to an answer. Same weights, different prompt, different capability.
Two forms
- few-shot CoT: the prompt contains worked examples that spell out the intermediate steps, so the model also produces intermediate steps; this sharply improves arithmetic, commonsense and symbolic reasoning
- zero-shot CoT: no examples at all; adding the single instruction "Let's think step by step" gives much of the same benefit
Emergent ability
- the gain is very small for small models
- the gain appears only beyond roughly 100B parameters
- below that size, chain-of-thought can even make results worse
Nothing was retrained
The reasoning capability was already inside the weights. The prompt only made it reachable. This is the main point of CoT, and it is also a warning: a prompt cannot add a capability the model does not have, and it does not change the model for the next user.
Note
Prompting, including CoT, only steers a frozen model at inference time. The reasons why this is not enough, and why training after pretraining is needed, are in Limits of Prompting and Instruction Tuning.