Technical note

Training–Inference Mismatch in Generative RL

Why reward fine-tuning under classifier-free guidance drifts, and why the same fix appears in LLM reinforcement learning.

Zeshi Yang*, Yujie Wang* (*equal contribution)·27 October 2026

技术笔记

生成式 RL 中的训练–推理不匹配

为什么在 classifier-free guidance 下做 reward 微调会漂移,以及为什么同样的修正也出现在 LLM 强化学习中。

杨泽世*,王玉洁* (*同等贡献)·2026 年 10 月 27 日

Abstract

Why can reward fine-tuning of a diffusion model sampled with classifier-free guidance improve for a while and then give back its gains, even though every update is weighted toward higher-reward samples? We show that the exponentially weighted flow-matching objective hides two updates inside one gradient: a reward-driven change, and a second term that fits the model to its own guided rollouts. When guided sampling and the training reference disagree, this second term is not neutral: it pulls the conditional branch toward the guided field. Subtracting the state-conditional mean weight removes it. A reference-field straight-through estimator gives the same corrected objective at a different estimation and infrastructure cost, and the identical structure reappears as score centering for training–inference mismatch in LLMs.

The whole note in one line
∇GLW=m(z) (G−FQ(z))⏟fits the guided rollouts  −  m(z) (FQ⋆(z)−FQ(z))⏟reward-induced change \nabla_G L_W = \underbrace{\fit{m(z)\,\bigl(G-F_Q(z)\bigr)}}_{\fit{\text{fits the guided rollouts}}} \;-\; \underbrace{\rew{m(z)\,\bigl(F_{Q^\star}(z)-F_Q(z)\bigr)}}_{\rew{\text{reward-induced change}}}

Keep the green term and drop the orange one. The same colours are used throughout.

Abbreviations used in this note
RL
Reinforcement learning; here, fine-tuning a generative model toward a reward.
LLM
Large language model.
CFG
Classifier-free guidance. Sampling uses v∅+w (vc−v∅)v_\varnothing+w\,(v_c-v_\varnothing), mixing conditional and unconditional predictions with scale ww; w=1w=1 is plain conditional sampling.
FM
Flow matching: regressing a velocity field onto X−ϵX-\epsilon along noisy interpolations [4].
NFT
DiffusionNFT, an online diffusion RL method that trains with forward-process (flow-matching) losses on reward-weighted rollouts [6].
IGO
Information-geometric optimization: update a sampling distribution toward a reward-tilted one [2].
AWR
Advantage-weighted regression: supervised regression with weights eA/βe^{A/\beta} [3].
KL
Kullback–Leibler divergence.
STE
Straight-through estimator: use one value in the forward pass and another's gradient in the backward pass, written with stop-gradient sg⁡(⋅)\operatorname{sg}(\cdot).
TIM
Training–inference mismatch: the sampler and the trainer assign different probabilities to the same tokens [1].

1. One structure, two sources of mismatch

Training–inference mismatch in LLM RL and CFG mismatch in diffusion RL look like unrelated engineering problems. They share one mathematical structure: the distribution that supplies the training samples is not the reference implicit in the training gradient. The causes differ; the resulting weighted gradients decompose in the same way.

For LLMs, a Megatron trainer and a vLLM sampler can produce different token probabilities because of numerical execution, sampling transforms, or checkpoint staleness [1]. For diffusion models, CFG changes the sampling procedure on purpose, while training may still use only the conditional branch [5].

LLM RL Diffusion RL
Sampling Tokens from the inference engine Endpoints generated with CFG
Training Weighted token log-likelihood Weighted FM on re-noised endpoints
Mismatch Trainer probabilities ≠ sampler probabilities Trainable velocity ≠ rollouts' re-noised mean field
Conditioning Prompt and token prefix Prompt, noisy latent, noise level
Conditional baseline Mean weight at a prefix Mean weight at a noisy state
Forward correction Sampler probabilities with the trainer's logit Jacobian Rollout mean field with the student's output Jacobian

We derive the diffusion case first, then map it to LLMs. Throughout, the rollout distribution, reward weights, and estimated statistics are held fixed during differentiation.

2. From IGO to exponentially weighted flow matching

Take the distribution-first view of IGO. Let Q(X∣c)Q(X\mid c) be the current CFG rollout distribution for input cc and A(X,c)A(X,c) an advantage. A local improvement trades reward against staying close to QQ:

Q⋆=arg⁡max⁡P{EP[A]−βDKL(P∥Q)},β>0. Q^\star = \arg\max_P \left\{ \mathbb E_P[A] - \beta D_{\mathrm{KL}}(P\Vert Q) \right\}, \qquad \beta>0.

Setting the functional derivative to zero, A−β(log⁡(P/Q)+1)+λ=0A-\beta(\log(P/Q)+1)+\lambda=0, gives the familiar exponential tilt

Q⋆(X∣c)=Q(X∣c) W(X,c)Z(c),W(X,c)=eA(X,c)/β, \boxed{ Q^\star(X\mid c) = \frac{Q(X\mid c)\,W(X,c)}{Z(c)}, \qquad W(X,c)=e^{A(X,c)/\beta}, }

with Z(c)=EQ[W]Z(c)=\mathbb E_{Q}[W] assumed finite. This exponential weighting comes from this particular KL-regularized objective; it is the same tilt as in AWR [3], not a definition of all IGO algorithms [2].

To fit Q⋆Q^\star with flow matching, draw X∼QX\sim Q and independent ϵ∼N(0,I)\epsilon\sim\mathcal N(0,I), and set

xt=(1−t)X+tϵ,u=X−ϵ,z=(xt,t,c), x_t=(1-t)X+t\epsilon, \qquad u=X-\epsilon, \qquad z=(x_t,t,c),

so t=1t=1 is noise, t=0t=0 is data, and uu is the denoising velocity. The exponentially weighted objective is

LW(θ)=12EX∼Q, t, ϵ[W(X,c) ∥Gθ(z)−u∥2]. \boxed{ L_W(\theta) = \frac12 \mathbb E_{X\sim Q,\,t,\,\epsilon} \left[ W(X,c)\,\|G_\theta(z)-u\|^2 \right]. }

For fixed cc, weighting by WW turns the endpoint measure QQ into Q⋆Q^\star up to the constant Z(c)Z(c), so the ideal regression target is the flow of Q⋆Q^\star. (FM is a field regression, not literally a log-likelihood or forward KL; across inputs, Z(c)Z(c) also sets their relative training weight [4].)

3. Two forces inside one gradient

Fix a noisy state zz. Two conditional averages matter: the rollout mean field and the mean weight,

FQ(z)=EQ[u∣z],m(z)=EQ[W∣z]. F_Q(z)=\mathbb E_Q[u\mid z], \qquad m(z)=\mathbb E_Q[W\mid z].

Writing G=Gθ(z)G=G_\theta(z), the output gradient is EQ[W(G−u)∣z]=m(z)G−EQ[Wu∣z]\mathbb E_Q[W(G-u)\mid z]=m(z)G-\mathbb E_Q[Wu\mid z]. Splitting EQ[Wu∣z]=m(z)FQ(z)+Cov⁡Q(W,u∣z)\mathbb E_Q[Wu\mid z]=m(z)F_Q(z)+\operatorname{Cov}_Q(W,u\mid z) gives

∇GLW(z)=m(z)(G−FQ(z))⏟rollout-distribution fitting−Cov⁡Q(W,u∣z)⏟reward-dependent correction. \boxed{ \nabla_G L_W(z) = \underbrace{\fit{m(z)\bigl(G-F_Q(z)\bigr)}}_{\fit{\text{rollout-distribution fitting}}} - \underbrace{\rew{\operatorname{Cov}_Q(W,u\mid z)}}_{\rew{\text{reward-dependent correction}}}. }

The orange term fits the guided rollouts

Gradient descent on the orange term moves GG toward FQF_Q. It survives when all weights equal one, so it expresses no preference between samples at all. At the pre-update field G0G_0 it vanishes only where G0=FQG_0=F_Q, which is exactly what CFG breaks.

With CFG rollouts and conditional-only training, this term transfers guided sampling behaviour into the conditional branch. Sampling with CFG afterwards may amplify that behaviour again.

Note that the relevant reference is FQF_Q, not automatically the cached CFG velocity: re-noising endpoints and following the actual CFG trajectory define different joint distributions [5].

The green term is the reward-induced flow change

Under exponential reweighting, FQ⋆(z)=EQ[Wu∣z]/m(z)F_{Q^\star}(z)=\mathbb E_Q[Wu\mid z]/m(z). Therefore

Cov⁡Q(W,u∣z)=m(z) (FQ⋆(z)−FQ(z)). \boxed{ \rew{\operatorname{Cov}_Q(W,u\mid z)} = m(z)\,\rew{\bigl(F_{Q^\star}(z)-F_Q(z)\bigr)}. }

The covariance isolates exactly the change from the rollout flow to the reward-tilted flow. If the goal is to distil Q⋆Q^\star completely, the orange term is appropriate. If the goal is to apply the reward-induced change to an existing policy G0G_0, the orange term is an extra, unwanted update.

4. Two ways to remove the orange term

The fix has two parts: isolate the green covariance, then anchor the update to the frozen pre-update policy with a purple constraint. Centering plus this constraint and a fixed-reference STE give the same gradient when the conditional quantities are exact.

A. Center the weight, then anchor the update

Replace WW by W−m(z)W-m(z), treating the baseline as a constant:

Lcenter(z)=12EQ[(W−m(z))∥G−u∥2∣z]. L_{\mathrm{center}}(z) = \frac12 \mathbb E_Q \left[ (W-m(z))\|G-u\|^2 \mid z \right].

Because EQ[W−m(z)∣z]=0\mathbb E_Q[W-m(z)\mid z]=0, the coefficient of GG cancels and the orange term disappears:

∇GLcenter(z)=−Cov⁡Q(W,u∣z). \boxed{ \nabla_G L_{\mathrm{center}}(z) = -\rew{\operatorname{Cov}_Q(W,u\mid z)}. }

Centering alone has no finite optimum. With fixed rollout statistics, this gradient does not depend on GG: the objective is affine in GG and unbounded below. Repeated inner steps keep pushing the field even after the intended improvement has been reached. (Try the Centered only mode in the demo below.)

Let G0(z)G_0(z) be the policy output before the update window, held fixed throughout its inner steps. Add a constraint weighted by the same conditional mean m(z)m(z):

Lcorrected(z)=12EQ[(W−m(z))∥G−u∥2∣z]+m(z)2∥G−G0∥2⏟reference-policy constraint. \boxed{ \begin{aligned} L_{\mathrm{corrected}}(z) ={}& \frac12 \mathbb E_Q \left[ (W-m(z))\|G-u\|^2 \mid z \right] + \underbrace{ \anc{\frac{m(z)}2\|G-G_0\|^2} }_{\anc{\text{reference-policy constraint}}}. \end{aligned} }

Its gradient and curvature are

∇GLcorrected(z)=m(z)(G−G0)−Cov⁡Q(W,u∣z),∇G2Lcorrected(z)=m(z)I. \nabla_G L_{\mathrm{corrected}}(z) = \anc{m(z)(G-G_0)} - \rew{\operatorname{Cov}_Q(W,u\mid z)}, \qquad \nabla_G^2 L_{\mathrm{corrected}}(z) = m(z)I .

Since W=eA/β>0W=e^{A/\beta}>0, m(z)>0m(z)>0 and the problem is strongly convex. The purple term is zero at G=G0G=G_0 and restores the policy as it moves. It anchors to G0G_0, not to the CFG field FQF_Q, so it does not bring the orange term back. The pointwise optimum is

G⋆(z)=G0(z)+Cov⁡Q(W,u∣z)m(z)=G0(z)+FQ⋆(z)−FQ(z). \boxed{ G^\star(z) = G_0(z) + \rew{\frac{\operatorname{Cov}_Q(W,u\mid z)}{m(z)}} = G_0(z)+\rew{F_{Q^\star}(z)-F_Q(z)}. }

The corrected objective applies the reward-induced flow change to the pre-update policy, and nothing else. Two details matter in practice: G0G_0 is the pre-update policy, not necessarily the pretrained model, and must stay fixed through the inner window; and the coefficient is the state-conditional m(z)m(z), not a batch average of WW.

Estimating m(z)m(z) with a tempered posterior

For each input cc, let X1,…,XKX_1,\dots,X_K be the KK rollout endpoints generated for that input. A uniform empirical prior and the Gaussian bridge xt∣X∼N((1−t)X, t2I)x_t\mid X\sim\mathcal N((1-t)X,\,t^2I) give, for 0<t<10<t<1,

ρj(T)(z)=softmax⁡j(−∥xt−(1−t)Xj∥222Tt2), \rho_j^{(T)}(z) = \operatorname{softmax}_j \left( -\frac{\|x_t-(1-t)X_j\|_2^2}{2Tt^2} \right),
m^T(z)=∑j=1Kρj(T)(z) Wj. \boxed{ \widehat m_T(z) = \sum_{j=1}^{K}\rho_j^{(T)}(z)\,W_j. }

Use the detached m^T(z)\widehat m_T(z) both in the centered weight and as the constraint coefficient. At T=1T=1 these are the exact posterior responsibilities of the empirical bank; T>1T>1 inflates the assumed noise variance and smooths a concentrated posterior, at the cost of bias relative to the population conditional mean. Compute the full summed latent squared norm and use a stable log-softmax.

What an inexact baseline costs

Replacing mm by a fixed estimate m^\widehat m in both places gives

∇GL^corrected=m(G−G0)−Cov⁡Q(W,u∣z)+(m−m^)(G0−FQ). \boxed{ \nabla_G\widehat L_{\mathrm{corrected}} = \anc{m(G-G_0)} - \rew{\operatorname{Cov}_Q(W,u\mid z)} + \fit{(m-\widehat m)(G_0-F_Q)}. }

A residue of the orange term survives in proportion to the baseline error. Positive regularization does not remove it; only an accurate conditional mean does. At low noise a concentrated posterior may correctly identify the source endpoint, so temperature smoothing is a regularizer, not a guarantee of a better estimate.

B. Correct the forward field with a fixed-reference STE

Instead of estimating the scalar m(z)m(z), estimate the vector field FQF_Q directly by ordinary FM on the CFG endpoints, as GuidanceNFT does with online flow matching on guided samples [5]:

min⁡ϕ12EQ[∥Fϕ(z)−u∥2],Fϕ(z)≈FQ(z). \min_\phi \frac12 \mathbb E_Q \left[ \|F_\phi(z)-u\|^2 \right], \qquad F_\phi(z)\approx F_Q(z).

With the same frozen G0G_0, define the straight-through surrogate

G~θ=Gθ+sg⁡(Fϕ−G0). \boxed{ \widetilde G_\theta = G_\theta+\operatorname{sg}(F_\phi-G_0). }

Its forward value is Gθ−G0+FϕG_\theta-G_0+F_\phi, its Jacobian is that of GθG_\theta. With an exact reference, ordinary weighted FM through this surrogate has gradient

∇Gθ12EQ[W∥G~θ−u∥2∣z]=m(z)(Gθ−G0)−Cov⁡Q(W,u∣z), \nabla_{G_\theta} \frac12 \mathbb E_Q \left[ W\|\widetilde G_\theta-u\|^2 \mid z \right] = \anc{m(z)(G_\theta-G_0)} - \rew{\operatorname{Cov}_Q(W,u\mid z)},

identical to the centered-and-anchored objective above: the purple constraint is implicit in the fixed reference. Our contribution here is this equivalence; the learned-reference correction itself follows [5].

If G0G_0 is replaced by the current GθG_\theta inside the stop-gradient at every step, G~θ=Gθ+sg⁡(FQ−Gθ)\widetilde G_\theta=G_\theta+\operatorname{sg}(F_Q-G_\theta), the purple term disappears and only the green covariance remains: the refreshed STE is centering without the constraint.

Which one to use

Conditional baseline Learned-reference STE
Estimates m(z)=E[W∣z]m(z)=\mathbb E[W\mid z] FQ(z)=E[u∣z]F_Q(z)=\mathbb E[u\mid z]
Implementation Kernel posterior over stored endpoints Auxiliary FM regression
Extra parameters None Reference model or adapter
Main error Finite-bank and temperature bias Reference-field approximation

A learned reference means maintaining an auxiliary model next to the policy; at trillion-parameter scale its weights, training, and communication are expensive, while the kernel estimator needs no extra parameters. Both still need a fixed G0G_0: cached predictions suffice at fixed training queries, fresh queries need extra reference evaluations or an explicit approximation, and the reference and student must use the same branch or CFG composition. STE itself does not require an auxiliary model; the difference is how the reference field is obtained. Learning both FQF_Q and FQ⋆F_{Q^\star} explicitly is a third way to build the difference target. None of these output-space identities guarantees that a shared network can realize the pointwise target exactly.

5. The same picture for LLMs

The decomposition, and both fixes, carry over to logit space. At a fixed prefix hh, let qq be the sampler's probabilities, pθ=softmax⁡(ℓθ)p_\theta=\operatorname{softmax}(\ell_\theta) the trainer's, eye_y the one-hot sampled token, and m(h)=Eq[W∣h]m(h)=\mathbb E_q[W\mid h]. The logit score is sθ(y)=ey−pθs_\theta(y)=e_y-p_\theta with Eq[sθ∣h]=q−pθ\mathbb E_q[s_\theta\mid h]=q-p_\theta, so negative weighted log-likelihood has gradient

∇ℓθL=m(h)(pθ−q)−Cov⁡q(W,ey∣h), \boxed{ \nabla_{\ell_\theta}L = \fit{m(h)(p_\theta-q)} - \rew{\operatorname{Cov}_q(W,e_y\mid h)}, }

the categorical twin of m(z)(G−FQ)−Cov⁡Q(W,u∣z)\fit{m(z)(G-F_Q)}-\rew{\operatorname{Cov}_Q(W,u\mid z)}. The orange term pulls the trainer toward the sampler's distribution, whatever the reward says.

Baseline or score centering: two routes to the same expectation

Score centering [1] subtracts the conditional mean of the score, sθ−Eq[sθ∣h]=ey−qs_\theta-\mathbb E_q[s_\theta\mid h]=e_y-q. Subtracting the conditional weight baseline instead gives the same expected update:

Eq[(W−m)sθ∣h]=Eq[W(sθ−Eq[sθ∣h])∣h]=Cov⁡q(W,sθ∣h). \boxed{ \mathbb E_q[(W-m)s_\theta\mid h] = \mathbb E_q \left[ W\left(s_\theta-\mathbb E_q[s_\theta\mid h]\right) \mid h \right] = \rew{\operatorname{Cov}_q(W,s_\theta\mid h)}. }

The diffusion baseline uses the first form; LLM score centering uses the second, with sampler probabilities. They agree in expectation with exact conditional means, not necessarily as finite-batch estimators.

Straight-through, in logits

The logit-level STE is

ℓ~θ=ℓθ+sg⁡(log⁡q−ℓθ). \boxed{ \widetilde\ell_\theta = \ell_\theta + \operatorname{sg}(\log q-\ell_\theta). }

For positive qq its forward softmax is qq and its logit Jacobian is the identity, so weighted cross-entropy yields the green term alone, like the refreshed diffusion STE. Freezing the correction at the pre-update logits ℓ0\ell_0, ℓ~θ=ℓθ+sg⁡(log⁡q−ℓ0)\widetilde\ell_\theta=\ell_\theta+\operatorname{sg}(\log q-\ell_0), additionally keeps a restoring term m(h)(p~θ−q)\anc{m(h)(\widetilde p_\theta-q)} with p~θ=softmax⁡(ℓ~θ)\widetilde p_\theta=\operatorname{softmax}(\widetilde\ell_\theta), the analogue of the purple constraint. Correcting only the sampled token's scalar log-probability leaves its derivative unchanged and is not enough.

The practical difference: LLM score centering can read the sampler's conditional token probabilities directly, while diffusion needs a conditional expectation over latent endpoints, either the scalar mean weight or the vector mean field. Kernel estimation and auxiliary-model training are two approximations to these. In both domains, centering removes the identified mismatch term; it does not in general recover an exact on-policy gradient under the trainer's own distribution.

6. What we see at CFG = 5

We compare NFT [6] with the corrected objective at guidance scale 5, using K=8K=8 rollouts per input. The corrected run keeps rising over its logged range; NFT improves at first and then gives back part of the gain.

0.4900.4950.5000.5050.5100.5150.5200.5250510152025303540Training stepRewardNFT · step 0: 0.492NFT · step 1: 0.4951NFT · step 2: 0.4947NFT · step 3: 0.4958NFT · step 4: 0.4974NFT · step 5: 0.4988NFT · step 6: 0.5022NFT · step 7: 0.502NFT · step 8: 0.5055NFT · step 9: 0.502NFT · step 10: 0.5029NFT · step 11: 0.5027NFT · step 12: 0.5078NFT · step 13: 0.5053NFT · step 14: 0.5077NFT · step 15: 0.508NFT · step 16: 0.51NFT · step 17: 0.5065NFT · step 18: 0.511NFT · step 19: 0.5108NFT · step 20: 0.5084NFT · step 21: 0.5045NFT · step 22: 0.5093NFT · step 23: 0.5045NFT · step 24: 0.5032NFT · step 25: 0.51NFT · step 26: 0.5087NFT · step 27: 0.5098NFT · step 28: 0.5065NFT · step 29: 0.4998NFT · step 30: 0.5057NFT · step 31: 0.5037NFT · step 32: 0.5034NFT · step 33: 0.5008NFT · step 34: 0.5052NFT · step 35: 0.5005NFT · step 36: 0.5004NFT · step 37: 0.5021NFT · step 38: 0.504NFT · step 39: 0.5028NFT · step 40: 0.4985NFT · step 41: 0.5071Our method · step 0: 0.4965Our method · step 1: 0.4999Our method · step 2: 0.4959Our method · step 3: 0.4966Our method · step 4: 0.498Our method · step 5: 0.497Our method · step 6: 0.5027Our method · step 7: 0.5022Our method · step 8: 0.5018Our method · step 9: 0.5039Our method · step 10: 0.5Our method · step 11: 0.5065Our method · step 12: 0.5093Our method · step 13: 0.504Our method · step 14: 0.5072Our method · step 15: 0.51Our method · step 16: 0.5103Our method · step 17: 0.5107Our method · step 18: 0.5112Our method · step 19: 0.5158Our method · step 20: 0.5124Our method · step 21: 0.5093Our method · step 22: 0.515Our method · step 23: 0.5103Our method · step 24: 0.516Our method · step 25: 0.5168Our method · step 26: 0.5164Our method · step 27: 0.512Our method · step 28: 0.5199Our method · step 29: 0.5186Our method · step 30: 0.5122Our method · step 31: 0.519Our method · step 32: 0.5232Our methodNFTCFG = 5

Figure 1. Reward versus training step at CFG = 5, K=8K=8 rollouts per input. Blue: corrected objective; brown: NFT [6]. Values are approximate readings of a single run per method, shown up to the last logged step (32 and 41) without smoothing or extrapolation. Hover over a point to see its value.

This is one run per method, so it motivates a controlled ablation rather than establishing the mismatch correction as the cause. Removing the orange term also does not by itself guarantee visual fidelity, prevent reward-induced oversaturation, or make reward improvement monotonic.

Citation

If you find this note useful, please cite it as:

@misc{yang2026tim,
  title        = {Training--Inference Mismatch in Generative {RL}},
  author       = {Yang, Zeshi and Wang, Yujie},
  year         = {2026},
  month        = oct,
  howpublished = {\url{https://zeshiyang.github.io/blog/training-inference-mismatch.html}},
  note         = {Blog post}
}

References

The cross-domain correspondence and the equivalence identities are derived in this note; the learned-reference correction for diffusion follows [5]. The experiment is separate from the published results below.

  1. Marek & Ryabinin. Score Centering Stabilizes Off-policy Reinforcement Learning. 2026.
    https://arxiv.org/html/2609.20807v1#S4

  2. Ollivier, Arnold, Auger & Hansen. Information-Geometric Optimization Algorithms: A Unifying Picture via Invariance Principles. 2017.
    https://www.jmlr.org/papers/v18/14-467.html

  3. Peng, Kumar, Zhang & Levine. Advantage-Weighted Regression: Simple and Scalable Off-Policy Reinforcement Learning. 2019.
    https://arxiv.org/abs/1910.00177

  4. Lipman et al. Flow Matching for Generative Modeling. 2022.
    https://arxiv.org/abs/2210.02747

  5. Liu, Li, Qian & Cheng. GuidanceNFT: NFT-Based Reward Fine-Tuning of Guided Diffusion Models. 2026.
    https://arxiv.org/html/2610.15856v1#S3

  6. Zheng et al. DiffusionNFT: Online Diffusion Reinforcement with Forward Process. 2025.
    https://arxiv.org/abs/2509.16117

摘要

用 classifier-free guidance 采样的扩散模型做 reward 微调时,为什么 reward 可能先涨一段、然后又把涨幅还回去,哪怕每一次更新都偏向高 reward 的样本?我们指出,指数加权的 flow-matching 目标在一个梯度里藏了两种更新:一个是由 reward 驱动的变化,另一个是让模型去拟合它自己 guided rollout 的项。当 guided 采样与训练所用的参考不一致时,第二项并不中性:它会把条件分支拉向 guided 场。减去按状态取条件的平均权重可以去掉这一项。基于参考场的 straight-through estimator 能得到同一个修正后的目标,只是估计方式和基础设施成本不同;而完全相同的结构,也以 score centering 的形式出现在 LLM 的训练–推理不匹配问题中。

一行公式概括全文
∇GLW=m(z) (G−FQ(z))⏟拟合 guided rollout  −  m(z) (FQ⋆(z)−FQ(z))⏟reward 带来的变化 \nabla_G L_W = \underbrace{\fit{m(z)\,\bigl(G-F_Q(z)\bigr)}}_{\fit{\text{拟合 guided rollout}}} \;-\; \underbrace{\rew{m(z)\,\bigl(F_{Q^\star}(z)-F_Q(z)\bigr)}}_{\rew{\text{reward 带来的变化}}}

保留绿色项,去掉橙色项。全文统一使用这套配色。

本文用到的缩写
RL
强化学习(reinforcement learning);这里指把生成模型朝某个 reward 方向微调。
LLM
大语言模型(large language model)。
CFG
Classifier-free guidance。采样时使用 v∅+w (vc−v∅)v_\varnothing+w\,(v_c-v_\varnothing),以尺度 ww 混合条件与无条件预测;w=1w=1 即普通的条件采样。
FM
Flow matching:沿加噪插值路径,把速度场回归到 X−ϵX-\epsilon [4]。
NFT
DiffusionNFT,一种在线扩散 RL 方法,在 reward 加权的 rollout 上用前向过程(flow-matching)损失训练 [6]。
IGO
Information-geometric optimization:把采样分布朝 reward 倾斜后的分布更新 [2]。
AWR
Advantage-weighted regression:以 eA/βe^{A/\beta} 为权重的监督回归 [3]。
KL
Kullback–Leibler 散度。
STE
Straight-through estimator:前向传播用一个值,反向传播用另一个量的梯度,借助 stop-gradient sg⁡(⋅)\operatorname{sg}(\cdot) 实现。
TIM
Training–inference mismatch:采样器与训练器对同一 token 给出的概率不同 [1]。

1. 一个结构,两种不匹配

LLM RL 中的训练–推理不匹配,和扩散 RL 中的 CFG 不匹配,看起来是两个不相关的工程问题。但它们有相同的数学结构:提供训练样本的分布,并不是训练梯度里隐含的那个参考。 成因不同,加权梯度却以同样的方式分解。

对 LLM 而言,Megatron 训练器和 vLLM 采样器可能因数值实现、采样变换或 checkpoint 滞后而给出不同的 token 概率 [1]。对扩散模型而言,CFG 是有意改变了采样过程,而训练可能仍然只用条件分支 [5]。

LLM RL 扩散 RL
采样 推理引擎生成的 token 用 CFG 生成的终点样本
训练 加权的 token 对数似然 在重新加噪的终点上做加权 FM
不匹配 训练器概率 ≠ 采样器概率 可训练速度场 ≠ rollout 重新加噪后的均值场
条件 prompt 与 token 前缀 prompt、带噪 latent、噪声水平
条件 baseline 某前缀下的平均权重 某带噪状态下的平均权重
前向修正 采样器概率 + 训练器的 logit Jacobian rollout 均值场 + 学生模型的输出 Jacobian

我们先推导扩散的情形,再对应到 LLM。全文中,rollout 分布、reward 权重以及估计出的统计量在求导时都视为常数。

2. 从 IGO 到指数加权 flow matching

采用 IGO 以分布为中心的视角。设 Q(X∣c)Q(X\mid c) 为输入 cc 下当前的 CFG rollout 分布,A(X,c)A(X,c) 为 advantage。局部改进在 reward 与“不要离 QQ 太远”之间权衡:

Q⋆=arg⁡max⁡P{EP[A]−βDKL(P∥Q)},β>0. Q^\star = \arg\max_P \left\{ \mathbb E_P[A] - \beta D_{\mathrm{KL}}(P\Vert Q) \right\}, \qquad \beta>0.

令泛函导数为零,A−β(log⁡(P/Q)+1)+λ=0A-\beta(\log(P/Q)+1)+\lambda=0,得到熟悉的指数倾斜

Q⋆(X∣c)=Q(X∣c) W(X,c)Z(c),W(X,c)=eA(X,c)/β, \boxed{ Q^\star(X\mid c) = \frac{Q(X\mid c)\,W(X,c)}{Z(c)}, \qquad W(X,c)=e^{A(X,c)/\beta}, }

其中假设 Z(c)=EQ[W]Z(c)=\mathbb E_{Q}[W] 有限。这种指数加权来自这个特定的 KL 正则目标;它与 AWR [3] 的倾斜相同,但并不是所有 IGO 算法的定义 [2]。

为了用 flow matching 拟合 Q⋆Q^\star,采样 X∼QX\sim Q 和独立的 ϵ∼N(0,I)\epsilon\sim\mathcal N(0,I),令

xt=(1−t)X+tϵ,u=X−ϵ,z=(xt,t,c), x_t=(1-t)X+t\epsilon, \qquad u=X-\epsilon, \qquad z=(x_t,t,c),

于是 t=1t=1 为噪声,t=0t=0 为数据,uu 是去噪速度。指数加权目标为

LW(θ)=12EX∼Q, t, ϵ[W(X,c) ∥Gθ(z)−u∥2]. \boxed{ L_W(\theta) = \frac12 \mathbb E_{X\sim Q,\,t,\,\epsilon} \left[ W(X,c)\,\|G_\theta(z)-u\|^2 \right]. }

对固定的 cc,用 WW 加权相当于把终点测度 QQ 变成 Q⋆Q^\star(相差常数 Z(c)Z(c)),所以理想的回归目标是 Q⋆Q^\star 的流。(FM 是对场的回归,并不严格等于对数似然或前向 KL;在不同输入之间,Z(c)Z(c) 还决定了它们的相对训练权重 [4]。)

3. 一个梯度里的两股力

固定一个带噪状态 zz。有两个条件平均量很关键:rollout 均值场和平均权重,

FQ(z)=EQ[u∣z],m(z)=EQ[W∣z]. F_Q(z)=\mathbb E_Q[u\mid z], \qquad m(z)=\mathbb E_Q[W\mid z].

记 G=Gθ(z)G=G_\theta(z),输出梯度为 EQ[W(G−u)∣z]=m(z)G−EQ[Wu∣z]\mathbb E_Q[W(G-u)\mid z]=m(z)G-\mathbb E_Q[Wu\mid z]。把 EQ[Wu∣z]\mathbb E_Q[Wu\mid z] 拆成 m(z)FQ(z)+Cov⁡Q(W,u∣z)m(z)F_Q(z)+\operatorname{Cov}_Q(W,u\mid z),得到

∇GLW(z)=m(z)(G−FQ(z))⏟拟合 rollout 分布−Cov⁡Q(W,u∣z)⏟依赖 reward 的修正. \boxed{ \nabla_G L_W(z) = \underbrace{\fit{m(z)\bigl(G-F_Q(z)\bigr)}}_{\fit{\text{拟合 rollout 分布}}} - \underbrace{\rew{\operatorname{Cov}_Q(W,u\mid z)}}_{\rew{\text{依赖 reward 的修正}}}. }

橙色项:拟合 guided rollout

对橙色项做梯度下降,会把 GG 推向 FQF_Q。即使所有权重都等于 1,这一项依然存在,所以它对样本之间没有任何偏好。在更新前的场 G0G_0 处,它只在 G0=FQG_0=F_Q 的地方为零,而这恰恰是 CFG 所破坏的。

当 rollout 用 CFG 生成、训练只用条件分支时,这一项会把 guided 采样的行为转移进条件分支。之后再用 CFG 采样,可能会把这种行为再放大一次。

注意,相关的参考是 FQF_Q,并不自动等于缓存下来的 CFG 速度:对终点重新加噪,与沿实际 CFG 轨迹采样,定义的是不同的联合分布 [5]。

绿色项:reward 带来的流的变化

在指数重加权下,FQ⋆(z)=EQ[Wu∣z]/m(z)F_{Q^\star}(z)=\mathbb E_Q[Wu\mid z]/m(z)。因此

Cov⁡Q(W,u∣z)=m(z) (FQ⋆(z)−FQ(z)). \boxed{ \rew{\operatorname{Cov}_Q(W,u\mid z)} = m(z)\,\rew{\bigl(F_{Q^\star}(z)-F_Q(z)\bigr)}. }

协方差恰好分离出从 rollout 流到 reward 倾斜后的流之间的变化。如果目标是完整地蒸馏 Q⋆Q^\star,橙色项是合理的;如果目标是把 reward 带来的变化施加到现有策略 G0G_0 上,橙色项就是一项额外的、不需要的更新。

4. 去掉橙色项的两种方法

修正分两步:先分离出绿色的协方差项,再用紫色约束把更新锚定在冻结的更新前策略上。在条件量精确的情况下,中心化加上这个约束,与固定参考的 STE 给出相同的梯度。

A. 中心化权重,再锚定更新

把 WW 换成 W−m(z)W-m(z),并把 baseline 视为常数:

Lcenter(z)=12EQ[(W−m(z))∥G−u∥2∣z]. L_{\mathrm{center}}(z) = \frac12 \mathbb E_Q \left[ (W-m(z))\|G-u\|^2 \mid z \right].

由于 EQ[W−m(z)∣z]=0\mathbb E_Q[W-m(z)\mid z]=0,GG 的系数相互抵消,橙色项消失:

∇GLcenter(z)=−Cov⁡Q(W,u∣z). \boxed{ \nabla_G L_{\mathrm{center}}(z) = -\rew{\operatorname{Cov}_Q(W,u\mid z)}. }

只做中心化没有有限的最优点。 在 rollout 统计量固定时,这个梯度与 GG 无关:目标对 GG 是仿射的,没有下界。即使已经达到预期的改进,反复的内层迭代仍会继续推动这个场。(可以在下面演示里试试 只中心化 模式。)

设 G0(z)G_0(z) 为更新窗口开始前的策略输出,在整个内层迭代中保持不变。加上一个以同一条件均值 m(z)m(z) 加权的约束:

Lcorrected(z)=12EQ[(W−m(z))∥G−u∥2∣z]+m(z)2∥G−G0∥2⏟参考策略约束. \boxed{ \begin{aligned} L_{\mathrm{corrected}}(z) ={}& \frac12 \mathbb E_Q \left[ (W-m(z))\|G-u\|^2 \mid z \right] + \underbrace{ \anc{\frac{m(z)}2\|G-G_0\|^2} }_{\anc{\text{参考策略约束}}}. \end{aligned} }

它的梯度和曲率为

∇GLcorrected(z)=m(z)(G−G0)−Cov⁡Q(W,u∣z),∇G2Lcorrected(z)=m(z)I. \nabla_G L_{\mathrm{corrected}}(z) = \anc{m(z)(G-G_0)} - \rew{\operatorname{Cov}_Q(W,u\mid z)}, \qquad \nabla_G^2 L_{\mathrm{corrected}}(z) = m(z)I .

因为 W=eA/β>0W=e^{A/\beta}>0,所以 m(z)>0m(z)>0,问题是强凸的。紫色项在 G=G0G=G_0 处为零,策略偏离时会把它拉回来。它锚定的是 G0G_0 而不是 CFG 场 FQF_Q,因此不会把橙色项带回来。逐点最优解为

G⋆(z)=G0(z)+Cov⁡Q(W,u∣z)m(z)=G0(z)+FQ⋆(z)−FQ(z). \boxed{ G^\star(z) = G_0(z) + \rew{\frac{\operatorname{Cov}_Q(W,u\mid z)}{m(z)}} = G_0(z)+\rew{F_{Q^\star}(z)-F_Q(z)}. }

修正后的目标只把 reward 带来的流的变化施加到更新前的策略上,别的什么都不做。实践中有两个细节:G0G_0 是更新前的策略,不一定是预训练模型,并且在整个内层窗口中必须固定;系数是按状态取条件的 m(z)m(z),而不是 WW 的 batch 平均。

用带温度的后验估计 m(z)m(z)

对每个输入 cc,设 X1,…,XKX_1,\dots,X_K 是该输入下生成的 KK 个 rollout 终点。取均匀的经验先验,并利用高斯桥 xt∣X∼N((1−t)X, t2I)x_t\mid X\sim\mathcal N((1-t)X,\,t^2I),对 0<t<10<t<1 有

ρj(T)(z)=softmax⁡j(−∥xt−(1−t)Xj∥222Tt2), \rho_j^{(T)}(z) = \operatorname{softmax}_j \left( -\frac{\|x_t-(1-t)X_j\|_2^2}{2Tt^2} \right),
m^T(z)=∑j=1Kρj(T)(z) Wj. \boxed{ \widehat m_T(z) = \sum_{j=1}^{K}\rho_j^{(T)}(z)\,W_j. }

把 detach 后的 m^T(z)\widehat m_T(z) 同时用于中心化权重和约束系数。T=1T=1 时,这正是经验样本库的精确后验责任度;T>1T>1 相当于放大假设的噪声方差、平滑过于集中的后验,代价是相对总体条件均值产生偏差。实现时请使用整个 latent 的平方范数之和,并用数值稳定的 log-softmax。

baseline 不准的代价

在两处都把 mm 换成固定的估计 m^\widehat m,得到

∇GL^corrected=m(G−G0)−Cov⁡Q(W,u∣z)+(m−m^)(G0−FQ). \boxed{ \nabla_G\widehat L_{\mathrm{corrected}} = \anc{m(G-G_0)} - \rew{\operatorname{Cov}_Q(W,u\mid z)} + \fit{(m-\widehat m)(G_0-F_Q)}. }

橙色项会残留一部分,大小与 baseline 的误差成正比。正的正则项去不掉它,只有准确的条件均值可以。低噪声时,集中的后验可能正好认出了来源终点,所以温度平滑只是一种正则,并不保证估计更准。

B. 用固定参考的 STE 修正前向场

不估计标量 m(z)m(z),而是直接估计向量场 FQF_Q:在 CFG 终点上做普通的 FM,就像 GuidanceNFT 在 guided 样本上做在线 flow matching 那样 [5]:

min⁡ϕ12EQ[∥Fϕ(z)−u∥2],Fϕ(z)≈FQ(z). \min_\phi \frac12 \mathbb E_Q \left[ \|F_\phi(z)-u\|^2 \right], \qquad F_\phi(z)\approx F_Q(z).

使用同一个冻结的 G0G_0,定义 straight-through 替代量

G~θ=Gθ+sg⁡(Fϕ−G0). \boxed{ \widetilde G_\theta = G_\theta+\operatorname{sg}(F_\phi-G_0). }

它的前向值是 Gθ−G0+FϕG_\theta-G_0+F_\phi,Jacobian 则是 GθG_\theta 的。在参考场精确时,对这个替代量做普通的加权 FM,梯度为

∇Gθ12EQ[W∥G~θ−u∥2∣z]=m(z)(Gθ−G0)−Cov⁡Q(W,u∣z), \nabla_{G_\theta} \frac12 \mathbb E_Q \left[ W\|\widetilde G_\theta-u\|^2 \mid z \right] = \anc{m(z)(G_\theta-G_0)} - \rew{\operatorname{Cov}_Q(W,u\mid z)},

与上面的“中心化 + 锚定”目标完全相同:紫色约束隐含在固定参考之中。这里我们的贡献是这个等价关系;学习参考场这一修正本身来自 [5]。

如果每一步都把 stop-gradient 里的 G0G_0 换成当前的 GθG_\theta,即 G~θ=Gθ+sg⁡(FQ−Gθ)\widetilde G_\theta=G_\theta+\operatorname{sg}(F_Q-G_\theta),紫色项就消失,只剩绿色的协方差:刷新式 STE 等价于不带约束的中心化。

该选哪一种

条件 baseline 学习参考场的 STE
估计对象 m(z)=E[W∣z]m(z)=\mathbb E[W\mid z] FQ(z)=E[u∣z]F_Q(z)=\mathbb E[u\mid z]
实现 在存储的终点上做核后验 辅助的 FM 回归
额外参数 无 参考模型或 adapter
主要误差 有限样本库与温度带来的偏差 参考场的近似误差

学习参考场意味着要在策略旁边维护一个辅助模型;在万亿参数规模下,它的权重、训练和通信开销都很大,而核估计不需要额外参数。两者都仍然需要固定的 G0G_0:对固定的训练查询,缓存预测即可;对新的查询则需要额外的参考前向计算或显式近似;并且参考与学生必须使用相同的分支或 CFG 组合方式。STE 本身并不需要辅助模型,区别只在于参考场从哪里来。显式地同时学习 FQF_Q 和 FQ⋆F_{Q^\star} 是构造差分目标的第三种方式。这些输出空间里的恒等式,都不保证一个共享的网络能精确实现逐点目标。

5. LLM 中的同一幅图景

这个分解以及两种修正都可以搬到 logit 空间。在固定前缀 hh 下,设 qq 为采样器的概率,pθ=softmax⁡(ℓθ)p_\theta=\operatorname{softmax}(\ell_\theta) 为训练器的概率,eye_y 为所采 token 的 one-hot 向量,m(h)=Eq[W∣h]m(h)=\mathbb E_q[W\mid h]。logit score 为 sθ(y)=ey−pθs_\theta(y)=e_y-p_\theta,且 Eq[sθ∣h]=q−pθ\mathbb E_q[s_\theta\mid h]=q-p_\theta,因此负加权对数似然的梯度为

∇ℓθL=m(h)(pθ−q)−Cov⁡q(W,ey∣h), \boxed{ \nabla_{\ell_\theta}L = \fit{m(h)(p_\theta-q)} - \rew{\operatorname{Cov}_q(W,e_y\mid h)}, }

这正是 m(z)(G−FQ)−Cov⁡Q(W,u∣z)\fit{m(z)(G-F_Q)}-\rew{\operatorname{Cov}_Q(W,u\mid z)} 在类别分布上的孪生形式。橙色项把训练器拉向采样器的分布,与 reward 无关。

baseline 还是 score centering:殊途同归

Score centering [1] 减去 score 的条件均值:sθ−Eq[sθ∣h]=ey−qs_\theta-\mathbb E_q[s_\theta\mid h]=e_y-q。改为减去条件权重 baseline,得到相同的期望更新:

Eq[(W−m)sθ∣h]=Eq[W(sθ−Eq[sθ∣h])∣h]=Cov⁡q(W,sθ∣h). \boxed{ \mathbb E_q[(W-m)s_\theta\mid h] = \mathbb E_q \left[ W\left(s_\theta-\mathbb E_q[s_\theta\mid h]\right) \mid h \right] = \rew{\operatorname{Cov}_q(W,s_\theta\mid h)}. }

扩散的 baseline 方法用的是第一种写法;LLM 的 score centering 用的是第二种,并使用采样器的概率。在条件均值精确时它们的期望相同,但作为有限 batch 的估计量不一定相同。

logit 空间的 straight-through

logit 层面的 STE 为

ℓ~θ=ℓθ+sg⁡(log⁡q−ℓθ). \boxed{ \widetilde\ell_\theta = \ell_\theta + \operatorname{sg}(\log q-\ell_\theta). }

当 qq 处处为正时,它前向的 softmax 就是 qq,logit Jacobian 是单位矩阵,所以加权交叉熵只给出绿色项,与刷新式的扩散 STE 一样。若把修正冻结在更新前的 logits ℓ0\ell_0 上,即 ℓ~θ=ℓθ+sg⁡(log⁡q−ℓ0)\widetilde\ell_\theta=\ell_\theta+\operatorname{sg}(\log q-\ell_0),则还会保留一个回复项 m(h)(p~θ−q)\anc{m(h)(\widetilde p_\theta-q)},其中 p~θ=softmax⁡(ℓ~θ)\widetilde p_\theta=\operatorname{softmax}(\widetilde\ell_\theta),对应紫色约束。只修正所采 token 的标量对数概率,并不改变它的导数,因此是不够的。

实践上的区别是:LLM 的 score centering 可以直接读取采样器的条件 token 概率;而扩散需要对 latent 终点求条件期望,要么是标量平均权重,要么是向量均值场。核估计和辅助模型训练是对它们的两种近似。在两个领域中,中心化都只去掉了已识别出的不匹配项;一般来说,它并不能恢复训练器自身分布下精确的 on-policy 梯度。

6. CFG = 5 时的观察

我们在 guidance 尺度 5、每个输入 K=8K=8 个 rollout 的设置下,比较 NFT [6] 与修正后的目标。修正后的运行在记录范围内持续上升;NFT 先上升,随后回落了一部分涨幅。

0.4900.4950.5000.5050.5100.5150.5200.5250510152025303540训练步数RewardNFT · 第 0 步: 0.492NFT · 第 1 步: 0.4951NFT · 第 2 步: 0.4947NFT · 第 3 步: 0.4958NFT · 第 4 步: 0.4974NFT · 第 5 步: 0.4988NFT · 第 6 步: 0.5022NFT · 第 7 步: 0.502NFT · 第 8 步: 0.5055NFT · 第 9 步: 0.502NFT · 第 10 步: 0.5029NFT · 第 11 步: 0.5027NFT · 第 12 步: 0.5078NFT · 第 13 步: 0.5053NFT · 第 14 步: 0.5077NFT · 第 15 步: 0.508NFT · 第 16 步: 0.51NFT · 第 17 步: 0.5065NFT · 第 18 步: 0.511NFT · 第 19 步: 0.5108NFT · 第 20 步: 0.5084NFT · 第 21 步: 0.5045NFT · 第 22 步: 0.5093NFT · 第 23 步: 0.5045NFT · 第 24 步: 0.5032NFT · 第 25 步: 0.51NFT · 第 26 步: 0.5087NFT · 第 27 步: 0.5098NFT · 第 28 步: 0.5065NFT · 第 29 步: 0.4998NFT · 第 30 步: 0.5057NFT · 第 31 步: 0.5037NFT · 第 32 步: 0.5034NFT · 第 33 步: 0.5008NFT · 第 34 步: 0.5052NFT · 第 35 步: 0.5005NFT · 第 36 步: 0.5004NFT · 第 37 步: 0.5021NFT · 第 38 步: 0.504NFT · 第 39 步: 0.5028NFT · 第 40 步: 0.4985NFT · 第 41 步: 0.5071本文方法 · 第 0 步: 0.4965本文方法 · 第 1 步: 0.4999本文方法 · 第 2 步: 0.4959本文方法 · 第 3 步: 0.4966本文方法 · 第 4 步: 0.498本文方法 · 第 5 步: 0.497本文方法 · 第 6 步: 0.5027本文方法 · 第 7 步: 0.5022本文方法 · 第 8 步: 0.5018本文方法 · 第 9 步: 0.5039本文方法 · 第 10 步: 0.5本文方法 · 第 11 步: 0.5065本文方法 · 第 12 步: 0.5093本文方法 · 第 13 步: 0.504本文方法 · 第 14 步: 0.5072本文方法 · 第 15 步: 0.51本文方法 · 第 16 步: 0.5103本文方法 · 第 17 步: 0.5107本文方法 · 第 18 步: 0.5112本文方法 · 第 19 步: 0.5158本文方法 · 第 20 步: 0.5124本文方法 · 第 21 步: 0.5093本文方法 · 第 22 步: 0.515本文方法 · 第 23 步: 0.5103本文方法 · 第 24 步: 0.516本文方法 · 第 25 步: 0.5168本文方法 · 第 26 步: 0.5164本文方法 · 第 27 步: 0.512本文方法 · 第 28 步: 0.5199本文方法 · 第 29 步: 0.5186本文方法 · 第 30 步: 0.5122本文方法 · 第 31 步: 0.519本文方法 · 第 32 步: 0.5232本文方法NFTCFG = 5

图 1. CFG = 5、每个输入 K=8K=8 个 rollout 时 reward 随训练步数的变化。蓝色:修正后的目标;棕色:NFT [6]。数值是每种方法单次运行的近似读数,绘制到最后一个记录步(分别为 32 和 41),未做平滑或外推。鼠标悬停在点上可查看数值。

每种方法只有一次运行,所以这只是促使我们做受控消融实验的依据,并不能证明差异来自不匹配修正。去掉橙色项本身也不能保证视觉保真、防止 reward 导致的过饱和,或使 reward 单调提升。

引用

如果这篇笔记对你有帮助,欢迎引用:

@misc{yang2026tim,
  title        = {Training--Inference Mismatch in Generative {RL}},
  author       = {Yang, Zeshi and Wang, Yujie},
  year         = {2026},
  month        = oct,
  howpublished = {\url{https://zeshiyang.github.io/blog/training-inference-mismatch.html}},
  note         = {Blog post}
}

参考文献

跨领域对应关系与等价恒等式在本文中推导;扩散的学习参考场修正来自 [5]。实验与下列已发表结果无关。

  1. Marek & Ryabinin. Score Centering Stabilizes Off-policy Reinforcement Learning. 2026.
    https://arxiv.org/html/2609.20807v1#S4

  2. Ollivier, Arnold, Auger & Hansen. Information-Geometric Optimization Algorithms: A Unifying Picture via Invariance Principles. 2017.
    https://www.jmlr.org/papers/v18/14-467.html

  3. Peng, Kumar, Zhang & Levine. Advantage-Weighted Regression: Simple and Scalable Off-Policy Reinforcement Learning. 2019.
    https://arxiv.org/abs/1910.00177

  4. Lipman et al. Flow Matching for Generative Modeling. 2022.
    https://arxiv.org/abs/2210.02747

  5. Liu, Li, Qian & Cheng. GuidanceNFT: NFT-Based Reward Fine-Tuning of Guided Diffusion Models. 2026.
    https://arxiv.org/html/2610.15856v1#S3

  6. Zheng et al. DiffusionNFT: Online Diffusion Reinforcement with Forward Process. 2025.
    https://arxiv.org/abs/2509.16117