Do AI Coding Agents Over-Edit? Microsoft Measured 18 Models Against Human Developers (November 2026)


Ask an AI coding agent to fix a bug and it often comes back with far more than you asked for — extra tests, rewritten comments, "improvements" nobody ordered. Three Microsoft-affiliated researchers have now measured this over-editing habit at scale. Their paper, posted to arXiv on November 25, analyzes 7,660 successful GitHub Copilot CLI sessions across 18 frontier models, and grades every patch block for whether it was actually needed.

The headline surprise: agents do change more code than humans — but by the "was it needed" measure, 11 of the 18 models left less unneeded code than human developers did. Here's what the study found and what you can do with it.

How do you measure an unneeded edit?

The method, Delta Residue Attribution (DRA), replays each agent's full working session, then reverts each block of the final patch one at a time and reruns the task's tests. If the tests still pass without a block, that block wasn't needed. Human developers' patches for the same tasks get graded the same way, so the comparison is apples to apples.

Yes, agents edit about twice as much

On SWE-bench Verified (real-repository bug fixes), agent patches changed roughly twice as many lines as developer patches. But the composition matters: 61% of the extra edits were tests and 13% documentation. On the harder DeepSWE benchmark, 58% of the surplus was actual code — so the tougher the task, the more real over-coding happens.

The surprise: agents score higher on necessity

Measuring the share of code changes that were needed, agents averaged 0.887 versus 0.864 for humans on SWE-bench Verified, and 11 of 18 models beat the human baseline. Still, about 11% of code units in an average agent patch are unneeded — and 89% of those change behavior, which makes them latent-bug material. One more useful detail: unneeded code overwhelmingly gets written during fix steps (83% of the residue), not debugging steps.

Are the agent's extra tests worth keeping?

Partly, yes. Tests the agents added on their own caught 68% of injected bugs (the task's own tests caught 77%) — and 5% of injected bugs were caught only by the agent's tests. The "unrequested" tests are real insurance, not just noise.

Can over-editing be pruned automatically?

Using only the tests visible to the agent, automated pruning removed 67% of unneeded code at 46% precision, and 89% of pruned patches still resolved their tasks. Asking the agent to audit its own patch was more precise (66%) but caught just 36%. And a finding worth pinning: resolve rate and code necessity are unrelated — on DeepSWE they even correlate negatively. A model that tops the leaderboard doesn't necessarily write clean patches.

What to do differently tomorrow

Three practical takeaways. First, when reviewing an agent's diff, focus on code changes made during fix steps — that's where the risky surplus lives. Second, don't reflexively delete the agent's added tests; check what they cover first. Third, when you choose a model for coding work, compare how much unneeded change it leaves behind, not just its benchmark resolve rate — the authors argue benchmarks should report both.

FAQ

So is over-editing actually bad?

It's mixed. Most of the surplus is tests and docs, some of which catch real bugs. The genuinely risky part is the ~11% of code units that aren't needed, since nearly all of them alter behavior.

Which model writes the cleanest patches?

The paper reports substantial differences between models but isn't a consumer ranking. The durable lesson is that cleanliness and resolve rate are separate axes.

How far do these results generalize?

The data comes from one harness (GitHub Copilot CLI) and only from sessions that succeeded. Other harnesses, and failed attempts, could behave differently.

Related on AI Learning Lab: Budget AI Coding Plans Compared · What Is an AI Benchmark?


Comments

Popular posts from this blog

AI Search vs Traditional Search: How to Use Each in 2026

What Is a Vector Database? How AI Finds Similar Things, Explained Simply

What Is a Small Language Model (SLM)? On-Device AI Explained