Retrieval-Augmented Code Review Comment Generation
On the map: Retrieval-augmented generation → RAG for code
Abstract (arXiv)
Automated code review comment generation (RCG) aims to assist developers by automatically producing natural language feedback for code changes. Existing approaches are primarily either generation-based, using pretrained language models, or information retrieval-based (IR), reusing comments from similar past examples. While generation-based methods leverage code-specific pretraining on large code-natural language corpora to learn semantic relationships between code and natural language, they often struggle to generate low-frequency but semantically important tokens due to their probabilistic nature. In contrast, IR-based methods excel at recovering such rare tokens by copying from existing examples but lack flexibility in adapting to new code contexts-for example, when input code contains identifiers or structures not found in the retrieval database. To bridge the gap between generation-based and IR-based methods, this work proposes to leverage retrieval-augmented generation (RAG) for RCG by conditioning pretrained language models on retrieved code-review exemplars. By providing relevant examples that illustrate how similar code has been previously reviewed, the model is better guided to generate accurate review comments. Our evaluation on the Tufano et al. benchmark shows that RAG-based RCG outperforms both generation-based and IR-based RCG. It achieves up to +1.67% higher exact match and +4.25% higher BLEU scores compared to generation-based RCG. It also improves the generation of low-frequency ground-truth tokens by up to 24.01%. We additionally find that performance improves as the number of retrieved exemplars increases.
Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Placed in RAG for code, one of 15 directions in Retrieval-augmented generation. Builds on 29 of its 47 references that are in the map. First posted on arXiv 13 Jun 2025.
Builds on
29 of 47 references.
Closest ancestors · 3
Same direction, newest first
- 2024Improving Retrieval-Augmented Code Comment Generation by Retrieving for Generation7 Aug
- 2022ReACC: A Retrieval-Augmented Code Completion Framework15 Mar
- 2021Retrieval Augmented Code Generation and Summarization26 Aug
Other references · 26
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
- 2014Sequence to Sequence Learning with Neural Networkscited by 2,974
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
14 more
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 327
- 2023InferFix: End-to-End Program Repair with LLMscited by 113
- 2018Guiding Neural Machine Translation with Retrieved Translation Piecescited by 63
- 2022Using Pre-Trained Models to Boost Code Review Automationcited by 63
- 2021Towards Automating Code Review Activitiescited by 54
- 2023LLaMA-Reviewer: Advancing Code Review Automation with Large Language Models through Parameter-Efficient Fine-Tuningcited by 47
- 2019Retrieve and Refine: Exemplar-based Neural Comment Generationcited by 36
- 2016Incorporating Discrete Translation Lexicons into Neural Machine Translationcited by 33
- 2022AUGER: Automatically Generating Review Comments with Pre-training Modelscited by 23
- 2023EditSum: A Retrieve-and-Edit Framework for Source Code Summarizationcited by 18
- 2023Generation-based Code Review Automation: How Far Are We?cited by 9
- 2024Retrieval-Augmented Test Generation: How Far Are We?cited by 7
- 2021Understanding Code Smell Detection via Code Review: A Study of the OpenStack Communitycited by 2
Built on by
Citing papers per year: 2025: 2; 2026: 4.
6 papers.
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 13
- 2026RovoDev Code Reviewer: A Large-Scale Online Evaluation of LLM-based Code Review Automation at Atlassiancited by 6
- 2025When More Retrieval Hurts: Retrieval-Augmented Code Review Generationcited by 2
- 2026Q-Bridge: Code Translation for Quantum Machine Learning via LLMscited by 1
- 2026OpenCodeReview: Determinism over Non-Determinism for Cost-Effective Agent-Based Code Reviewcited by 0
- 2026From Static to Dynamic: Benchmarking Real-World Code Review with MCR-Benchcited by 0
- 2026From Static to Dynamic: Benchmarking Real-World Code Review with MCR-Bench27 Aug 2026
- 2026OpenCodeReview: Determinism over Non-Determinism for Cost-Effective Agent-Based Code Review10 Aug 2026
- 2026Q-Bridge: Code Translation for Quantum Machine Learning via LLMs29 Mar 2026
- 2026RovoDev Code Reviewer: A Large-Scale Online Evaluation of LLM-based Code Review Automation at Atlassian3 Jan 2026
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025When More Retrieval Hurts: Retrieval-Augmented Code Review Generation7 Nov 2025
Similar, not cited
Close in wording, no citation either way
- 2025When Retriever Meets Generator: A Joint Model for Code Comment Generation ↗
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches
- 2025LAURA: Enhancing Code Review Generation with Context-Enriched Retrieval-Augmented LLM
- 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?
- 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunities
- 2024Context-Augmented Code Generation Using Programming Knowledge Graphs
- 2026Rethinking Training Data for Generating Code Review Comments
- 2025SACL: Understanding and Combating Textual Bias in Code Retrieval with Semantic-Augmented Reranking and Localization