研究发现编程智能体的多余编辑其实大多是补测试和文档
How Much Do Coding Agents Over-Edit, and Why? An Empirical Study of Unneeded Edits in Repository-Level Agent Patches
想知道 Copilot 这类编程智能体是不是真的手太闲?这篇用 DRA 方法拆了 7,660 条轨迹,发现多余的编辑大半是在帮你补测试和文档,代码本身比人写得还克制。做编程智能体评测或 harness 的人应该看看剪枝那部分数据。
arXiv 论文提出 Delta Residue Attribution(DRA)方法,对 SWE-bench Verified 上 6,728 条和 DeepSWE 上 932 条 GitHub Copilot CLI 轨迹(共 7,660 条、覆盖 18 个前沿模型)逐单元回放并重跑测试,判定每个补丁单元是否必要。
结果显示,智能体补丁确实改动更多行,但在 SWE-bench Verified 上 61% 的额外编辑是新增测试、13% 是文档;代码必要性上,18 个模型中有 11 个留下的多余代码比人类开发者更少(NP_code 均值 0.887 对 0.864)。平均仍有 11% 的代码单元不必要,其中 89% 会改变行为。
代码必要性与解题率在 SWE-bench Verified 上不相关,在 DeepSWE 上呈负相关(Spearman -0.59,p=0.01)。用 DRA 基于智能体可见测试做剪枝,可移除大部分多余代码(67% 召回、46% 精确率),89% 的剪枝后补丁仍能解题;让智能体自查 diff 精确率更高(66%)但召回更低(36%)。作者建议基准同时报告代码必要性指标。
How Much Do Coding Agents Over-Edit, and Why? An Empirical Study of Unneeded Edits in Repository-Level Agent Patches
Agent patches are larger than developers', which is widely read as over-editing. But patch size does not say whether the extra edits are needed, what they are, or where they come from. We introduce Delta Residue Attribution (DRA), which replays agent trajectories, traces every block (unit) of the final patch to the step that wrote it, reverts each unit, and reruns the task tests to decide whether the unit is needed. We apply DRA to 7,660 resolved GitHub Copilot CLI trajectories from 18 frontier models on SWE-bench Verified (6,728) and DeepSWE (932), and grade developer patches using the same method. Agent patches do change more lines than developers'; on SWE-bench Verified the majority of extra edits add tests (61%) and documentation (13%) while on DeepSWE, most extra edits are code (58%). On both benchmarks, agents' code is on average at least as necessary as developers' (mean $NP_{code}$ 0.887 vs. 0.864 on SWE-bench Verified, where 11 of 18 models leave less unneeded code than developers, and 0.797 vs. 0.785 on DeepSWE). On average, 11% of an agent patch's code units on SWE-bench Verified are still unneeded, and 89% of those change behavior. Debug steps write almost none of the unneeded code. Code necessity differs substantially by model; it is unrelated to resolve rate on SWE-bench Verified and negatively correlated with it on DeepSWE (Spearman -0.59, p = 0.01). On SWE-bench Verified, pruning with DRA using only the tests the agent can see (its own tests and the repository's) removes the majority of unneeded code but also some needed code (67% recall, 46% precision), and 89% of pruned patches still resolve the task; asking the agent to audit its own diff is more precise but less effective (36% recall, 66% precision). We recommend that benchmarks report code necessity next to resolve rate and that over-editing be addressed through model training and harness-level pruning.
本条情报归属 AITOP「论文」核心栏目,重点聚焦北美前沿实验室与硅谷科技巨头。在跨区域产业观察坐标中,该动态直接关联「AI 开发者工具链、Coding Agent 与工程化实践」研究主线,反映出当前技术演进与商业落地的最新风向。涉及核心实体与技术议题包括:SWE-bench、GitHub Copilot、编程助手、智能体,读者可通过下方标签进入对应专题页查阅历史脉络与关联对比。
信源核验说明:本文原始线索采编自「arXiv cs.AI」(@Aakash Goel, Benjamin Steenhoek, Yu Hu),经 AITOP 多维评分管线结构化提炼。