Stabilizing Long-term Multi-turn Reinforcement Learning with Gated Rewards

📄 arXiv: 2508.10548v1 📥 PDF

作者: Zetian Sun, Dongfang Li, Zhuoen Chen, Yuhuai Qin, Baotian Hu

分类: cs.LG, cs.AI, cs.CL

发布日期: 2025-08-14


💡 一句话要点

提出Gated Reward Accumulation以解决长时程强化学习中的奖励稀疏问题

🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture)

关键词: 强化学习 奖励塑造 软件工程 多轮交互 策略优化 Gated Reward Accumulation 长时程学习

📋 核心要点

  1. 现有的奖励塑造方法在长时程强化学习中面临奖励稀疏性的问题,导致策略优化困难。
  2. 本文提出了一种新的Gated Reward Accumulation方法,通过设定阈值来控制即时奖励的累积,从而提高学习的稳定性。
  3. 实验结果显示,G-RA在多个基准测试中显著提高了完成率和修改率,表明其有效性和实用性。

📝 摘要(中文)

在长时程强化学习任务中,奖励稀疏性仍然是一个重大挑战。现有的基于结果的奖励塑造方法难以定义有意义的即时奖励,且可能引入偏差或需要明确的任务分解。验证基础的奖励塑造使用逐步评估者,但即时奖励与长期目标之间的不一致可能导致奖励黑客行为和次优策略。本文在软件工程任务的背景下提出了一种统一的SWE导向强化学习框架,支持多轮交互、基于Docker的执行和可定制的奖励函数。我们还提出了Gated Reward Accumulation(G-RA),该方法仅在高层(长期)奖励达到预定义阈值时累积即时奖励,从而确保稳定的强化学习优化。实验结果表明,G-RA显著提高了完成率和修改率,同时避免了由于奖励不一致导致的策略退化。

🔬 方法详解

问题定义:本文旨在解决长时程强化学习中的奖励稀疏性问题。现有方法在定义即时奖励时容易引入偏差,且可能导致策略优化不稳定。

核心思路:我们提出的Gated Reward Accumulation方法通过设定高层奖励的阈值来控制即时奖励的累积,确保只有在达到特定条件时才进行奖励积累,从而避免奖励不一致带来的问题。

技术框架:整体架构包括SWE导向强化学习框架,支持多轮交互和Docker执行。主要模块包括环境交互、奖励计算和策略优化。

关键创新:G-RA是本研究的核心创新点,通过引入阈值机制,确保即时奖励与长期目标的一致性,显著提高了学习的稳定性和效率。

关键设计:在设计中,我们设置了高层奖励的阈值,并采用了适应性调整的策略优化算法,以确保在不同任务中均能有效应用。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,G-RA方法在SWE-bench Verified和kBench上完成率从47.6%提升至93.8%,修改率从19.6%提升至23.8%。这些结果显示了G-RA在提高任务完成率和优化策略方面的显著效果,避免了奖励不一致导致的策略退化。

🎯 应用场景

该研究的潜在应用领域包括软件工程中的自动化测试、代码生成和智能调试等任务。通过提高长时程强化学习的稳定性和效率,G-RA方法可以为软件开发过程中的智能决策提供支持,进而提升开发效率和软件质量。

📄 摘要(原文)

Reward sparsity in long-horizon reinforcement learning (RL) tasks remains a significant challenge, while existing outcome-based reward shaping struggles to define meaningful immediate rewards without introducing bias or requiring explicit task decomposition. Alternatively, verification-based reward shaping uses stepwise critics, but misalignment between immediate rewards and long-term objectives can lead to reward hacking and suboptimal policies. In this work, we address this problem in the context of software engineering (SWE) tasks, where multi-turn reasoning and rule-based verification are critical. We introduce the SWE-oriented RL Framework, a unified system supporting multi-turn interaction, docker-based execution, and customizable reward functions. Additionally, we propose Gated Reward Accumulation (G-RA), a novel method that accumulates immediate rewards only when high-level (long-term) rewards meet a predefined threshold, ensuring stable RL optimization. Experiments on SWE-bench Verified and kBench demonstrate that G-RA leads to an increase in completion rates (47.6\% \rightarrow 93.8\% and 22.0\% \rightarrow 86.0\%) and modification rates (19.6\% \rightarrow 23.8\% and 12.0\% \rightarrow 42.0\%), while avoiding policy degradation caused by reward misalignment. Our findings highlight the importance of balanced reward accumulation in long-horizon RL and provide a practical solution.