arxiv.org·2026/10/21
编码智能体训练通常固定harness、只更新策略;HarnessAdapt-RL在RL中同时训练二者:冻结教师为缺陷修复生成任务特定的机制级技能(不提供具体代码),另一教师针对跨任务交互问题提出工具与钩子变更,仅当通过率或可训练率至少一项提升且不降低另一项才保留,策略再用GRPO在新轨迹上学习并引导后续演化。基于9B模型训练后,作者报告在SWE-bench Verified/Multilingual/Pro上pass@1较GRPO高9.8、12.6、6.4个百分点,并高于OpenHands-GRPO。消融显示机制级技能移除后仍最优,随策略再演化优于冻结早期版本或训练前搜索,移除工具/钩子最多使pass@1下降7.7个百分点。因此部署需保留策略与工具/钩子;局限包括仅覆盖SWE-bench式修复、单一9B基座、每配置训练一次、接受规则未做显著性检验。
为什么重要 给训练 agent 的团队一个可复用的联合优化机制:不止更新权重,还要同时演化部署所需的工具与 hooks,并区分训练期技能与部署期组件适合 做 coding/agent RL 训练、harness 工具链设计、训练数据闭环的工程师
训练编码智能体通常会更新策略,同时保持 harness 固定。在训练期间,轨迹暴露出有缺陷的修复策略和交互问题,这些问题因任务而异,并随着策略学习而变化。我们提出 HarnessAdapt-RL,它在强化学习期间训练策略并调整其 harness。对于有缺陷的修复策略,一个冻结的教师模型生成任务特定的机制级技能。
对于在任务中反复出现的交互问题,一个单独的教师模型演化工具和钩子,仅当每个变更能提高观察到的通过率或观察到的可训练率且不降低其中任何一项时才保留该变更。策略使用调整后的 harness 进行训练,其新轨迹进一步指导适配。
使用 9B 基础模型,HarnessAdapt-RL 在 SWE-bench Verified、Multilingual 和 Pro 上将 pass@1 相对于 GRPO 提高了 9.8、12.6 和 6.4 个百分点,并优于使用人工设计的 OpenHands harness 的 GRPO。在评估时移除机制级技能后,其带来的收益仍然持续存在。
随着策略变化重新演化工具和钩子优于冻结早期版本。相比之下,在部署时移除它们会损失最多 7.7 个百分点。因此,训练产生了一个模型-harness 对:训练后的策略以及演化出的工具和钩子,其中技能在部署时被移除。
Training coding agents typically updates the policy while keeping the harness fixed.
During training, trajectories reveal flawed repair strategies and interaction problems that vary across tasks and change as the policy learns.
We introduce HarnessAdapt-RL, which trains the policy and adapts its harness during reinforcement learning.
For flawed repair strategies, a frozen teacher generates task-specific mechanism-level skills.
For interaction problems recurring across tasks, a separate teacher model evolves tools and hooks, keeping each change only if it improves the observed pass rate or the observed trainable rate without lowering either.
The policy trains with the adapted harness, and its new trajectories guide further adaptation.
With a 9B base model, HarnessAdapt-RL improves pass@1 over GRPO by 9.8, 12.6, and 6.4 percentage points on SWE-bench Verified, Multilingual, and Pro, and outperforms GRPO with the human-designed OpenHands harness.
Gains from mechanism-level skills persist after their removal at evaluation. Re-evolving tools and hooks as the policy changes outperforms freezing early versions.
Removing them at deployment, in contrast, costs up to 7.7 percentage points.
Training therefore produces a model-harness pair: the trained policy and the evolved tools and hooks, with skills removed at deployment.
首轮提案
pass/trainable
自动测试
pass/trainable
被拒提案
pass/trainable
注释 · 格式为 术语解释提交补丁通过任务测试的比例,衡量任务成败 / 术语解释采样 rollout 中可用于 GRPO 策略更新的比例,避免全成功/全失败组无梯度信号 相对变化;被拒提案因可训练率下降而未采用出自 §4.4, Fig 3
EVIDENCE / METHODS
表格
HarnessAdapt-RL 平均 44.9%,GRPO 平均 35.3%,三基准全部更高
| 配置 | SWE-Verified | SWE-Multilingual | SWE-Pro | Avg |
|---|---|---|---|---|
| Base model | 42.2 | 19.3 | 31.8 | 31.1 |
| GRPO | 47.8 | 24.7 | 33.3 | 35.3 |
| OpenHands-GRPO | 51.4 | 33.3 | 32.3 | 39.0 |
| Skill-Mechanism | 52.2 | 28.0 | 34.6 | 38.3 |
| HarnessAdapt-RL | 57.6 | 37.3 | 39.7 | 44.9 |
注释 · 单位为 pass@1(%),Avg 是三基准均值;所有配置评估时均移除技能出自 Table 1
原版排版与图表 · 手机无法内嵌时可在浏览器打开。PDF 插件内选文不能传给网页助手。