做LLM强化学习训练的团队终于有了一个能省算力又提效果的方法——ESPO在数学推理任务上不仅性能更好,还省了20%的token,训练成本敏感的团队值得一试。
ESPO(Early-Stopping Proximal Policy Optimization)是一种针对大语言模型强化学习训练的新方法,能在推理轨迹中早期检测到错误步骤并提前终止生成。传统PPO算法在模型犯错后仍会强制生成直到最大步长,浪费计算资源并污染优势估计。ESPO通过实时计算基于logits的代理遗憾值,在累积遗憾显著超过估计值时终止轨迹,并将截断轨迹视为吸收失败状态,无需额外奖励模型或人工标注。在DeepSeek-R1-Distill-Qwen-7B的数学推理训练中,ESPO在AIME 2024、AMC 2023和MATH-500上均超越PPO,同时累计节省超过20%的生成token。
ESPO: Early-Stopping Proximal Policy Optimization
When a large language model under reinforcement learning commits a wrong reasoning step early in a trajectory, standard algorithms force it to keep generating until the maximum horizon, spending compute on tokens that never receive positive reward and polluting advantage estimates with post-failure noise. We propose ESPO (Early-Stopping Proximal Policy Optimization), which detects trajectory failure on-the-fly and terminates rollouts early. At each generation step, ESPO computes a surrogate regret using only the logits already computed during sampling, and terminates when the smoothed cumulative regret significantly exceeds its estimated values. Truncated trajectories are treated as absorbing failure states with a terminal reward, concentrating negative temporal-difference (TD) errors near the detected failure step without any additional reward model or human annotation. On DeepSeek-R1-Distill-Qwen-7B trained for mathematical reasoning, ESPO surpasses PPO on AIME~2024 (46.28% vs. 45.25%), AMC~2023 (85.83% vs. 82.94%), and MATH-500 (87.42% vs. 85.43%), while saving more than 20% rollout tokens cumulatively.