LAURA: Enhancing Code Review Generation with Context-Enriched Retrieval-Augmented LLM
Authors:
- 16 November 2025
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 2983-2995
Abstract
Code review is critical for ensuring software quality and maintainability. With the rapid growth in software scale and complexity, code review has become a bottleneck in the development process because of its time-consuming and knowledge-intensive nature and the shortage of experienced developers willing to review code. Several approaches have been proposed for automatically generating code reviews based on retrieval, neural machine translation, pre-trained models, or large language models (LLMs). These approaches mainly leverage historical code changes and review comments. However, a large amount of crucial information for code review, such as the context of code changes and prior review knowledge, has been overlooked. This paper proposes an LLM-based review knowledge-augmented, context-aware framework for code review generation, named LAURA. The framework integrates review exemplar retrieval, context augmentation, and systematic guidance to enhance the performance of ChatGPT-4o and DeepSeek v3 in generating code review comments. Besides, given the extensive low-quality reviews in existing datasets, we also constructed a high-quality dataset. Experimental results show that for both models, LAURA generates review comments that are either completely correct or at least helpful to developers in 42.2% and 40.4% of cases, respectively, significantly outperforming SOTA baselines. Furthermore, our ablation studies demonstrate that all components of LAURA contribute positively to improving comment quality.Keywords
All Related Versions
Funding Information
- National Natural Science Foundation of China
This publication has 50 references indexed in Scilit:
- DeepCRCEval: Revisiting the Evaluation of Code Review Comment Generation2025
- Exploring the impact of code review factors on the code review comment generationAutomated Software Engineering, 2024
- Fine-tuning and prompt engineering for large language models-based code review automationInformation and Software Technology, 2024
- ChatGPT Prompt Patterns for Improving Code Quality, Refactoring, Requirements Elicitation, and Software Design2024
- Automating modern code review processes with code similarity measurementInformation and Software Technology, 2024
- What makes a code review useful to OpenDev developers? An empirical investigationEmpirical Software Engineering, 2023
- From Commit Message Generation to History-Aware Commit Message Completion2023
- A ground-truth dataset and classification model for detecting bots in GitHub issue and PR commentsJournal of Systems and Software, 2021
- WhoReview: A multi-objective search-based approach for code reviewers recommendation in modern code reviewApplied Soft Computing, 2021
- But the reviewers are making different criticisms of my paper! Diversity and uniqueness in reviewer comments.1992