mlsanityData to 7 Oct 2026

Not All RAGs Are Created Equal: A Component-Wise Empirical Study for Software Engineering Tasks

arXiv 2605.14503 ↗First posted 14 May 2026cs.SEcited by 1

On the map: Retrieval-augmented generation → RAG for code

Abstract (arXiv)

While Retrieval-Augmented Generation (RAG) is increasingly adopted to ground Large Language Models (LLMs) in software artifacts, the optimal configuration of its components remains an open question for software engineering (SE) tasks. The lack of systematic guidance forces practitioners into costly, ad-hoc experimentation. This paper presents a comprehensive, component-wise empirical study that dissects the RAG pipeline, evaluating over 21 distinct models and methods. Our study systematically isolates and evaluates 4 query processing techniques, 7 retrieval models spanning sparse, dense, and hybrid paradigms, 4 context refinement methods, and 6 distinct generators. We test these components on a suite of 3 core SE tasks: code generation, summarization, and repair. Our empirical findings reveal a crucial insight: the retriever-side components, particularly the choice of the retrieval algorithm, often exert a more significant influence on final system performance than the selection of the generator model. Strikingly, the classic lexical retriever BM25 demonstrates exceptionally robust performance across diverse tasks. Our analysis provides a practical, data-driven roadmap for researchers and practitioners, offering clear guidance on prioritizing optimization efforts when constructing effective RAG systems for software engineering contexts.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Placed in RAG for code, one of 15 directions in Retrieval-augmented generation. Builds on 40 of its 54 references that are in the map. First posted on arXiv 14 May 2026.

Builds on

40 of 54 references.

Closest ancestors · 4

Same direction, newest first

  1. 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyond26 Mar
  2. 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunities23 Jan
  3. 2022ReACC: A Retrieval-Augmented Code Completion Framework15 Mar
  4. 2021Retrieval Augmented Code Generation and Summarization26 Aug

Other references · 36

  1. 2024The Llama 3 Herd of Modelscited by 14,192
  2. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  4. 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,203
  5. 2024Qwen2.5 Technical Reportcited by 4,713
  6. 2019Unsupervised Cross-lingual Representation Learning at Scalecited by 3,907
  7. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
  8. 2017Billion-scale similarity search with GPUscited by 2,477
  9. 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 1,906
  10. 2024Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phonecited by 1,883
  11. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  12. 2022Text Embeddings by Weakly-Supervised Contrastive Pre-trainingcited by 1,216
24 more
  1. 2020Leveraging Passage Retrieval with Generative Models for Open Domain Question Answeringcited by 1,203
  2. 2025Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Modelscited by 1,175
  3. 2024M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillationcited by 1,050
  4. 2021Measuring Coding Challenge Competence With APPScited by 879
  5. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  6. 2023Towards General Text Embeddings with Multi-stage Contrastive Learningcited by 705
  7. 2019Passage Re-ranking with BERTcited by 629
  8. 2022Precise Zero-Shot Dense Retrieval without Relevance Labelscited by 508
  9. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
  10. 2023LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compressioncited by 443
  11. 2023Is ChatGPT Good at Search? Investigating Large Language Models as Re-Ranking Agentscited by 356
  12. 2023Improving Text Embeddings with Large Language Modelscited by 295
  13. 2023RECOMP: Improving Retrieval-Augmented LMs with Compression and Selective Augmentationcited by 253
  14. 2018code2vec: Learning Distributed Representations of Codecited by 249
  15. 2022DocPrompting: Generating Code by Retrieving the Docscited by 151
  16. 2024Granite Code Models: A Family of Open Foundation Models for Code Intelligencecited by 116
  17. 2023Jina Embeddings 2: 8192-Token General-Purpose Text Embeddings for Long Documentscited by 103
  18. 2024Searching for Best Practices in Retrieval-Augmented Generationcited by 83
  19. 2024DebugBench: Evaluating Debugging Capability of Large Language Modelscited by 74
  20. 2022No More Fine-Tuning? An Experimental Evaluation of Prompt Tuning in Code Intelligencecited by 41
  21. 2024Do Large Language Models Rank Fairly? An Empirical Study on the Fairness of LLMs as Rankerscited by 17
  22. 2023Understanding Difficulty-based Sample Weighting with a Universal Difficulty Measurecited by 9
  23. 2024Retrieval-Augmented Test Generation: How Far Are We?cited by 7
  24. 2025Knowledge Graph Based Repository-Level Code Generationcited by 4

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2025A Deep Dive into Retrieval-Augmented Generation for Code Completion: Experience on WeChat
  2. 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?
  3. 2024A Methodology for Evaluating RAG Systems: A Case Study On Configuration Dependency Validation
  4. 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches
  5. 2024Understanding the Fundamental Design Decisions of Retrieval-Augmented Generation Systems
  6. 2024Seven Failure Points When Engineering a Retrieval Augmented Generation System
  7. 2024Evaluating the Effectiveness and Efficiency of Demonstration Retrievers in RAG for Coding Tasks
  8. 2026Mapping the RAG Landscape: A Four Axis Taxonomy of Efficiency, Defense, Interactivity, and Reasoning