Vibe Engines
YouTube

Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path

~11 min readNeurIPS 2022

STaR,
explained.

To teach a model to reason, the obvious plan is to show it thousands of worked solutions — but writing those by hand is expensive, and you only have questions and answers. STaR's insight is that the model can write the worked solutions itself. Let it think out loud, keep the reasoning whenever it lands on the right answer, train on those keepers, and repeat. The model becomes its own teacher, bootstrapping from correct-by-luck reasoning to genuinely better reasoning. Here's the loop, and the trick that rescues the problems it can't yet solve.

The delta

What changes against Self-Instruct: the model bootstraps reasoning, not instructions

Rung 3 generates tasks and filters them for diversity. This rung generates reasoning and filters it for correctness, which is a much stronger filter because it is not a heuristic — it is the answer key. The loop: prompt the model with a few worked examples, let it produce a chain of reasoning and a final answer for each training problem, keep only the chains whose final answer is right, fine-tune on those, and repeat with the improved model. Each round the model solves problems the previous round could not, which produces training data the previous round could not.

That loop stalls in an obvious place: problems the model never gets right generate no training data at all, so the hardest problems — the ones worth learning from — are exactly the ones that contribute nothing. The fix is the paper's cleverest move and it runs the inference backwards. Give the model the correct answer as a hint and ask it to produce the reasoning that leads there. A chain generated with the answer in hand is then used as training data without the hint, so at training time the model sees a hard problem paired with a plausible route to its solution.

Stated in the units this ladder cares about: the supervision signal costs nothing per example beyond a known answer — no human writing reasoning, no preference labels, no reward model. Where rung 1 needed contractors and rung 9 needs an expensive annotation effort, this needs a dataset of problems with answers, which already exists for every subject that has ever been examined.

01

No rationale labels

Chain-of-thought showed that models reason better when they write out intermediate steps. The natural follow-up is to train a model to always do that well — but that seems to need a big dataset of high-quality reasoning traces, and those are scarce and costly to write. What you usually have is only the easy part: questions paired with their final answers, no worked solutions.

STaR's move is to close that gap by having the model generate its own rationales and using the known answers as a filter. When the model reasons its way to the correct answer, that reasoning is probably decent — good enough to learn from. When it reasons to a wrong answer, discard it. You never wrote a single rationale; you just judged the model's own reasoning by whether it worked. That turns a pile of question-answer pairs into reasoning training data, for free.

The one-sentence version

Let the model generate rationales, keep only the ones that reach the correct answer, fine-tune on them, and repeat — the model bootstraps its own reasoning from question-answer pairs alone.

02

Generate, filter, fine-tune

The core loop is three steps, run over your dataset of problems:

Step 2 is the whole trick: the ground-truth answer is a free, automatic quality check that selects which self-generated reasoning to trust. The model isn't told how to reason — only whether its reasoning arrived somewhere correct, and it learns from the ones that did. After fine-tuning on the keepers, the model is a bit better, so the next round it generates more correct rationales, which makes it better still. The runnable version below shows the filter keeping only correct-answer rationales and accuracy climbing each round.

03

Rationalization

There's a flaw in the plain loop: hard problems never contribute. If the model can't solve a problem, it never produces a correct rationale for it, so that problem is silently excluded from training — forever. The model only ever learns from problems it could already almost do, and the hard ones stay hard. That caps how far bootstrapping can go.

STaR's fix is rationalization. For a problem the model got wrong, give it the correct answer as a hint and ask it to produce a rationale that reaches that answer — reasoning backward from the solution. If it can construct such a rationale, that reasoning trace is added to the training set (with the hint removed). Now the hard problems can contribute reasoning examples too, dramatically widening what the model learns from.

Two sources of training rationales
DirectModel solves it and lands on the right answer → keep the rationale.
RationalizedModel failed → give it the answer as a hint, keep a rationale that reaches it.
CoverageTogether they cover far more problems than direct solving alone.

The runnable below makes this concrete: direct solving covers a fraction of problems, and rationalization pulls in a big chunk of the ones it missed — so the training set spans the hard problems the plain loop would abandon.

04

The bootstrap

Run the loop repeatedly and it bootstraps: each iteration's improved model generates better, more numerous rationales, which fine-tune an even better model. It's a self-improvement flywheel powered by nothing but question-answer pairs and the model's own generations. The improvement isn't unbounded — it tapers as the model approaches the limit of what this data and process can teach — but the early rounds compound quickly.

What makes it work is the asymmetry between generating a rationale and checking it: the model can't always reason correctly, but you can always check whether its answer is right. That gap — hard to produce, easy to verify — is exactly what STaR exploits, turning a cheap verifier (does the answer match?) into a training signal for the expensive skill (reasoning). It's the same asymmetry that underlies a great deal of later reasoning work.

How it works

How STaR bootstraps a reasoner, step by step

STaR needs a pretrained model, a dataset of questions with known answers and a handful of worked examples. The paper used GPT-J, a 6B-parameter model, on three datasets: generated n-digit addition problems, CommonsenseQA (five-way multiple choice, 9,741 training and 1,221 dev questions) and GSM8K (7,473 training and 1,319 test problems).

Question x + few-shot rationales Model writes rationale, then answer Answer = key? compare with y yes no Keep it solved unaided Hint: give y mark the right choice Rationalize reason toward y if it reaches y Fine-tune the original model on all kept hints removed before training the new model generates the next round
One STaR round. Accent boxes are rationalization, the path that lets questions the model failed still produce training data.
  1. Prompt with a few rationales. A fixed few-shot prompt shows the format: question, rationale, answer. For CommonsenseQA it was 10 questions based on the chain-of-thought paper's exemplars, with rewritten rationales; for arithmetic, 10 scratchpad examples per digit length.
  2. Generate. The current model writes a rationale and an answer for every training question, using greedy decoding.
  3. Filter by the answer key. A rationale is kept only if its final answer matches the known answer. No other check is applied.
  4. Rationalize the misses. For questions answered wrongly, the correct answer is shown as a hint and the model writes a rationale that reaches it. In CommonsenseQA the correct option is marked as the right one in the list of choices; in arithmetic the target answer is appended. A rationalized example is kept only if it lands on the correct answer, and it is stored without the hint, so the training example reads as if the model had reasoned there unaided.
  5. Fine-tune from the original model. Each outer iteration fine-tunes the original pretrained GPT-J on all kept examples, rather than continuing from the previous iteration's checkpoint, to avoid overfitting. For CommonsenseQA, training started at 40 steps and grew by 20% each iteration.
  6. Repeat. The new model generates the next round's rationales. A better model keeps correct rationales for more questions, and the loop runs until performance stops improving.

Why the decoding is greedy

The authors tried sampling rationales at higher temperatures, 0.5 and 0.7, to get more varied training data. It backfired: higher temperature raised the chance of reaching the correct answer through flawed reasoning, which the filter then kept, and models trained on that data did worse; on arithmetic the scratchpads degenerated. On CommonsenseQA the risk is built in, since a random guess among five options is right 20% of the time and simple similarity heuristics reach about 30% with no reasoning at all.

STaR as approximate reinforcement learning

The paper frames the loop as an approximation to a policy-gradient method whose reward is 1 when the final answer is correct and 0 otherwise. Filtering discards exactly the zero-reward samples, and fine-tuning on the rest follows that gradient. The approximations are greedy decoding instead of sampling, many fine-tuning steps on each round's fixed data, and rationalization, whose samples come from a hint-conditioned distribution the model never sees at test time. That last piece is not part of the on-policy gradient (the paper suggests framing it as an off-policy estimate, with the hint-augmented model as the proposal distribution), and it is what lets failed questions contribute at all.

The math

The objective STaR approximates

J(M, X, Y) = Σi E(r̂i, ŷi) ~ pM(· | xi) [ 1(ŷi = yi) ]
∇J(M, X, Y) = Σi E(r̂i, ŷi) ~ pM(· | xi) [ 1(ŷi = yi) · ∇ log pM(ŷi, r̂i | xi) ]
  • xi, yi — a training question and its known answer.
  • r̂i, ŷi — the rationale and answer the model M generates.
  • 1(ŷi = yi) — the reward: 1 if the answer matches, 0 otherwise. Zero-reward samples contribute nothing to the gradient, which is why discarding them loses nothing.
  • ∇ log pM(ŷi, r̂i | xi) — the fine-tuning gradient on the kept text, rationale and answer together.

Two consequences follow. A question the model never answers correctly has near-zero expected reward and contributes no gradient at all, which is the gap rationalization fills with samples from a hint-conditioned model rather than from pM. And the reward checks only ŷ, so a wrong rationale that happens to land on the right answer is reinforced exactly as strongly as a sound one.

The evidence

What STaR achieved, and against which baselines

The comparisons isolate two questions: do rationales help at all, measured by fine-tuning GPT-J to output answers directly, and does rationalization help, measured by running STaR without it. A roughly 30 times larger GPT-3 fine-tuned to answer directly is the reference point.

CommonsenseQA (dev)AccuracyTraining data used
Few-shot, direct answer (GPT-J)20.9%~0%
Few-shot chain of thought (GPT-J)36.6%~0%
Few-shot chain of thought (LaMDA 137B)55.6%~0%
GPT-J fine-tuned on answers only60.0%100%
STaR without rationalization68.8%69.7%
STaR with rationalization72.5%86.7%
GPT-3 175B fine-tuned on answers only73.0%100%

The training-data column is the share of training questions that ended up with a kept rationale; rationalization raised it from 69.7% to 86.7%, alongside its 3.7-point accuracy gain. On GSM8K, STaR reached 10.7% against 5.8% for direct-answer fine-tuning and about 3% for few-shot prompting, but it kept rationales for only 28.7% of training problems, a reminder that the loop can only amplify what the model can sometimes already do. On arithmetic, STaR with rationalization reached 89.5% overall after 16 iterations, against 76.3% for a baseline trained on 10,000 examples without rationales; without rationalization, accuracy rose in stages, one digit length at a time.

A small human study added a qualitative check: crowdworkers ranking rationales for 50 questions that both methods answered correctly preferred STaR's rationales to the few-shot prompt's more often than not. The authors do not claim this shows human-level rationale quality.

Since then

What the authors admit, and what happened next

The admission is precisely located and it is the reason rung 9 exists. Filtering on the final answer accepts any chain that arrives at it, including chains that are wrong, incoherent, or that reach the right answer for the wrong reason — and the backwards-reasoning trick makes this worse by construction, because a chain written with the answer already known is under no pressure to be the reasoning that would have found it. Post-hoc justification is a category of output humans produce readily, and nothing in this filter excludes it. A lucky guess with a confident explanation is indistinguishable from understanding, to this filter, and gets reinforced.

It also needs known answers, so it is confined to verifiable domains, and each round's fine-tune is trained on the previous round's distribution, which is a self-reinforcement loop with no external correction.

How it held up: as the template for everything that followed. Generate attempts, keep what verifies, train on the survivors, repeat is the shape of the reasoning-model wave — and the largest change since was to swap the supervised fine-tune for reinforcement learning on the same verified signal, which makes the loop continuous rather than round-based. Read this rung as the origin of the idea that a model can be its own source of training data for reasoning, and rung 9 as the objection that the filter is measuring the wrong thing.

SOLVE IT YOURSELF

Filter, rationalize, bootstrap

STaR's loop is a filter and a flywheel. This keeps only the rationales whose answer is correct (the free quality check), shows that rationalization — hinting the answer on failed problems — lifts coverage from 40% to 75% by pulling in problems direct solving missed (which otherwise contribute nothing), and runs the bootstrap: accuracy climbs each iteration toward a ceiling with diminishing returns (0.30 → 0.60 → 0.75 → 0.83 …). Change the solve rates or the gain and watch the flywheel turn.

YOUR TASK

Write the body of star_iterate. Everything else in the file is already written; this is the function the paper is about. Press ▶ Run to check it against the 5 assertions below — they start red.

WHAT IT HAS TO SATISFY — 5 ASSERTIONS
  1. STaR keeps only correct-answer rationales
  2. Rationalization increases coverage over direct-only
  3. Without rationalization a hard problem contributes nothing
  4. Accuracy improves each iteration toward the ceiling
  5. Accuracy never exceeds the ceiling
CPython · WebAssembly
06

What it foreshadowed

STaR reads, in hindsight, like a blueprint for the reasoning-model era. Its loop — generate candidate reasoning, keep what's verified correct, train on it, repeat — is precisely the shape of the reinforcement-learning-from-verified-answers methods (like GRPO with verified-answer rewards, the setup DeepSeek-R1 used) that trained the current generation of reasoning systems. STaR did it with supervised fine-tuning on filtered samples; later work does it with RL and reward signals, but the core self-improvement idea is the same.

Its enduring lesson is the generate-verify asymmetry as an engine for self-improvement: whenever producing a solution is hard but checking it is easy, a model can bootstrap by generating many attempts and learning from the ones that pass the check. Reasoning with checkable answers is the clearest case, which is why STaR started there — and why that pattern now underlies how frontier models learn to think. It also sits naturally beside process reward models, which sharpen the "verify" side that STaR relies on.

Worth knowing

A subtle risk of the loop: a rationale can reach the right answer by flawed reasoning (correct by luck), and training on it teaches bad habits — the same "right answer, wrong reasoning" problem that process reward models were built to catch.

Questions

Questions people ask about STaR

Can you show an example of STaR rationalization?

Here is the shape of it, with an illustrative question rather than one from the paper. A CommonsenseQA-style question asks where you would keep milk so it does not spoil, with five options. The model answers cupboard, which is wrong, so plain STaR discards the attempt. For rationalization, the same question is shown again with the refrigerator option marked as the correct choice, and the model writes a rationale that leads there: milk spoils at room temperature, cold slows bacteria, and a refrigerator is the cold place in a kitchen. Because it ends at the right answer, it is kept, and it is stored with the mark removed, so the model trains on the question alone followed by that reasoning.

How is STaR different from rejection sampling fine-tuning?

Both keep only the model's own solutions that reach the correct answer and fine-tune on them. Rejection sampling fine-tuning, or RFT, from a 2023 study of math-reasoning scaling by Yuan and colleagues, runs that filter once, sampling many solutions per problem from a supervised model and keeping the distinct correct reasoning paths. STaR differs in three ways. It iterates, so each round's improved model generates the next round's data. It generates greedily, one attempt per question, rather than sampling many. And it adds rationalization, which uses the answer as a hint to recover training examples from questions the model failed. Later work such as ReST-EM frames the iterated loop as expectation-maximization.

Why does STaR fine-tune from the original model each iteration?

To avoid overfitting. Each round's kept rationales were generated by the previous round's model, so continuing to train that model on its own outputs would compound whatever it had over-learned, round after round. STaR instead restarts from the original pretrained GPT-J every iteration and fine-tunes it on the current, larger set of kept examples. Improvement still carries forward, because the data improves: a better model keeps correct rationales for more questions, and the next round trains on all of them. The cost is retraining from scratch each time, which the paper offsets by starting with a short run, 40 steps for CommonsenseQA, and growing it by 20% per round.

Is STaR a form of reinforcement learning?

Approximately. The paper shows that STaR's filter-then-fine-tune loop approximates a policy-gradient method whose reward is 1 for a correct final answer and 0 otherwise. Samples with zero reward contribute nothing to that gradient, so discarding them and fine-tuning on the rest moves in roughly the same direction. The differences are that STaR decodes greedily instead of sampling, takes many supervised steps on each round's fixed data, and adds rationalization, whose hint-conditioned samples come from a different distribution, so at best it is an off-policy estimate, as the paper itself suggests. Later reasoning work replaced the supervised step with reinforcement learning on the same kind of verified reward, which turns STaR's rounds into a continuous loop.

What came after STaR, such as V-STaR and Quiet-STaR?

Several follow-ups kept STaR's core idea of learning from the model's own verified reasoning. V-STaR, from 2024, also uses the incorrect solutions STaR throws away: it trains a verifier with DPO on correct and incorrect self-generated solutions and uses it to pick among candidates at test time. Quiet-STaR, also from 2024 and from STaR's first author, extends rationales to ordinary text, teaching a model to generate short internal thoughts that help predict what comes next. ReST-EM and rejection sampling fine-tuning scaled the filter-and-retrain loop to larger models and math datasets, and RL-based reasoning training can be read as STaR with the supervised step replaced by policy optimization.

How well did STaR work on GSM8K math problems?

Modestly. With GPT-J, STaR reached 10.7% on the GSM8K test set, nearly double the 5.8% from fine-tuning the same model to output answers directly and far above the roughly 3% from few-shot prompting. But even with rationalization it kept rationales for only 28.7% of the training problems, because a 6B model rarely produced a correct multi-step solution, and the loop can only learn from what it gets right or can rationalize. CommonsenseQA, where STaR nearly matched a fine-tuned GPT-3 175B at 72.5% against 73.0%, was a far better fit. Bootstrapping amplifies ability the model already has some of the time; it does not create it from nothing.

Check yourself

4 questions to test what you just read

Work each one out before you open it — a number, a prediction or a reason, not a definition. Producing the answer is what makes it stick. Your progress is kept on this device.

STaR's GPT-J scored 72.5% on CommonsenseQA and a fine-tuned GPT-3 scored 73.0%. Roughly how many times larger is GPT-3, and what did each model learn from?

Show answer

175B / 6B ≈ 29×, which the paper rounds to 30×. GPT-3 was fine-tuned on every training question's answer; STaR's GPT-J learned from its own rationales for the 86.7% of questions it could solve or rationalize, with no human-written rationales beyond the 10 in its prompt.

Which training questions contribute nothing in a STaR round without rationalization, and how does rationalization change that set?

Show answer

Every question the model answers wrongly contributes nothing: its indicator reward is 0, so no example is kept. Without rationalization, 30.3% of CommonsenseQA training questions were left out (69.7% kept). Rationalization recovers the ones the model can reason toward once given the answer, cutting the left-out share to 13.3% (86.7% kept).

Why does STaR store a rationalized example without its hint, and what would the model learn if the hint stayed in?

Show answer

At test time there is no hint. Stored without it, the example teaches the model to produce that reasoning from the question alone. With the hint left in, the model would learn to reason toward an answer it has been given, a skill it can never use at test time, and the hard questions would teach it nothing transferable.

A rationale for a five-option question is incoherent but happens to end on the correct letter. Using STaR's gradient, what does training do to that rationale?

Show answer

Its reward 1(ŷ = y) is 1, so the update increases log pM(ŷ, r̂ | x) for the whole text, flawed rationale included. The filter cannot tell lucky from sound, and with a 20% chance-level hit rate on five options such examples are not rare, which is why the authors kept greedy decoding instead of higher temperatures.

Where this sits

Teaching a base model to follow

A pre-trained model completes text; it does not take instructions. Nine papers on getting from one to the other, from RLHF to a loss with no reward model in it.

  1. 1InstructGPT2022
  2. 2Constitutional AI2022
  3. 3Self-Instruct2023
  4. 4LoRA2022
  5. 5QLoRA2023
  6. 6Direct Preference Optimization2023
  7. 7GRPO2024
  8. 8STaR2022
  9. 9Let's Verify Step by Step2023

All 110 papers, in 19 ladders →

Finished this one? 0 / 110 Paper Breakdowns done
NextLet's Verify Step by Step Next on the “Teaching a base model to follow” ladder · rung 9 of 9

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Paper Breakdowns