E4R-Reviewer: Effective and Explainable Automated Code Review via End-to-End Reasoning-Guided Alignment
Open Access
- 1 October 2026
- journal article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3 (ISSTA) , 102-126
Abstract
Code review is a key practice for ensuring software quality and maintainability. Despite progress in Automated Code Review (ACR), existing methods face two core challenges: (1) Isolated Task Modeling. Current approaches often model and optimize subtasks in ACR independently, ignoring the inherent logical order and internal dependencies among them which affects the effectiveness of ACR. (2) Lack of Explainability. At the task level, the absence of explanatory information in review comments increases developers’ cognitive load; at the model level, the black-box nature fundamentally undermines developer trust. To address these challenges, we propose E4R-Reviewer, which improves the E ffectiveness and E xplainability of ACR through E nd-to- E nd R easoning-guided alignment. For effectiveness , E4R-Reviewer unifies multiple fine-grained ACR subtasks into a single end-to-end reasoning process, enabling cross-task knowledge sharing and allowing the model to explicitly complete a reasoning chain that covers quality estimation, issue localization, issue classification, issue description, fix suggestion, and code refinement in one generation. Meanwhile, we adopt a Group Relative Policy Optimization (GRPO)-based reinforcement-learning alignment, treating the reasoning steps as optimizable intermediate objectives. We design subtask-specific rewards and integrate them via curriculum-inspired, multi-stage reward fusion that follows the real-world review workflow. For explainability , E4R-Reviewer produces reasoning process and structured review results covering all fine-grained ACR subtasks, improving the transparency and explainability of the review results. Extensive evaluations on public, real-world datasets demonstrate that E4R-Reviewer significantly outperforms existing methods and achieves state-of-the-art performance: a 74.61% F1-score in quality estimation and +22.96% CodeBLEU in code refinement. Furthermore, Large Language Model (LLM) and human evaluation further confirm the superiority of E4R-Reviewer in terms of effectiveness and explainability.Keywords
Funding Information
- National Key Research and Development Program of China (2023YFB3307202)
This publication has 70 references indexed in Scilit:
- CodeDoctor: multi-category code review comment generationAutomated Software Engineering, 2025
- Fine-tuning and prompt engineering for large language models-based code review automationInformation and Software Technology, 2024
- Code Compliance Assessment as a Learning Problem2023
- Weighted kappa measures for ordinal multi-class classification performanceApplied Soft Computing, 2023
- Automated Code Review Comment Classification to Improve Modern Code Reviews2022
- Is Historical Data an Appropriate Benchmark for Reviewer Recommendation Systems? : A Case Study of the Gerrit Community2021
- Mastering the game of Go with deep neural networks and tree searchNature, 2016
- Code Reviews Do Not Find Bugs. How the Current Code Review Best Practice Slows Us Down2015
- Expectations, outcomes, and challenges of modern code review2013
- Reducing human effort and improving quality in peer code reviews using automatic static analysis and reviewer recommendation2013