DefectReviewer: Towards Generating Defect-Focused Review Comment Based on Fine-Grained Defect Localization
Yuan Huang, Ao Zeng, Yuxuan Zhang, Xiangping Chen, Zibin Zheng
Key points
From the paper's conclusion- We propose DefectReviewer , a defect-focused review comment generation approach combining task-specific fine-tuning with fine-grained localization signals.
Abstract
Code review is critical to software quality assurance, with defect detection as a primary objective. While LLMs enable automated review comment generation, most approaches treat code review as a general-purpose task, favoring frequent but low-risk feedback. We propose DefectReviewer , a defect-focused review comment generation approach combining task-specific fine-tuning with fine-grained localization signals. The key insight is that while task-specific fine-tuning establishes the foundation for defect-focused review, grounding the model in where the defect is provides complementary guidance to narrow the reasoning space for what the defect is . DefectReviewer uses a Just-In-Time localization tool to identify defect lines, grounding review comment generation through structural prompting and fine-tuning. DefectReviewer is designed as a specialized, selectively applicable component that complements general-purpose reviewers. We evaluate DefectReviewer on a large-scale real-world dataset against six representative baseline methods. DefectReviewer consistently outperforms state-of-the-art baselines, improving BLEU and ROUGE-L by 17.0% and 24.2%, respectively. A dual-track semantic evaluation combining LLM judges with human expert validation confirms that DefectReviewer produces comments with higher defect relevance and readability. Additional analyses show that it can be applied to different generation architectures and that its performance changes moderately as the number of input defect lines varies, although the trend differs across architectures.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- CR-Bench-v2: Evaluating the Real-World Utility of AI Code Review AgentsarXiv · 2026
- CIVER: Causal Intervention Verification for Reliable Code ReviewarXiv · 2026
- From Static to Dynamic: Benchmarking Real-World Code Review with MCR-BenchProceedings of the ACM on Software Engineering · 2026
- CRJudgeBench: Can AI Detect Plausible but Invalid Code Reviews?arXiv · 2026
- E4R-Reviewer: Effective and Explainable Automated Code Review via End-to-End Reasoning-Guided AlignmentProceedings of the ACM on Software Engineering · 2026
- Helping LLMs improve code generation using feedback from testing and static analysisDiscover Artificial Intelligence · 2026