mlsanityData to 7 Oct 2026

Retrieval-Augmented Code Review Comment Generation

arXiv 2506.11591 ↗First posted 13 Jun 2025cs.SEcited by 6

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

  1. 2024Improving Retrieval-Augmented Code Comment Generation by Retrieving for Generation7 Aug
  2. 2022ReACC: A Retrieval-Augmented Code Completion Framework15 Mar
  3. 2021Retrieval Augmented Code Generation and Summarization26 Aug

Other references · 26

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  5. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  6. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
  7. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
  8. 2014Sequence to Sequence Learning with Neural Networkscited by 2,974
  9. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  10. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  11. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
  12. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
14 more
  1. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
  2. 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 327
  3. 2023InferFix: End-to-End Program Repair with LLMscited by 113
  4. 2018Guiding Neural Machine Translation with Retrieved Translation Piecescited by 63
  5. 2022Using Pre-Trained Models to Boost Code Review Automationcited by 63
  6. 2021Towards Automating Code Review Activitiescited by 54
  7. 2023LLaMA-Reviewer: Advancing Code Review Automation with Large Language Models through Parameter-Efficient Fine-Tuningcited by 47
  8. 2019Retrieve and Refine: Exemplar-based Neural Comment Generationcited by 36
  9. 2016Incorporating Discrete Translation Lexicons into Neural Machine Translationcited by 33
  10. 2022AUGER: Automatically Generating Review Comments with Pre-training Modelscited by 23
  11. 2023EditSum: A Retrieve-and-Edit Framework for Source Code Summarizationcited by 18
  12. 2023Generation-based Code Review Automation: How Far Are We?cited by 9
  13. 2024Retrieval-Augmented Test Generation: How Far Are We?cited by 7
  14. 2021Understanding Code Smell Detection via Code Review: A Study of the OpenStack Communitycited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 2; 2026: 4.

6 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025When Retriever Meets Generator: A Joint Model for Code Comment Generation ↗
  2. 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches
  3. 2025LAURA: Enhancing Code Review Generation with Context-Enriched Retrieval-Augmented LLM
  4. 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?
  5. 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunities
  6. 2024Context-Augmented Code Generation Using Programming Knowledge Graphs
  7. 2026Rethinking Training Data for Generating Code Review Comments
  8. 2025SACL: Understanding and Combating Textual Bias in Code Retrieval with Semantic-Augmented Reranking and Localization