arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.40945cs.LGcs.AI
收藏

大语言模型强化学习中训练-推理不匹配的起源与演化

On the Origin and Evolution of Training-Inference Mismatch in LLM Reinforcement Learning

Yu Li, Yufa Zhou, Tian Lan

AI总结:

该研究探究大语言模型强化学习中训练-推理不匹配的来源特性,提出偏差-滞后修正(DLC)方法,可控制KL散度并防止训练崩溃。

摘要:

大语言模型的同策略强化学习假设训练响应是从当前策略中采样得到的。在实际应用中,推理引擎采样响应,而独立的训练器计算梯度,两者之间的训练-推理不匹配使得训练数据变为异策略。这种不匹配有两个来源:引擎的数值特性和异步采样的陈旧权重,且针对其中一个来源的稳定训练的修正方法可能在另一个来源下失效。我们探究不匹配来源的何种特性决定了所需的修正方法。在采样器的权重下评估训练器,可将每个采样 token 的误差精确拆分为引擎的数值偏差和训练器的策略滞后,并在训练过程中追踪这两者。数值偏差近似保持恒定,因此会以几乎固定的量对更新产生偏差,而在每个前缀处将得分居中可消除其主导偏差。策略滞后由训练器自身的更新产生:其留下的偏差会进入下一次更新,从而增大下一次滞后并形成反馈循环。重要性权重仅在滞后比率保持集中时能切断该循环,在 Qwen3-1.7B 上,当该比率的有效样本量降至二分之一以下时,重要性权重失效。基于此分析,我们提出了偏差-滞后修正(DLC)方法,该方法可对数值偏差进行居中处理,针对采样器的权重裁剪滞后比率,并在有效样本量降至二分之一以下时重新同步采样器。在采样器陈旧的情况下,DLC 可将与同策略训练的 KL 散度控制在 Qwen3-0.6B 和 Qwen3-1.7B 两次独立同策略训练之间 KL 散度的两倍以内,且其重新同步操作可防止逐 token 修正会留下的崩溃,而这种崩溃无法通过在采样器前缀上测量的 KL 散度检测到。

英文摘要:

On-policy reinforcement learning for large language models assumes that training responses are sampled from the current policy. In practice, an inference engine samples the responses and a separate trainer computes the gradients, and the \textbf{training-inference mismatch} between the two makes the training data off-policy. The mismatch has two sources, the numerics of the engine and the stale weights of asynchronous sampling, and a correction that stabilizes training under one source can fail under the other. \textit{We ask which property of a mismatch source decides the correction it needs.} Evaluating the trainer at the sampler's weights splits each sampled-token error exactly into a \textit{numerical discrepancy} of the engine and a \textit{policy lag} of the trainer, and we follow both through training. The numerical discrepancy stays approximately constant, so it biases the updates by a nearly fixed amount, and centering the score at each prefix removes its leading bias. The policy lag is produced by the trainer's own updates: the bias it leaves enters the next update, which enlarges the next lag and closes a feedback loop. Importance weighting cuts this loop only while the lag ratio stays concentrated, and on Qwen3-1.7B it fails at the step where the effective sample size of the ratio falls below one half. From this account we derive the \textbf{discrepancy-lag correction} (DLC), which centers the numerical discrepancy, clips the lag ratio against the sampler's weights and resynchronizes the sampler when this effective sample size falls below one half. Under a stale sampler, DLC keeps the KL divergence from on-policy training within twice the KL between two independent on-policy trainings on Qwen3-0.6B and Qwen3-1.7B, and its resynchronization prevents collapses that the per-token corrections leave and that a KL measured on the sampler's prefixes does not detect.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑