关于KL正则化策略优化

·

研究论文 · 2026/10/08

针对大语言模型智能体的异步强化学习,训练策略与采样策略不一致(陈旧检查点、推理引擎与训练器概率不同)。标准方法要么裁剪重要性比率(引入偏差),要么如GRPO对每个提示采样一组响应(长回合时成本高)。我们提出KL正则化策略优化(KLPO),将KL正则项锚定在采样器上。正则化改进步骤有闭式吉布斯解,KLPO在采样器自身轨迹上通过最小二乘拟合对数比率最优性条件,因此采样器概率以对数比率形式进入,无需重要性权重。消去回归截距后,用信号采样器均值加采样器到训练器的KL散度替代难解的对数配分函数。对于令牌级策略镜像下降目标,我们证明所得梯度可由终端回报计算,无需评论家,通过采样器中心得分或单轨迹残差,即使在随机工具输出下也成立。进一步证明KL项的独立蒙特卡洛估计保持这些梯度无偏,推导更廉价top-K和二元近似的精确KL差距,并展示SPPO、GPO、REBEL和BPO均为KLPO的特例。结果是一种无评论家更新,每个提示使用一次 rollout,既不需要学习归一化器,也不需要一组响应。

该工作为异步LLM强化学习中的策略不一致问题提供了无需重要性权重和评论家的统一框架,理论严谨且实用,能显著降低长回合训练成本,并统一了多种现有方法。

Asynchronous reinforcement learning (RL) for large language model (LLM) agents trains one policy on trajectories generated by another: rollouts come from stale checkpoints, and the inference engine's probabilities differ from the trainer's even at identical parameters. Standard remedies either clip importance ratios, which biases the update, or, as in GRPO, sample a group of responses per prompt, which is costly when episodes are long. We propose KL-Regularized Policy Optimization (KLPO), a framework that anchors the KL regularizer at the sampler. The regularized improvement step then has a closed-form Gibbs solution, and KLPO fits its log-ratio optimality condition by least squares on the sampler's own trajectories, so the sampler probability enters through a log-ratio and no importance weights are needed. Profiling out the regression intercept replaces the intractable log-partition function with the signal's sampler mean plus a sampler-to-trainer KL divergence. For token-level policy mirror descent targets, we show that the resulting gradient can be computed from terminal returns without a critic, via sampler-centered scores or a single trajectory residual, even under stochastic tool outputs. We further prove that independent Monte Carlo estimates of the KL term keep these gradients unbiased, derive the exact KL gap of cheaper top-K and binary approximations, and show that SPPO, GPO, REBEL, and BPO arise as special cases of KLPO. The result is a critic-free update that uses one rollout per prompt and requires neither a learned normalizer nor a group of responses.

阅读原文

参与讨论