AI 编程 5.0 · 必读 2026-11-25 · 论文

How Much Do Coding Agents Over-Edit, and Why? An Empirical Study of Unneeded Edits in Repository...

DRA 方法:重放 agent 轨迹,把补丁每个代码块回溯到写入它的步骤,revert 后重跑任务测试判定必要性覆盖 7,660 条 Copilot CLI 轨迹18 个前沿模型,SWE-bench Verified 6,728 + DeepSWE 932,开发者补丁同法评级结论:agent 补丁确实改更多行,但 SWE-bench 上多余编辑 61% 在补测试13% 是文档;代码必要性与开发者持平(0.887 对 0.864)平均 11% 代码单元仍属多余,其中 89% 改变行为;调试步骤几乎不产生必要性在 DeepSWE 与解决率负相关选型别拿补丁大小当质量信号

打开原文回到归档

How Much Do Coding Agents Over-Edit, and Why? An Empirical Study of Unneeded Edits in Repository-Level Agent Patches

中文导读

Agent 补丁比开发者的更大,但这不等于过度编辑。论文提出 Delta Residue Attribution(DRA):重放 agent 轨迹,把最终补丁的每个代码块追溯到写入它的步骤,逐块回退并重跑任务测试来判定必要性,再用同一方法给开发者补丁评级。实验覆盖 18 个前沿模型在 SWE-bench Verified(6,728 条)与 DeepSWE(932 条)上共 7,660 条已解决的 GitHub Copilot CLI 轨迹。结论:SWE-bench Verified 上多数多余编辑是测试(61%)与文档(13%);两个基准上 agent 代码的平均必要性与开发者持平甚至更好(NP_code 0.887 对 0.864、0.797 对 0.785,18 个模型中 11 个留下的无用代码比人少)。但平均仍有 11% 的代码单元属多余,其中 89% 会改变行为;调试步骤几乎不产生多余代码。在 DeepSWE 上代码必要性与解决率负相关(Spearman -0.59)。作者建议基准在解决率之外报告代码必要性,并通过模型训练与 harness 级剪枝治理过度编辑。

为什么值得关注

把「过度编辑」从印象变成可归因指标:补丁大小不是质量信号,测试/文档类多余编辑占大头,而真正会改变行为的无用代码平均仍有 11%。DRA 式剪枝实验(67% recall / 46% precision,89% 剪枝后补丁仍能解决任务)说明 harness 层自动化可行但精度有限;对 coding agent 评测与 harness 优化都是直接可用的度量框架。

条目一句话:Coding agents' extra edits are mostly tests/docs; code necessity rivals human patches

关键信息

  • 标题:How Much Do Coding Agents Over-Edit, and Why? An Empirical Study of Unneeded Edits in Repository-Level Agent Patches
  • 作者:Aakash Goel, Benjamin Steenhoek, Yu Hu
  • 原文:https://arxiv.org/abs/2611.34875
  • 发布时间:2026-11-25
  • 来源分类:cs.SE, cs.AI
  • 关联标签:coding-agents, swebench, empirical-study, patch-quality

English Abstract

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.

English Summary

Agent patches are larger than developers', but size alone does not say whether the extra edits are needed. Delta Residue Attribution (DRA) replays trajectories, traces each patch block to the step that wrote it, reverts it, and reruns task tests to judge necessity. Applied to 7,660 resolved GitHub Copilot CLI trajectories from 18 frontier models on SWE-bench Verified (6,728) and DeepSWE (932), with developer patches graded identically: most extra edits add tests (61%) and docs (13%), and agents' code is at least as necessary as developers' (mean NP_code 0.887 vs 0.864; 11 of 18 models leave less unneeded code than humans). Still, 11% of agent code units are unneeded and 89% of those change behavior; debug steps write almost none. Necessity is unrelated to resolve rate on SWE-bench Verified, negatively correlated on DeepSWE (-0.59). Patch size is a poor proxy for edit quality.

Obsidian Notes

  • 内容由 opencli arxiv paper 2611.34875 -f json 拉取 arXiv 元数据与摘要生成。
  • 中文导读与价值判断锚定在论文摘要、作者、日期与分类信息上;未补充摘要之外的实验细节。