Every Loss Mask Is a Reward

A pre-registered research plan. Loss-masking truncated, over-turn, or late rollouts in agentic RL adds a reward-free term to the policy gradient that pays excluded trajectories the mean reward. We derive the term, separate the regimes in which it merely rescales the gradient from those in which it can reverse it, give each mask an unbiased replacement (a prefix-conditioned baseline for budget failures; never-drop or randomized protection for infrastructure drops), and lay out the experiments that would show the replacements win at matched compute, or not.

Bowen WangPre-registration · no results yet

0+0.7−0.3SolvedSubmitted, failedadvantage = 0Hit the cap (truncated)masking pays this trajectory +b relative to R = 0R = 0 on truncation (no mask)loss-masked on truncationadvantage R − b, with group mean b = 0.3
Figure 1. What each outcome is paid under the two common conventions for a rollout that hits its turn or length cap. With the group mean reward b=0.3b = 0.3, a solved trajectory receives advantage +0.7+0.7, a submitted failure −0.3-0.3. Treating the cap as a failure (R=0R=0, left bars) also pays −0.3-0.3. Loss-masking the capped rollout (right bars) sets its advantage to exactly zero, which is indistinguishable from paying it R:=bR := b.Three consequences follow: (1) running out the clock becomes strictly better than admitting failure; (2) the gap grows with bb, so it grows as training succeeds; (3) because the mask is decided after the trajectory ends, every earlier token inherits the subsidy.

Policy-gradient training of LLM agents routinely excludes rollouts from the loss. Responses that hit the length limit are masked out (DAPO’s overlong filtering[2]), trajectories that exhaust their turn budget or time out are masked (DeepSWE’s compact filtering[3], Mini-o3’s over-turn masking[7]), and asynchronous systems drop rollouts that arrive too stale to be worth training on. The stated rationale is usually noise control: a truncated attempt might have been about to succeed, so scoring it as a failure injects a wrong label. This reasoning is intuitive and widely available as a switch. We will argue that it changes the objective in a precise way, and that whether the change is harmful depends on three things the rationale never mentions: which outcomes the environment has, over whom the baseline is computed, and whether the task’s budget is part of the objective.

The purpose of this post is to lay out a research plan before running it. We have a derivation we believe, a set of symptoms in the literature that the derivation explains, and a set of experiments that would confirm or falsify it. We have not run the experiments. Writing the predictions down first is the point: if the curves in the last section come out the other way, that is what we will report.

The claims, in the order we will defend them:

  • Masking is paying. For any trajectory-level inclusion rule, the expected update of the masked loss is ∇E[R 1{X}]−b ∇P(X)\nabla\mathbb{E}[R\,\mathbb{1}\{X\}] - b\,\nabla P(X). When excluded trajectories would otherwise score zero, this is ∇J+b ∇P(¬X)\nabla J + b\,\nabla P(\neg X): the baseline, harmless under full inclusion, becomes a reward of size bb for being excluded.
  • The baseline term is decided by predictability. A mask that is predictable from the prefix, in the sense E[mt∣ht,at]=E[mt∣ht]\mathbb{E}[m_t\mid h_t,a_t]=\mathbb{E}[m_t\mid h_t], keeps the baseline zero-mean; it still reweights which states are trained, and that is not free. A mask that depends on how the trajectory ends makes the baseline a reward. Truncation, turn caps, format failures, and staleness drops are all of the second kind.
  • It can rescale, reweight, or reverse. In an environment with only two outcomes (solved, or capped) the masked update is ∑x(1−Jx)∇Jx\sum_x (1-J_x)\nabla J_x: a per-prompt rescaling toward hard prompts, with no change of direction. With a third outcome, a submitted failure, the subsidy competes with the failure penalty. And when the excluded trajectories include unobserved successes, a two-strategy construction reverses the sign: the surviving data asks for fewer thorough attempts while the true objective asks for more.
  • Reweighting cannot repair it. Truncation is deterministic censoring with inclusion probability zero or one. Horvitz–Thompson corrections need a known positive probability. The only exact fixes are not to exclude, or to randomize the exclusion so a probability exists.
  • It is partly already visible. Skywork-OR1 decomposed overall and non-truncated success rates, compared advantage masks, saw truncation and clip ratio rise under the mask, and chose not to mask[4]. MicroCoder found length growth increasing with the masking rate, and also that a conditional mask beat both full masking and no masking in its setting[5]. Environment steps rise through DeepSWE training[3], and staleness thresholds bias toward short responses[11]. Each of these measures the symptom along one axis; the identity separates three (mask timing, baseline population, budget semantics), and that is the part we claim.
  • Each mask has an unbiased replacement. In the budget regime, what the mask removes is not noise but the signal “do not hit the cap”; the variance it buys can be bought legitimately with a baseline conditioned on the turn index reached, which is prefix-measurable and therefore unbiased. In the infrastructure regime the replacements are not dropping, or dropping with a known probability and reweighting. The experiments test whether these replacements match or beat masking at matched compute; if they do not, the paper reports a diagnosis and nothing more.

Revision note. A first draft of this plan predicted a drift toward the cap on ALFWorld. In a two-outcome environment the identity predicts only a rescaling (see the caution in the reversal section), so that prediction was inconsistent with our own math. This revision separates the regimes, weakens the “causal masks are free” claim to what the algebra supports, replaces the imputation arm with a matched-update control, adds a three-outcome environment, and corrects the compute budget. We record the change rather than hide it.


Where the masks live

Before any math, it is worth being concrete about how common this is, because the identity below is only interesting if the switch it describes is on somewhere. We read the current main branches of the frameworks we might run on. Two things matter and differ across implementations: whether the switch is a default or an opt-in, and the population over which the baseline is computed.

FrameworkSwitchDefault?Baseline computed overKind
rLLM / DeepSWEcompact_filtering.* (max turns, max length, timeout, error)On in the DeepSWE recipeSurvivors only: masked episodes are removed before groupingoutcome-dependent
TRLmask_truncated_completionsOff (False)All GG membersoutcome-dependent
NeMo-RLoverlong_filtering (sets loss_multiplier = 0)Opt-in; on in the DAPO guideFlag: masked_reward_policy include | excludeoutcome-dependent
Milesmask_truncated_zero_reward sample filter; --max-weight-staleness with dropFilter opt-in; stale handler defaults to dropAll GG (“removed samples still count toward normalization”)outcome-dependent
ROLLGroup queue drops groups older than the async ratioOn in async moden/a (whole group gone)outcome-dependent
prime-rlmask_stale_tokens by per-token weight versionOn (max_staleness default 8)All GGmixed: version fixed at sampling, but the freshness threshold is taken at consumption time
verlfilter_groups (DAPO dynamic sampling)Opt-inn/aoutcome-dependent but harmless (Ri−b=0R_i - b = 0)

Three rows deserve a note. The rLLM row is the DeepSWE recipe, and it removes masked episodes before the group statistics are computed, which puts it in the amplified regime of Corollary 2 below. The prime-rl row is the closest thing to a mask decided before each token is sampled, but it is not quite that: the token’s weight version is fixed at sampling, while whether it counts as stale depends on the training step at which the trajectory is consumed, which depends on how long the trajectory ran. We found no implementation that is purely predictable in the sense of Corollary 3. And the caps bind: in a recent SWE-smith run with an 80-turn budget, 84% of trajectories hit the turn cap[14], although the same report notes that successful trajectories had a median of 8 turns and that tightening the length cap did not affect successful runs. In that run the long tail was mostly failures; we return to this in the discussion.


Notation and setup

We work with a single prompt and a policy πθ\pi_\theta that generates a trajectory τ\tau of action tokens interleaved with environment observations. The objective is the terminal reward, and the estimator is REINFORCE with a baseline, which is what GRPO reduces to on a single step.

J(θ)=Eτ∼πθ[R(τ)],S(τ)=∑t∇θlog⁡πθ(at∣ht),g^=(R−b) S(τ).J(\theta)=\mathbb{E}_{\tau\sim\pi_\theta}[R(\tau)],\qquad S(\tau)=\sum_{t}\nabla_\theta\log\pi_\theta(a_t\mid h_t),\qquad \hat g=(R-b)\,S(\tau).
  • RR: terminal reward, here binary. Partial credit does not change the argument.
  • bb: the baseline. In GRPO it is the group mean; we first treat it as a constant equal to the population mean JJ, then relax this.
  • hth_t: the prefix before token tt (prompt, earlier actions, earlier observations).
  • X(τ)X(\tau): an inclusion event. 1{X}=1\mathbb{1}\{X\}=1 means the trajectory enters the loss. “Not truncated”, “arrived before the staleness limit”, and “parsed correctly” are all instances.

The one fact we use repeatedly is the score identity: for any prefix, Eat∼π(⋅∣ht)[∇log⁡π(at∣ht)]=0\mathbb{E}_{a_t\sim\pi(\cdot\mid h_t)}[\nabla\log\pi(a_t\mid h_t)]=0. Summed over a trajectory it gives E[S(τ)]=0\mathbb{E}[S(\tau)]=0, which is exactly why a baseline is free: E[b S]=0\mathbb{E}[b\,S]=0. Everything below is about what happens when the expectation is no longer over all trajectories.


The identity

Apply the inclusion rule to the loss and take the expectation over the full policy distribution. The two factors of (R−b)(R-b) separate:

E[1{X} (R−b) S]=∇θ E[R 1{X}]⏟gradient of the included reward  −  b ∇θP(X)⏟baseline×selection.\mathbb{E}\big[\mathbb{1}\{X\}\,(R-b)\,S\big] =\underbrace{\nabla_\theta\,\mathbb{E}\big[R\,\mathbb{1}\{X\}\big]}_{\text{gradient of the included reward}} \;-\;\underbrace{b\,\nabla_\theta P(X)}_{\text{baseline}\times\text{selection}}.

Both terms are REINFORCE identities, E[f(τ)S(τ)]=∇E[f(τ)]\mathbb{E}[f(\tau)S(\tau)]=\nabla\mathbb{E}[f(\tau)], applied to f=R 1{X}f=R\,\mathbb{1}\{X\} and f=1{X}f=\mathbb{1}\{X\}. The identity holds for any on-policy sample, any inclusion rule without its own parameter dependence, and any baseline that does not depend on the trajectory being scored. What it means depends on what the excluded trajectories would have scored, and there are two regimes.

Regime A: budget failure, reward known. This is the convention that motivates masking in the first place: an excluded trajectory would have been scored R=0R=0. Then R 1{X}=RR\,\mathbb{1}\{X\}=R almost surely, the first term is ∇J\nabla J, and

E[g^masked]=∇J−b ∇P(X)=∇J+b ∇P(¬X).\mathbb{E}[\hat g_{\text{masked}}] =\nabla J - b\,\nabla P(X) =\nabla J + b\,\nabla P(\neg X).

The masked estimator is the unbiased gradient plus a term that carries no information about reward. Its direction is “make exclusion more likely” and its magnitude is bb. Equivalently, since a trajectory with advantage zero contributes nothing, masking a trajectory is identical to assigning it R:=bR:=b. We find this phrasing more useful than the gradient one because it says what the policy is being taught: an excluded attempt is worth exactly an average attempt. The equivalence is exact only with the baseline and every other statistic (mean, std, loss denominator, regularizers) held at the values they take under masking; if one imputes bb into the reward path and recomputes the group mean, the imputed sample regains a nonzero advantage and the two are no longer the same computation.

Regime B: outcome never observed. When the infrastructure cancels or discards a rollout before its result exists, or discards a finished one, the excluded set contains successes and E[R 1{X}]≠J\mathbb{E}[R\,\mathbb{1}\{X\}]\ne J. The masked estimator is then the exact gradient of the survivors’ objective: with bb set to the survivors’ mean, it is ∇(E[R 1{X}]/E[1{X}])\nabla\big(\mathbb{E}[R\,\mathbb{1}\{X\}]/\mathbb{E}[\mathbb{1}\{X\}]\big) up to scale: the success rate among surviving attempts. This regime does not need the R=0R=0 convention, and it is where the sign reversal below lives. The two regimes share the identity but not the ground truth, so we keep them apart in the experiments.

More on the derivation and its assumptions

The identity requires only that bb does not depend on the trajectory being scored and that the expectation is over the sampling policy. With the self-inclusive group mean over all GG members (TRL’s convention), the expectation is (1−1/G) [∇J+J ∇P(¬X)](1-1/G)\,[\nabla J + J\,\nabla P(\neg X)]: the effective subsidy is exactly the population mean JJ, with no extra term; with a true leave-one-out baseline the (1−1/G)(1-1/G) factor disappears. With per-token normalization by a θ\theta-free weight w(τ)w(\tau) the term becomes b ∇E[w 1{¬X}]b\,\nabla\mathbb{E}[w\,\mathbb{1}\{\neg X\}]: rescaled, not removed. With a survivor-only denominator (token-mean over the micro-batch, which is verl’s default) the scale of the whole update depends on the survivor count, which is a separate, mostly benign effect we control for with constant normalization[8]. If excluded trajectories carry a nonzero reward R¬XR_{\neg X} (e.g. a format penalty of −1-1), the subsidy is b−R¬Xb - R_{\neg X}, which is why penalties behave so differently from masks in practice.

Key result

Under full inclusion the baseline is a control variate: zero mean, variance only. Under trajectory-level exclusion it stops being zero mean. The masked update equals the unbiased gradient plus b ∇P(excluded)b\,\nabla P(\text{excluded}). Masking is paying the excluded rollouts the mean reward.


Three corollaries

Corollary 1: the feedback loop

The subsidy is bb, the mean reward. As training succeeds, bb rises, so the reward for being excluded rises with it. A policy at 30% success pays truncation 0.3; the same policy at 60% pays it 0.6. This is the opposite of a self-correcting effect. It is the same structural property that makes drift under training–inference mismatch compound in Score Centering[1]: a term whose magnitude is tied to the thing being optimized.

Corollary 2: survivor baselines amplify it

If the group mean is computed only over surviving members, which is what happens when masked episodes are removed before grouping (rLLM) or when masked_reward_policy: exclude is set (NeMo-RL), the baseline is itself selection-biased. Writing NXN_X for the number of survivors in a group of GG, the expected update becomes κ ∇J+β ∇P(¬X)\kappa\,\nabla J+\beta\,\nabla P(\neg X) with β/κ→J/P(X)=E[R∣X]\beta/\kappa\to J/P(X)=\mathbb{E}[R\mid X] for large GG. So the total coefficient on ∇P(¬X)\nabla P(\neg X) is the survivors’ mean reward, and relative to the all-population baseline the extra term is

extra subsidysurvivor  ≈  J P(¬X)P(X)  ∇P(¬X),\text{extra subsidy}_{\text{survivor}}\;\approx\;\frac{J\,P(\neg X)}{P(X)}\;\nabla P(\neg X),

which grows with the exclusion rate itself. In a two-outcome environment this coefficient is degenerate: every survivor has R=1R=1, the survivors’ advantage is zero, and the signal vanishes rather than drifting. Under std-normalized advantages with binary rewards the per-prompt subsidy is b/σ=p/(1−p)b/\sigma=\sqrt{p/(1-p)}, largest on nearly-solved prompts. We flag these as derived, not yet measured; the ablation on baseline population below is designed to separate them.

Corollary 3: predictable masks keep the baseline neutral; outcome-dependent masks do not

Predictable mask: decided before the token is sampled (e.g. a sampling-time staleness rule)weight sync; later tokens carry a newer versionE[mask_t | h_t, a_t] = E[mask_t | h_t] ⇒ baseline term vanishes; states are reweighted, signal may be lostOutcome-dependent mask (truncation, turn cap, late drop): decided after the trajectory endscap hit / dropped at the endevery earlier token is masked retroactivelymask correlated with a_t given h_t ⇒ E[Σ_t ∇log π · mask] = ∇P(kept) ≠ 0 ⇒ subsidy b·∇P(excluded)
Figure 2. Whether the baseline term survives is decided by when the mask is decided. Top: a mask fixed before token tt is sampled (a per-token staleness mask with a sampling-time threshold would be one) satisfies E[mt b ∇log⁡π(at∣ht)]=0\mathbb{E}[m_t\,b\,\nabla\log\pi(a_t\mid h_t)]=0, so the baseline stays a control variate. The surviving update is the gradient restricted to unmasked positions: a reweighting of states. That keeps the baseline neutral but can still remove signal, and under shared parameters a reweighted gradient is not guaranteed to be an ascent direction for the original objective. Bottom: a truncation or late-drop mask is decided at the end and applied to every earlier token. The indicator is correlated with the actions, the baseline term survives, and every token inherits the subsidy.

Formally, let mtm_t be the inclusion indicator for token tt. The precise condition is on conditional expectations, not on causality as such: if E[mt∣ht,at]=E[mt∣ht]\mathbb{E}[m_t\mid h_t,a_t]=\mathbb{E}[m_t\mid h_t], then E[mt b st]=0\mathbb{E}[m_t\,b\,s_t]=0 and E[∑tmt (R−b) st]=∑tE[mt Qt st]\mathbb{E}[\sum_t m_t\,(R-b)\,s_t]=\sum_t\mathbb{E}[m_t\,Q_t\,s_t], the policy gradient reweighted by mtm_t. In the tabular case this is an ascent direction for a behavior-weighted objective[18]; with shared parameters, reweighting states can lower JJ, and the mask can delete the signal from exactly the states that matter. A mask that depends on the future is not automatically biased either: what matters is whether it is correlated with the action given the prefix. Truncation, turn caps, and duration-based drops plainly are, because the action affects the length. So the design rule is weaker than “causal masks are free”: predictable masks cost signal but not bias; outcome-dependent masks cost both. DAPO’s dynamic sampling is outcome-dependent and harmless for a different reason: it excludes whole groups whose advantages are already zero.


A constructive reversal

A bias of size bb on a direction that is unrelated to reward sounds like a nuisance. It is worth showing that it can flip the sign of the update in a setting that is not exotic. The construction lives in Regime B: a two-strategy coding agent under an asynchronous trainer that drops rollouts older than a staleness threshold, so that the excluded set contains successes.

StrategyWhat it doesTrue successP(kept | success)P(kept | failure)
FastReads two files, edits, submits in ~10 turns0.601.01.0
ThoroughReproduces the bug, writes a regression test, edits, runs the suite; ~80 turns on success, but failures surface early0.900.11.0

Let pp be the probability of choosing Thorough. The true objective is J(p)=0.6+0.3pJ(p)=0.6+0.3p, increasing in pp. The trainer sees the kept distribution, whose success rate is

Jkept(p)=E[cR]E[c]=0.6−0.51p1−0.81p,Jkept′(p)=−0.024(1−0.81p)2<0.J_{\text{kept}}(p)=\frac{\mathbb{E}[cR]}{\mathbb{E}[c]}=\frac{0.6-0.51p}{1-0.81p}, \qquad J_{\text{kept}}'(p)=\frac{-0.024}{(1-0.81p)^2}<0.

The surviving data asks for fewer thorough attempts at every pp. We checked this by exact enumeration at p=σ(θ)=0.5p=\sigma(\theta)=0.5: the full-distribution gradient with respect to θ\theta is +0.075+0.075, the survivor estimate with a population-mean baseline is −0.017-0.017, and inverse-probability weighting with the known keep probabilities recovers +0.075+0.075. The numbers in the table are ours, not measured from any system; the point is that the structure, successes that finish late and failures that surface early, is the ordinary shape of careful software work.

The same identity has a second, quieter prediction for truncation masks in Regime A, provided the environment has a third outcome. A failing attempt that is masked when it runs out the clock receives advantage 0; one that submits a wrong answer receives −b-b. So on tasks the agent is going to fail anyway, the trained behavior is to keep going rather than to submit. Succeed fast, fail slow is the implied reward schedule, and it is the signature we will look for in turn-count distributions conditioned on outcome.

A caution in the other direction

If the environment has only two outcomes, every failure is a cap hit, so per prompt Px(cap)=1−JxP_x(\text{cap})=1-J_x and the masked update is

∑x[∇Jx+Jx∇(1−Jx)]=∑x(1−Jx) ∇Jx.\sum_x\big[\nabla J_x+J_x\nabla(1-J_x)\big]=\sum_x(1-J_x)\,\nabla J_x .

Masking then rescales each prompt’s gradient by 1−Jx1-J_x and shifts weight toward hard prompts; it does not change direction within a prompt, and a small gradient step still raises success. With a survivor-only baseline every survivor has R=1R=1 and the signal is zero. ALFWorld is such an environment: episodes end only on success or on the cap. It can show the rescaling, the difficulty reweighting, and the survivor-baseline collapse, but it cannot show “fail slow”, and we do not predict a drift toward the cap there. The direction claim needs a submitted-failure outcome: single-turn RLVR with a length cap (truncated / wrong / right) and WebShop (bought wrong / bought right / stepped out) have one.


Why reweighting cannot fix it

The natural instinct is importance weighting: if a trajectory survives with probability c(τ)c(\tau), weight it by 1/c1/c. Horvitz–Thompson corrections of this kind exist for randomized token subsampling[10]. They need c(τ)>0c(\tau)>0 and known. Truncation is deterministic censoring: a trajectory that reaches the cap is excluded with probability one, and a trajectory that does not is included with probability one. There is no weight that recovers the contribution of a sample that was never observed. The same holds for a hard staleness cutoff.

This leaves two exact options. Do not exclude: score the capped rollout with the reward its budget implies, or keep the late rollout and handle its staleness as an off-policy problem, which is what partial rollouts plus per-token corrections already do[1]. Or randomize the exclusion so that a probability exists: when the scheduler would drop a group, keep it with a known probability aa and weight it by 1/a1/a. The second option is the STOPD trick[13] applied to trajectories rather than tokens; it is unbiased in expectation,

EB ⁣[Ba Gg]=Gg,Cov⁡B ⁣(BaGg)=(1a−1)GgGg ⁣⊤,\mathbb{E}_B\!\left[\frac{B}{a}\,G_g\right]=G_g,\qquad \operatorname{Cov}_B\!\left(\frac{B}{a}G_g\right)=\Big(\frac{1}{a}-1\Big)G_gG_g^{\!\top},

and it is not free: the variance inflation is 1/a−11/a-1. Whether that price is worth paying relative to simply waiting for stragglers is an empirical question we will put in the plan.


Remedies

None of the remedies is new machinery. Each is the choice that the identity says is consistent with a stated objective, and the identity says that masking is consistent with none of them. That is a statement about objectives, not about training curves: a consistent estimator can still lose to an inconsistent one on variance or effective step size, and MicroCoder reports a conditional mask beating both full masking and no masking in its setting[5]. Which one trains better is what the experiments are for. But the identity also says why masking can look helpful, and that points at the replacement.

What masking removes in the budget regime is signal, not noise

In Regime A the contribution of the excluded trajectories to the unmasked estimator is

E[1{¬X} (0−b) S]=− b ∇P(cap),\mathbb{E}\big[\mathbb{1}\{\neg X\}\,(0-b)\,S\big]=-\,b\,\nabla P(\text{cap}),

whose mean is not zero. It is the gradient that teaches the policy not to hit the cap. Masking deletes it, and in doing so also deletes the variance of a −b-b advantage spread over the thousands of tokens of a long failed trajectory. So the variance benefit of masking and its bias are the same term; there is no version of outcome-dependent masking that keeps one and drops the other. The legitimate way to buy that variance reduction is a better baseline.

The replacement: a baseline conditioned on the turn reached

“This trajectory is already long” is information that exists in the prefix. Let ℓt\ell_t be the turn index of token tt, and define

bt=E^[R∣reached turn ℓt]=∑j≠i1{lenj≥ℓt} Rj∑j≠i1{lenj≥ℓt}    (leave-one-out over the group, shrunk toward the group mean when the count is small).b_t=\hat{\mathbb{E}}\big[R\mid \text{reached turn }\ell_t\big] =\frac{\sum_{j\ne i}\mathbb{1}\{\text{len}_j\ge\ell_t\}\,R_j}{\sum_{j\ne i}\mathbb{1}\{\text{len}_j\ge\ell_t\}} \;\;\text{(leave-one-out over the group, shrunk toward the group mean when the count is small)}.

Because btb_t depends only on hth_t (the event “this rollout reached turn ℓt\ell_t”) and on other, independent rollouts, E[bt st]=0\mathbb{E}[b_t\,s_t]=0 and the estimator stays unbiased for ∇J\nabla J. Its effect is exactly the one masking was reaching for: among rollouts that reached a late turn, most end at the cap with R=0R=0, so btb_t is small there and a long failed trajectory’s advantage 0−bt0-b_t is small too. The comparison with masking is one line: masking sets that advantage to 00 (biased); the baseline sets it to R−E[R∣ℓt]R-\mathbb{E}[R\mid\ell_t] (unbiased). The variance it removes is Var(E[R∣ℓ])\mathrm{Var}(\mathbb{E}[R\mid\ell]), which is measurable offline from logged rollouts before any training; a conditional leave-one-out baseline is only better than the group mean when that explained variance exceeds roughly one over the bucket count, which is why the shrinkage is part of the definition and not an option.

Two things this replacement is not. It is not a process reward: it changes no optimum, so the agent cannot game it by changing its length. And it is not new machinery: it is the state-dependent baseline of textbook REINFORCE with the cheapest possible state feature. If it matches masking on success and removes the cap-hit drift at matched compute, the recommendation is a one-line default: never mask budget failures; score them zero and baseline on the turn reached.

Why the rollout is excludedObjective you actually wantConsistent treatment
The task’s own budget ran out (turn cap, context cap defined by the task)Solve within budgetDo not mask; assign R=0R=0 and baseline on the turn reached. The advantage −bt-b_t is the signal consistent with this objective, with the variance masking was buying recovered without bias.
Infrastructure cancelled it (staleness threshold, queue limit, timeout unrelated to the task)Solve the taskDo not drop. Partial rollouts with per-token off-policy correction. If dropping is unavoidable: randomized protection with weight 1/a1/a.
You believe a capped attempt would have succeeded with more budgetSolve eventually (budget-free)Extend and score. Continue a capped rollout for kk more turns with probability pp, score the result, weight by 1/p1/p; this is randomized protection applied to the budget rather than to the scheduler, and it is unbiased for the extended-budget objective. Imputing a value V^(hT)\hat V(h_T) is the cheaper, biased alternative.

The first row is a few lines in the advantage function of every framework we checked. The second is a scheduler change; Miles’ async buffer already holds whole groups and has a single _drop_stale branch where a coin flip and a weight would go. The third is a rollout-time change that must be labelled as optimizing a different objective. In all three, the design principle is the same: to discard, decide before sampling; to reduce variance, change the baseline; to change the objective, change the reward and say so. None of the three needs an outcome-dependent mask.


Experimental plan

We organize the plan around three questions, in increasing cost. Each has a measurement that could come out against us. We state the arms, the controls, and what we would conclude from each outcome before seeing any of them.

Question 1: Is the term present in real gradients?

Experiment setup. Fix a checkpoint. Collect a few thousand multi-turn rollouts with per-token log-probabilities, rewards, truncation flags, and weight versions. Miles and slime dump all of this with --save-debug-rollout-data and replay it at a fixed checkpoint with --load-debug-rollout-data --debug-train-only; swapping the sample filter changes the masking rule without regenerating anything. We will use SWE-smith rollouts from a Qwen3-4B or 8B mini-swe-agent run with a 40–80 turn cap, where the cap is known to bind for most trajectories[14], and ALFWorld rollouts as a cheap second environment.

Outcome census first. Before any gradient, count what the rollouts actually are: solved, submitted and failed, budget failure (cap or context limit), and infrastructure no-result (cancelled, timed out, dropped). The census decides which regime dominates in a realistic configuration, and therefore which ground truth applies. If budget failures are 80% of the non-solved mass and infrastructure no-results are 2%, Regime A is the story and the asynchronous experiments are secondary; if the reverse, the Fast/Thorough construction is the one to chase.

Arms. Advantages recomputed under: (a) no mask, R=0R=0 on cap (the reference); (b) mask with baseline over all GG; (c) mask with baseline over survivors; (d) mask only a random fraction ρ∈{0.3,0.6,1.0}\rho\in\{0.3,0.6,1.0\} of capped rollouts; (e) no mask, R=0R=0 with the turn-reached baseline. All statistics (mean, std, denominators) are computed once from the unmasked batch and frozen, so that the arms differ only in the mask or baseline. Arm (e) also yields the offline number that decides whether the replacement can work at all: the per-token advantage variance under (a) versus (e), which should drop by Var(E[R∣ℓ])/Var(R)\mathrm{Var}(\mathbb{E}[R\mid\ell])/\mathrm{Var}(R). For each, the full-batch policy gradient at the fixed θ\theta, flattened after backward on a single device to avoid tensor-parallel gathers.

Measurements. Cosine between each arm and the reference; the ratio of norms; the projection of the difference onto the estimated ∇P(cap)\nabla P(\text{cap}), obtained by REINFORCE on the cap indicator from the same rollouts; the same quantities bucketed by turn index and by prompt difficulty. On two-outcome data (ALFWorld) the algebra fixes the answer in advance: per prompt the masked gradient must be (1−Jx)(1-J_x) times the reference and the survivor-baseline variant must be zero; we use this as a correctness check of the replay pipeline, not as a finding.

What we learn. The identity is algebra and is not what is being tested. The informative numbers are, on three-outcome data, the cosine gap between (a) and (b) after removing the norm rescaling, and the fraction of that gap explained by the ∇P(cap)\nabla P(\text{cap}) direction. If the direction gap is within the seed-to-seed noise of (a), the effect at this checkpoint is a rescaling and reweighting, not a distortion, and we say so before spending anything on Phase 3.

Question 2: Does the term move behavior?

Experiment setup. The direction claim needs a third outcome, so the main environments are three-outcome ones. The cheapest is single-turn RLVR with a length cap (Qwen3-1.7B on GSM8K/MATH with the cap chosen so that 20–40% of responses are truncated at initialization), which is exactly the setting of[4] and[5] and gives truncated / wrong / right. The agentic one is WebShop in verl-agent[15] with its 15-step cap, which gives bought wrong / bought right / stepped out. ALFWorld (Qwen2.5-1.5B, 50-step cap, 150 iterations on two H100s, public curves) is kept as a two-outcome control: there the identity predicts a per-prompt rescaling by 1−Jx1-J_x and a shift of gradient share toward hard prompts, and the survivor-baseline arm should lose its signal. The default convention in all three is R=0R=0, so the other arms are one-line edits to the reward and mask.

Arms (3 seeds each). (i) R=0R=0 on cap, no mask; (ii) loss-mask on cap; (iii) matched-update control: the mask arm with its learning rate rescaled each step so that its update norm matches arm (i)’s, which separates a change of direction from a change of effective step size; (iv) mask with Dr. GRPO constant normalization[8] (norm_adv_by_std_in_grpo=False, loss_agg_mode=seq-mean-token-sum-norm) to remove the length-normalization bias as a confound; (v) mask with survivor-only baseline; (vi) the proposed replacement: R=0R=0 on cap with the turn-reached baseline. Arm (vi) is the one the paper stands or falls on: it must match or beat (ii) on success at matched compute while behaving like (i) on cap-hit rate and length.

Measurements. Cap-hit rate, submitted-failure rate and episode length per iteration; success rate; clip ratio; update norm; per-token advantage variance; the running value of bb, so that we can plot the rate of change of the cap-hit rate against bb rather than against steps; on ALFWorld, gradient share by difficulty bucket.

Question 3: Does it suppress slow successes under asynchronous drops?

Experiment setup. Miles with the SWE-smith mini-swe-agent recipe[14] scaled to Qwen3-4B or 8B on a single node, fully asynchronous. The staleness drop is the default --max-weight-staleness handler and the buffer holds complete groups, so the first experiment uses groups that are finished but stale: their rewards exist, and the only question is whether they enter the loss and with what weight. This prototype tests the selection mechanism only. Its rollout and sandbox costs are already paid, so it cannot show a saving in straggler waiting or sandbox time; those claims belong to the in-flight variant, which protects a group before it is cancelled and is a separate, harder experiment. We will choose a task subset with success rate between 0.2 and 0.5 so that bb is large enough for the subsidy to be visible.

Arms. (i) drop stale groups (default); (ii) never drop; (iii) randomized protection with a∈{0.25,0.5}a\in\{0.25,0.5\} and the weight 1/a1/a applied as a loss weight on the whole group, with one coin per group memoized by group id so that a group that passes through the drop branch more than once is not re-drawn; (iv) a gradient oracle computed on the same cohort of rollouts and the same learner checkpoint with every group included, not a separately generated synchronous run. All arms use the same off-policy correction (per-token truncated importance ratios plus score centering[1]), so that differences are due to selection and not to the correction. An unbiased gradient is not an unbiased Adam step; we report both the gradient cosine and the training outcome.

Measurements. Turn-count distributions conditioned on outcome (the “succeed fast, fail slow” signature); the rate at which successful trajectories ran the test suite before submitting, as a proxy for thoroughness; gradient cosine to the synchronous reference; wall-clock and sandbox cost per unit of reward improvement, so that protection is charged for the stragglers it keeps alive.

Ablations

The ablations exist to pin the effect to the mechanism and to separate it from the two confounds we know about: length-normalization bias[8][9] and the genuine noise reduction that masking provides early in training.

AblationValuesWhat it isolatesPrediction
Baseline populationall GG vs. survivors onlyCorollary 2 amplificationSurvivor arm drifts faster; gap widens with cap-hit rate
Advantage normalizationstd on vs. offp/(1−p)\sqrt{p/(1-p)} scalingStd on: drift concentrated on high-bb prompts
Loss normalizationtoken-mean vs. constant (Dr. GRPO)Length-normalization confoundDirection unchanged; slope reduced by a constant factor
Task difficulty splitb∈[0.1,0.2], [0.3,0.5], [0.6,0.8]b\in[0.1,0.2],\,[0.3,0.5],\,[0.6,0.8]Subsidy ∝b\propto bCap-hit growth rate increases monotonically with bb
Mask dosemask 30 / 60 / 100% of capped rolloutsDose–response, cf.[5]Growth rate roughly linear in dose
Cap tightnessLength cap at 3 truncation rates (three-outcome task); ALFWorld 30 / 50 / 80 steps (control)Whether the effect is cap-specificThree-outcome: final length tracks the cap under masking, not under R=0R=0; ALFWorld: only the (1−Jx)(1-J_x) rescaling changes
Group sizeG∈{4,8,16}G\in\{4,8,16\}(1−1/G)(1-1/G) factor; survivor-count varianceWeak dependence for all-GG baseline; strong for survivor baseline
PPO epochs / clip1 vs. 2 epochs; clip on/offWhether clipping hides the term (ratio ≡ 1 on the first pass)Term present at epoch 1; clipping on epoch 2 does not remove it
KL / entropy termsβ∈{0,10−3}\beta\in\{0,10^{-3}\}Mask-dependent regularizersSmall modulation; sign unchanged
Protection probabilitya∈{0.1,0.25,0.5,1}a\in\{0.1,0.25,0.5,1\}Bias–variance of randomized rescueUnbiased at all aa; variance ∝1/a−1\propto 1/a-1; a sweet spot below 1 only if stragglers are expensive
Workflow commitments
  1. One objective, one variable at a time, three seeds, error bands. The same discipline as[1].
  2. Q1 runs before any online training. If the offline gradient gap is below seed noise, we report that and stop.
  3. No claim about direction is made from a two-outcome environment. ALFWorld results are reported as rescaling and reweighting only; direction comes from the three-outcome environments, and only if the matched-update control does not reproduce it.
  4. Every online arm reports bb over time, so that rates are plotted against bb and the ∝b\propto b prediction can be checked directly.

Predicted results

These are predictions, written before the runs. We give them with the observation that would falsify each.

0%25%50%75%100%training steps →fraction of rollouts hitting the capR = 0 on cap (no mask)loss-masked on capmask, learning rate rescaled to match the R = 0 update normmask + constant normalization (Dr. GRPO control)SCHEMATIC PREDICTION — NOT DATA
Figure 3 (schematic, not data). Predicted cap-hit rate during Q2 training in a three-outcome environment (single-turn RLVR with a length cap, or WebShop). Under R=0R=0 the rate falls monotonically as the policy learns to finish. Under masking we expect an initial fall, because masking does remove genuine label noise while bb is small, followed by a drift back toward the cap as bb grows. The matched-update control is predicted to fall like R=0R=0, not to drift: if it drifts too, the effect is step size, not direction. The Dr. GRPO control is predicted to keep the sign of the drift with a smaller slope. The proposed replacement (R=0R=0 with the turn-reached baseline, not drawn) is predicted to follow the R=0R=0 curve on cap-hit rate while matching the mask arm’s early success. In the two-outcome ALFWorld control no drift is predicted; the mask arm should track R=0R=0 with a smaller effective step.
  1. P1 (algebra check, Q1). On two-outcome ALFWorld data with frozen statistics, the masked gradient equals (1−Jx)(1-J_x) times the reference per prompt to numerical precision, and the survivor-baseline variant is zero. Falsified if not; that would mean a statistic is not frozen or the implementation differs from the model, which must be fixed before anything else is run.
  2. P2 (direction, Q1). The difference between the masked and unmasked gradients has cosine above 0.5 with the estimated ∇P(cap)\nabla P(\text{cap}), and its norm scales with bb across task subsets. Falsified if the difference is isotropic relative to ∇P(cap)\nabla P(\text{cap}), or if its norm is flat in bb.
  3. P3 (drift, Q2, three-outcome environments). The cap-hit rate under masking stops falling, or rises, once bb exceeds roughly 0.3, while under R=0R=0 and under the matched-update control it keeps falling; the submitted-failure rate under masking falls faster than under R=0R=0. Falsified if the mask and R=0R=0 arms are indistinguishable in cap-hit rate at matched bb across three seeds, or if the matched-update control reproduces the drift.
  4. P4 (amplification, Q2 ablation). The survivor-baseline arm drifts faster than the all-GG arm, with a gap that grows with the cap-hit rate. Falsified if the two baselines produce the same curves.
  5. P5 (signature, Q3). Under staleness drops, successful trajectories get shorter and failed trajectories get longer over training relative to the never-drop arm, and the fraction of successes that ran tests before submitting falls. Falsified if the outcome-conditioned turn distributions do not separate, or separate in the other direction.
  6. P6 (rescue, Q3). Randomized protection at a=0.5a=0.5 recovers the never-drop arm’s final success within seed noise at lower wall-clock than never-drop, and at a=0.1a=0.1 it does not, because the variance inflation dominates. Falsified if never-drop is cheaper or if no a<1a<1 matches it.
  7. P7 (the replacement, Q2). Offline, the turn-reached baseline cuts per-token advantage variance by at least 20% relative to the group mean on three-outcome data. Online, arm (vi) matches or beats the mask arm on final success at matched compute, with a cap-hit rate and episode length that track the R=0R=0 arm. Falsified if the offline variance reduction is below 10% (then the fix has no lever and we fall back to reporting the diagnosis), or if the mask arm beats arm (vi) on success by more than seed noise at matched update magnitude (then masking’s benefit is not the variance we modelled, which is itself the finding).

We also expect one result that is not a confirmation: the mask arm should match or beat R=0R=0 on success rate early in training, when bb is small and the label noise removed by masking is real. Reports that found overlong filtering helpful at short caps and unhelpful at long ones[6] are consistent with the crossover we would predict, and MicroCoder’s conditional mask[5] shows that a partial mask can beat both ends. If the mask arm wins throughout at matched update magnitude, the identity is still true but the noise benefit dominates the subsidy at these scales, and the honest headline is narrower: a diagnosis, not a fix.

Stopping conditions
  • The offline gradient gap in Q1 is below the seed-to-seed variation of the reference gradient.
  • A plain queue-policy change in Q3 (train stale, never drop) already removes the effect at no measurable cost, in which case randomized protection is unnecessary and we say so.
  • Protection’s variance and sandbox cost make it lose to waiting at every aa.

Discussion and what would change our mind

What the identity does and does not say. It is a statement about the expected update at a fixed parameter. It does not by itself predict training dynamics, and the drift we predict depends on ∇P(excluded)\nabla P(\text{excluded}) being a cheap direction for the policy to move along. For length and turn count it plainly is; for format failures it may not be. We also note that masking removes real noise early, so the net effect over a run can be positive for a while, and the identity does not say that it must turn negative: the extra term grows with bb, but its effect also depends on ∥∇P(excluded)∥\|\nabla P(\text{excluded})\|, on its angle with the task gradient, on the variance removed, and on the optimizer. The identity fixes the sign of the extra term, not the sign of the net effect.

Relation to prior observations. Skywork-OR1 §3.2.3 is the closest prior work[4]: it decomposed overall and non-truncated success rates, compared advantage masks on truncated samples, observed a steadily rising clip ratio and more truncation under the mask, and chose not to mask. MicroCoder found that a higher masking rate accelerates length growth with a roughly dose-dependent effect, and that a conditional mask outperformed both ends[5]. The overlong-filtering ablation in[6] found gains at short caps that vanish at long ones. DeepSWE’s report shows environment steps rising through training under compact filtering[3]. Applied Compute documented the short-response bias of staleness thresholds[11]. Our reading is that these are one mechanism seen from several angles, each along one axis; what we add is the separation of mask timing, baseline population and budget semantics, and predictions in a multi-turn agent that no single prior report makes. The experiments above are designed to test whether that reading is right.

Counter-evidence we carry with us. The SWE-smith run with 84% cap hits[14] also reports that successful trajectories had a median of 8 turns and that tightening the length cap did not affect successful runs. That is evidence for Regime A (the long tail is failures) and against the idea that slow successes were being deleted in that configuration. The outcome census in Q1 exists to settle this before Phase 3 is funded.

Relation to score centering. The two terms are different objects that share a shape. Score centering[1] cancels a drift that arises because the sampler and trainer disagree at every prefix; it is a property of the probabilities. The term here arises because the trainer never sees some trajectories; it is a property of the data pipeline. A pipeline can have both, and the remedies compose: centering handles what arrives late, and not dropping ensures that it arrives.

What would change our mind. If P2 fails, the bias exists but points somewhere the policy cannot easily follow, and the practical consequence is small. If P3 fails under constant normalization, the length drift reported in the literature is the normalization bias of[9], not ours. If the matched-update control reproduces the drift, the effect is effective step size, not direction, and the right framing is “masking is an uncontrolled learning-rate schedule”. If P5 fails, the asynchronous story reduces to the known short-response bias with nothing new added. We would publish any of these as the result.

Scope limits we accept going in. ALFWorld has two outcomes, no tests and no notion of thoroughness; it can show the rescaling and the reweighting, not the direction change, which is why it is a control. Small SWE models may have success rates so low that bb, and with it the effect, is negligible, which is why Q3 restricts to a mid-difficulty subset. And frontier training stacks may already use penalties or bootstraps rather than masks, in which case this is a cleanup of open-source defaults rather than a change to frontier practice. We think that is still worth doing: the defaults are what most agentic RL runs use. Finally, none of the remedies is guaranteed better by the algebra alone: the turn-reached baseline is unbiased but only helps if turn index explains enough reward variance; predictable masks still reweight states; keeping stale groups costs off-policy risk and trainer time; randomized protection trades bias for variance and cost. The deliverable is the replacement rule and the matched-compute evidence for it (P7, P5, P6); the diagnosis is what makes the rule principled, not the product.


Appendix: execution plan and compute budget

The body of the post fixes the arms, controls, and measurements. This appendix fixes the order of operations, the code paths we will touch, and the compute we expect to spend, so that the plan can be executed as written and audited afterwards. Numbers for ALFWorld come from the published verl-agent recipe and are reliable; numbers for SWE runs are projections from comparable configurations and are to be recalibrated after the pilot.

A. Phases and go/no-go gates

PhaseWhat runsOutputGate
0. Algebra and census (2–3 days)Fixed checkpoint; one batch of rollouts with frozen statistics; masked vs. R=0R=0 gradients on two-outcome data must differ by exactly (1−Jx)(1-J_x) per prompt; outcome census (solved / submitted failure / budget failure / infra no-result) on real SWE rolloutsPipeline correctness; which regime dominatesRatio not (1−Jx)(1-J_x) → a statistic is not frozen; fix before anything else. Census says Regime A dominates → Phase 3 becomes secondary
1. Three-outcome online (1 week)Q2 on single-turn RLVR with a length cap and on WebShop: six arms × three seeds, then ablations; ALFWorld as the two-outcome controlSlope of cap-hit rate against bb; whether the matched-update control reproduces it; whether the turn-reached baseline arm matches the mask arm on successMask and R=0R=0 indistinguishable at matched bb, or matched-update control drifts too → no direction effect; the project becomes a diagnosis of step-size effects and stops before Phase 3. Baseline arm loses to mask on success → the replacement rule is withdrawn and the finding is reported
2. SWE pilot (1 week)Miles SWE-smith, Qwen3-8B, one arm, 100 steps; dump rollouts for Q1Seconds per step; cap-hit rate; range of bb; offline replay datab<0.15b<0.15 or cap-hit rate below 30% → change the task subset before Phase 3
3. SWE online + async (2–3 weeks)Q3: four to five arms × two to three seedsOutcome-conditioned turn distributions; cosine to the synchronous reference; cost per unit rewardPhase 3 starts only if Phases 0–1 show a direction distortion beyond seed noise in a realistic configuration. Never-drop already removes the effect at no cost → randomized protection unnecessary; report that

B. Engineering checklist

Phases 0–1, verl-agent (WebShop, ALFWorld) and a single-turn RLVR recipe. ALFWorld recipe: Qwen2.5-1.5B-Instruct, env.max_steps=50, group 8 × 16 groups, 150 iterations, two H100s; WebShop with the 15-step cap from the same repository; single-turn: Qwen3-1.7B on GSM8K/MATH with the length cap set so that 20–40% of initial responses truncate. Code touches: (a) the reward on a cap hit (already R=0R=0); (b) zeroing response_mask for cap-hit episodes to obtain the mask arm; (c) the matched-update control: after each backward, scale the mask arm’s learning rate by the ratio of the R=0R=0 arm’s update norm to its own, measured on the same batch; (d) the survivor-baseline arm filters before the mean inside compute_grpo_outcome_advantage; (e) the turn-reached baseline: for each rollout ii and turn ℓ\ell, compute the leave-one-out mean of RjR_j over group members j≠ij\ne i with lenj≥ℓ\text{len}_j\ge\ell, shrink it toward the group mean with weight nℓ/(nℓ+κ)n_\ell/(n_\ell+\kappa) (κ=2\kappa=2), and broadcast Ri−bi,ℓR_i-b_{i,\ell} to the tokens of turn ℓ\ell; about fifteen lines in the advantage function, using the per-token turn index verl-agent already carries. For offline replays all statistics are computed once from the unmasked batch and frozen. Controls: norm_adv_by_std_in_grpo=False and loss_agg_mode=seq-mean-token-sum-norm.

Phases 2–3, Miles (SWE-smith). Start from the public mini-swe-agent recipe[14] with Qwen3-8B, a 40-turn cap, 64k context, n=8n=8, 16 prompts per step. Task subset: run the pilot over the SWE-smith training set and keep tasks with success rate in [0.2, 0.5][0.2,\,0.5], roughly one to two thousand. Code touches: (a) --rollout-sample-filter-path pointing at mask_truncated_zero_reward gives the mask arm, and omitting it gives R=0R=0; (b) the RESCUE hook replaces the else-branch of fully_async_data_buffer.py::_drop_stale with a Bernoulli(aa) keep, drawn once per group id and memoized, and attaches 1/a1/a as a loss weight on the whole group (not a reward multiplier, which later normalization could undo); (c) never-drop raises --max-weight-staleness; all three async arms enable the same truncated importance sampling plus score centering; (d) offline replay uses --save-debug-rollout-data and --load-debug-rollout-data --debug-train-only, with a post-backward hook that flattens the gradient for the cosine computation; the Q3 oracle is the same cohort replayed with every group included at the same checkpoint.

Logging contract. Every online run logs per step: the outcome census (solved / submitted failure / budget failure / infra no-result), cap-hit rate, mean and outcome-conditioned turn counts, success rate, clip ratio, update norm, the realized baseline bb, staleness statistics where applicable, and wall-clock. All rate-of-change claims are plotted against bb as well as against steps.

C. Compute budget

Units are H100-hours. For a B200 cluster, halve only the LLM-bound items (Phases 0–1, the offline replay); the SWE items are sandbox-bound and do not shrink with the accelerator.

ItemPer runRunsH100-hConfidence
Phase 0 algebra check and outcome census——~20high
Phase 1 single-turn RLVR with length cap: 6 arms × 3 seeds1 GPU × ~8 h ≈ 818~150medium
Phase 1 WebShop: 6 arms × 3 seeds2 GPUs × ~15 h ≈ 3018540medium
Phase 1 ALFWorld control: 6 arms × 3 seeds2 GPUs × 15.1 h ≈ 30 (363 s/iter × 150)18540high
Phase 1 ablations: cap tightness, group size, std, mask dose≈ 8–30~30~600medium
Phase 2 SWE pilot: 8B, 100 steps, one nodesee note1–2~150–300low
Phase 2 Q1 offline replay: 5 rules × 3 checkpoints≈ 3 per rule (2k sequences × 64k tokens)15~50medium
Phase 3 SWE online: drop / never-drop / a=0.5a=0.5 / a=0.25a=0.25 / sync reference, × 2 seeds, 300 steps≈ 150 (one node × ~20 h)10~1,500low
Phase 3 third seed and aa sweep≈ 1506~900low

SWE step-cost note. With 128 rollouts per step averaging 25 turns and contexts growing to 30k tokens, generation is about 1.2M tokens per step and the trainer sees about 4M tokens. On one 8×H100 node the LLM side is one to two minutes, but rollouts are bounded by sandbox and tool latency; we project three to five minutes per step, so 300 steps is roughly 20 hours, or about 150 H100-hours per run. A comparable public configuration runs Qwen3-8B for 1000 steps on four B200s. The first twenty steps of the pilot calibrate this number, and Phase 3 is re-budgeted from the measured seconds per step.

Totals. Phases 0–1 alone (the round that tests the replacement rule in the budget regime and decides whether Phase 3 runs): about 1,850 H100-hours, or ten days on one 8×H100 node; the single-turn arms alone, which already test P3 and P7, are about 150 and fit on one GPU in a week. Adding the SWE pilot, the offline replay and Phase 3 with drop / never-drop / a=0.5a=0.5 at two seeds: about 3,700 H100-hours. Full version (all ablations, three seeds, the aa sweep): about 4,600 H100-hours. The SWE items are projections and are re-budgeted after the pilot.

D. Allocation on a 24-node H100 cluster

With 192 GPUs the full program is about a day of saturated compute, so GPU time stops being the constraint. The plan below spends the surplus on confidence rather than on more arms, and it keeps the gate: Phase 3 is scheduled only after Phases 0–1 show a direction effect that the matched-update control does not reproduce.

PhaseParallelizationWall-clock
0. Algebra check and outcome census1 nodehalf a day
1. Single-turn, WebShop, ALFWorld control, ablations (~85 runs)1–2 GPUs per run, 4–8 runs per node, 15 nodes in one waveabout 15 hours (bounded by the 2-GPU runs)
2. SWE pilot2 nodes: 8B at cap 40 and at cap 801 day, mostly calibration
2. Q1 offline replay1 nodehalf a day
3. SWE online, 8B: 5 arms × 3 seeds = 15 runsone node per run, 15 nodes concurrentlyabout 1 day for 300 steps; never-drop and high-aa arms 30–50% longer
3. 30B-A3B replication: drop / never-drop × 2 seeds2 nodes per run, 4 runs on the remaining 9 nodesabout 2 days

GPU wall-clock for the whole program is four to five days; with pilot calibration, code changes, and analysis, two weeks is a realistic cycle. Upgrades worth buying with the surplus: five seeds instead of three for the headline arms (R=0R=0 vs. mask; drop vs. never-drop); 500–1000 steps for the SWE arms, since the subsidy scales with bb and the crossover may sit past step 300; the 30B-A3B replication at the scale where the 84% cap-hit rate was measured[14]; a cap-tightness ablation (40 vs. 80 turns) on SWE, which ALFWorld cannot provide; and a fully-run synchronous reference as the gradient oracle for Q3. Not worth buying: more benchmarks or more model families, which dilute engineering time without touching the claim.

E. Infrastructure prerequisites

  • Sandbox CPU. 128 concurrent rollouts per SWE node; 15 nodes plus the 30B runs means roughly 2,000–2,500 concurrent containers. Budget 2–3k CPU cores, a local registry with the SWE-smith images cached, and a few hundred GB of container-layer storage per node. This is the component most likely to delay the program.
  • Wall-clock scheduling. Asynchronous arms finish at different times because of stragglers; the scheduler must not wait on the slowest run before starting analysis.
  • Storage. Rollout dumps are 1–2 GB per step; dumping the first 50 steps of 15 runs is about 1–1.5 TB.
  • Discipline. One variable per comparison, the pre-registered predictions unchanged, the stopping conditions honored. The failure mode that abundant compute invites is adding arms until an effect appears, which is the one thing this post is designed to prevent.

References
  1. [1] M. Marek, M. Ryabinin. Score Centering Stabilizes Off-policy Reinforcement Learning. arXiv:2609.20807, 2026.
  2. [2] Q. Yu et al. DAPO: An Open-Source LLM Reinforcement Learning System at Scale. arXiv:2503.14476, 2025. §3.4, overlong filtering.
  3. [3] Agentica / Together AI. DeepSWE: Training a State-of-the-Art Coding Agent from Scratch by Scaling RL. blog, 2025. Compact filtering; Figure 7.
  4. [4] J. He et al. Skywork Open Reasoner 1 Technical Report. arXiv:2505.22312, 2025. §3.2.3, advantage mask on truncated samples.
  5. [5] MicroCoder / Breaking Training Bottlenecks §2.3: masking rate vs. output-length growth, and conditional masking. arXiv:2603.07777, 2026.
  6. [6] Tricks or Traps? A Deep Dive into RL for LLM Reasoning. arXiv:2508.08221, 2025. §4.4.
  7. [7] Mini-o3: Scaling Up Reasoning Patterns and Interaction Turns for Visual Search. arXiv:2509.07969, 2025. Over-turn masking.
  8. [8] Z. Liu et al. Understanding R1-Zero-Like Training: A Critical Perspective (Dr. GRPO). arXiv:2503.20783, 2025.
  9. [9] On the impossibility of unbiased and length-invariant policy optimization. arXiv:2607.23364, 2026.
  10. [10] NAT: Horvitz–Thompson corrections for token subsampling in policy gradients. arXiv:2603.06619, 2026.
  11. [11] Applied Compute. Staleness in fully asynchronous RL. research note, 2026.
  12. [12] Withdrawn in revision. An earlier draft cited a NeurIPS 2026 poster on latency-conditioned selection bias that we could not verify; [11] documents the short-response bias of staleness thresholds.
  13. [13] STOPD: Stochastic Truncation for On-Policy Distillation. arXiv:2610.21337, 2026.
  14. [14] LMSYS. Agentic RL on MI355X with Miles: SWE-smith with mini-swe-agent. blog, October 2026. 84% of trajectories hit the turn cap.
  15. [15] L. Feng et al. Group-in-Group Policy Optimization for LLM Agent Training (GiGPO) and verl-agent. arXiv:2505.10978, code, 2025.
  16. [16] Framework sources read for the table: TRL grpo_trainer.py, rLLM transform.py and CompactFilteringConfig, NeMo-RL algorithms/grpo.py, Miles filter_hub/sample_filters.py and fully_async_data_buffer.py, prime-rl train_sink.py, verl core_algos.py. Main branches as of November 3, 2026.
  17. [17] NovaSky. SkyRL fully asynchronous training. docs.
  18. [18] T. Degris, M. White, R. Sutton. Off-Policy Actor-Critic. arXiv:1205.4839, 2012.