Prompting Techniques for Language Models
Prompting alone is not enough when the examples the model learned from never showed reasoning.
Two Ways to Answer the Same Question
Suppose you want a language model to reason through a problem before it commits to an answer. You could simply ask it to show its work in the prompt. But that only helps if the model already knows how to show its work, and that skill has to come from somewhere. This article approaches chain-of-thought reasoning from the training data side. The question we will keep returning to is: what must the example responses in a finetuning dataset look like if a model is going to learn to think in steps?
What do you think happens?
A shop has 4 trays with 6 muffins on each tray. It sells 9 muffins. How many muffins are left? Before you look at the answer, decide which response style would be more useful to a learner checking the work: a bare number, or a response that states each intermediate result.
Reveal answer
The response that states each intermediate result is the more useful one for checking, because each link can be verified. Both lead to the same final value, 15.
The final value is 15 in either case. The difference is whether the reader can see and check the steps that produced it.
What a Step-by-Step Response Contains
A chain-of-thought (CoT) response states intermediate steps, and each step depends on the result of the one before it, so the final answer is supported by a visible chain.
The contrast becomes clear when two training examples sit side by side. The source describes two examples a dataset builder might write for a question about nitrogen. In the first, the instruction asks for the boiling point of nitrogen and the response is a single value, -320.4F. The response contains no reasoning at all. In the second, the instruction explicitly asks the model to reason step by step, and the response walks through an apple problem one stage at a time before arriving at the total. Both examples come from the same research source, and together they show the two response styles.
How Each Step Depends on the One Before
The word chain is doing real work. In a CoT response, each step is built on the step before it, so the final answer is supported by a sequence of smaller claims rather than appearing from nowhere. The apple response in the source follows this pattern: it states a fact, performs an operation on that fact, and then uses the result of that operation as the input to the next operation. A reader can check each link, and a model trained on such responses learns to produce intermediate results in the same order.
Tracing the Muffin Chain
A shop has 4 trays with 6 muffins on each tray. It sells 9 muffins. How many muffins are left?
- 1State the starting facts
There are 4 trays, and each tray holds 6 muffins.
- 2Apply the first operation
Compute the total on the trays: $4 \times 6 = 24$.
- 3Use that result as the next input
The shop starts with 24 muffins, so the 24 becomes the number that the sale is subtracted from.
- 4Apply the second operation
Subtract the sale: $24 - 9 = 15$.
15 muffins are left. Each intermediate value (24, then 15) can be checked on its own, and the second step cannot be computed without the result of the first.
Change the number of muffins sold from 9 to 30 and retrace the chain. Which intermediate value changes, and which one stays the same?
Hints
- The first intermediate value depends only on the trays, so it does not change.
- Check whether the second step still uses the result of the first step.
Why a Model Must See Step-by-Step Examples
A model learns the patterns that appear in its training examples. If every example in a finetuning set jumps straight to a final answer, the model has little reason to produce intermediate steps when it faces a hard question. The source makes this point directly: to teach a model to generate step-by-step responses, its training data should include CoT responses. Prompting alone is not enough when the examples the model learned from never showed reasoning.
The evidence cited in the source supports this. In work by Chun et al. (2024), adding step-by-step responses to finetuning data improved performance on CoT tasks for models of several different sizes. For some tasks, accuracy nearly doubled. The improvement comes from the data itself, which is why the construction of CoT examples matters for anyone building a training set.
Mistakes When Thinking About CoT Data
Common mistake Assuming that asking for steps in the prompt is enough
What it looks likeA builder writes only final-answer examples and then asks the model to show its work at inference time.
Why it failsThe source states that prompting alone does not supply the pattern. If the examples the model learned from never showed reasoning, the model has little reason to produce intermediate steps.
Do this insteadInclude CoT responses in the training data so the model learns the pattern from examples.
Common mistake Treating any response with a number in it as a CoT response
What it looks likeThe response 'The total is 15.' is a single value, with no intermediate steps.
Why it failsA CoT response states intermediate steps in which each step depends on the one before it. A bare value, like the -320.4F boiling point example, has no chain.
Do this insteadCheck whether the response contains intermediate steps linked to one another before the final answer.
Common mistake Thinking step-by-step data is just a longer version of a normal answer
Why it failsEach intermediate claim must be correct and must feed into the next one. A chain with a wrong link is not supported, even if it looks detailed.
Do this insteadVerify each link in the chain, the same way a reader would check the apple response.
Why Step-by-Step Data Is Scarce
If CoT data helps so much, why not simply have plenty of it? The source identifies the bottleneck: generating multi-step responses is slow and laborious. Explaining how to solve a problem step by step is far more demanding than writing down only the final answer. A bare answer such as 9 takes seconds to record, while the apple response requires the writer to state each intermediate value correctly. Because of this extra effort, CoT datasets are less common than other instruction datasets.
For dataset construction, this scarcity means that each CoT example costs more to produce, so a builder cannot assume that a large pool of step-by-step responses already exists. Every example that shows intermediate steps has to be written with the same care that each link requires, which limits how quickly such a dataset can grow.
Judging Response Styles
For each response below, decide whether it is a step-by-step (CoT) response or a final-answer-only response, and explain your decision in terms of whether each step depends on the one before it. Response A: 'The boiling point is -320.4F.' Response B: 'Start with 4 trays of 6 muffins, which is 24. Sell 9 from the 24, which leaves 15.'
Hints
- Look for intermediate values that are stated before the last line.
- Ask whether the second value is built from the first.
Key Takeaways
- A chain-of-thought response states intermediate steps, and each step depends on the result of the one before it, so the final answer is supported by a visible chain.
- A final-answer-only response, such as a single boiling point value, gives no reasoning for a reader to check.
- Prompting alone does not supply the step-by-step pattern; a model learns to produce CoT responses when its training data includes them.
- Research cited in the source found that adding step-by-step responses to finetuning data improved CoT performance across several model sizes.
- CoT datasets are less common because writing multi-step responses is slower and harder than writing a final answer.