Delta Residue Attribution: Tracing Every Unneeded Edit in Agent-Generated Code Patches
Agent-generated patches are larger than human patches. That much is known. What has not been known is whether the extra lines are necessary, what they do, or which tool calls produced them. Delta Residue Attribution (DRA) answers those questions by replaying agent trajectories, tracing every block of the final patch to the step that wrote it, reverting each unit, and rerunning task tests to…
Delta Residue Attribution (DRA) is a technique used to analyze agent-generated code patches and determine which edits are unnecessary. It works by replaying the agent's trajectory, tracing each block of the final patch to the tool call that produced it, and then reverting and testing the removal of each block. This allows researchers to classify whether a block is needed or unneeded based on whether its removal causes the patch to fail.
The study applied DRA to 7,660 resolved GitHub Copilot CLI trajectories across 18 frontier models on SWE-bench Verified and DeepSWE. The results showed that agent patches tend to make more changes than human patches, with 61% of extra edits adding tests and 13% adding documentation on SWE-bench Verified. However, when measuring the necessity of code edits only, agents performed at least as well as human developers.
Eleven out of the 18 models left less unneeded code than human developers on SWE-bench Verified. On average, 11% of an agent patch's code units were still unneeded, and 89% of those unneeded units changed program behavior. Debug steps wrote almost none of the unneeded code, indicating the problem lies with certain tool calls producing edits that do not contribute to task resolution.
The study found that code necessity varies substantially by model and is unrelated to resolve rate on SWE-bench Verified. However, it is negatively correlated with resolve rate on DeepSWE, suggesting that some models solve more tasks by making more edits rather than by making better edits. Two pruning strategies were tested: automated pruning, which removes blocks identified as unnecessary, and agent self-audit, where the agent reviews its own diff and removes unnecessary edits.
Automated pruning is aggressive and risks breaking patches, while agent self-audit is safe but leaves most unneeded code untouched.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to