Daily AI Paper

Daily AI Paper

2026-11-28

Archived
2026-11-28

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

arXiv:2611.34875v1

When people talk about coding agents over-editing, they usually mean something simple: the agent changes a lot more code than a human developer would. But that alone does not tell us whether those extra changes are actually wasteful. A large patch might be messy, or it might include necessary tests, documentation updates, cleanup, or debugging leftovers that only look excessive at first glance. This paper is about separating those possibilities. That distinction matters because in software engineering, patch size is not just an aesthetic issue. Bigger changes are harder to review, more likely to introduce unintended behavior, and more likely to be rejected by maintainers. A patch that fixes a bug by rewriting far more than needed may still pass tests, but it can create maintenance risk and reduce trust in the agent. So the real question is not just, “Did the agent change more?” but “Which of those changes were actually necessary, which were extra, and where did they come from?” To answer that, the authors introduce a method called Delta Residue Attribution, or DRA. The core idea is to replay the agent’s whole trajectory, break the final submitted patch into small independent units, trace each unit back to the step that introduced it, and then test whether removing that unit still lets the patch pass. If the patch still passes after removing a unit, that unit is treated as unneeded. If removing it breaks the task tests, it is treated as needed. This is a delta-debugging style counterfactual test: remove one piece, rerun the oracle, and see what happens. The background here is important. Prior work has shown that coding models often over-edit on small function-level tasks, and at the repository level their successful patches can be much larger than developers’ patches. But patch size by itself is a blunt instrument. It cannot tell you whether the extra lines are code, tests, docs, or comments. It also cannot tell you whether the extra code was written during debugging and later left behind, or whether it was part of the final fix. DRA is designed to answer those finer-grained questions. The method starts from a resolved trajectory, meaning a task where the final patch passes the benchmark tests. The authors replay the agent’s structured file-editing actions on the base repository until they reconstruct the final patch exactly. They exclude trajectories that do not replay cleanly. Then they split the patch into units: contiguous blocks of changed lines in a file, with nearby blocks merged if they are separated by at most one unchanged line. A new file or deleted file counts as one unit. Each unit is then classified by file type. Code units are the main object of study, while test, documentation, configuration, and comment or formatting changes are treated separately. That distinction matters because on SWE-bench Verified, the benchmark’s grading resets test files, so test edits do not affect whether a patch passes. In other words, test changes may be useful in a real repository, but they are not part of the benchmark’s success criterion. The paper therefore reports code necessity as the primary measure, and treats test and documentation changes as extra edits rather than as needed or unneeded in the same sense. DRA also attributes each unit to the step that most recently wrote it. That lets the authors ask not only what was unnecessary, but when it entered the trajectory. They divide steps into broad roles: debug steps, which include exploring, reproducing, and probing; fix steps, which include the actual fix and refinement; and cleanup steps, which revert earlier changes. A unit first written during debugging but later revised during the fix is attributed to the fix, not to the debug phase. To decide necessity, the authors revert each unit one at a time and rerun the task tests. If the reverted patch still passes, that unit is unneeded; if the revert breaks the tests, it is needed. Because benchmark tests do not cover every behavior, they also validate unneeded code units with behavioral probes. These probes are generated to exercise the changed code and compare behavior under the agent patch, the reverted patch, and the developer patch. That gives a stronger notion of necessity, while still keeping the benchmark tests as the main oracle. A particularly important part of the paper is that the authors do not just analyze agent patches. They also grade developer patches with the same method. That provides a baseline for how much “unneeded” code exists even in human-written fixes. This is crucial, because no test-based notion of minimality is perfect. A patch can be technically unnecessary under the benchmark oracle and still reflect a reasonable implementation choice. So the authors treat unneeded units as an upper bound on true excess, not a perfect measure of bad editing. The study is large. It covers 18 models from four providers, evaluated through the GitHub Copilot CLI coding agent on two benchmarks: SWE-bench Verified and DeepSWE. SWE-bench Verified has 500 Python tasks, while DeepSWE has 113 longer-horizon tasks across several languages. In total, they analyze 6,728 resolved SWE-bench Verified trajectories and 932 DeepSWE trajectories, plus developer baselines on both benchmarks. They also report that the replay success rate is very high for SWE-bench Verified trajectories, and they use a second judge to check the reliability of the role labels. So what do they find? First, yes, agent patches do change more lines than developer patches. But the composition of those extra edits differs by benchmark. On SWE-bench Verified, the majority of the extra changes are not code at all: 61% are tests and 13% are documentation. On DeepSWE, by contrast, most of the extra edits are code, at 58%. That already suggests that “over-editing” is not a single phenomenon; it depends on the task setup and what the agent is being asked to do. Second, when the authors focus specifically on code, the picture is more nuanced than the patch-size headline suggests. On SWE-bench Verified, 11 of the 18 models leave less unneeded code than developers do, on average. The mean code necessity is 0.887 for agents versus 0.864 for developers. That means agent code is, on average, at least as necessary as developer code, and sometimes more so. On DeepSWE, agents and developers are much closer: 0.797 versus 0.785. So the common assumption that agent code is intrinsically sloppier than human code is not supported here. Third, even though agent patches are larger, only a modest fraction of their code is actually unnecessary. On average, 11% of an agent patch’s code units on SWE-bench Verified are still unneeded. And among those unneeded code units, 89% change behavior, according to the behavioral probes. That is an important result: most of the residue is not harmless whitespace or cosmetic cleanup. It often affects program behavior, which means it is the kind of extra code that can matter in real maintenance and review. Fourth, the source of residue matters. Debug steps write almost none of the unneeded code. Most of the residue comes from fix steps. That tells us that over-editing is not mainly a case of agents leaving behind obvious debugging detritus. Instead, the extra code is usually part of the final repair itself. In other words, if you want to reduce unnecessary code, you probably cannot solve the problem just by trimming exploratory steps after the fact. Fifth, the relationship between over-editing and solve rate is not what you might expect. On SWE-bench Verified, code necessity differs substantially by model, but it does not track resolve rate in a meaningful way. Better success on the benchmark does not automatically mean cleaner, more minimal edits. On DeepSWE, the relationship is actually negative: models with higher resolve rates tend to leave less necessary code, with a Spearman correlation of minus 0.59. That suggests that on the harder benchmark, the strongest models may also be the more disciplined editors, but this is not a universal pattern. The paper also tests whether unneeded code can be removed automatically. They try two approaches on SWE-bench Verified. One is self-audit: ask the agent to inspect its own diff and identify removable code. That method is fairly precise, but it only finds a minority of the unneeded code. The other is harness-level pruning using the agent’s own tests plus the repository’s regression tests. That approach finds more of the unneeded code, but it is less precise and sometimes removes needed code too. Still, many of the pruned patches continue to resolve the task, which suggests that there is real room for automatic cleanup. The main limitation, and the authors are explicit about this, is that test-based necessity is not the same as true semantic necessity. If the tests do not cover a behavior, a unit may look unneeded even though a developer intended it. That is why the behavioral probes and the developer baseline are so important. The paper is careful to frame its measure as an upper bound on excess, not a perfect ground truth. Another limitation is that units are reverted one at a time, so the method measures single-unit necessity, not whether a group of units could be removed together. And the results are tied to the specific benchmarks and agent harnesses studied here. The practical takeaway is straightforward. Benchmarks should report code necessity alongside resolve rate, because success alone hides a lot of variation in edit quality. And if we want coding agents to become more maintainable, the solution likely has two parts: better model training that discourages unnecessary edits, and better harnesses that can prune or catch extra code before it reaches a human reviewer. The broader message is that “passes tests” is not enough. For coding agents, how they get to a passing patch matters almost as much as whether they get there at all.

Previous daily papers

2026-11-27Spectrum Adaptation of AI-Native Autoencoder Communications with Transfer Learning2026-11-26Stranger Things: When Objects Appear Without Their Typical Neighbors2026-11-25OmniAct: One Policy, One Million Embodiments2026-11-24Let Vision-Language Models Generate Images through Their Representations2026-11-24Pruning Autonomous Driving VLAs: What to Preserve for Reasoning and Action2026-11-24Tabular Foundation Models for Weighted Regression and Classification2026-11-23BioEmu2: Scalable Emulation of Biomolecular Dynamics2026-11-23Model Carving: Training Transformers That Optimize Their Own Topology2026-11-23MemOnce: A Scalable Memory Architecture for Large Language Models2026-11-22SoK: Assessing the Evolution of LLM Capability in Software Vulnerability Research2026-11-22Depth Pro 2: Sharp and Temporally Consistent Metric Monocular Depth2026-11-22RL Post-Training in Diffusion Transformers Is Activation Steering2026-11-20FrontierReplay: Split-Free Exact Prefix Caching for Hybrid Language Models2026-11-19Jailbreak Detection on Large Language Models via Contrastive Prototype Structures2026-11-19Auditing black-box clinical prediction models with a large language model through queries alone: a blinded test with planted flaws2026-11-18Spool: Low-Latency Streaming Inference for Hybrid Vision-Language Models2026-11-18Ambient LLMs: Data-Efficient Supervised Fine-tuning via Temperature Matching2026-11-18Know When to Zoom: How Small Is Too Small for Vision-Language Models?2026-11-17ViRA: Toward Ultra-High-Resolution Visual Agents via Cross-Input Relative Policy Optimization2026-11-17Latent Lattice Language Models2026-11-17SWE-CoWork: Benchmarking Coding Agents as Digital Employees in Organizations2026-11-16StreamEmbed: Real-Time Indexing from Pixels for Screenshot Retrieval2026-11-15ArchSpace: Recording, Reviewing, and Referencing LLM Architecture Research2026-11-15Classical Energies Learn to Reason 1,000x Faster than Looped Models2026-11-15Unbundling Multimodal Vision Encoding2026-11-14Goal Encoding in LLMs2026-11-13Dataset Distillation via Drifting2026-11-12AutoScaffold: AI-Guided Scaffolding for Reinforcement Learning of Language Models2026-11-12Contrastive Discovery: Open-Ended Scientific Discovery over Competing Explanations2026-11-12Emergent Biological Capabilities in a Foundation Model for Molecular Interactions2026-11-11Medical Image Segmentation: Foundation Model Adaptation versus Task-Specific Training2026-11-10Mitigating Agentic Deception via Evaluation-Side Partially Observable Games2026-11-09On Agentic Manipulation Policies2026-11-09Can Agentic Systems Close the Gap in Radiology with Production AI Tools?2026-11-09Computer-Use Agents Are Embodied Generalists2026-11-08Failure Prediction and Classification in Vision-Language-Action Models Via Calibrated Latent Probing2026-11-08Scientist World: Grow a Research World for AI-Scientists2026-11-08Understanding AI from the Inside: The State of Mechanistic Interpretability for AI Safety2026-11-06User Embeddings are Superpositions of Interpretable Behavioral Modes2026-11-05FrontierPhysics: Evaluating Agents for End-to-End Physics Research2026-11-05Reinforcement Learning Enables Scaling Generalist Robot Policy Improvement2026-11-05Perceptive Humanoid Motion from Simulation2026-11-04From Autonomous Agents to Cognitive Symbionts: Toward AI-Augmented Human Intelligence2026-11-04DreamX: Video Diffusion Model is a Universal Latent Action Learner2026-11-04PyRUA-DataFarm: LLM Agent as a Cost-Efficient Teleoperator for Real-Ready Robot Data2026-11-03Pixel: A Co-Designed Full-Stack Robot System for Learning General-Purpose Mobile Manipulation2026-11-03Strategist: Evolving Reasoning with Agents2026-11-03DR Pixel: Page-Native Deep Research with Vision-Language Models2026-11-02ACCT: Asymmetric Cross-LLM Context Transfer2026-11-02Latent Reasoning in Continuous Space for Unified Multimodal Models2026-11-02Subquadratic Attention with a Hierarchical Tree-Structured Indexer2026-11-01Testimony from Timelines: Evidence-Grounded Significance Testing of Temporal Clinical Hypotheses2026-11-01ShallowDefend: Harnessing Shallow Safety Alignment for Multi-Turn Defender2026-10-31Difficulty Calibration Across Time for Membership Inference in Diffusion Models2026-10-30world2vec: Mechanistic world models through latent dynamics learning2026-10-30Elucidating the Design Space of LM Data Attribution2026-10-29Pushing Dexterity and Safety for In-Hand Object Pose Reaching That Works Remarkably Well2026-10-29Can LLMs Uncover Hidden Physical Laws through Free Exploration?2026-10-29Scaling Laws for Tool-Use Agents via Controllable Environment Synthesis