Self-Evolving Coding Agents via Harness-Policy Optimization
AuthorsZhepei Wei, Wenlin Yao, Baolin Peng, Danqing Wang, Qianhui Wu, Hao Cheng, Yu Meng, Jianfeng Gao
AffiliationsMicrosoft Research · University of Virginia · Carnegie Mellon University https://github.com/MSR-Orchard/Self-HPOhttps://huggingface.co/self-hpo
Self-HPO helps coding agents improve both their problem-solving policy and the tools and workflows that guide it.
Key results
Self-HPO improves from the base agent’s 57.8% across the three coding benchmarks.
Self-HPO result with Qwen3.5-35B-A3B and its self-proposed harness.
HPO result using Opus 4.8 as the harness proposer.
Self-HPO result, up from 80.0% for the base agent.
What the paper found
Self-HPO makes a coding agent improve both its model and the software harness that controls its tools, feedback, and submissions. Using Qwen3.5-35B-A3B with mini-SWE-agent, it alternates harness-search steps, where the current policy studies failed attempts and proposes targeted changes, with reinforcement-learning steps using GRPO and Balanced Adaptive Rollout. Tasks that remain unsolved during training guide the next harness search, so the system adapts as the policy’s weaknesses shift. Across SWE-Bench Verified, SWE-Bench Multilingual, and SWE-Bench Pro, the average resolve rate rises from 57.8% for the base agent to 64.8% with Self-HPO; on SWE-Bench Verified, it reaches 69.5%, compared with 61.0% for the base. Using Anthropic’s Opus 4.8 as an external harness proposer pushes the Verified score to 71.6%. The gains also extend beyond single-attempt reliability: on SWE-Bench Verified, pass@8 increases from 80.0% to 84.8%. The central finding is that harness and policy improvements reinforce one another: each helps on its own, but their combination performs better than the sum of their separate gains.
Original abstract
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.
Read the original paperMore in Code Generation
Browse all 46 papers →Training the Whole Agent, Not Just the Model
Lingxiao Tang, Wei Tao, Yiwen Guo, Lingfeng Bao
HarnessAdapt-RL improves coding agents by evolving their tools and interaction setup alongside the model during training.
WebCoder: Scaling General Frontend Development with Artifact-Grounded Agentic Reinforcement Learning
Zijun Dou, Zhen Yang, Xijun Liu, Dongzhuoran Zhou, Aohan Zeng, Jie Tang
WebCoder trains an AI agent to build and improve full frontend projects by learning from how its code changes perform in a live application.
Compact Documentation for Coding Agents: A Benchmark, an Optimizer, and Why It Does Not Transfer
Md Shohel Arman, Igor Molybog
Better code documentation can faithfully reconstruct software, but surprisingly does not necessarily help AI coding agents fix real issues when the source code is already available.