训练整个智能体,而不仅是模型

·

研究论文 · 2026/10/22

训练编码智能体通常只更新策略而保持执行框架固定。训练过程中,轨迹会揭示有缺陷的修复策略和交互问题,这些问题因任务而异并随策略学习而变化。我们提出HarnessAdapt-RL,在强化学习过程中同时训练策略并自适应调整其执行框架。针对有缺陷的修复策略,一个冻结的教师模型生成任务特定的机制级技能。针对跨任务反复出现的交互问题,另一个教师模型演化工具和钩子,仅当每次更改能提高观察到的通过率或可训练率且不降低任一指标时才保留。策略在自适应后的框架下训练,其新轨迹指导进一步的自适应。在9B基础模型上,HarnessAdapt-RL在SWE-bench Verified、Multilingual和Pro上分别比GRPO的pass@1提高了9.8、12.6和6.4个百分点,并优于使用人工设计的OpenHands框架的GRPO。机制级技能带来的增益在评估时移除后仍持续。随着策略变化重新演化工具和钩子优于冻结早期版本。相反,在部署时移除它们会损失高达7.7个百分点。因此,训练产生了一个模型-框架对:训练后的策略和演化的工具与钩子,部署时移除技能。

该研究提出了一种在强化学习过程中同时优化策略和执行框架的新方法,显著提升了编码智能体在多个基准上的性能,并揭示了训练产生的模型-框架对中技能与工具的不同部署策略,对智能体训练有重要启示。

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.

阅读原文

参与讨论