Off-Policy Policy Optimization with Proximal KL
Reading note. This blog is an introduction to our paper. Please read the paper for rigorous theoretical proofs and the full discussion of experimental results.
Reward-based training for mathematical reasoning generates answers, checks them, and updates the model using correctness feedback. But how far should the model change in each round? Proximal KL balances reward against KL divergence, a measure of how probability distributions differ, relative to the round’s starting model. That starting model is the reference; “proximal” refers to penalizing movement away from it within the round. A small example will show why this can help even when the answers come from the current model, as in on-policy learning.
More importantly, generation and training often run in parallel in practice, so some answers come from older model versions: off-policy data. This raises our central question: can updates using old data preserve the optimizer, meaning the policy that maximizes this round’s KL-regularized objective? We establish conditions under which token-wise importance correction, reweighting each sampled token by its current-model probability divided by its generating-model probability, does so. A token is one unit of generated text. The key is assigning it the KL cost of the whole response that it can influence, including what is generated afterward.
Why KL can help
KL 如何帮助优化
Why add KL when a correctness reward already identifies which responses are desirable? The choice of objective also determines the path that optimization follows. We first show a case where using the current policy as a KL reference lets optimization improve both prompts, while direct PG sacrifices one. This motivates the proximal objective. Extending it to a full response then tells us which token should receive each KL cost.
An on-policy example
一个 on-policy 例子
Proximal KL can, in some cases, achieve a better result than ordinary policy gradient (PG), even with on-policy data. The following idealized example makes this possibility concrete by comparing the limiting reward of two optimization procedures.
A model answers different questions using the same set of weights. This is what we mean by shared parameters: an update that helps one question can also change how the model answers another. A two-question example isolates this effect.
Consider two equally likely prompts with a binary action and reward $R=a$. Use a small logistic model that maps the same parameter vector to a success probability for each prompt. It can solve both prompts, but initially succeeds with probabilities $(p_1,p_2)=(1/2,p_{\mathrm{init}})$, where $0<p_{\mathrm{init}}\le1/64$. One prompt is therefore much easier at initialization. All expectations in this example are exact and on-policy: neither stale data nor sampling noise causes the failure.
To make the model concrete, set $p_m=\sigma(u_m^\top\theta)$, where $\sigma$ is the logistic function that maps a real-valued score to a probability. This score is the logit: for a binary choice with probability $p$, it equals the log-odds $\log[p/(1-p)]$. The feature vectors describe how the same weights affect the two prompts:
\[u_1=\frac15(1,1)^\top,\qquad u_2=\frac15(1,-4)^\top,\qquad \theta_0=(-\Delta,\Delta)^\top.\]Here Δ is the positive log-odds gap between the two initial success probabilities. Both prompts become solvable along $\theta=(c,0)^\top$ as $c\to\infty$, so this parameterization can represent joint success.
For these shared features, ordinary PG, represented by continuous-time Euclidean gradient flow on the average reward $J=(p_1+p_2)/2$, improves the easier prompt while suppressing the harder one. Gradient flow describes taking infinitesimally small steps along the exact reward gradient. Its limit is $(p_1,p_2)=(1,0)$, and $J$ never exceeds $1/2$. As correct answers to the harder prompt become rarer, that prompt contributes even less to the reward gradient. The model can solve both prompts, but this optimization path increasingly favors only one.
The key mechanism is the conflict between the two prompt gradients: $u_1^\top u_2<0$, so progress on the easier prompt can suppress the harder one. Appendix D.1 of our paper proves that this feedback persists and gives the limit above.
This failure occurs along the reward-gradient optimization path. Can a reference-dependent penalty produce a path that improves both prompts? A proximal round maximizes reward while penalizing KL deviation from the previous round’s policy, then uses the resulting policy as the next reference. Here we assume each round is solved exactly; the next subsection writes out its objective. Repeated exact KL-proximal solves in the same model class and from the same initialization give
\[(p_{K,1},p_{K,2}) =\left(\sigma(K/\beta),\sigma(-\Delta+K/\beta)\right) \longrightarrow\class{pkl-math-focus}{(1,1)}, \qquad \Delta=\log\frac{1-p_{\mathrm{init}}}{p_{\mathrm{init}}}.\]Here $K$ counts completed proximal rounds and $\beta>0$ is the fixed KL penalty strength. Each round increases both success log-odds by $1/\beta$, then refreshes the reference. Both prompts eventually have success probability approaching one, so the average reward approaches 1, compared with the PG limit of 1/2. Proximal KL changes the optimization path: progress relative to the reference incurs a cost, reducing the easier prompt’s dominance within a round while allowing further progress after the reference refreshes.
We must also check that the original model can realize both improvements simultaneously. The parameter increment $(5,0)^\top/\beta$ realizes the exact proximal logit increase $1/\beta$ for both prompts. The proximal target is therefore representable in this same shared model at every round.
KL can improve on-policy optimization. In this example, PG approaches average reward 1/2, while Proximal KL approaches 1.
The construction and full proof appear in Appendix D.1, “Illustration of proximal feedback with shared parameters,” of our paper.
How do these updates affect success? Press Play to follow 1000 iterations from the same starting point, or drag the step slider. Compare mean reward, then switch to the harder or easier prompt’s success probability to see which question accounts for the gap between PG and repeated exact proximal solves.
This is a deterministic simulation of the two-prompt model. One PG step uses the exact reward gradient with step size $\eta=1$; one proximal round uses the analytic maximizer and refreshes the reference. These operations have different computational costs, so the counter compares optimization paths, not training speed.
Simulation update rules
PG numerically approximates the gradient flow with
\[\theta_{t+1}=\theta_t+\frac{\eta}{2}\sum_{m=1}^2 u_m p_m(1-p_m).\]An exact proximal round increases both logits by $1/\beta$, realized here by
\[\theta_{k+1}=\theta_k+(5/\beta,0)^\top.\]The plot reports unregularized mean reward $J=(p_1+p_2)/2$ or either prompt’s success probability after each iteration. The proximal objective changes whenever its reference is refreshed.
We next define the proximal objective and explain how its feedback changes the update.
Proximal objective
Proximal objective
The two-prompt example in the preceding subsection repeatedly solves a reference-dependent objective. To specify what one such round optimizes, we distinguish the learner $\pi_\theta$, which changes within the round, from the reference $\pi_k$, which remains fixed. The reference is the policy from which this round begins. It defines the distribution against which we measure the cost of changing the model’s answers, even when every training response comes from the current learner.
We seek policy improvement while controlling how far the policy moves. This motivation also underlies Schulman et al.’s TRPO, which constrains KL, and PPO, which studies clipped and KL-penalized surrogate objectives. A surrogate is an auxiliary objective constructed to produce a policy update. Clipping replaces a value outside a chosen interval by its nearest bound within that objective. Here we put a learner-to-reference KL penalty on the complete response distribution.
The prompt $x$ comes from the training distribution $\mathcal D$, the response $\tau$ is a complete token sequence, and $R$ scores that response. Our objective is
\[J_k(\theta) =\mathbb E_{x\sim\mathcal D,\,\tau\sim\pi_\theta}[R(x,\tau)] \class{pkl-math-focus}{-\beta\,\mathbb E_{x\sim\mathcal D} D_{\mathrm{KL}}\!\left(\pi_\theta(\cdot\mid x)\,\Vert\,\pi_k(\cdot\mid x)\right)}.\]The reward term favors correct answers; the reverse KL penalty controls movement away from the reference. Holding that reference fixed within a round makes the target well-defined. Refreshing it between rounds allows cumulative improvement far beyond the initial model.
Which response distribution would maximize this objective? Solving over unrestricted response distributions identifies the policy that an exact proximal round aims to reach:
\[\pi_k^*(\tau\mid x) =\frac{\pi_k(\tau\mid x)\exp(R(x,\tau)/\beta)}{Z_k(x)}, \qquad Z_k(x)=\mathbb E_{\tau\sim\pi_k(\cdot\mid x)}[e^{R(x,\tau)/\beta}].\]For binary rewards, multiply each correct response’s reference probability by $e^{1/\beta}$, then renormalize so the probabilities sum to one. Larger $\beta$ gives a more conservative round; smaller $\beta$ amplifies correct answers more strongly. This exponentially reweighted distribution, called a Gibbs distribution, is the proximal target used below.
This solution identifies the optimization target for a round. To see how KL changes the update, return to the two-prompt example. Write the learner’s success logit as $z_m=\log[p_m/(1-p_m)]$ and the reference logit as $z_{k,m}$. The proximal objective’s gradient is
\[\nabla J_k(\theta)=\frac12\sum_{m=1}^{2} u_m p_m(1-p_m)\left[1\class{pkl-math-focus}{-\beta(z_m-z_{k,m})}\right].\]The vectors $u_m$ describe how a parameter change affects each prompt. When their inner product is negative, improving one can hurt the other. As a prompt’s success logit increases above its reference value, the bracket reduces its reward-driven contribution; that contribution reaches zero at a logit gain of $1/\beta$. After the reference is refreshed, another round can improve both prompts further. The KL term therefore supplies an improvement target that moves with each reference refresh.
Each response in the example contains a single action. A language model generates many dependent tokens, so applying the same response-level objective raises a credit-assignment question: which costs should influence each token’s update? Using only the current token’s KL omits future-cost contributions and generally gives a biased estimate of this objective’s gradient. We now trace where those contributions come from.
Future-KL credit assignment
Future-KL credit assignment
Why should an early token account for KL costs that occur later? Increasing its probability also makes the continuations beginning with it more likely. A continuation is the remaining sequence generated after the current choice. For example, choosing a different first step in a solution changes which later reasoning steps the model generates. Those continuations can differ in how far they move from the reference. The objective charges for the whole response, so the update for that early choice must account for its effect on later costs as well as its immediate cost.
Credit assignment means deciding which rewards and costs should influence each token’s update. Schulman et al.’s stochastic computation graphs, diagrams of dependencies among random choices and computed quantities, formalize this downstream-cost principle. Here it gives Future-KL: the sum of sampled KL log-ratio costs from the current token through the end. The computation reuses the completed response; during generation, each token is conditioned on the existing prefix, the prompt and tokens already generated.
The formula animation follows token 2 in a three-token response: remove the past term’s zero expected contribution, then retain the current and future costs.
To express this dependence in the gradient, we need a token’s cost and its sensitivity to the model parameters. Write $h_i=(x,a_{<i})$ for the prompt and all tokens before the current position. The log-ratio compares the learner’s and reference’s probabilities for the sampled token; the score vector describes how its log-probability changes with the model parameters:
\[\ell_i=\log\frac{\pi_\theta(a_i\mid h_i)}{\pi_k(a_i\mid h_i)}, \qquad \psi_i=\nabla_\theta\log\pi_\theta(a_i\mid h_i).\]A sampled log-ratio can be positive or negative; at a fixed prefix $h_i$, its expectation over the learner’s next-token distribution gives a conditional KL divergence. Adding the token log-ratios gives the log-ratio for the complete response. Here responses come from the current learner, with a fixed reference and verifier reward, supplied by an answer-correctness checker. The paper gives the regularity assumptions for the derivation. Applying the score-function gradient identity to KL optimization gives
\[\nabla J_k =\mathbb E\left[ \left(R-\beta\sum_{j=1}^{T}\ell_j\right) \sum_{i=1}^{T}\psi_i\right].\]This expression initially pairs every token’s score with the cost of the entire response. The optional recap below explains the differentiation step. Our next task is to determine which score–cost pairs contribute to the expected update.
Recap: differentiating the response-level KL objective
Autoregressive factorization expresses a response probability as the product of its conditional token probabilities. Taking its logarithm and differentiating turns this product into a sum of token scores:
\[\pi_\theta(\tau\mid x)=\prod_{i=1}^{T}\pi_\theta(a_i\mid h_i), \qquad \nabla_\theta\log\pi_\theta(\tau\mid x)=\sum_{i=1}^{T}\psi_i.\]Write $J_k=\mathbb E_{\pi_\theta}[R-\beta\sum_j\ell_j]$. Differentiating the sampling probabilities gives the reward-minus-cost times the response score shown in the main text. Differentiating the learner inside the log-ratios adds $-\beta\mathbb E\sum_j\psi_j$. This second contribution has zero expectation by the zero-mean score identity established in the main discussion of past costs.
The remaining gradient therefore comes from how changing the learner changes the probability of sampling each response.
Past costs contribute zero in expectation. Condition on a prefix $h_i$ and imagine sampling its next token repeatedly. The prefix fixes everything that has already happened. Increasing some next-token probabilities must decrease others, since the probabilities still sum to one. This normalization gives a zero-mean score:
\[\mathbb E[\psi_i\mid h_i] =\sum_a\pi_\theta(a\mid h_i)\nabla_\theta\log\pi_\theta(a\mid h_i) =\nabla_\theta\sum_a\pi_\theta(a\mid h_i)=0.\]For a past position $j<i$, the prefix contains both $h_j$ and $a_j$, so $\ell_j$ has the same value for every possible next token. Multiplying every score by this same value preserves their cancellation:
\[\mathbb E[\ell_j\psi_i\mid h_i] =\ell_j\class{pkl-math-focus}{\mathbb E[\psi_i\mid h_i]}=0, \qquad j<i.\]This equality concerns an average over possible current actions. On an individual response, both the past cost and the score can be nonzero. The cost can also depend on the learner parameters; the direct derivative of that dependence was already included in the differentiation step. Removing the past cost from the score’s coefficient preserves the expected gradient.
Current and future costs depend on the action being updated. The current cost $\ell_i$ uses the probability of the token actually chosen. At a future position $j>i$, that choice is part of the prefix and can change the entire continuation distribution. Different next tokens can therefore lead to different expected later costs. Denote the expected cost after choosing token $a$ by $m_j(a)=\mathbb E[\ell_j\mid h_i,a_i=a]$. First average over continuations after each choice, then average over the choices themselves:
\[\mathbb E[\ell_j\psi_i\mid h_i] =\sum_a\pi_\theta(a\mid h_i)m_j(a) \nabla_\theta\log\pi_\theta(a\mid h_i).\]The scores still have zero mean, but they are now weighted by potentially different costs. For example, a first reasoning step can lead mostly to continuations that stay close to the reference, while another leads to larger KL costs. Changing the probabilities of those first steps changes the expected later cost. The weighted sum is generally nonzero, so it belongs in the objective’s gradient. A future term can vanish in a special case, such as equal conditional costs for all choices; there is no general cancellation that lets us omit it.
A binary example of score–cost cancellation
A binary choice makes the difference explicit. Suppose the current action is $a_i\in\lbrace 0,1\rbrace$ with probability $p=\sigma(\alpha)$ of choosing 1, where $\alpha$ is its logit. The score with respect to that logit is $a_i-p$. Write $c_0$ and $c_1$ for the expected future costs after the two choices. Then this score-times-cost term is
\[\begin{aligned} \mathbb E[\ell_j(a_i-p)\mid h_i] &=(1-p)c_0(-p)+pc_1(1-p)\\ &=p(1-p)\class{pkl-math-focus}{(c_1-c_0)}. \end{aligned}\]If both choices receive the same cost, their contributions cancel. Holding $c_0$ and $c_1$ fixed isolates the effect of changing the current choice: if choosing 1 has a higher expected future cost, raising its logit increases the expected cost. The KL penalty enters the objective with a negative sign, so this particular score–cost contribution pushes the logit downward. Shared parameters can also change the continuation costs themselves; those effects enter through the other terms of the full gradient. This calculation isolates why a zero-mean score alone does not eliminate action-dependent costs.
These two cases identify the costs for each score: remove positions before the current token and retain its complete suffix, as in the formula animation above. We may also subtract a history-only baseline, a comparison value $b(h_i)$ shared by all possible actions at the same prefix. Like a past cost, it multiplies every action’s score by the same value, so $b(h_i)\mathbb E[\psi_i\mid h_i]=0$. Holding this baseline fixed during differentiation gives the exact identity
\[\nabla_\theta J_k(\theta) =\mathbb E_{\pi_\theta}\sum_{i=1}^{T} \psi_i\left[R-b(h_i)\class{pkl-math-focus}{-\beta\sum_{j=i}^{T}\ell_j}\right].\]The bracket is the full Future-KL advantage: reward relative to the baseline, minus the sampled KL costs attributable to the current choice. The first token receives the entire response’s cost; the last receives only its own. Keeping only $\ell_i$ drops the current action’s effect on the later distribution. The omitted terms generally have nonzero expected contributions, so the resulting gradient estimator is biased even with on-policy data. Increasing the batch size does not remove this omission bias.
This subsection establishes the gradient when responses are sampled from the current learner. The next section considers responses sampled from older policies: how does that change in sampling distribution affect the proximal target?
Why token-wise correction works
Token-wise correction 为什么成立
In asynchronous training, a response may be generated while the learner is already updating. Its generating policy, the behavior policy $\pi_{\mathrm{behav}}$, can therefore differ from the current learner. Can we learn from these old responses without changing the policy that maximizes our proximal objective? This section explains why full Future-KL makes that possible with token-wise correction, then connects the shared target to learning progress.
Keep the two policy comparisons separate: behavior tells us where the data came from; reference $\pi_k$ defines the KL penalty. We hold that reference fixed while studying one round. Staleness counts recorded policy versions between behavior and learner, but their probability mismatch depends on how much those updates changed the model. Reusing a batch for several updates can also create mismatch, even if its initial staleness is zero.
Correcting old responses
校正旧策略的回答
Importance sampling compensates for a change in sampling probabilities. Exact sequence correction weights a complete response by the product of all token ratios:
\[w_i=\frac{\pi_\theta(a_i\mid h_i)}{\pi_{\mathrm{behav}}(a_i\mid h_i)}, \qquad W(\tau)=\class{pkl-math-focus}{\prod_{i=1}^{T}w_i}.\]Under the usual coverage condition, this product recovers the on-policy gradient in expectation. But multiplying many ratios can create high variance, as studied in work on the curse of horizon. Token-wise correction is a common practical choice, including in AReaL: each token’s update uses only its own $w_i$. It generally changes the expected update because the prefix and later tokens still come from behavior.
For Proximal KL, the token update combines that weight with the reward-minus-cost coefficient from the previous section:
\[\class{pkl-math-focus}{w_i}\,\psi_i \left(R-\class{pkl-math-focus}{C_i}-b(h_i)\right), \qquad C_i=\beta\sum_{j=i}^{T}\ell_j.\]Here $\psi_i=\nabla_\theta\log\pi_\theta(a_i\mid h_i)$ is the token’s score, and $b(h_i)$ is a history-only baseline held fixed during differentiation. For the theory, $C_i$ includes the current token and every later token, without truncation or cost clipping. Our question is whether this expected update still vanishes only at the proximal target. Such a zero-expected-update policy is the stationary policy, or fixed point.
The sequence correction in this theoretical comparison is the exact product $W$. The later ablation separately tests geometric-mean and IS-free controls.
Pathwise cancellation
Pathwise cancellation
The difficulty is the continuation: after correcting the current token, the rest of the answer still comes from the old policy. Ordinarily, changing how an answer continues can change how we evaluate that token. Full Future-KL has a special property at the proximal target: different continuations may earn different rewards, but their KL costs change by exactly the same amount. Their reward-minus-cost is identical.
A short value-based view explains why. Let $V_k(h)$ be the optimal KL-regularized expected return from history $h$, and $Q_k(h,a)$ the value after choosing token $a$. Appending a token deterministically gives the next history $ha$, so $Q_k(h,a)=V_k(ha)$; for example, $(x,a_1)$ followed by $a_2$ becomes $(x,a_1,a_2)$. At a completed response, $V_k=R$.
At the proximal target $\pi_k^*$, a token’s KL cost is exactly the difference between the values after and before it:
\[\beta\log\frac{\pi_k^*(a_i\mid h_i)}{\pi_k(a_i\mid h_i)} =Q_k(h_i,a_i)-V_k(h_i) =\class{pkl-math-focus}{V_k(h_{i+1})-V_k(h_i)}.\]Now add these costs along a response. Each intermediate value appears once with a plus sign and once with a minus sign. They cancel, leaving the terminal reward minus the starting value. Equivalently,
\[R(\tau)-\beta\sum_{j=i}^{T} \log\frac{\pi_k^*(a_j\mid h_j)}{\pi_k(a_j\mid h_j)} =\class{pkl-math-focus}{V_k(h_i)}.\]This is pathwise cancellation: the identity holds separately for every supported continuation, including one sampled from an older behavior policy. The animation shows the matching terms cancelling.
At the proximal target, reward minus full Future-KL is the same on every continuation of a given history.
If we subtract only the costs after the current token, the remaining value is $Q_k(h_i,a_i)$. Including the current cost leaves $V_k(h_i)$. This distinction explains why the complete current-inclusive sum matters. Appendix E.2 of our paper derives these identities from the proximal objective.
A shared stationary policy
共同的 stationary policy
What does cancellation do for learning? At the target, every sampled continuation multiplies the current token’s score by the same coefficient, $V_k(h_i)-b(h_i)$. Current-token IS converts the action average from behavior to the target policy. The score under that policy has mean zero, so the expected update is zero. The coefficient itself need not be zero; averaging the weighted score is the crucial step.
To show that only the target has zero expected update, the proof works backward. At the final token, there is no continuation to account for, and the KL-regularized action choice has a unique optimum. Once later decisions equal their targets, cancellation gives each earlier action its exact Q-value. The earlier decision then has its own unique KL-regularized optimum. Repeating this backward induction identifies the whole stationary policy.
Token-wise and exact sequence correction share the same unique stationary policy: the proximal optimizer.
This policy maximizes expected reward minus response-level KL to the fixed reference. The theorem uses positive KL strength, full unmodified Future-KL and a detached history-only baseline; Appendix E.2 of our paper gives the support and expressiveness assumptions and the complete proof.
This backward use of Q-values is closely related to soft Q-learning and path consistency. Earlier work by Schulman, Chen and Abbeel, PCL and Trust-PCL studies the relationship between regularized policy updates and soft values. Here Q-values explain the proof; our algorithm learns the policy directly from sampled returns and does not fit a Q-network.
From the target to learning progress
从 target 到学习进展
Knowing where an update stops does not yet tell us whether it gets there. Two update rules can have the same stationary policy but follow different paths. For Proximal KL, the convergence argument uses the same backward structure: errors in an action’s sampled Q-return come from later-token policies. The final decisions have no such error; as later policies approach their targets, their contribution to earlier decisions becomes accurate.
For independently adjustable token logits, we prove convergence of the continuous-time, exact-population update while the reference stays fixed. Behavior may change over time, with each history’s visit probability kept uniformly above zero. Appendix E.3 of our paper provides the precise statement and proof.
Reaching one round’s target is only one part of training. Refreshing the reference starts another round of improvement. With binary rewards and exact proximal solves, every round increases the odds of a correct response whenever the starting success probability lies strictly between zero and one. The on-policy example in the first section illustrates how these gains accumulate.
For sampled updates, Appendix F of our paper analyzes a projected linear-logit variant with controlled behavior mismatch and gives a polynomial sample-budget reward guarantee. One interpretation is that a single response from the trained policy can approach the success rate of an initial-policy oracle best-of-$N$, which selects a correct answer whenever one appears among its $N$ samples. The theorem’s update rule, representation conditions and budget are specified there. Together, these results connect a preserved target, progress toward it, and reward improvement across rounds.
Practical updates
实际更新
To train with Future-KL, we need an update computable from sampled responses: which probabilities to record, which costs to sum, and when to refresh the reference. We specify this algorithm first, then show how horizon, cost bounds, and group-relative normalization change each token’s update coefficient.
Proximal KL algorithm
Proximal KL 算法
Each Proximal KL update records the sampling probabilities, computes reward advantage and Future-KL, then updates the learner. The animation follows the algorithm one line at a time, with the full procedure kept in view. Training uses sampled rewards and token probabilities; it does not fit the Q-function used in the proof.
The reference defines the KL cost; recorded behavior probabilities define the importance correction. They may come from the same policy, but their roles remain separate.
For position $i$ in response $m$, constructing the update coefficient starts with its KL cost. The practical version allows a finite Future-KL horizon, the number of positions whose costs enter this token’s coefficient, and per-token cost clipping, giving
\[C_{m,i}^{(H)} =\beta\sum_{j=i}^{\class{pkl-math-focus}{\min(T_m,i+H-1)}} \operatorname{clip}\!\left( \log\frac{\pi_\theta(a_{m,j}\mid h_{m,j})}{\pi_k(a_{m,j}\mid h_{m,j})}, \class{pkl-math-focus}{-\epsilon_F,\epsilon_F}\right).\]The window includes the current token and at most $H-1$ later tokens. Full tail extends to the response endpoint; $\epsilon_F=\infty$ removes per-cost clipping. Costs accumulate as an unnormalized sum over the window.
The coefficient also needs a reward signal. Comparing a response’s reward with those of other responses to the same prompt supplies the response-level advantage $\widehat A_m$, a positive or negative coefficient shared by that response’s tokens. Each position subtracts its own $C_{m,i}^{(H)}$ and applies the current-token importance weight. To turn this coefficient into a parameter update, one implementation minimizes the detached score loss
\[\mathcal L^{(H)}(\theta) =-\frac{1}{N_{\mathrm{tok}}}\sum_{m,i} \operatorname{sg}\!\left[ w_{m,i}\bigl(\widehat A_m\class{pkl-math-focus}{-C_{m,i}^{(H)}}\bigr)\right] \log\pi_\theta(a_{m,i}\mid h_{m,i}).\]Here $N_{\mathrm{tok}}$ counts non-padding action tokens in the minibatch. Stop-gradient, $\operatorname{sg}$, treats the coefficient as fixed during differentiation; the next update recomputes it. The loss gradient has a minus sign, so gradient descent adds the token score multiplied by its detached, importance-corrected coefficient, averaged over these tokens. When response lengths vary, the sampled token-count denominator can also change the expected field relative to the response-averaged population update analyzed earlier.
Horizon and cost bounds
Horizon 与 cost bounds
A smaller $H$ removes terms from the full Future-KL coefficient and generally changes its expected score update. Even with on-policy sampling, truncation introduces bias relative to the complete gradient whenever the omitted terms’ combined expected score contribution is nonzero. Under token-wise IS, this truncation acts on a full-tail field that already has sampling bias.
Future costs are random and can be correlated with one another, so removing terms can change sampling variance in either direction. A bias–variance trade-off must account for both effects: bias describes how far the expected update departs from the desired update, while variance describes fluctuations caused by sampling. Variance reduction and improved training performance are possibilities to measure in a particular setting.
The cost bound $\epsilon_F$ limits each log-ratio before it enters the earlier tokens’ future sums. Clipping changes the coefficient and can bias its expected score contribution. The resulting magnitude bound describes this altered coefficient; its sampling variance also depends on correlations among terms. For finite $H$ and $\epsilon_F$,
\[|C_{m,i}^{(H)}| \le\beta\epsilon_F\min(H,T_m-i+1).\]The controls act on different aspects of the update. $H$ selects which positions participate; $\epsilon_F$ bounds each contribution; $\beta$ rescales the feedback. Even equal $\beta H$ can assign credit to very different tokens.
A finite horizon shortens the range of KL credit assigned to the current score. The model still sees the full prefix, and generation uses the same response limit. Our tail-decay variant keeps unit weights for the first $H$ costs and linearly downweights later costs to zero at the endpoint. This reweighting generally changes the expected update; the net change depends on the affected terms’ combined expected score contributions.
Different Algorithms
不同算法
Start from PG with token-wise importance correction. One branch adds PPO clipping to obtain the GRPO comparator; the other subtracts Future-KL to obtain Proximal KL. The animation keeps the shared loss terms in place and highlights each branch’s change. Select a branch to follow its algorithm.
The experiments compare this additive cost with PPO clipping, which acts on a different part of the update. Given the sign of an advantage, PPO clipping gates further changes in a proximal ratio $\rho_i=\pi_\theta/\pi_k$. Above the upper bound, a positive-advantage contribution can be switched off while a negative one remains. Proximal KL supplies additive feedback: positive future log-ratios reduce the coefficient, while negative costs can increase it. At the cost bound, the clipped contribution remains part of the token’s score coefficient.
The update differences can be made explicit with surrogate losses, differentiable expressions constructed to produce the desired update direction. All methods use the same verifier reward; their surrogates produce different update fields. We write ascent surrogates below, with common token normalization omitted; implementation minimizes their negatives. PG uses reward advantage and the current-to-behavior weight:
\[\mathcal L_{\mathrm{PG}} =\mathbb E_{\pi_{\mathrm{behav}}}\sum_i w_i\operatorname{sg}[\widehat A_m].\]Differentiating $w_i$ produces $w_i\nabla\log\pi_\theta$. For the same detached coefficient, ascent in this ratio form gives the same update as descent in the negative score loss above: PG uses $\widehat A_m$, and Proximal KL uses $\widehat A_m-C_i^{(H)}$. An implementation chooses one differentiable path; differentiating both the weight and a score-loss factor would add an unintended term.
The GRPO comparator clips the proximal ratio with PPO clipping width $\epsilon$ and multiplies by fixed reference-to-behavior correction:
\[\mathcal L_{\mathrm{GRPO}} =\mathbb E_{\pi_{\mathrm{behav}}}\sum_i \frac{\pi_k}{\pi_{\mathrm{behav}}} \min\!\left( \rho_i\widehat A_m, \class{pkl-math-focus}{\operatorname{clip}(\rho_i,1-\epsilon,1+\epsilon)}\widehat A_m \right).\]CISPO clips the detached learner-to-behavior weight while retaining the score contribution:
\[\mathcal L_{\mathrm{CISPO}} =\mathbb E_{\pi_{\mathrm{behav}}}\sum_i \operatorname{sg}\!\left[ \class{pkl-math-focus}{\operatorname{clip}(w_i,c_{\mathrm{lo}},c_{\mathrm{hi}})}\widehat A_m \right]\log\pi_\theta(a_i\mid h_i).\]Proximal KL adds future credit to the token coefficient:
\[\mathcal L_{\mathrm{PKL}} =\mathbb E_{\pi_{\mathrm{behav}}}\sum_i w_i\operatorname{sg}[\widehat A_m\class{pkl-math-focus}{-C_i^{(H)}}].\]Compared with PG, it changes regularization credit; compared with GRPO, it changes how movement is controlled; compared with CISPO, it explicitly includes future cost relative to a fixed reference. The experiments can therefore ask separately whether correction alone suffices, whether bounding weights suffices, and how clipping compares with additive future feedback.
The GRPO variant here omits the initial-reference KL penalty. A permanent penalty toward initialization and a local reference refreshed between rounds define different objectives; Proximal KL uses the latter.
Reference refresh
Reference refresh
The surrogate formulas describe an update with a fixed reference. To specify a training run, we must also decide when to refresh that reference. We use $L$ for optimizer updates within a round and $K$ for the total number of rounds. Within a round, $\pi_k$ is fixed, behavior synchronizes on its own schedule, and the learner keeps updating. The zero-lag Proximal KL comparisons refresh reference every 50 updates. In ordinary off-policy minibatch comparisons, reference probabilities are recomputed at the start of a global batch and retained across its minibatches. Both fit the framework; each experiment must still be read with its own configuration.
Alongside reference timing, the score loss requires a concrete rule for its group-relative advantage. With a verifier that supplies only final correctness, multiple responses to the same prompt provide a comparison: subtracting the group mean gives higher coefficients to responses that outperform their group. The periodic-refresh experiment uses this centered reward; controlled-staleness experiments also divide it by the group standard deviation.
The group mean and standard deviation are computed from sampled responses, including the response being updated. They depend on sampled actions and rewards, while the baseline in the fixed-point proof is fixed by the current history. Dividing the reward coefficient by the group standard deviation also changes its scale relative to the separately computed KL cost, giving groups with different reward spreads different reward-to-KL balances. The finite-sample theorem analyzes a specified group-centered reward-minus-KL residual; the practical update centers and normalizes rewards before subtracting the separately computed KL cost.
The update gives each ablation a concrete question: where should importance correction act, how does baseline error enter, how large should each cost be, and how far into the future should it reach?
Main results
Main results
Does the update sustain learning when rollout policies fall behind, and do its gains extend to new problems? We examine training stability first, then compare fixed checkpoints across eight held-out benchmarks. A checkpoint is a saved model-weight snapshot.
Experiment overview
- Periodic refresh: Slime on DAPO-Math-17K, with 1.7B, 4B, 8B, and 32B models at learning rate $10^{-6}$. The smaller models use base checkpoints; 32B uses a post-trained checkpoint.
- Controlled staleness: AReaL with Qwen3-1.7B-Base and Qwen3-4B-Base on 9,453 filtered math prompts. The 1.7B comparisons use learning rates $5\times10^{-6}$ and $10^{-5}$; 4B uses $5\times10^{-6}$.
Stability tests
稳定性测试
Can the methods keep learning as the actor and learner drift apart? In the periodic-refresh experiment, each fresh response batch is used once, while actor weights remain fixed between synchronizations. The learner keeps changing, so newly generated responses become progressively more off-policy.
The figure compares PG, CISPO, GRPO, and Proximal KL across four model sizes. Training accuracy is the fraction of responses accepted by the verifier. Online curves are EMA-smoothed; aggregation across seeds is reported separately.
The second half of training separates early improvement from sustained learning. CISPO makes substantial initial progress at 1.7B before its accuracy falls sharply. At 8B and 32B, PG and CISPO also undergo large training-accuracy declines. Proximal KL retains its gains across all four scales.
GRPO also sustains training, but Proximal KL reaches higher accuracy with fewer updates in this experiment. At 8B, its smoothed training accuracy first reaches roughly 50% after about 200 updates, compared with about 640 for GRPO. Its mean raw training accuracy is also higher over the final 100 updates shared by the methods at 1.7B, 4B, and 8B.
All four methods use importance weighting. These trajectories therefore motivate examining how they control policy movement: weight bounds, PPO clipping, and additive Future-KL produce different learning behavior.
We next compare methods at controlled rollout staleness. Here generation overlaps optimization, and each response batch is reused, so both rollout delay and learner changes during reuse contribute to the mismatch. Within each method comparison, model, data, learning rate, sampling, and evaluation are matched.
The evaluation metrics answer different questions. Mean@16 measures response accuracy; pass@16 measures problem coverage. A problem solved once in 16 attempts counts as a success for pass@16 but contributes only $1/16$ to mean@16. Coverage can improve without an equally large improvement in single-response reliability.
The figure pairs AIME24 pass@16 with entropy. Lower entropy means the next-token distribution concentrates on fewer choices. Correct and incorrect answers can both be generated confidently, so entropy needs to be read alongside accuracy.
PG can be competitive for the smaller model at the lower learning rate, but that behavior does not reliably extend to larger models or more aggressive updates. At 4B and high staleness, PG shows a pronounced AIME24 decline and entropy fluctuations. GRPO and Proximal KL sustain more stable trajectories, motivating a closer checkpoint comparison between them. The clipping-width ablation later examines how GRPO’s clipping interval affects this stability.
Held-out evaluation
Held-out evaluation
Do the gains improve both reliability and coverage? The next figure compares AIME24 mean@16 and pass@16 in four matched settings. Proximal KL has higher late-training values on both metrics in all four, so the improvement is visible at both the response and problem levels.
We then evaluate fixed checkpoints across eight benchmarks. MATH500, OlympiadBench, MinervaMath, and Gaokao2023MathEn use greedy pass@1: one response per problem, choosing the highest-probability token at each step. AIME24/25 and AMC23/24 use mean@16 from sampled responses.
The table’s Average is micro accuracy: for trained models, it pools correct responses across all eight benchmarks, with 4,149 evaluated responses per seed. Each response contributes once, so benchmarks with more evaluated responses have greater weight. Average is neither an equal-weight mean of benchmark scores nor pass@16.
The trained 1.7B rows report means and sample standard deviations across three training seeds; the standard deviation describes run-to-run spread. Average reports only the seed mean. The trained 4B rows report individual checkpoints. Base rows summarize initialization evaluations, without training-seed statistics; their Average uses the same benchmark response-count weights. Checkpoints are selected independently of online evaluation peaks, and table scores are unsmoothed. Bolding is a descriptive within-pair comparison, not a test of statistical significance.
Across all seven matched off-policy comparisons, Proximal KL has higher Average than GRPO, with a largest absolute gain of 2.58 percentage points. The comparisons cover both fresh rollouts reused for multiple updates and stale rollout data. AIME25 mean@16 favors GRPO in several comparisons, so the aggregate gain coexists with task-specific trade-offs.
Fresh sampling and response reuse give different comparisons. With one update per fresh batch, Average is comparable: 34.50 for GRPO and 34.09 for Proximal KL. With reused fresh rollouts, Proximal KL reaches 33.13 versus 31.99. After the first update, reuse creates learner–data mismatch. The on-policy control also disables PPO clipping, so the two protocols differ in both reuse and update rule.
The higher-staleness configurations retain the advantage. For 4B, moving from the lower- to higher-staleness configuration changes Average by +0.22 percentage points for Proximal KL and −1.04 for GRPO, using unrounded scores. Proximal KL has the more favorable signed change on six of eight benchmarks. These are comparisons of complete training configurations; Proximal KL’s Future-KL settings also differ, so the change cannot be attributed to staleness alone.
The ablations below separate individual update choices to understand these results more closely.
Mechanism ablations
机制消融
Which parts of the update matter? The following comparisons examine importance correction, PPO clipping, baseline sensitivity, Future-KL cost bounds, and Future-KL horizon. Each changes a specific ingredient and asks how learning responds. A separate fixed-policy diagnostic measures correction variance without changing the policy during measurement.
Importance correction
Importance correction
Does Future-KL still work well if importance correction is changed? All three variants retain each token’s own Future-KL coefficient. Token-wise IS weights that coefficient by the current action’s probability ratio. Sequence-level IS uses a detached geometric mean of the whole response’s ratios, while IS-free uses weight one.
The sequence-level control is not exact full-response correction: taking the geometric mean changes the weight from the full product analyzed earlier. This figure tests those practical weighting choices directly.
Token-wise correction sustains stronger training pass@16 and achieves higher MATH500 greedy pass@1 and AIME24 mean@16 than both controls. Keeping future credit alone does not preserve the observed performance. The result supports retaining current-token correction alongside Future-KL.
GRPO clipping width
GRPO clipping width
How sensitive is GRPO to a wider PPO clipping interval? The next figure compares a narrower and a wider interval, tracking training mean@16, training pass@16, and raw gradient norm before gradient-norm clipping.
The wider interval produces larger gradient excursions together with a temporary decline in training mean@16 and pass@16. The narrower interval maintains a steadier rise with smaller excursions. Both runs complete the observation window; the wider run’s decline is not a training crash. This comparison shows that the clipping choice can materially affect GRPO’s observed stability.
Baseline perturbation
Baseline perturbation
How sensitive are the methods to a common shift in their advantages? We shift normalized advantages upward in groups whose rewards are not all equal, leaving verifier rewards and within-group advantage differences unchanged. The shift can change advantage signs, which determine which contributions PPO clipping removes. Proximal KL still subtracts its Future-KL cost after the shift.
Across the displayed MATH500 and AIME24 metrics, Proximal KL is less sensitive to the intervention. This supports a practical advantage of additive future feedback when the estimated advantage shifts.
The experiment measures a group-dependent perturbation. Whether a shift is applied depends on sampled group rewards, so it is not the fixed history-only baseline shift whose expected contribution vanishes in the proof. The evidence here is the observed difference between perturbed and unperturbed training trajectories.
Future-KL cost bounds
Future-KL cost bounds
Do very large sampled KL costs help learning? We vary the bound $\epsilon_F$ on each cost while retaining the full Future-KL sum. The unbounded variant still includes KL regularization. Alongside AIME24 mean@16 and pass@16, the figure shows gradient norm before gradient-norm clipping, so differently sized excursions remain visible.
A relatively tight cost bound achieves good accuracy with smaller gradient excursions than a very large bound or no bound. A moderately larger bound also retains good performance, so the useful range is not confined to one precise threshold. Within the tested range, allowing ever larger costs does not consistently improve accuracy.
Cost clipping changes the values used to construct the update; gradient-norm clipping acts on the resulting gradient. The plotted pre-clipping norms help distinguish these two stages.
Future-KL horizon
Future-KL horizon
Can a shorter Future-KL horizon improve learning? We compare the full tail, intermediate windows, and current-token-only credit. Some comparisons keep the KL coefficient fixed; another matches the coefficient–horizon product to test whether a stronger local penalty compensates for removing future terms.
The figure separates two questions: how horizon affects held-out accuracy during training, and how it changes correction variance when the policies and sampled responses are held fixed.
Both intermediate-window configurations outperform full tail on late AIME24 mean@16 and pass@16 over their common observation interval, including a comparison that keeps the KL coefficient unchanged. The current-token-only variant learns more slowly even when its coefficient–horizon product matches an intermediate window. Later-token credit therefore provides useful information beyond simply increasing the local penalty.
The variance measurement is separate. It freezes a pair of policies and a shared bank of responses, then measures the first token’s scalar Future-KL correction at each horizon. Variance is computed among responses to the same prompt and then averaged across prompts. The plot shows the raw measured variance without rescaling or smoothing.
For these fixed policies and responses, variance increases with horizon. Shorter sums fluctuate less on this data. This measures scalar correction variance, not full-gradient variance: a gradient also contains the importance-weighted score, reward advantage, and their joint fluctuations. The diagnostic does not establish that variance reduction caused the accuracy gains.
The comparisons thus answer complementary questions. Finite horizons change the expected update by removing future contributions, the diagnostic measures their fluctuation on fixed data, and the training curves show the resulting performance in the tested settings.