一句话:提出双通路 SGCR 框架,将 LLM 代码审查锚定于人工规约以生成可信反馈,工业部署中采纳率相对提升 90.9%。
LLM 驱动的自动化代码审查前景广阔,但因缺乏可靠性、上下文感知能力和可控性而难以在工程实践中落地。本文提出 Specification-Grounded Code Review(SGCR)框架,将 LLM 锚定在人工编写的规约之上,从而产出可信且切题的审查反馈。SGCR 采用新颖的双通路架构:显式通路依据从规约导出的预定义规则保证确定性的合规检查,隐式通路则以启发式方式发现并验证规则之外的问题。该框架已在 HiThink Research 的真实工业环境中部署,其审查建议获得 42% 的开发者采纳率,相比基线 LLM(22%)实现 90.9% 的相对提升。工作表明,规约锚定是弥合 LLM 生成能力与软件工程严格可靠性要求之间差距的有效范式。
Automating code review with Large Language Models (LLMs) shows immense promise, yet practical adoption is hampered by their lack of reliability, context-awareness, and control. To address this, we propose Specification-Grounded Code Review (SGCR), a framework that grounds LLMs in human-authored specifications to produce trustworthy and relevant feedback. SGCR features a novel dual-pathway architecture: an explicit path ensures deterministic compliance with predefined rules derived from these specifications, while an implicit path heuristically discovers and verifies issues beyond those rules. Deployed in a live industrial environment at HiThink Research, SGCR’s suggestions achieved a 42% developer adoption rate—a 90.9% relative improvement over a baseline LLM (22%). Our work demonstrates that specification-grounding is a powerful paradigm for bridging the gap between the generative power of LLMs and the rigorous reliability demands of software engineering.
DOI 原文 ·
@inproceedings{paperbot9437,
title = {SGCR: A Specification-Grounded Framework for Trustworthy LLM Code Review},
author = {Kai Wang and Bingcheng Mao and Shuai Jia and Yujie Ding and Dongming Han and Tianyi Ma and Bin Cao},
booktitle = {ASE},
year = {2025},
doi = {10.1109/ase63991.2025.00315}
}