SGCR: A Specification-Grounded Framework for Trustworthy LLM Code Review

📅 2025-12-19
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
LLM-driven code review suffers from low reliability, weak contextual awareness, and poor controllability. To address these limitations, we propose SGCR, a specification-anchored code review framework featuring a novel explicit–implicit dual-path architecture: the explicit path rigorously derives verifiable rules from human-written specifications, while the implicit path assists in identifying latent defects not explicitly defined. SGCR integrates specification modeling, dual-path prompt engineering, context-aware feedback generation, and industrial-scale LLM deployment. Evaluated in a real-world setting at Haitong Securities Research Institute, SGCR achieved a 42% developer adoption rate—representing a 90.9% relative improvement over the baseline LLM (22% → 42%). This constitutes the first empirical validation that specification anchoring significantly enhances the reliability of LLM-based code review.

Technology Category

Application Category

📝 Abstract
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.
Problem

Research questions and friction points this paper is trying to address.

Addresses LLMs' unreliability in automated code review
Enhances context-awareness and control in code feedback
Bridges generative power with software engineering reliability
Innovation

Methods, ideas, or system contributions that make the work stand out.

Framework grounds LLMs in human-authored specifications for trustworthy feedback
Dual-pathway architecture ensures rule compliance and heuristically discovers issues
Specification-grounding bridges LLM generative power with software engineering reliability
🔎 Similar Papers
No similar papers found.
K
Kai Wang
HiThink Research, Hangzhou, China
B
Bingcheng Mao
HiThink Research, Hangzhou, China
Shuai Jia
Shuai Jia
Shanghai Jiao Tong University
Computer VisionVisual Object TrackingAdversarial Learning
Y
Yujie Ding
Zhejiang University, Hangzhou, China
Dongming Han
Dongming Han
HiThink Research
LLMVisualizationAgent
T
Tianyi Ma
HiThink Research, Hangzhou, China
B
Bin Cao
Zhejiang University of Technology, Hangzhou, China