AI and Technical Debt: Evidence from 4 Billion Lines of Code

João Dimas, Eddie Lu and Labros Pnevmatikos

Working Paper

Evidence against widespread “AI slop” in corporate software. We compare firms’ public software projects around first detected AI use with similar projects where AI use has not yet been detected.

Fewer total issues per line.

Total issues per line
−1.4%
Average over the first seven months

Change per line (% of pre-detection average)

  • Total issues per line
Change per line (% of pre-detection average) relative to comparison projects. Month −1 is the reference; the dashed line marks first detected AI use.
Month from first detected AI useTotal issues (%)
-120.02
-11-0.09
-10-0.46
-9-0.28
-8-0.40
-7-0.30
-6-0.28
-5-0.17
-4-0.17
-3-0.24
-2-0.05
-1 (reference)0.00
0-0.29
1-0.68
2-0.90
3-1.26
4-1.68
5-2.25
6-2.57
Monthly point estimates relative to comparison projects, measured from the month before first detected AI use. Percentages use each measure’s pre-detection average.

Total issues combine maintainability issues, bugs, and security vulnerabilities.

Both declines persist when the comparison group is restricted to projects where AI use is detected later.

Technical debt per line falls modestly.

Technical debt per line
−0.7%
Average over the first seven months

Change per line (% of pre-detection average)

  • Technical debt per line
Change per line (% of pre-detection average) relative to comparison projects. Month −1 is the reference; the dashed line marks first detected AI use.
Month from first detected AI useTechnical debt (%)
-12-0.08
-110.08
-10-0.31
-9-0.11
-8-0.30
-7-0.44
-6-0.31
-5-0.24
-4-0.05
-3-0.10
-2-0.00
-1 (reference)0.00
00.00
1-0.28
2-0.45
3-0.72
4-1.01
5-1.19
6-1.60
Monthly point estimates relative to comparison projects, measured from the month before first detected AI use. Percentages use the pre-detection average.

Technical debt is the estimated future cost of resolving maintainability issues.

The decline is similar in size but is not statistically significant when the comparison group is restricted to later-detected projects.

Fewer bugs per line.

Bugs per line
−2.1%
Average over the first seven months

Change per line (% of pre-detection average)

  • Bugs per line
Change per line (% of pre-detection average) relative to comparison projects. Month −1 is the reference; the dashed line marks first detected AI use.
Month from first detected AI useBugs (%)
-12-1.78
-11-2.29
-10-2.02
-9-2.15
-8-2.33
-7-0.78
-6-0.41
-5-0.28
-4-0.62
-3-0.38
-2-0.09
-1 (reference)0.00
0-0.61
1-1.18
2-1.59
3-2.31
4-2.77
5-3.06
6-3.38
Monthly point estimates relative to comparison projects, measured from the month before first detected AI use. Percentages use each measure’s pre-detection average.

Both declines persist when the comparison group is restricted to projects where AI use is detected later.

Quality gains concentrate in projects with weaker initial practices.

Average changes per line over the first seven months, relative to comparable projects within each group. Percentages use each group’s own pre-detection average.
MeasureWeaker initial practicesStronger initial practices
Total issues per line−2.1%−0.2%
Bugs per line−3.1%−0.1%
Technical debt per line−1.8%+0.7%

Initial practices combine test-file share, tests changed with code, human review, use of pull requests, and configured automatic checks.

The stronger-practice group’s changes are not statistically significant. The issue and bug declines in the weaker group also hold against later-detected projects.

Other quality measures show no significant change.

Critical issues per line
No significant change
Security vulnerabilities per line
No significant change
Security-review flags per line
No significant change
Duplicated-code share
No significant change
Complexity per line
No significant change

No statistically significant change in either comparison group.

Codebases also grow 6.6% more than those of comparable projects over the same seven months.

Abstract

We examine whether generative artificial intelligence (AI) speeds up software development at the expense of code quality. Our novel monthly panel tracks 1,459 corporate public software projects from 2022 to 2026, covering 3.9 billion lines of source code. An industry-standard tool identifies maintainability issues, bugs, and security vulnerabilities in each monthly snapshot of the code. We convert its estimated repair time into a dollar measure of technical debt, the future cost of resolving maintainability issues. We compare code quality changes around first detected AI use with changes at comparable projects where we have not yet detected AI use. Contrary to concerns about “AI slop,” total issues per line decline by 1.4%, bugs per line by 2.1%, and technical debt per line by 0.7% of their averages before detection. Quality gains concentrate in projects with weaker development practices before AI use. We also find that issues per unit of software functionality decline relative to comparison projects. Together, the findings link detected AI use to faster growth in firms’ software assets and a lower engineering burden relative to both code volume and software features.