通过信号重构提升弱反馈下代码修复代理的强化学习效果
Signal Reshaping for GRPO in Weak-Feedback Agentic Code Repair
- 重构结果奖励、过程信号和回溯样本可比性,增强梯度更新精度
- 在编译与语义双重验证下准确率从0.385提升至0.535
- 适合研究代码生成、强化学习反馈设计的学者参考
代码代理强化学习常面临弱反馈问题:执行时的信号虽可靠且可运行,但仅反映任务成功的必要或表层条件,而非目标语义谓词。以代理式编译修复为场景,本文研究标准GRPO在弱反馈下的信号重构。核心观点是,只有在三种信号重构后,组内比较才有意义:结果奖励恢复语义排序,过程信号定位轨迹内信用分配,同一提示下的回溯样本保持执行可比性。我们提出一种最小化重构方案,不改变GRPO的组归一化优势结构:编译-语义分层奖励重构轨迹排序,步骤级过程评分脱离组奖励归一化以重塑组内更新强度,故障原因感知的回溯治理重构组内可比性。实验显示显著端到端提升:完整信号重构的GRPO将严格编译-语义准确率从基线模型的零样本0.385提升至0.535。受控对比进一步揭示增益来源:二值奖励去除仅编译通过的中间层级,削弱轨迹控制;在分层奖励基础上加入过程评分加权,准确率从0.48提升至0.53,平均评估步数从23.50降至17.02。作为边界对比,特权提示的词级蒸馏主要优化局部分布对齐;在长工具使用轨迹中,该信号被非关键词稀释,无法替代语义、过程信用或组内可比性。
原文摘要 · Abstract (English)
Code-agent RL often receives weak feedback: rollout-time signals are reliable and executable, but capture only necessary or surface conditions for task success rather than the target semantic predicate. Using agentic compile-fix as the setting, we study signal reshaping for standard GRPO under such feedback. Our central claim is that GRPO's within-group comparison is meaningful only after three kinds of signals are reshaped: outcome rewards recover semantic ranking, process signals localize intra-trajectory credit, and rollouts from the same prompt remain execution-comparable. We operationalize these conditions with a minimal signal-reshaping construction that leaves GRPO's group-normalized advantage construction unchanged: compile-and-semantic layered rewards reshape trajectory ranking, step-level process scores outside group reward normalization reshape within-trajectory update strength, and failure-cause-aware rollout governance reshapes within-group comparability. Experiments show a clear end-to-end gain: full signal-reshaped GRPO improves strict compile-and-semantic accuracy from the base model's zero-shot $0.385$ to $0.535$. Controlled comparisons further explain the source of this gain: binary rewards remove the compile-only middle tier and degrade trajectory control; on top of layered rewards, process-score weighting further improves accuracy from $0.48$ to $0.53$ and reduces average evaluation steps from $23.50$ to $17.02$. As a boundary comparison, privileged-prompt token-level distillation mainly optimizes local distributional alignment; in long tool-use trajectories, this signal is diluted by non-critical tokens and cannot replace outcome semantics, process credit, or within-group comparability.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。