arXiv cs.AI· Lo Gullstrand Heander, Markus Borg, Emma S\"oderberg, Christofer Rydenf\"alt·· 2 天前AI 评分26
CodeHealth 能否预测智能体代码审查的 token 成本:一项针对 465 个智能体编写 PR 的预注册研究
CodeHealth Predicts the Token Cost of Agentic Code Review: A Pre-Registered Study of 465 Agent-Authored Pull Requests
AI 导读
一项预注册研究用 465 个智能体编写的 PR 测试 CodeHealth 能否预测多智能体代码审查的 token 成本,结果显示三个 LLM 的 CodeHealth 系数均为负,每提高 1 点 CodeHealth 对应 token 成本降低 3.5% 至 6.1%。该关联与 PR 规模无关,且调整被评分文件大小后关联消失,研究者将其解释为文件大小的中介效应。
正文 · 原文
Abstract:Context: Organizations increasingly delegate code review to multi-agent large language model (LLM) pipelines billed per token. Low code quality raises human maintenance effort, but its effect on agent review cost has not been measured.
Objective: We test whether baseline CodeHealth predicts the token cost of agentic review and fix beyond pull request (PR) footprint.
Method: In a pre-registered observational study, we sampled 465 agent-authored PRs from 246 repositories in AIDev, jointly stratified by CodeHealth and footprint under repository caps. A frozen five-agent review-and-fix pipeline processed every PR with three different LLMs. Per LLM, we fitted a mixed model of log tokens on CodeHealth and log PR footprint, with a repository random intercept.
Results: For all three LLMs the CodeHealth coefficient was negative, with 95% CI excluding zero; each CodeHealth point was associated with 3.5% to 6.1% lower token cost. CodeHealth was unrelated to PR footprint, so PR size does not explain the association. Two of three registered smells predicted fix cost; batch fixing left median CodeHealth unchanged. Exploratory analyses located the association in the review stage, where agents iterated more on unhealthy code without writing more comments. Adjusting for the size of the scored files absorbed the association, which we interpret as mediation by file size.
Conclusions: A quality metric calibrated against human maintainability also predicts the inference cost of multi-agent review and fix. The effect is modest per point and not carried by PR size, so the refactoring case extends to agent-reviewed code when it changes structure and file size, not only the score.
Data Availability: this https URL
| Comments: | 32 pages, 6 figures, 16 tables |
| Subjects: | Software Engineering (cs.SE); Artificial Intelligence (cs.AI) |
| Cite as: | arXiv:2610.21914 [cs.SE] |
| (or arXiv:2610.21914v1 [cs.SE] for this version) | |
| https://doi.org/10.48550/arXiv.2610.21914 arXiv-issued DOI via DataCite (pending registration) |
Submission history
From: Lo Gullstrand Heander [view email]
[v1]
Thu, 15 Oct 2026 14:00:33 UTC (162 KB)
来源:arXiv cs.AI · arxiv.org