通过Harness-Policy优化实现自我进化的编码智能体
研究论文 · 2026/10/20
大型语言模型(LLM)智能体在编码任务中展现出潜力,其性能由策略模型和协调与环境交互的harness共同决定。harness与策略相互增强,仅优化其一并非最优——针对某一检查点调优的harness可能无法针对更新后策略的失败模式,而策略学习仍受限于固定harness产生的轨迹。为此,我们提出Self-HPO,一种递归自我改进框架,交替优化harness和策略,并利用演进中的策略作为自身的harness提议者。具体而言,每轮中当前策略首先分析自身失败并提出新的harness候选(H步),然后在选定harness下通过强化学习(RL)更新策略(P步),训练中识别的困难任务构成下一轮harness搜索集,使harness优化始终针对策略演进的失败模式。在三个编码基准上,Self-HPO持续优于仅harness和仅策略的基线,将Qwen3.5-35B-A3B的平均解决率从57.8%提升至64.8%,且增益可泛化至分布外设置。进一步分析表明,两个优化组件即使与各自基础版本配对仍保持增益,且联合增益超过各自增益之和。Self-HPO还提升了可靠性(Pass@1)并扩展了能力前沿(Pass@k)。此外,使用更强外部模型(如Opus 4.8)作为harness提议者,同一框架可带来进一步性能提升。
该工作指出harness与策略需协同进化,提出递归自我改进框架,实验证明联合优化能超线性提升编码智能体性能,并展示用更强模型提议harness的扩展性,对智能体自我改进研究有参考价值。
Large language model (LLM) agents have shown promising potential in coding tasks, and their performance is jointly determined by the policy model and the harness that mediates their interaction with the environment. Indeed, harness and policy are mutually reinforcing and evolving only one component is suboptimal---a harness tuned for one checkpoint may not target the failure modes of an updated policy, while policy learning remains limited to the trajectories elicited by a fixed harness. In light of this, we propose Self-HPO, a recursive self-improving framework for coding agents that alternates harness and policy optimization, using the evolving policy as its own harness proposer. Specifically, in each round, the current policy first analyzes its own failures and proposes new harness candidates (H-step). The policy is then updated through reinforcement learning (RL) under the selected harness (P-step), and hard tasks identified during training form the next harness search set, keeping harness optimization targeted to the policy's evolving failure modes. Across three coding benchmarks, Self-HPO consistently outperforms harness-only and policy-only baselines, improving Qwen3.5-35B-A3B's average resolve rate from 57.8% to 64.8%, with gains generalizing to out-of-distribution settings. Further analysis shows that both optimized components retain gains even when paired with their base counterparts, while their joint gain exceeds the sum of their individual gains. Self-HPO also improves reliability (Pass@1) and expands the capability frontier (Pass@k) over the base agent. Additionally, we show that with a stronger external model (e.g., Opus 4.8) as the harness proposer, the same framework yields a further performance boost.