TL;DR
Does code written by AI agents survive longer in a codebase than human-written code, or is it quickly replaced as technical debt? This paper reveals that the answer depends almost entirely on your measurement choices. By re-analyzing 854,139 lines of code across 88 different experimental "specifications," the authors show that for autonomous agents like Devin, the "verdict" on code survival can be flipped simply by changing how you calculate statistical uncertainty.
What Problem Does This Paper Address?
As AI coding agents like GitHub Copilot and Devin become mainstream, researchers have started asking a critical question: what happens to this code after it is merged? This is known as "post-merge behavior" or "code survival." If agent-generated code is correct but hard to maintain, it might be modified or removed much sooner than human code, signaling long-term technical debt.
However, existing studies have reached conflicting conclusions. Some say agent code lasts longer; others say it's replaced faster. The authors of this paper argue that these disagreements aren't necessarily about the agents themselves, but about the "measurement ladder"—the series of defensible but impactful choices researchers make, such as how to track a line of code as it moves, what counts as a "modification," and how to handle statistical dependencies within a repository.
Methods
The authors performed a multiverse analysis (specifically a specification curve) to see how different combinations of measurement choices affect the final result. They varied nine key choices, including:
- Line Tracking: Following a line by its position (line number) vs. its identity (using
git blamewith rename detection). - Unit of Analysis: Counting by individual lines, "hunks" (blocks of code), or entire Pull Requests (PRs).
- Modification Definition: Syntactic (any change) vs. AST-structural (only changes that alter the code's logic, ignoring whitespace/renames).
- Intent Classification: Using traditional keyword-based rules vs. Large Language Models (LLMs) to decide if a change was a bug fix or a feature addition.
- Statistical Uncertainty: Comparing "model-based" standard errors (treating every line as independent) against "clustered" standard errors (accounting for the fact that lines in the same repo are often modified together).
They used Kaplan-Meier survival curves and Cox proportional hazards regression to estimate the "hazard ratio" (HR)—a measure of how much more (or less) likely agent code is to be modified compared to human code at any given time.
Datasets
The study uses the AIDev dataset, which contains nearly a million PRs from five different agents: GitHub Copilot, Cursor, Claude Code, OpenAI Codex, and Devin. The authors focused on a filtered cohort of 2,802 merged PRs across 215 open-source repositories, totaling 854,139 lines of code.
Key Insights and Ideas
- The "Clustering" Trap: This is perhaps the most critical finding. Many previous studies treated every line of code as an independent data point. However, lines in the same repository are highly dependent. When the authors clustered standard errors by repository, many "significant" findings—especially for the autonomous agent Devin—vanished.
- LLMs are the New Gold Standard for Intent: Traditional keyword-based rules for classifying why code changed (e.g., looking for "fix" in a commit message) are surprisingly inaccurate ($\kappa = 0.38$). LLMs, however, agree with human labels as well as two humans agree with each other ($\kappa \approx 0.70$).
- Supervised vs. Autonomous Agents: For human-supervised agents like Copilot, the results were stable: their code generally survives longer than human code across most measurements. For the fully autonomous agent Devin, the results were volatile, with the verdict shifting between "modified sooner" and "no difference" based on the measurement pipeline.
- The Human Maintenance Burden: Despite the rise of agents, humans still do the heavy lifting. Human developers make about 88% of the modifications to agent-generated code.
Key Results
The authors summarized the diversity of measurement choices in previous literature in Figure 1:
- Copilot/Supervised Agents: In 13 out of 22 specifications across repositories, Copilot code was found to be retained longer than human code. It was almost never found to be modified sooner.
- Devin/Autonomous Agents: The verdict was highly sensitive. Using "model-based" errors, 15 of 22 specifications reported it was modified sooner. But with proper repository clustering, only 3 specifications showed a difference—no more than what you'd expect from random chance (permuted labels).
- Sensitivity to Single Choices: The authors re-ran five published study designs on their data and found that each one could have its headline result flipped by changing just one measurement choice.
Limitations and Future Work
- Dataset Specificity: The results are based on the AIDev dataset. While it's a standard benchmark, the behavior of agents might differ in closed-source corporate environments.
- Agent Evolution: Coding agents are moving targets. The "Devin" studied here is a specific version from a specific period; newer autonomous agents might behave differently.
- Future Directions: The authors suggest that future studies must use their provided "operationalization checklist," which includes recommendations like following line identity rather than location and always reporting results under multiple variance estimators. They also plan to investigate how the level of human supervision (e.g., "Copilot" vs "Devin") fundamentally changes the maintenance lifecycle.
Summary updated