Manuscript Offprint
arXiv:2610.21018Failure Is the Mother of Success: Recovering Supervision with Grounding Hindsight
ABSTRACT
Large language models solve reasoning problems by generating long chains of steps, where a single mistake made in the middle steps can negatively impact the final answer. Reinforcement learning with verifiable rewards trains on the final answer alone: when every attempt at a problem fails there is no successful attempt to imitate and no spread between attempts to score, so GRPO learns nothing from exactly the problems it most needs to learn. The failed reasoning can nevertheless suggest what to try next. Prior work either reveals the reference answer when it retries, trusts self-written guidance without testing it, or re-scores the failed attempt instead of sampling a new one. We propose Replay-Selected Hindsight Distillation (RSHD), which enables reasoning explorations from the failure itself. Rather than resampling blindly or revealing the answer, the policy reasons over its own note on what went wrong, and explores from notes that beat the group become supervision during GRPO training. The policy writes a corrective note about each failed attempt without seeing a reference answer or solution, then re-solves the problem with the note in context. A note written without the answer cannot be checked for truth, only for effect: after screening for notes that state the answer, it is admitted only if its exploration replays succeed more often than the original group did, and an admitted replay is distilled into the plain-prompt policy. Because admission turns on fresh successes rather than on the failed rollout, supervision is recovered from groups in which every attempt failed, and from mixed-group failures alike. Only the policy is trained, the only judge is the outcome verifier, and deployment requires no notes or extra inference. Across model families and sizes and two training domains, RSHD consistently improves over GRPO on in-domain benchmarks, and the gains carry over to out-of-domain evaluation sets.
1 INTRODUCTION
Group-relative policy optimization (GRPO) trains reasoning models by comparing verifier rewards across completions of the same problem (Shao et al., 2024; DeepSeek-AI et al., 2025; Surana et al., 2026b). When every completion fails, all group-relative advantages are zero. These all-fail groups provide no task-reward gradient even though their trajectories may reveal recognizable mistakes and unproductive strategies (Yu et al., 2025b; Wei et al., 2026), which potentially can guide the policy on reasoning explorations. This is common precisely on hard problems: if a problem is solved with probability 0.1, an eight-sample group is all-fail more than 40% of the time, and in our math training run roughly half of the groups at the hardest MATH level carry no gradient in Figure 1. GRPO therefore tends to improve problems the policy already sometimes solves while leaving many failures at the capability frontier unused.

Figure 1: Groups that GRPO have no learning signal. On the hardest level, half the groups carry no gradient at all.
Turning these failures into supervision is difficult. Conditioning retries on the reference answer introduces information unavailable at test time (Yang et al., 2026), while trusting self-generated feedback without verification can reinforce incorrect diagnoses. In addition, simply re-scoring a failed rollout can increase the probability of the same mistaken tokens. Useful supervision from failure should instead comes from reasoning explorations, which can reveal a better behavior, verify that it helps, and transfer that behavior back to the plain-prompt policy.
We propose Replay-Selected Hindsight Distillation (RSHD), a failure-conditioned exploration and distillation procedure, which enalbes the reasoning explorations in GRPO. After the verifier scores a group, the same policy summarizes what went wrong in each failed attempt without access to the reference answer, and then re-solves the problem with this note in context. A note is retained only when its fresh exploration replays outperform the original group, and successful replays are distilled into the plain-prompt policy. Thus, even an all-fail group can yield verified supervision despite having zero GRPO advantage. Unlike increasing temperature or nucleus width, which only diversifies retries, RSHD conditions exploration on a diagnosis of the specific failed reasoning. The procedure requires no auxiliary model and adds no inference-time guidance.
Prior work also recovers all-fail signals and internalizes guided retries (Xia et al., 2026b; Shi et al., 2026; Chen et al., 2026; Xia et al., 2026a; Sleiman, 2026). In RSHD the note test is not optional. Across our math run one note in nine states the answer outright and three in five fail the replay test (Table 4). The test is affordable because the group GRPO has already sampled supplies the baseline to beat, so the structure that creates the all-fail problem also pays for its remedy. Section 2 details the differences from these methods and from re-scoring the failed attempt (Wu et al., 2026a).
We evaluate RSHD against GRPO across model families and sizes and two training domains, competition mathematics and free-form science questions, on in-domain and out-of-domain benchmarks. RSHD improves over GRPO consistently, with the largest gains on the hardest problems, and the gains carry over out of domain. A sizeable share of the admitted notes come from all-fail groups, where the original reward signal is zero, and the trained models solve problems in fewer tokens and run out of budget less often. The extra cost is training-time generation only, roughly double the tokens sampled per step, and nothing changes at inference. We summarize our contributions as follows:
• Reasoning explorations from failed reasoning. We develop a failure-conditioned exploration and distillation procedure that can discover successful outcomes without a successful exemplar in the initial group. The note writer never sees the reference answer, and a note is used only after its replays beat the group.
• Replay-selected transfer alongside GRPO. RSHD transfers what this exploration finds into the plain-prompt policy alongside GRPO, keeping replay selection and imitation separate from GRPO’s reward normalization. We characterize the selected-target distribution and the auxiliary signal available when all original advantages vanish.
• An empirical study of the resulting training recipe. We report improved reasoning performance and analyze the notes and replays that supply supervision, including those recovered from all-fail groups, without adding deployment-time guidance.

Figure 2: RSHD overview. From a scored GRPO group, each failed attempt yields a corrective note (left). The note is screened for answer leaks and replayed; it is admitted only if the replays beat the group's own success rate, with one revision round (middle). An admitted replay is scored by the same weights with and without the note, and the plain-prompt policy imitates it with detached lift weights, added to the GRPO loss (right).
out: when every rollout of a prompt earns the same reward the advantages vanish and the prompt contributes nothing. RSHD is built for that case.
Hindsight Exploration. Hindsight Experience Replay reinterprets a failed trajectory through the goal it actually reached (Andrychowicz et al., 2017), and later work settles how much credit a relabeled trajectory should carry, which relabeled goals to train on, and how to iterate the idea as imitation (Rauber et al., 2019; Harutyunyan et al., 2019; Zhao & Tresp, 2018; Ghosh et al., 2021). In reinforcement learning the achieved goal is handed back by the environment; in language it must be inferred from the model's own text, which is where leakage and trust become problems: goals are inferred from outputs, a failed rationale is regenerated with the answer revealed, or inference is sidestepped by keeping only verified samples (Zhang et al., 2023; Zelikman et al., 2022; Singh et al., 2023; Xia et al., 2025). A recent line aims directly at all-fail reasoning groups, retrying with verbal feedback, training a reflect-and-retry loop, converting failures into guidance, hinting from the reference, or restoring student states and distilling verified continuations (Shinn et al., 2023; Shi et al., 2026; Wang et al., 2026b; Lv et al., 2026; Xia et al., 2026b; Chen et al., 2026; Xia et al., 2026a; Sleiman, 2026; Vishe et al., 2026; Yu et al., 2026a). RSHD belongs to this family and differs in three ways. Its writer sees neither the reference answer nor a solution and receives no training objective of its own; a note is admitted by comparing its replays against the already sampled GRPO group, all-fail groups included; and the original group keeps its advantages while a uniformly chosen replay is transferred through a separate plain-prompt loss, with no state restoration or restriction to successful replays.
On-Policy Self-Distillation with Privileged Context. Distillation can transfer privileged information into a policy that lacks it at deployment (Hinton et al., 2015; Lopez-Paz et al., 2016; Wang et al., 2025). GKD and on-policy self-distillation supervise student-generated behavior with a teacher evaluated on the same prefixes (Agarwal et al., 2024; Zhao et al., 2026; Hübotter et al., 2026; Liu et al., 2026), and the open design choice is what the teacher reads. Prior work fills the slot with the reference answer, which leaks and can destabilize training (Yang et al., 2026), with a successful peer completion from the same group (Li et al., 2026b), with a summary of the trajectory (Wang et al., 2026a; Zhou et al., 2026; Hu et al., 2026), or, closest to us, with a hindsight skill the policy writes about its own completed trajectory and re-scores the original actions under, after a skill-SFT stage (Wu et al., 2026a). All of these keep the sampled trajectory fixed and admit the context on sight. RSHD tests the context through fresh outcomes before using it, and lets the auxiliary target change: the distilled tokens are a continuation sampled under the note and selected by its outcome, so the weighted imitation loss is not standard student-on-policy distillation.
3 PROBLEM FORMULATION
Task and notation. Let be a problem and its reference answer, and let be a completion, with its prefix before token . A verifier returns by checking the final answer of against and reads nothing else. A prompt policy that maximizes
Definition 1 (Finite-horizon verifier MDP). Fix a completion budget for the task and trajectory above, so . At RL time , the state records its generated prefix and remaining budget. For , an action appends the next token (or an abstract reasoning step (Wu et al., 2026b; 2025a)); an end-of-sequence action enters an absorbing state. The transition is deterministic and rewards are zero before termination. The only terminal reward is the verifier's defined above; the reference is available to that verifier, not to the policy. Write .
A policy induces a trajectory law , with success probability , so the training objective can equivalently be viewed as maximizing verifier success over induced trajectories.
Group-relative learning and on-policy distillation. At each update, a frozen snapshot samples a group for each problem . “‘latex Let
where is the within-group reward standard deviation and is a numerical stabilizer. GRPO minimizes
where
Here is a single rollout-level statistic shared by all tokens of rollout , unlike the state-action advantage . Thus, failed completions reveal neither where the reasoning went wrong nor how to correct it. Moreover, if , an independently sampled group is all-fail with probability , in which case every and the group provides no task-reward gradient. For on-policy distillation, let denote privileged context and define the frozen teacher
For a sequence u, teacher and student log-probabilities at the same prefix are
and the generic distillation objective is
where is a fixed token weight, typically determined from the teacher–student score gap . In RSHD, is a fresh continuation sampled under privileged context ; teacher scores are stop-gradient and only the student is updated.
4 METHOD: REPLAY-SELECTED HINDSIGHT DISTILLATION
A student who gets a problem wrong learns more from working out what went wrong and reasoning over how to explore a different strategy, rather than being handed the answer, and learns nothing at all from being told only that eight attempts were wrong. RSHD fills the three open slots of Section 3
Algorithm 1 RSHD: explore and select. Kept only if its replays beat the group.
R(y): 1 if y solves problem x
g: answer, used only by leaks()
ys = pi.sample(x, n=8) p = mean(map(R, ys)) for y in failed(ys): s = pi.write_note(x, y) for rnd in (1, 2): if bad(s) or leaks(s, g): break # screened out zs = pi.sample(x+s, n=2) r = mean(map(R, zs)) if r > p: # admitted yield s, pick(zs) break if rnd == 1: s = pi.revise(s, r, zs)
Algorithm 2 RSHD: policy update. Imitated in proportion to the note's lift.
kept: Algorithm 1's (s, replay)
c: weight cap, lam: aux coef
loss = grpo_loss(ys) # unchanged num, ntok = 0.0, 0 for s, yt in kept: # one model, scored twice lt = pi.logp(yt, x+s).detach() ls = pi.logp(yt, x) # per-token lift, capped at c w = clip(lt-ls, 0, c).detach() num += (w * ls).sum() ntok += len(yt) # w=0 too
nothing kept -> plain GRPO
if ntok > 0: loss -= lam * num / ntok return loss
with that idea: a failed attempt is used to write a corrective note, the note is admitted only if solving the problem again with it in context succeeds more often than the original group did, and a solution produced under an admitted note is distilled into the plain-prompt policy. The original group keeps its GRPO advantages, while the admitted replays add a separate reasoning exploration signal. Figure 2 shows the data flow, and Algorithms 1 and 2 the two halves in pseudocode: one problem is shown, batched in practice.
4.1 THE REPLAY-SELECTED HINDSIGHT DISTILLATION (RSHD) OBJECTIVE
Start from (3) with the privileged context being a note written about the failed rollout , and make two choices. First, the sequence that carries the credit is not but a replay: a full solution the same snapshot produced with the note in context, .
Re-scoring under the note could only raise the probability of tokens the model already wrote, the mistaken ones included, whereas a replay contains the tokens the note actually steered. Second, each replay token is weighted by the note's detached, clipped, positive lift on it, so that credit concentrates where the note changed the policy and vanishes where it did not. Scoring at identical prefixes under both prompts as in (2), the loss over the credited positions of a batch is
where caps the weight so that no token dominates, and
where A contains every token of every admitted replay, including zero-weight positions, and U is the admitted set defined in Section 4.2. with only failed rollouts contributing to the second term; successful ones are left to GRPO. Three properties follow directly. Non-empty updates under failure. On an all-fail group every advantage in (1) is zero, while any admitted replay with positive weight gives (4) a nonzero gradient. Exact fallback to GRPO. When no note is admitted, A is empty, the second term vanishes, and the step reduces to plain GRPO. No deployment overhead. Because the note appears only in the teacher prompt, deployment uses the plain prompt with no extra inference, while the outcome-selected targets and teacher-preference weights make (4) distinct from standard student-on-policy distillation and place trust in the note-admission procedure.
4.2 REASONING EXPLORATION AND NOTE ADMISSION
Reasoning exploration. For each the snapshot writes a short corrective note from : what went wrong and what to do instead, at most 80 words, returned as a structured lesson. The writer sees neither the reference answer nor a solution, so notes need no successful exemplar. Groups the policy solves every time are skipped, and failures in mixed and all-fail groups are treated alike. A note is worth using when a fresh attempt is likelier to succeed with it than without it. Writing
the note helps exactly when . Both are properties of fresh attempts rather than of the note's text, and neither is observable, so we estimate the comparison by replay.
Screening and admitting. Two checks run before a single replay is sampled. Write when parses and does not state the reference answer (a string match of the normalized against the note text), and otherwise; a note failing either check is discarded at no sampling cost. A note with is then used to solve the problem times under the rollout sampling settings, and admitted iff its replays beat the original group,
so that the admitted set of a problem is
A note that falls short is revised once: the writer sees the note, its tally, and excerpts of up to three failed replays, again without the reference, and the revision is screened and tested against the same ; a second failure ends the search. For the target in (4) is one of that note's replays drawn uniformly, , whether or not it succeeded.
What admission guarantees. Admission in (5) provides enrichment rather than purity: for an all-fail group, a note is admitted if at least one of its k replays succeeds, and a uniformly sampled admitted replay is correct with probability
so the distilled replay is more likely to be correct but is not guaranteed to be correct. Because an answer-revealing note could satisfy this test trivially, the leak screen is applied before admission, while experiments separately report note survival, replay improvement, and distilled-replay correctness.
5 FAILURE-CONDITIONED EXPLORATION AND TRANSFER
In the verifier MDP of Definition 1, two failures motivate reasoning exploration. No reward contrast: an all-fail GRPO group, which occurs with probability (Section 3), provides no task-reward signal (Lemma 2). Local repair ceiling: a failed trajectory may enter a strategy from which success is unreachable within the remaining budget (Yu et al., 2026b), while restarting with failure-derived context can explore a different strategy. We formalize the second failure and the restart below; proofs appear in Appendix D.
No reward contrast in an all-fail group. Let be the rollout distribution of original prompt and its population success rate. There are no advantages if rollouts are all fail:
Lemma 2 (All-fail GRPO reward signal). For independent , define the event . Then
On , every group-relative advantage is zero and the task-reward part of this group's clipped GRPO surrogate has zero gradient.
This is a finite-sample loss of reward signal, while KL regularization and other problems can still supply gradients. In-rollout self-correction can append reasoning, but cannot erase an earlier prefix or recover spent budget.
The ceiling of local repair. We condition on a fixed problem and write for its rollout law, so that .

Figure 3: Learning with failure-derived notes in a controlled two-strategy task. Plain-prompt success during training (log scale, mean and 95% interval over ten seeds) at three reasoning budgets H, with initial viable-strategy probability 0.01 and note strength 1.6. Every arm is allotted two extra attempts per rollout. Unguided retry imitates accepted retries without a note, repair-biased restart proposes a strategy switch with probability 0.1 and a local repair otherwise, and the strategy-switch note always proposes the other strategy. Success is measured without a note.
Definition 3 (Repair basin and escape rate). For a failed attempt , let comprise complete, budget-feasible trajectories preserving its committed prefix or strategy, with . A possibly history-dependent reflection kernel has escape bound if, given every preceding history without success,
The basin captures a locally reasonable but unreachable approach, not a local optimum of the parameter objective.
Proposition 4 (Repair-restricted exploration ceiling). If a repair kernel has escape bound (Definition 3), then the chance of success within m retries is at most
Prefix- or strategy-preserving repair has and cannot succeed in this case.
The restriction is on the retry kernel, not the name of a method: reflection that restarts from the problem and changes strategy need not have small (Shinn et al., 2023; Shi et al., 2026). The proposition identifies when error repair alone cannot reach a solution; Appendix D gives a horizon-3 witness.
Restarting under a failure-derived proposal. After observing a failure, the same policy writes a context s and solves again from the original problem.
Definition 5 (Failure-conditioned contextual proposal). The current snapshot writes a context s from a failed rollout and its incorrect verdict, then produces fresh complete attempts under . Conditional on the original history and fixed s, define
The escape rate measures a change of strategy; only measures its outcome. Replays are on-policy for this snapshot on the augmented prompt, not for the deployed plain-prompt policy.
Choosing s selects a trajectory-scale proposal without changing model weights, analogous to a temporally extended policy choice (Sutton et al., 1999). It may expose an existing but rarely sampled strategy; the note need not identify an erroneous step.
Proposition 6 (Guided discovery and selected replays). Draw independent complete replays from . Admit s if at least one succeeds, and choose one replay uniformly from the accepting batch, with law . For ,
If , guided replays discover success more often than plain retries; if , they exceed the same-budget repair ceiling of Proposition 4.
On an all-fail group the method’s replay-rate test reduces to this any-success event. Admission does not prove : a neutral note can pass by chance. Population uplift is an empirical premise, while the selected target can still be incorrect.
Transferring discovery into the plain policy. The original GRPO advantages are unchanged. An OPSD-style auxiliary imitates a selected replay without its note. Let and be the prompt policies after the GRPO-only local update and after adding that auxiliary, with trajectory laws and . The next result states what transfer must achieve, rather than assuming that any token-weighted imitation objective achieves it.
Theorem 7 (Conditional local non-degradation). Suppose the admitted replay target has law Q with population margin for . For let be a mixture of complete trajectories. If , then
Thus suffices for non-degradation on . If no replay is admitted and no auxiliary update is taken, the local update equals GRPO's.
This is a conservative policy-improvement condition (Kakade & Langford, 2002; Schulman et al., 2015), not a guarantee supplied by the current positive-lift loss: selected replay sampling and per-token weighting do not certify closeness to . The proof and a token-level KL sufficient condition appear in Appendix D. In the simplest case, however, the loss does move the successful root decision:
Proposition 8 (Two-strategy detached-lift witness). Consider a standalone one-decision problem with strategies 0, 1 and exactly for 1. The original group contains only 0. Let the plain policy have and the fixed-context teacher have , where . Assume there are no other gradients on . From independent teacher replays admit any batch containing 1 and choose one replay uniformly. For , take one gradient step on with detached weights
Conditional on admission, the plain success rate never decreases on this local step and increases strictly in expectation:
The original group’s task-reward GRPO gradient is zero.
The witness depends on credit being placed on the successful root decision and on that logit being unaffected by other trajectories. With shared parameters, multiple decisions, or a different auxiliary objective, positive guided success or a nonzero imitation gradient alone cannot guarantee improvement of the plain policy.
A controlled illustration. Figure 3 runs these steps in a small verifier MDP with two strategies. One is locally valid but cannot finish within the budget H, and the other succeeds only if several later decisions are also correct. A single two-logit policy produces both the GRPO group and the replays, and a note shifts one of its logits by a fixed amount. GRPO barely improves at H = 8, where almost every group fails. At H = 5 and H = 8 the strategy-switch note learns fastest, while a restart that leaves the failed strategy only one time in ten lags far behind at H = 8, as the repair ceiling of Proposition 4 predicts. Unguided retry with the same extra budget comes close by the end of training (0.92 against 0.94 at H = 8), so here the note mainly speeds up discovery. The note effects are fixed by the model rather than written by a policy, so the figure shows what happens when a note helps, not that real notes do.
6 EXPERIMENTS
Setup. Backbones are Qwen3-1.7B, Qwen3-4B and Qwen3-8B (Yang et al., 2025), three sizes spanning roughly a factor of five in parameters, used as released. Each is trained twice. The math
| Backbone | Method | MATH-500 | MMLU-Pro | GPQA-Diamond | TheoremQA |
|---|---|---|---|---|---|
| Qwen3-4B | Base | 65.2 | 30.2 | 1.8/3.1 | 30.6 |
| GRPO | 76.9 | 48.7 | 3.0/9.6 | 40.1 | |
| OPSD | 73.6 | 34.5 | 3.1/6.2 | 34.8 | |
| SEED | 75.2 | 41.7 | 2.3/7.5 | 38.7 | |
| RSHD (ours) | 84.5 | 61.2 | 9.1/27.0 | 56.5 | |
| Qwen3-1.7B | Base | 64.2 | 27.3 | 0.3/2.8 | 25.3 |
| GRPO | 68.1 | 31.1 | 1.6/5.3 | 28.4 | |
| OPSD | 70.3 | 30.9 | 1.3/3.7 | 28.8 | |
| SEED | 71.2 | 29.8 | 1.3/8.7 | 28.4 | |
| RSHD (ours) | 70.0 | 40.4 | 4.9/17.2 | 40.8 | |
| Qwen3-8B | Base | 62.3 | 28.0 | 1.2/2.4 | 26.8 |
| GRPO | 75.3 | 45.1 | 2.8/8.7 | 35.2 | |
| OPSD | 71.0 | 32.2 | 2.7/4.1 | 31.9 | |
| SEED | 74.4 | 42.8 | 3.1/12.7 | 38.6 | |
| RSHD (ours) | 80.6 | 60.7 | 8.9/22.7 | 55.9 |
Table 1: RSHD improves over GRPO on every benchmark and every backbone. Accuracy (% , mean over 8 samples per problem); GPQA-Diamond shows exact/matched. The MATH-500 column reports models trained on MATH, and the other three report models trained on the MMLU-Pro pool, so GPQA-Diamond and TheoremQA are out of domain. All trained rows use the same GRPO rollouts and 150-step budget. Best in bold.
domain trains on the 7,498 MATH training problems (Hendrycks et al., 2021) and is evaluated on MATH-500 (Lightman et al., 2024). The science domain trains on 2,141 MMLU-Pro questions (Wang et al., 2024) with numeric answers, asked free-form, and is evaluated on 300 questions held out from that pool, the free-form GPQA-Diamond set of Chandak et al. (2025) (126 questions), and the 619 numeric questions of TheoremQA (Chen et al., 2023); the latter two are disjoint from the pool. In Table 1 the MATH-500 column reports the math-trained models and the three science columns the science-trained models.
Metric. Accuracy averaged over 8 samples per problem (temperature 0.6, 4,096 tokens), graded by an exact verifier. GPQA-Diamond, whose answers are often phrases, carries a second number in which rejected answers are re-judged by the evaluated model with a yes/no prompt (Appendix A); the matcher never enters training.
Baselines. Base is the released model. All trained rows share the GRPO backbone, rollouts, and step budget and differ only in the added loss. OPSD (Zhao et al., 2026) re-scores the student's rollouts under the reference solution; SEED (Wu et al., 2026a) re-scores them under a self-written note kept without testing (our writer and prompts, without its skill-SFT stage). RSHD differs from SEED in testing the note and from both in distilling a continuation sampled under it rather than the rollout.
Training. All baseline use 150 steps of 14 problems 8 rollouts, learning rate , DAPO token-level loss, and 3,072-token completions. RSHD uses replays, two note rounds, , , and no KL penalty. Full settings are in Appendix B.
6.1 MAIN RESULTS
Table 1 is the main comparison. On MATH, RSHD reaches 84.5 on MATH-500 against 76.9 for GRPO at 4B, a gain of 7.6 points from the same 150 steps and the same rollouts, and 80.6 against 75.3 at 8B. Section 6.2 breaks the 4B result down by problem difficulty. The gain comes with a change in behavior: RSHD writes shorter solutions (1,979 tokens on average against 2,545), runs out of budget half as often (13.2% against 26.2%), and leaves a problem without a boxed answer half as often (8.9% against 18.2%). The share of problems solved on all 8 samples rises from 66.4% to 72.6% and pass@8 from 86.2% to 92.0%, so the improvement is consistent as well as in the mean.
On the science domain the gains are larger. On the held-out slice of the training pool RSHD reaches 61.2 against 48.7 at 4B and 60.7 against 45.1 at 8B, and the two external sets move with it: TheoremQA rises from 40.1 to 56.5 at 4B and from 35.2 to 55.9 at 8B, and GPQA-Diamond, where

Figure 4: Held-out accuracy during training. Rows are the training domain, named on the y-axis (top: MATH, held out on 100 MATH-500 problems; bottom: the MMLU-Pro numeric pool, held out on 100 of its 300 reserved questions), columns are the backbone; every 25 steps, 8 samples per problem at the training temperature. Each panel's y-range is fitted to its own curves, so compare gaps within a panel rather than across panels. RSHD separates from GRPO by step 50 on all three backbones, and the gap is widest on the science domain, where GRPO plateaus early.
every model is weak, from 9.6 to 27.0 matched at 4B. The science-trained models also improve on MATH-500, which they never trained on (74.2 to 81.3 at 4B, 70.7 to 77.5 at 8B), so what the notes teach is not confined to the domain they were written about.
Training dynamics. Figure 4 shows the held-out accuracy during training for every backbone and training domain. On the 4B and 8B backbones the two curves nearly coincide at step 25 and separate by step 50, after which RSHD stays ahead at every checkpoint: the final gap on MATH is 4.5 points at 4B and 5.6 at 8B, and on the science pool about 10 points at 4B and 14 at 8B, where GRPO plateaus within the first 75 steps while RSHD keeps improving until step 100.
6.2 ABLATIONS
The gain grows with problem difficulty. Every MATH problem carries a difficulty label from Level 1 to Level 5, transcribed by Hendrycks et al. (2021) from the competition sources the problems were drawn from, and MATH-500 inherits it (Lightman et al., 2024). We did not define the levels, no part of training or note admission sees them, and their ordering was fixed long before this work, so the split is not one we chose. Figure 5 reads the Qwen3-4B math result along it. The two models are indistinguishable at Level 1 (94.5 both), where 43 problems sit near ceiling and a few samples separate the arms. From there the margin rises monotonically with difficulty, reaching +10.8 points on the 134 Level-5 problems. RSHD adds nothing where GRPO already succeeds and the most where it does not, which is the profile a method that manufactures signal out of failures should have.

Figure 5: Accuracy by MATH's own difficulty label (Qwen3-4B); the y-axis starts at 40. The darker top segment of each RSHD bar is its gain over GRPO, also printed above the pair.
Problems the policy cannot solve at all. Difficulty is a property of the problem; the condition RSHD is built for is a property of the group the policy produced. Section 4.1 claims the two terms divide the work exactly at that line: when all rollouts of a group fail, every advantage in (1) is zero and GRPO's update is empty, while an admitted replay still carries gradient.
The level breakdown above is consistent with that claim without testing it, so we test it directly on Gemma-4-E4B: we stratify MATH-500 by what the released model solves in 8 samples, a third arm that neither trained model can influence, and read the two trained models within each stratum. The 66 problems the base model never solves are those that would have produced an all-fail group had they been in training. There RSHD reaches 15.0 against GRPO's 6.4 (Table 2); a paired bootstrap over those problems puts the gap at points with a interval of , and RSHD is ahead on 21 of them against 3 the other way. On the remaining 434 problems the two arms are level to within half a point. The overall is therefore not a thin gain spread across the benchmark; it is a large gain on the eighth of it where GRPO has no signal at all, and a wash everywhere else.
Table 2: MATH-500 split by what the released Gemma-4-E4B solves in 8 samples. The gain sits entirely on the problems it never solves. is computed before rounding.
| Base model solves it | n | accuracy (%) ↑ | Δ | |
|---|---|---|---|---|
| GRPO | RSHD | |||
| never (0/8) | 66 | 6.4 | 15.0 | +8.5 |
| sometimes (1–7) | 172 | 84.8 | 84.4 | -0.4 |
| avg | 45.6 | 49.7 | +4.1 | |
7 CONCLUSION
GRPO receives no learning signal when every rollout in a group fails, leaving many difficult problems underused during training. We introduced RSHD, which turns failed rollouts into corrective notes, validates them through fresh replays, and distills only guidance that improves outcomes. Across model scales and both mathematics and science domains, RSHD consistently outperforms GRPO, with the largest gains on harder problems and no additional inference-time overhead. These results show that failed rollouts are not merely wasted samples: when their lessons are verified before training, they can become a useful source of supervision for improving reasoning models.
USE OF LARGE LANGUAGE MODELS
In this work, we used generative AI tools to implement analysis code, to provide feedback on the experimental design and on the interpretation of results, and to help draft the paper, its figures and its LaTeX.
REFERENCES
Rishabh Agarwal, Nino Vieillard, Yongchao Zhou, Piotr Stanczyk, Sabela Ramos, Matthieu Geist, and Olivier Bachem. On-policy distillation of language models: Learning from self-generated mistakes. In International Conference on Learning Representations, 2024.
Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. Advances in Neural Information Processing Systems, 2017.
Nikhil Chandak, Shashwat Goel, Ameya Prabhu, Moritz Hardt, and Jonas Geiping. Answer matching outperforms multiple choice for language model evaluation, 2025.
Guirong Chen, Shuqi Ye, Wenkai Yang, Shiqi Shen, Guangyao Shen, and Yankai Lin. CURE: Critique-driven unified reinforcement learning for test-time self-improvement. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 28632–28653. Association for Computational Linguistics, 2026. doi: 10.18653/v1/2026.acl-long.1321. URL https://aclanthology.org/2026.acl-long.1321/.
Wenhu Chen, Ming Yin, Max Ku, Pan Lu, Yixin Wan, Xueguang Ma, Jianyu Xu, Xinyi Wang, and Tony Xia. TheoremQA: A theorem-driven question answering dataset. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, 2023.
Daixuan Cheng, Shaohan Huang, Xuekai Zhu, Bo Dai, Wayne Xin Zhao, Zhenliang Zhang, and Furu Wei. Reasoning with exploration: An entropy perspective, 2025.
Ganqu Cui, Yuchen Zhang, Jiacheng Chen, Lifan Yuan, Zhi Wang, Yuxin Zuo, Haozhan Li, Yuchen Fan, Huayu Chen, Weize Chen, Zhiyuan Liu, Hao Peng, Lei Bai, Wanli Ouyang, Yu Cheng, Bowen Zhou, and Ning Ding. The entropy mechanism of reinforcement learning for reasoning language models, 2025.
DeepSeek-AI, Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, et al. Deepseek-r1 incentivizes reasoning in llms through reinforcement learning. Nature, 645:633–638, 2025. doi: 10.1038/s41586-025-09422-z.
Dibya Ghosh, Abhishek Gupta, Ashwin Reddy, Justin Fu, Coline Devin, Benjamin Eysenbach, and Sergey Levine. Learning to reach goals via iterated supervised learning. In International Conference on Learning Representations (ICLR), 2021. arXiv:1912.06088.
Anna Harutyunyan, Will Dabney, Thomas Mesnard, Mohammad Azar, Bilal Piot, Nicolas Heess, Hado van Hasselt, Greg Wayne, Satinder Singh, Doina Precup, and Rémi Munos. Hindsight credit assignment. In Advances in Neural Information Processing Systems (NeurIPS), 2019. arXiv:1912.02503.
Dan Hendrycks, Collin Burns, Saurav Kadavath, Akul Arora, Steven Basart, Eric Tang, Dawn Song, and Jacob Steinhardt. Measuring mathematical problem solving with the math dataset. In NeurIPS Datasets and Benchmarks, 2021.
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
Wentao Hu, Zhendong Chu, Yiming Zhang, Junda Wu, Ming Jin, Xiangyu Zhao, Yilei Shao, Yanfeng Wang, and Qingsong Wen. SkillBrew: Multi-objective curation of skill banks for LLM agents. arXiv preprint arXiv:2605.29440, 2026.
Jonas Hübotter et al. Reinforcement learning via self-distillation, 2026.
Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In Proceedings of the Nineteenth International Conference on Machine Learning, 2002.
Branislav Kveton, Xintong Li, Julian McAuley, Ryan Rossi, Jingbo Shang, Junda Wu, and Tong Yu. Active learning for direct preference optimization. arXiv preprint arXiv:2503.01076, 2025.
Xintong Li, Chuhan Wang, Junda Wu, Rohan Surana, Tong Yu, Julian McAuley, and Jingbo Shang. Importance sampling for multi-negative multimodal direct preference optimization. In International Conference on Learning Representations (ICLR), 2026a.
Yu Li, Shu Hong, and Tian Lan. Localizing credit at the divergence: Path-conditioned self-distillation for llm reasoning, 2026b.
Hunter Lightman, Vineet Kosaraju, Yura Burda, Harri Edwards, Bowen Baker, Teddy Lee, Jan Leike, John Schulman, Ilya Sutskever, and Karl Cobbe. Let's verify step by step. In International Conference on Learning Representations, 2024.
Yifeng Liu, Shiyuan Zhang, Yifan Zhang, and Quanquan Gu. Self-distilled policy gradient, 2026.
Zichen Liu, Changyu Chen, Wenjun Li, Penghui Qi, Tianyu Pang, Chao Du, Wee Sun Lee, and Min Lin. Understanding r1-zero-like training: A critical perspective, 2025.
David Lopez-Paz, Leon Bottou, Bernhard Scholkopf, and Vladimir Vapnik. Unifying distillation and privileged information. In International Conference on Learning Representations, 2016.
Dongyi Lv, Fushun E, Aichen Cai, Liang Huang, Ya Zhang, Qiuyu Ding, Canhui Wu, Zhi Wang, Yuesong Zhang, Jiaqi Wang, and Nan Duan. FailForge: Distilling procedural competence from persistent failures into code agents, 2026. URL https://arxiv.org/abs/2608.08570.
Gagan Mundada, Zihan Huang, Rohan Surana, Sheldon Yu, Jennifer Yuntong Zhang, Xintong Li, Tong Yu, Lina Yao, Jingbo Shang, Julian McAuley, and Junda Wu. WS-GRPO: Weakly-supervised group-relative policy optimization for rollout-efficient reasoning. arXiv preprint arXiv:2602.17025, 2026.
Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul Christiano, Jan Leike, and Ryan Lowe. Training language models to follow instructions with human feedback. In Advances in Neural Information Processing Systems, 2022.
Paulo Rauber, Avinash Ummadisingu, Filipe Mutz, and Jürgen Schmidhuber. Hindsight policy gradients. In International Conference on Learning Representations (ICLR), 2019. arXiv:1711.06006.
John Schulman, Sergey Levine, Philipp Moritz, Michael Jordan, and Pieter Abbeel. Trust region policy optimization. In Proceedings of the 32nd International Conference on Machine Learning, 2015.
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms, 2017.
Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, Mingchuan Zhang, Y. K. Li, Y. Wu, and Daya Guo. Deepseekmath: Pushing the limits of mathematical reasoning in open language models, 2024.
Taiwei Shi, Sihao Chen, Bowen Jiang, Linxin Song, Longqi Yang, and Jieyu Zhao. Experiential reinforcement learning, 2026. URL https://arxiv.org/abs/2602.13949.
Noah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan, and Shunyu Yao. Reflexion: Language agents with verbal reinforcement learning. In Advances in Neural Information Processing Systems, 2023.
Avi Singh, John D. Co-Reyes, Rishabh Agarwal, Ankesh Anand, Piyush Patil, Xavier Garcia, Peter J. Liu, James Harrison, Jaehoon Lee, Kelvin Xu, et al. Beyond human data: Scaling self-training for problem-solving with language models, 2023.
Essam Sleiman. Privileged on-policy self-distillation. Canvas research write-up, July 2026. URL https://www.canvas.inc/research/privileged-self-distillation.
Rohan Surana, Xintong Li, Sheldon Yu, Yiran Jenny Shen, Chuhan Wang, Tong Yu, Prithviraj Ammanabrolu, Jingbo Shang, Julian McAuley, and Junda Wu. MASS-DPO: Multi-negative active sample selection for direct policy optimization. arXiv preprint arXiv:2605.10784, 2026a.
Rohan Surana, Gagan Mundada, Xunyi Jiang, Chuhan Wang, Zhenwei Tang, Difan Jiao, Zihan Huang, Yuxin Xiong, Junda Wu, Sheldon Yu, Xintong Li, Raghav Jain, Nikki Kuang, Sizhe Zhou, Bowen Jin, Zhendong Chu, Tong Yu, Ryan Rossi, Kuan-Hao Huang, Jingbo Shang, Jiawei Han, and Julian McAuley. Generate, filter, control, replay: A comprehensive survey of rollout strategies for LLM reinforcement learning. Transactions on Machine Learning Research (TMLR), 2026b. arXiv:2605.02913.
Rohan Surana, Gagan Mundada, Junda Wu, Xintong Li, Yizhu Jiao, Bowen Jin, Sizhe Zhou, Tong Yu, Ritwik Sinha, Jiawei Han, Jingbo Shang, and Julian McAuley. F-GRPO: Factorized group-relative policy optimization for unified candidate generation and ranking. arXiv preprint arXiv:2605.12995, 2026c.
Richard S. Sutton, Doina Precup, and Satinder Singh. Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning. Artificial Intelligence, 112(1–2):181–211, 1999. doi: 10.1016/S0004-3702(99)00052-1.
Yash Vishe, Rohan Surana, Xunyi Jiang, Zihan Huang, Xintong Li, Nikki Lijing Kuang, Tong Yu, Ryan A. Rossi, Jingbo Shang, Julian McAuley, and Junda Wu. Skill-R1: Agent skill evolution via reinforcement learning. arXiv preprint arXiv:2605.09359, 2026.
Hao Wang, Guozhi Wang, Han Xiao, Yufeng Zhou, Yue Pan, Jichao Wang, Ke Xu, Yafei Wen, Xiaohu Ruan, Xiaoxin Chen, and Honggang Qi. Skill-sd: Skill-conditioned self-distillation for multi-turn llm agents, 2026a.
Shengjie Wang, Guanghe Li, Zonghan Yang, and Yang Gao. Hindsight hint distillation: Scaffolded reasoning for swe agents from cot-free answers, 2026b.
Yu Wang, Xinshuang Liu, Xiusi Chen, Sean O'Brien, Junda Wu, and Julian McAuley. Self-updatable large language models by integrating context into model parameters. In International Conference on Learning Representations (ICLR), 2025.
Yubo Wang, Xueguang Ma, Ge Zhang, Yuansheng Ni, Abhranil Chandra, Shiguang Guo, Weiming Ren, Aaran Arulraj, Xuan He, Ziyan Jiang, Tianle Li, Max Ku, Kai Wang, Alex Zhuang, Rongqi Fan, Xiang Yue, and Wenhu Chen. MMLU-Pro: A more robust and challenging multi-task language understanding benchmark. In Advances in Neural Information Processing Systems, Datasets and Benchmarks Track, 2024.
Hui Wei, Junda Wu, Sheldon Yu, Sizhe Zhou, Yizhu Jiao, Ming Zhong, Bowen Jin, Tong Yu, Shijia Pan, Jiawei Han, and Julian McAuley. How hard does it think? analyzing step-aware reasoning energy in LLM chain-of-thought trajectories. arXiv preprint arXiv:2607.28674, 2026.
Jinyang Wu, Shuo Yang, Zhengxi Lu, Fan Zhang, Yuhao Shen, Lang Feng, Haoran Luo, Zheng Lian, Shuai Zhang, Zhengqi Wen, and Jianhua Tao. SEED: Self-evolving on-policy distillation for agentic reinforcement learning, 2026a.
Junda Wu, Xintong Li, Ruoyu Wang, Yu Xia, Yuxin Xiong, Jianing Wang, Tong Yu, Xiang Chen, Branislav Kveton, Lina Yao, Jingbo Shang, and Julian McAuley. OCEAN: Offline chain-of-thought evaluation and alignment in large language models. In International Conference on Learning Representations (ICLR), 2025a.
Junda Wu, Rohan Surana, Zhouhang Xie, Yiran Shen, Yu Xia, Tong Yu, Ryan A. Rossi, Prithviraj Ammanabrolu, and Julian McAuley. In-context ranking preference optimization. arXiv preprint arXiv:2504.15477, 2025b.
Junda Wu, Yuxin Xiong, Xintong Li, Sheldon Yu, Zhengmian Hu, Tong Yu, Rui Wang, Xiang Chen, Jingbo Shang, and Julian McAuley. CTRLS: Chain-of-thought reasoning via latent state-transition. In Proceedings of the 29th International Conference on Artificial Intelligence and Statistics (AISTATS), 2026b.
Xu Xia, Jinghua Piao, Min Yang, Xiaochong Lan, Jiaju Chen, and Yong Li. From scoring to acting: Outcome-verified comparative self-distillation for LLM agents, 2026a.
Yu Xia, Yiran Shen, Junda Wu, Tong Yu, Sungchul Kim, Ryan A. Rossi, Lina Yao, and Julian McAuley. SAND: Boosting LLM agents with self-taught action deliberation. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2025.
Yu Xia, Canwen Xu, Zhewei Yao, Julian McAuley, and Yuxiong He. Learning to hint for reinforcement learning, 2026b. URL https://arxiv.org/abs/2604.00698.
Zhouhang Xie, Junda Wu, Yiran Shen, Yu Xia, Xintong Li, Aaron Chang, Ryan Rossi, Sachin Kumar, Bodhisattwa Prasad Majumder, Jingbo Shang, Prithviraj Ammanabrolu, and Julian McAuley. A survey on personalized and pluralistic preference alignment in large language models. arXiv preprint arXiv:2504.07070, 2025.
Yuxin Xiong, Xunyi Jiang, Rohan Surana, Xintong Li, Sheldon Yu, Nikki Lijing Kuang, Ryan A. Rossi, Jingbo Shang, Tong Yu, Julian McAuley, and Junda Wu. RRPO: Reference-relative policy optimization with stratified conditional rollouts. arXiv preprint arXiv:2607.18470, 2026.
An Yang et al. Qwen3 technical report, 2025.
Chenxu Yang, Chuanyu Qin, Qingyi Si, Minghui Chen, Naibin Gu, Dingyu Yao, Zheng Lin, Weiping Wang, Jiaqi Wang, and Nan Duan. Self-distilled rlvr, 2026.
Qiying Yu, Zheng Zhang, Ruofei Zhu, Yufeng Yuan, Xiaochen Zuo, Yu Yue, Tiantian Fan, Gaohong Liu, Lingjun Liu, Xin Liu, et al. Dapo: An open-source llm reinforcement learning system at scale, 2025a.
Sheldon Yu, Yuxin Xiong, Junda Wu, Xintong Li, Tong Yu, Xiang Chen, Ritwik Sinha, Jingbo Shang, and Julian McAuley. Explainable chain-of-thought reasoning: An empirical analysis on state-aware reasoning dynamics. In Findings of the Association for Computational Linguistics: EMNLP 2025, pp. 16660–16667, 2025b.
Sheldon Yu, Junda Wu, Xintong Li, Nikki Lijing Kuang, Sizhe Zhou, Tong Yu, Jiawei Han, Jingbo Shang, and Julian McAuley. OLIVIA: Online learning via inference-time action adaptation for decision making in LLM ReAct agents. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2026a. arXiv:2605.11169.
Sheldon Yu, Tong Yu, Xunyi Jiang, Rohan Surana, Gagan Mundada, Sungchul Kim, Lina Yao, Julian McAuley, and Junda Wu. Can we break LLMs out of self-loops? fine-grained reasoning control with activation steering. arXiv preprint arXiv:2607.18100, 2026b.
Eric Zelikman, Yuhuai Wu, Jesse Mu, and Noah D. Goodman. STaR: Bootstrapping reasoning with reasoning. In Advances in Neural Information Processing Systems, 2022.
Tianjun Zhang, Fangchen Liu, Justin Wong, Pieter Abbeel, and Joseph E. Gonzalez. The wisdom of hindsight makes language models better instruction followers. In International Conference on Machine Learning, 2023.
Rui Zhao and Volker Tresp. Energy-based hindsight experience prioritization. In Conference on Robot Learning (CoRL), 2018. arXiv:1810.01363.
Siyan Zhao, Zhihui Xie, Mengchen Liu, Jing Huang, Guan Pang, Feiyu Chen, and Aditya Grover. Self-distilled reasoner: On-policy self-distillation for large language models, 2026.
Sizhe Zhou, Sheldon Yu, Hui Wei, Junda Wu, Siru Ouyang, Yizhu Jiao, Shijia Pan, Julian McAuley, Yu Zhang, Tong Yu, and Jiawei Han. Filesystem-based memory for LLM agents: Organization, evolution, and sustainability. arXiv preprint arXiv:2607.26637, 2026.
A PROMPTS
Every prompt the method uses is listed here verbatim. All of them carry the same system prompt, You are an expert mathematician. Solve the problem carefully and precisely. Curly braces are the template's placeholders.
Solve prompt. The prompt the policy acts on. The note block is present only in a replay or in the teacher pass; the student and the deployed model never see it. On the science sets one extra line is appended: If the answer is a number, put only the number in the box, without units.
Problem:
{question}
Hindsight note from an earlier attempt at this problem:
[ {note} ]
Use it if it helps.
Solve the problem. Think step by step, then give the final answer in \boxed{} .
Note prompt. Written once per failed attempt. The attempt text is truncated to 6,000 characters (head and tail) when longer. The writer sees no reference answer or solution.
You are reviewing one attempt at a math problem and writing a short note that the same solver will read before its next attempt at this problem.
Problem:
{question}
Attempt: {attempt}
Verdict: the attempt was incorrect.
Write one note that names the core mistake and what to do instead, so the solver avoids it.
Constraints:
- The note is advice to the solver, written as instructions, not a description of what happened.
- At most 80 words.
- Return ONLY valid JSON with exactly these fields: {"summary": "one sentence on what the attempt did", "note": "the advice"}
Revision prompt. Used once, for a note whose replays did not beat the group's no-note rate. Up to three failed replays are shown, each truncated to 1,200 characters.
You previously wrote a note for the problem below. When the solver used the note, it was correct on {successes} of {total} new attempts.
Problem: {question}
Previous note: [ {note}]
Excerpts from attempts that still failed with the note: {failures}
Revise the note so that it prevents these failures. Keep what worked.
Constraints:
- The note is advice to the solver, written as instructions, not a description of what happened.
- At most 80 words.
- Return ONLY valid JSON with exactly these fields: {"summary": "one sentence on why the previous note fell short", "note": "the revised advice"}
Answer-matching prompt (evaluation only). On the two free-form test sets, an answer the exact verifier rejects is shown to the evaluated model itself, decoded greedily with Qwen3's /no_think switch, and counted as correct if the reply is Yes. This prompt is never used in training.
You are grading a free-form answer to a question. Decide whether the candidate answer means the same thing as the reference answer. Differences in wording, units, formatting, rounding within about 1%, or extra explanation do not matter; a different value, entity or claim does.
Question: {question}
Reference answer: {reference}
Candidate answer: {candidate}
Does the candidate answer match the reference answer? Reply with exactly one word: Yes or No. /no_think
B IMPLEMENTATION DETAILS
Trainer. RSHD is a subclass of TRL's GRPOTrainer. TRL owns rollout generation, weight synchronization to vLLM, distributed training, checkpoints, and the GRPO loss; the subclass adds two hooks. After TRL has sampled and scored a batch, the rollouts of all training processes are gathered on the main process, which runs the note search (write, replay, judge, revise) against the shared vLLM server. Because TRL syncs the weights to that server every step, notes and replays are always produced by the policy that produced the rollouts. The kept note and one replay per failed rollout are then broadcast back to the process that owns the rollout. The reward is a single function, one if the verifier accepts the completion's final answer and zero otherwise.
The distillation term. For every rollout with a kept note, the chosen replay is scored twice with the current weights: once under the note prompt without gradient (the teacher) and once under the plain prompt with gradient (the student). The student pass rides along in TRL's own loss forward as extra batch rows, left-padded to a common width, rather than in a second forward pass, because ZeRO-2 reduces each parameter's gradient once per backward and rejects a parameter used by two graphs. The per-token weight is the clipped positive part of the teacher–student log-probability gap; the term is the weighted negative log-likelihood averaged over the active replay tokens of the micro-batch, scaled by the inverse of the gradient-accumulation count exactly as TRL scales its own loss, and added with coefficient . When no rollout in the batch has a kept note on any process, no rows are appended and the step is plain GRPO to the byte.
The committed carrier. The codebase also implements the alternative the paper argues against, and it produced the middle curve of Figure 4: the failed rollout's own tokens are re-scored under the note, and the student is pushed up on them with weight (teacher – student)) per token. That run used the earlier configuration of the pipeline (coefficient 0.01, KL 0.01, notes for successful rollouts too, no leak filter) and its final model scores 78.6 on MATH-500 under the protocol of Section 6, against 76.9 for GRPO and 84.5 for RSHD. A configuration-matched comparison is not yet run.
Table 3: Registered training settings, shared by every arm and backbone. All runs are full-parameter (bf16, DeepSpeed ZeRO-2, gradient checkpointing) on 7 training GPUs with a vLLM server on the eighth. GRPO-only baselines differ from RSHD only in the rows marked *. Nothing is fit besides the policy.
| Symbol/config | Meaning | Value |
|---|---|---|
| GRPO backbone | ||
| n | rollouts per prompt | 8 |
| problems per optimizer step | 14 (4 rows/GPU 4 micro-steps 7 GPUs) | |
| optimizer steps | 150 (about one pass over 2,100 problems) | |
| ratio clip | 0.2 | |
| loss aggregation | token-level (DAPO) | |
| reference-model KL coefficient | 0 (RSHD); 0.01 (GRPO baseline)* | |
| learning rate, warm-up | , none | |
| sampling | temperature 1.0, top-p 1.0 | |
| prompt / completion budget | 1,024 / 3,072 tokens | |
| Notes and replays | ||
| k | which rollouts get a note | failed rollouts of groups not solved 8/8 |
| note writer | the policy itself, greedy, 2,048-token budget, 80 words | |
| replays per note | 2 (temperature 1.0) | |
| keep rule | replay success rate > the group's no-note rate | |
| revision rounds | 1 (a rejected note is rewritten once and re-tested) | |
| answer-leak filter | notes that state the reference answer are rejected | |
| Distillation term | ||
| auxiliary coefficient | 0.2 | |
| target | one replay of the kept note, chosen uniformly, imitated from the plain prompt | |
| per-token weight | clip | |
| rows | failed rollouts only; empty when no note is kept (plain GRPO) | |
Table 4: The note search in numbers (Qwen3-4B on MATH, all 150 steps). Three notes in four are discarded, and the two screens cost no replays at all. A step holds 14 problems and 112 rollouts.
| The filter — one note per failed rollout | ||
|---|---|---|
| notes written | 4,680 | |
| returned no usable note | 310 | (6.6%) |
| stated the reference answer | 517 | (11.0%) |
| replays did not beat the group | 2,705 | (57.8%) |
| kept | 1,148 | (24.5%) |
| What survives | ||
| replay success rate, all judged notes | 0.26 | (no note: 0.17) |
| kept notes that are revisions | 33% | |
| kept notes from all-fail groups | 17% | |
| distilled replays verified correct | 79% | |
| replay tokens the note did not raise | 56% | |
Note search details. Notes are written for failed rollouts of groups not solved by all rollouts. The writer is the policy itself, decoded greedily with a 2,048-token budget, of which most is the model's own thinking; a note whose completion hits the budget before producing a JSON object, or whose output contains no note, is discarded without replay. The leak check applies the verifier's answer-match routine to the note text (the normalized reference inside a boxed expression, or as a whole-number match in the normalized text). Replays use the rollout sampling settings (temperature 1.0, 3,072 tokens). The keep rule compares the replay success rate with the problem's no-note rate computed over all rollouts across processes. Notes that fail the rule are revised once with the revision prompt of Appendix A; the revised note's own replays are the ones distilled if it is kept. Per step the trainer logs every note with its verdict and tally, and every tenth step it dumps full rollouts, notes, and replays for a few problems.
Evaluation. Trained checkpoints are evaluated with vLLM (tensor parallel 4, bf16), 8 samples per problem at temperature 0.6, top- 0.95, and 4,096 tokens, and graded by the exact verifier of the set: the normalized last boxed expression for MATH-500, and a number within 1%, a list, or a short-string match for the science sets. On the two free-form sets, every answer the exact verifier rejects is additionally judged by the evaluated model itself with the answer-matching prompt of Appendix A, and the tables report both numbers as exact/matched.
C NOTATION SUMMARY
| Symbol | Meaning |
| Rollouts and rewards | |
| prompt and its reference answer | |
| a completion and its prefix before token | |
| the GRPO group of rollouts for a prompt | |
| verifier reward (final answer matches ); reward of rollout | |
| the failed set; the group's no-note success rate | |
| the policy being trained; the frozen snapshot that sampled the group | |
| Finite-horizon verifier MDP | |
| reasoning state, next action, completion budget | |
| trajectory law, success set, probability | |
| distribution of states reached at time | |
| expected terminal reward from a state; after an action | |
| state-action advantage; best feasible continuation value | |
| Notes and replays | |
| a hindsight note; the note written about failed rollout ( = none kept) | |
| the solve prompt with the note block inserted | |
| replays per note; the -th continuation sampled under the note | |
| replay success rate ; kept iff | |
| the replay chosen (uniformly) for distillation | |
| Distillation term | |
| stop-gradient snapshot teacher reading the note | |
| per-token lift weight clip; its cap | |
| the set of credited replay tokens in a batch | |
| GRPO loss; the distillation term; its coefficient | |
| stop-gradient | |
D FORMAL SETUP, PROOFS, AND BOUNDARY CASES
All trajectory laws, states, rewards, and values below use the verifier MDP of Definition 1. We condition on a fixed problem throughout. This appendix states the no-reward-contrast failure of Section 5 formally, proves the results stated there, and records their boundary cases.
Proof of Lemma 2. Independence gives the probability. On , both the sample reward mean and its standard deviation are zero, so each advantage vanishes. Every clipped task-reward-surrogate term is therefore identically zero in the new policy parameters. KL regularization and gradients from other prompts are not included in this claim.
Proof of Proposition 4. A successful trajectory must be outside . Hence the chance that retry succeeds, conditional on all previous retries failing, is at most . Repeated conditioning yields ; Bernoulli's inequality gives . Independence between retries is unnecessary.
For a concrete witness, take a horizon-3 process whose first decision selects strategy or . After , three further individually valid transitions are required for success; after , two suffice. The prefix committing to has with the remaining budget, although none of its transitions is locally invalid. Any repair kernel preserving that decision has . An unconstrained restart can choose and is therefore outside the hard-ceiling hypothesis. More generally, if the conditional chance of leaving the basin is not uniformly small, the soft bound says little about a full-restart reflection method.
Proof of Proposition 6. Conditional on the original history and fixed , the replay outcomes are independent Bernoulli variables with parameter . They all fail with probability . Choose an index uniformly, independently of those outcomes. The event implies admission and has unconditional probability , so conditioning on admission gives . This is at least since its denominator is at most one. The function increases strictly with . Compare to for plain retries, or to the bound in Proposition 4.
The acceptance event selects a batch enriched in successful outcomes; it does not certify the content of its note. In particular, can yield admission after the original group happens to fail n times. A uniformly chosen accepted replay is not guaranteed correct when . Adaptive proposals and revisions require conditioning on the history before each new replay batch. The same-attempt comparison also excludes note-writing tokens from its cost.
Lemma 9 (Finite-horizon performance difference). For two plain-prompt policies , on the verifier MDP, let be the terminal-reward advantage and the state law under at time . Then
Thus a nonnegative expected -advantage at every state visited by is sufficient for non-degradation.
Proof. Set for padded trajectories. Conditional on under , the expected difference is . Summing over time telescopes to .
This is the finite-horizon performance-difference identity underlying conservative policy iteration. A better hinted policy does not establish nonnegative advantages for a plain-prompt student.
Proof of Theorem 7. For the mixture of complete-trajectory laws,
Because is an event, . The asserted inequality and non-degradation condition follow.
Pinsker's inequality supplies a stronger, distributional sufficient condition:
For padded autoregressive trajectories of common horizon, the KL chain rule is
Thus per-prefix distributional distillation could establish the transfer premise if it matches the mixture’s conditionals on the mixture’s prefixes. Neither clipping a GRPO ratio nor optimizing the selected-token positive-lift loss of Section 4.1 alone certifies this KL bound. The mixture parameter is not automatically the auxiliary loss coefficient; the theorem is for one problem and one local update, not an entire shared-parameter run.
Proof of Proposition 8. For a selected , and is unchanged. For , , so gradient descent raises the logit to . The sigmoid is strictly increasing, and Proposition 6 yields . Lemma 2 gives the GRPO assertion.