Rethinking Importance Sampling in LLM Policy Optimization: A Cumulative Token Perspective
作者: Yuheng Zhang, Chenlu Ye, Shuowei Jin, Changlong Yu, Wei Xiong, Saurabh Sahu, Nan Jiang
分类: cs.LG, cs.AI
发布日期: 2026-05-08
🔗 代码/项目: GITHUB
💡 一句话要点
提出累积令牌策略优化(CTPO),通过累积重要性采样比解决LLM强化学习中的偏差-方差困境。
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture)
关键词: 大语言模型 强化学习 策略优化 重要性采样 数学推理 策略梯度 后训练
📋 核心要点
- 现有方法在令牌级IS比率(引入偏差)与全序列IS比率(高方差)之间难以平衡,导致策略梯度估计不稳定。
- 提出累积令牌IS比率,通过位置t之前的乘积提供无偏的前缀修正,并结合位置自适应裁剪机制实现更一致的正则化。
- 在工具集成推理任务中,CTPO在多个模型规模下均超越了GRPO和GSPO,展现出更优的数学推理性能。
📝 摘要(中文)
强化学习(包括可验证奖励的RLVR)已成为大语言模型(LLM)后训练的关键技术。其核心在于离线策略梯度估计中重要性采样(IS)比率的设计。现有方法面临偏差-方差困境:PPO和GRPO采用的令牌级IS比率忽略了前缀状态分布的不匹配,引入了偏差;全序列比率虽能提供精确的轨迹级修正,但因令牌比率的乘法累积导致方差过高;GSPO虽通过长度归一化提升了数值稳定性,却牺牲了精确性。本文提出“累积令牌IS比率”(即位置t之前的令牌比率乘积),证明其在令牌级策略梯度公式下能提供无偏的前缀修正,且方差严格低于全序列比率。基于此,我们提出CTPO算法,结合位置自适应裁剪机制,根据累积对数比率的平方根增长特性缩放裁剪边界,在数学推理任务中显著优于GRPO和GSPO基线。
🔬 方法详解
问题定义:论文旨在解决LLM在离线策略优化(如PPO/GRPO)中,由于重要性采样比率设计不当导致的梯度估计偏差与方差失衡问题。现有方法要么因忽略前缀状态分布而产生偏差,要么因长序列乘积导致方差爆炸。
核心思路:引入“累积令牌IS比率”,即在位置t处使用从起始到当前位置的累积乘积。该方法在理论上证明了其能提供无偏的前缀修正,同时通过数学性质限制了方差的增长,从而在偏差与方差之间找到了最优平衡点。
技术框架:CTPO算法在标准的策略梯度框架下运行,主要包含累积比率计算模块和位置自适应裁剪模块。在训练过程中,模型根据当前策略与参考策略的概率比值,动态计算累积乘积,并将其应用于目标函数中。
关键创新:最重要的创新在于将IS比率从单一令牌或全序列扩展为“累积令牌”形式。这一设计不仅在数学上保证了无偏性,还通过累积效应有效抑制了方差,是解决长序列强化学习不稳定的理论突破。
关键设计:引入位置自适应裁剪(Position-adaptive Clipping),利用累积对数比率随时间步t呈$\sqrt{t}$增长的特性,动态调整对数空间的裁剪边界,确保在不同生成长度下都能保持一致的正则化强度,防止梯度更新过大或过小。
🖼️ 关键图片
📊 实验亮点
CTPO在多个具有挑战性的数学推理基准测试中进行了验证。实验结果显示,无论是在小规模还是大规模模型上,CTPO均显著优于强基线算法GRPO和GSPO。其核心优势在于通过更精确的梯度估计,实现了更稳定的训练过程,并在最终推理准确率上取得了最优的平均性能表现。
🎯 应用场景
该研究主要应用于大语言模型的后训练阶段,特别是在需要复杂推理、数学解题及工具调用的场景中。通过提升强化学习的训练稳定性,CTPO能够帮助模型更高效地学习长链条推理逻辑,对提升模型在科学计算、代码生成及复杂任务规划领域的表现具有重要价值。
📄 摘要(原文)
Reinforcement learning, including reinforcement learning with verifiable rewards (RLVR), has emerged as a powerful approach for LLM post-training. Central to these approaches is the design of the importance sampling (IS) ratio used in off-policy policy-gradient estimation. Existing methods face a fundamental bias-variance dilemma: token-level IS ratios, as adopted by PPO (Schulman et al., 2017) and GRPO (Shao et al., 2024), introduce bias by ignoring prefix state distribution mismatch; full sequence ratios provide exact trajectory-level correction but suffer from high variance due to the multiplicative accumulation of per-token ratios, while GSPO (Zheng et al., 2025) improves numerical stability via length normalization at the cost of deviating from the exact full-sequence IS correction. In this work, we identify the cumulative token IS ratio, the product of per-token ratios up to position $t$, as a theoretically principled solution to this dilemma. We prove that, under the token-level policy-gradient formulation, this ratio provides an unbiased prefix correction for each token-level gradient term and has strictly lower variance than the full sequence ratio. Building on this insight, we propose CTPO (Cumulative Token Policy Optimization), which combines the cumulative token IS ratio with position-adaptive clipping that scales log-space clip bounds according to the natural $\sqrt{t}$ growth of the cumulative log-ratio. This yields more consistent regularization across token positions. We implement and evaluate CTPO in the tool-integrated reasoning setting on several challenging mathematical reasoning benchmarks, achieving the best average performance across both model scales compared with strong GRPO and GSPO baselines. Code will be available at https://github.com/horizon-llm/CTPO.