mlsanityData to 7 Oct 2026

Understanding the Fundamental Design Decisions of Retrieval-Augmented Generation Systems

arXiv 2411.19463 ↗First posted 29 Nov 2024cs.SE cs.AIcited by 7

On the map: Retrieval-augmented generation → RAG pipeline design and evaluation

Abstract (arXiv)

Retrieval-Augmented Generation (RAG) has emerged as a critical technique for enhancing large language model (LLM) capabilities. However, practitioners face significant challenges when making RAG deployment decisions. While existing research prioritizes algorithmic innovations, a systematic gap persists in understanding fundamental engineering trade-offs that determine RAG success. We present the first comprehensive study of three universal RAG deployment decisions: whether to deploy RAG, how much information to retrieve, and how to integrate retrieved knowledge effectively. Through systematic experiments across three LLMs and six datasets spanning question answering and code generation tasks, we reveal critical insights: (1) RAG deployment must be highly selective, with variable recall thresholds and failure modes affecting up to 12.6% of samples even with perfect documents. (2) Optimal retrieval volume exhibits task-dependent behavior QA tasks show universal patterns (5-10 documents optimal) while code generation requires scenario-specific optimization. (3) Knowledge integration effectiveness depends on task and model characteristics, with code generation benefiting significantly from prompting methods while question answering shows minimal improvement. These findings demonstrate that universal RAG strategies prove inadequate. Effective RAG systems require context-aware design decisions based on task characteristics and model capabilities. Our analysis provides evidence-based guidance for practitioners and establishes foundational insights for principled RAG deployment. Our code, data and artifacts are publicly available at https://github.com/ShengmingZ/RAGBenchmarkCodeQA.

Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Placed in RAG pipeline design and evaluation, one of 15 directions in Retrieval-augmented generation. Builds on 60 of its 89 references that are in the map. First posted on arXiv 29 Nov 2024.

Builds on

60 of 89 references.

Closest ancestors · 7

Same direction, newest first

  1. 2024Retrieval Augmented Generation (RAG) and Beyond: A Comprehensive Survey on How to Make your LLMs use External Data More Wisely23 Sep
  2. 2024RAGChecker: A Fine-grained Framework for Diagnosing Retrieval-Augmented Generation15 Aug
  3. 2024A Tale of Trust and Accuracy: Base vs. Instruct LLMs in RAG Systems21 Jun
  4. 2024Evaluation of Retrieval-Augmented Generation: A Survey13 May
  5. 2024A Survey on RAG Meeting LLMs: Towards Retrieval-Augmented Large Language Models10 May
  6. 2024The Power of Noise: Redefining Retrieval for RAG Systems26 Jan
  7. 2024Seven Failure Points When Engineering a Retrieval Augmented Generation System11 Jan

Other references · 53

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  3. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
  4. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  6. 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
  7. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
  8. 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
  9. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  10. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,317
  11. 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 2,895
  12. 2023Code Llama: Open Foundation Models for Codecited by 2,105
38 more
  1. 2021Unsupervised Dense Information Retrieval with Contrastive Learningcited by 1,203
  2. 2022Interleaving Retrieval with Chain-of-Thought Reasoning for Knowledge-Intensive Multi-Step Questionscited by 911
  3. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  4. 2023Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning by Large Language Modelscited by 550
  5. 2023Active Retrieval Augmented Generationcited by 506
  6. 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 442
  7. 2024A Systematic Survey of Prompt Engineering in Large Language Models: Techniques and Applicationscited by 428
  8. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
  9. 2024Benchmarking Retrieval-Augmented Generation for Medicinecited by 326
  10. 2023Chain-of-Note: Enhancing Robustness in Retrieval-Augmented Language Modelscited by 180
  11. 2018Learning to Mine Aligned Code and Natural Language Pairs from Stack Overflowcited by 165
  12. 2020Challenges in Deploying Machine Learning: a Survey of Case Studiescited by 151
  13. 2022DocPrompting: Generating Code by Retrieving the Docscited by 151
  14. 2023Large Language Models Understand and Can be Enhanced by Emotional Stimulicited by 143
  15. 2023CodePlan: Repository-level Coding using LLMs and Planningcited by 139
  16. 2022ReACC: A Retrieval-Augmented Code Completion Frameworkcited by 117
  17. 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
  18. 2024Reducing hallucination in structured outputs via Retrieval-Augmented Generationcited by 92
  19. 2019Taxonomy of Real Faults in Deep Learning Systemscited by 90
  20. 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?cited by 89
  21. 2022CERT: Continual Pre-Training on Sketches for Library-Oriented Code Generationcited by 87
  22. 2024Searching for Best Practices in Retrieval-Augmented Generationcited by 83
  23. 2024Enhancing LLM Factual Accuracy with RAG to Counter Hallucinations: A Case Study on Domain-Specific Queries in Private Knowledge-Basescited by 76
  24. 2019A Comprehensive Study on Deep Learning Bug Characteristicscited by 65
  25. 2021Collaboration Challenges in Building ML-Enabled Systems: Communication, Documentation, Engineering, and Processcited by 56
  26. 2024Calibration and Correctness of Language Models for Codecited by 49
  27. 2024A Survey of Prompt Engineering Methods in Large Language Models for Different NLP Taskscited by 46
  28. 2023SkCoder: A Sketch-based Approach for Automatic Code Generationcited by 40
  29. 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Modelcited by 40
  30. 2024UniMS-RAG: A Unified Multi-source Retrieval-Augmented Generation for Personalized Dialogue Systemscited by 38
  31. 2020Adoption and Effects of Software Engineering Best Practices in Machine Learningcited by 33
  32. 2024Prompting Techniques for Secure Code Generation: A Systematic Investigationcited by 33
  33. 2024REAR: A Relevance-Aware Retrieval-Augmented Framework for Open-Domain Question Answeringcited by 28
  34. 2022Toward Understanding Deep Learning Framework Bugscited by 26
  35. 2021An Empirical Study on Deployment Faults of Deep Learning Based Mobile Applicationscited by 20
  36. 2023Domain Adaptive Code Completion via Language Models and Decoupled Domain Databasescited by 19
  37. 2022Bugs in Machine Learning-based Systems: A Faultload Benchmarkcited by 15
  38. 2024Are LLMs Correctly Integrated into Software Systems?cited by 13

50 most cited of 53 All 53 (JSON)

Built on by

Cited by year (2026 to 7 Oct)

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

7 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Mapping the RAG Landscape: A Four Axis Taxonomy of Efficiency, Defense, Interactivity, and Reasoning
  2. 2025Enhancing Retrieval-Augmented Generation: A Study of Best Practices
  3. 2024Toward Optimal Search and Retrieval for RAG
  4. 2024A Comprehensive Survey of Retrieval-Augmented Generation (RAG): Evolution, Current Landscape and Future Directions
  5. 2025A Systematic Review of Key Retrieval-Augmented Generation (RAG) Systems: Progress, Gaps, and Future Directions
  6. 2024Deploying Large Language Models With Retrieval Augmented Generation
  7. 2024Optimizing and Evaluating Enterprise Retrieval-Augmented Generation (RAG): A Content Design Perspective
  8. 2025Dynamic and Parametric Retrieval-Augmented Generation