Microsoft 论文:AI 编程修复的改动量是人类程序员的 2.33 倍
程序员都吐槽 AI 编程工具爱乱改一通,Microsoft 这篇论文把 7,660 次运行逐块拆开验证:多出来的编辑大半是测试和文档,代码本身甚至比人写得还精准。做编程智能体评测的话,这篇的指标方法直接能拿来用。
Microsoft 新论文分析 AI 编程工具与人类开发者修复 bug 的差异,发现智能体补丁改动行数是人类开发者的 2.33 倍。团队回放了 7,660 次 GitHub Copilot CLI 运行,覆盖 18 个模型,并将每个补丁块追溯到生成它的步骤。通过逐块删除再重跑测试,论文量化了哪些改动是必需的。
结果显示,在 SWE-bench Verified 上 61% 的额外编辑是测试代码,智能体补丁的必需代码块占比达 88.7%,略高于人类的 86.4%。也就是说,AI 的“多编辑”并非过度修改代码本身,而是主要来自补充测试和文档。多余代码产生于修复编写环节,而非调试残留;3 个 Gemini Flash 模型的多余代码比例高于人类。
论文建议在对比编程智能体时,除了 resolve rate,还应报告必需代码占比这一指标,并通过训练和运行后剪枝来减少冗余编辑。
New Microsoft paper finds that AI coding tools write bigger bug fixes than human programmers (2.33X bigger than human developers) mainly because they add tests and documentation, while their actual code is about as necessary as a human's.
Agent patches change 2.33 times as many lines as developer fixes, which is widely read as over-editing. Size alone cannot say whether the extra edits are needed, what they are, or where they come from.
They replayed 7,660 GitHub Copilot CLI runs from 18 models and traced each patch block to the step that wrote it. They then removed each block, reran the tests, and graded developer patches the same way.
On SWE-bench Verified, 61% of the extra edits were tests, and agent patches averaged 88.7% needed code blocks versus 86.4% for developers. The unneeded code came from writing the fix, not debug leftovers, and 3 Gemini Flash models left more than developers.
Report needed-code share next to resolve rate when comparing coding agents, and cut over-editing through training and post-run pruning.
This report is categorized under AITOP's "Papers" desk, focusing on US frontier AI labs and Silicon Valley technology leaders. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include GitHub Copilot, SWE-bench, coding assistants, Gemini Flash.
Source attribution: curated from rohanpaul_ai (@rohanpaul_ai).