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

📄 arXiv: 2610.40945v1 📥 PDF

作者: Yu Li, Yufa Zhou, Tian Lan

分类: cs.LG, cs.AI

发布日期: 2026-10-29


💡 一句话要点

提出差异-滞后校正方法以解决LLM强化学习中的训练推理不匹配问题

🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture) 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 强化学习 大型语言模型 训练推理不匹配 数值差异 策略滞后 校正方法 KL散度 异步采样

📋 核心要点

  1. 现有的基于策略的强化学习方法假设训练响应来自当前策略,但实际中存在训练-推理不匹配问题,导致训练数据变为离策略数据。
  2. 本文提出的差异-滞后校正(DLC)方法通过中心化数值差异、剪裁滞后比率并在有效样本量低于一半时重新同步采样器来解决这一问题。
  3. 实验表明,DLC能够有效控制KL散度,保持在两次独立的基于策略训练之间的两倍以内,显著提高了训练的稳定性。

📝 摘要(中文)

在大型语言模型的强化学习中,基于策略的训练假设训练响应来自当前策略。然而,推理引擎和训练器之间的训练-推理不匹配使得训练数据变为离策略数据。该不匹配源于引擎的数值误差和异步采样的滞后权重。本文探讨了不匹配源的特性如何决定所需的校正方法,并提出了差异-滞后校正(DLC)方法,能够有效地中心化数值差异,剪裁滞后比率,并在有效样本量低于一半时重新同步采样器。实验结果表明,DLC在滞后采样器下能够保持KL散度在两次独立的基于策略训练之间的两倍以内,防止了传统逐token校正未能检测到的崩溃现象。

🔬 方法详解

问题定义:本文旨在解决大型语言模型强化学习中的训练-推理不匹配问题,现有方法在处理异步采样和数值误差时存在不足,导致训练数据偏离真实策略。

核心思路:提出差异-滞后校正(DLC)方法,通过分析数值差异和策略滞后,设计出一种能够动态调整的校正机制,以提高训练的稳定性和有效性。

技术框架:DLC方法包括三个主要模块:首先,评估训练器在采样器权重下的表现;其次,中心化数值差异并剪裁滞后比率;最后,在有效样本量低于一半时重新同步采样器。

关键创新:DLC的核心创新在于能够同时处理数值差异和策略滞后,通过动态调整校正策略,避免了传统方法在不同不匹配源下的失效。

关键设计:DLC方法中,重要性加权用于切断反馈循环,参数设置上关注滞后比率的集中度,并通过KL散度的控制来评估训练效果。具体的损失函数和网络结构设计尚未详细说明,需进一步研究。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,DLC方法在Qwen3-1.7B模型上有效地将KL散度控制在两次独立的基于策略训练之间的两倍以内,显著提高了训练的稳定性,尤其是在面对滞后采样器时,避免了传统方法未能检测到的崩溃现象。

🎯 应用场景

该研究的潜在应用场景包括大型语言模型的训练优化,尤其是在需要高效且稳定的强化学习策略的自然语言处理任务中。DLC方法的提出为解决训练-推理不匹配问题提供了新的思路,未来可能在多种AI应用中发挥重要作用。

📄 摘要(原文)

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.