重新思考LLM强化学习中的训练-推理不匹配:它从何而来以及如何纠正
研究论文 · 2026/09/29
本文研究大语言模型可验证奖励强化学习(RLVR)中的训练-推理不匹配问题,即推理引擎采样轨迹而训练引擎计算梯度时,两者对相同token赋予不同概率。为在策略更新中校正这一差异,作者提出校准重要性采样(CIS)。CIS基于一个经验支持的对数几率位移刻画,将不匹配表示为对数几率中的加性位移ε_t,由softmax前的逐logit扰动决定,其分布近似不依赖于token置信度。该刻画引出一种置信度感知截断:大的正位移在单一常数阈值处截断,映射回一个随token置信度增加而收紧的重要性比率上限。理论上,作者证明CIS将精确重要性采样误差中无界的二阶矩替换为常数有界项,代价是受截断超额控制的偏差。在三个混合专家模型和五个数学推理基准上的评估中,CIS在所有三个模型上均取得最高的五基准平均分。诊断分析表明,与截断重要性采样相比,CIS对低置信度token施加更少的截断偏差,而对小重要性权重的向上截断会降低留出准确率。
该研究针对RLVR中训练与推理引擎概率不一致的关键问题,提出了有理论保证且实验有效的校正方法,对提升大语言模型强化学习的稳定性和性能具有重要价值。
We study training-inference mismatch in reinforcement learning with verifiable rewards (RLVR) for large language models, where rollouts are sampled by an inference engine while gradients are computed by a training engine, and the two engines assign different probabilities to the same tokens. To account for this discrepancy in policy updates, we introduce calibrated importance sampling (CIS). CIS is motivated by an empirically supported logit-displacement characterization that expresses the mismatch as an additive displacement varepsilon_t in log-odds, determined by the per-logit perturbation before the softmax, whose distribution is approximately invariant to token confidence. This characterization motivates a confidence-aware truncation: large positive displacements are truncated at a single constant threshold, which maps back to an importance-ratio cap that tightens as token confidence increases. Theoretically, we show that CIS replaces the unbounded second moment that governs the error of exact importance sampling with a term bounded by a constant, at the cost of a bias controlled by the truncated excess. In evaluation across three mixture-of-experts models and five mathematical reasoning benchmarks, CIS achieves the highest five-benchmark average on all three models among the evaluated baselines. Diagnostic analyses show that CIS places less truncation bias on low-confidence tokens than truncated importance sampling, while upward clipping of small importance weights reduces held-out accuracy.