SEMar 24

When More Retrieval Hurts: Retrieval-Augmented Code Review Generation

arXiv:2511.0530247.3h-index: 6
AI Analysis

This addresses the issue of generic or off-point code reviews for developers, though it is incremental as it builds on existing retrieval-augmented methods.

The paper tackles the problem of generating code reviews by proposing a retrieval-augmented framework that uses historical reviews as in-context examples, finding that it outperforms baselines with BLEU-4 scores of 12.32 and 12.96, but more retrieval can degrade performance due to redundancy and conflicts.

Code review generation can reduce developer effort by producing concise, reviewer-style feedback for a given code snippet or code change. However, generation-only models often produce generic or off-point reviews, while retrieval-only methods struggle to adapt well to new contexts. In this paper, we view retrieval augmentation for code review as retrieval-augmented in-context learning, where retrieved historical reviews are placed in the input context as examples that guide the model's output. Based on this view, we propose RARe (Retrieval-Augmented Code Reviewer), a framework that retrieves relevant historical reviews from a corpus and conditions a large language model on the retrieved in-context examples. Experiments on two public benchmarks show that RARe outperforms strong baselines and reaches BLEU-4 scores of 12.32 and 12.96. A key finding is that more retrieval can hurt: using only the top-1 retrieved example works best, while adding more retrieved items can degrade performance due to redundancy and conflicting cues under limited context budgets. Human evaluation and interpretability analysis further support that retrieval-augmented generation reduces generic outputs and improves review focus.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes