Act 3 · Frontier & Caveats

12. Teaching Models to Reason: STaR and Self-Improvement

In STaR, a model writes its own reasoning, an answer key discards what's wrong, and the survivors become its next training set.

1. Run the loop

The algorithm, explained. Start with a pretrained model and a stack of problems whose correct answers you know. There are no worked solutions, only the answers. For each problem, the model writes out its reasoning and ends with an answer. If that answer matches the key, the reasoning is kept. If it misses, the model gets one more try with the correct answer shown as a hint; if it now reasons its way there, the reasoning is kept and the hint is deleted from the record. Finally, the original pretrained model is fine-tuned on everything kept, and the loop starts over with a slightly better model writing the next round of reasoning.

correct ✓ keepwrong ✗✓ kept↺ repeatgeneratea rationale + answerfilteranswer vs. the keyrationalizehint = the answerfine-tunebase model, on keepers

This is STaR's loop.reference 1 It still needs a dataset, questions with correct answers, but nobody has to write the reasoning; the model authors that itself. Everything rests on the answer key: the correctness check that decides which rationales are allowed to train, and the external signal deciding what the model may study.

Algorithm

The same loop from section 1, in ten lines.

M ← M0one model is both student and teacher
loop: until accuracy plateausexpert iteration (Anthony et al. 2017): the same loop, before LLMs
kept ← ∅
for (x, y) in problems:the only supervision that exists: answers, never reasoning
r, ŷ ← M(x)one greedy rollout: low variance, biased exploration; RFT (Yuan et al. 2023) samples k instead
if ŷ = y: keep (x, r, y)in RL terms: a binary reward, checked for free by section 1's answer key
else:
r′, ŷ′ ← M(x, hint = y)hindsight: knowing the destination makes the route easier to find
if ŷ′ = y: keep (x, r′, y)the hint is stripped, so the model trains as if it had found the route unaided
M ← finetune(M0, kept)restart from the base model every round, so early quirks never compound into the weights
The ten lines above are STaR's Algorithm 1, condensed.reference 1 Line 2's loop is not just similar to reinforcement learning: it is the same procedure, expert iteration, from five years before LLM reasoning.reference 2 Line 5 makes one attempt per problem; the RFT variant samples several instead and keeps the ones that reach the right answer.reference 3

2. Which reasoning goes into the training set?measured · Qwen2.5-3B-Instruct · 100 MATH-500 problems

Download the notebook (zip, 5.0 MB) ↓

To understand how reasoning is selected for the training set, let's look at how STaR could work with Qwen2.5-3B-Instruct on 4 problems pulled from the MATH-500 dataset, below. We won't be showing the training itself; rather, we will focus on how the reasoning is selected for training in the first place.

Notice that when the model's answer does not match the answer key, the model still gets another chance, through rationalization. The model is re-prompted with the answer as a hint, and as long as it produces reasoning that leads to the correct answer, that reasoning trace is still stored. When rationalization is off, the model gets no second chances.

problem 1 of 4

Press Play to run one pass of STaR on this problem.

The answer key for this problem:key81

    Algebra · level 5

    The greedy chain

    What is the maximum value of 4(x + 7)(2 - x), over all real numbers x?

    press Play to see its reply

    Run the same pass on all 100 problems. How many put reasoning into the training set?

    This is the data one round of STaR would fine-tune on; nothing here is trained. Sampling 16 chains per problem instead of one greedy chain, the RFT variant,reference 3 reaches 81 problems without a hint, but more samples also reach more right answers through wrong reasoning, which is why STaR decodes greedily.reference 1

    Why keep reasoning that was given the answer? The reasoning is what we want the model to learn, and the hint is removed before the trace is stored. In the STaR paper, rationalization raised accuracy on CommonsenseQA from 68.8% to 72.5%.reference 1

    No human in the loop. Every trace in the training set was written by the model and checked only against the answer key: 43 from one greedy pass, 53 more from rationalization. The questions and their answer keys are reused; the model writes everything else. So the training set grows without drawing on the limited stock of human-written text that pre-training depends on.

    Trained on reasoning, graded on answers. The answer key checks only the final answer, so a flawed argument that lands correctly is kept and imitated. Models often follow a wrong reasoning path to the right answer.reference 4 Here, 22 of the 53 rescued traces refer to the hint directly.