Understanding the Fundamental Design Decisions of Retrieval-Augmented Generation Systems
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
- 2024Retrieval Augmented Generation (RAG) and Beyond: A Comprehensive Survey on How to Make your LLMs use External Data More Wisely23 Sep
- 2024RAGChecker: A Fine-grained Framework for Diagnosing Retrieval-Augmented Generation15 Aug
- 2024A Tale of Trust and Accuracy: Base vs. Instruct LLMs in RAG Systems21 Jun
- 2024Evaluation of Retrieval-Augmented Generation: A Survey13 May
- 2024A Survey on RAG Meeting LLMs: Towards Retrieval-Augmented Large Language Models10 May
- 2024The Power of Noise: Redefining Retrieval for RAG Systems26 Jan
- 2024Seven Failure Points When Engineering a Retrieval Augmented Generation System11 Jan
Other references · 53
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
- 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,317
- 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 2,895
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
38 more
- 2021Unsupervised Dense Information Retrieval with Contrastive Learningcited by 1,203
- 2022Interleaving Retrieval with Chain-of-Thought Reasoning for Knowledge-Intensive Multi-Step Questionscited by 911
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2023Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning by Large Language Modelscited by 550
- 2023Active Retrieval Augmented Generationcited by 506
- 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 442
- 2024A Systematic Survey of Prompt Engineering in Large Language Models: Techniques and Applicationscited by 428
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
- 2024Benchmarking Retrieval-Augmented Generation for Medicinecited by 326
- 2023Chain-of-Note: Enhancing Robustness in Retrieval-Augmented Language Modelscited by 180
- 2018Learning to Mine Aligned Code and Natural Language Pairs from Stack Overflowcited by 165
- 2020Challenges in Deploying Machine Learning: a Survey of Case Studiescited by 151
- 2022DocPrompting: Generating Code by Retrieving the Docscited by 151
- 2023Large Language Models Understand and Can be Enhanced by Emotional Stimulicited by 143
- 2023CodePlan: Repository-level Coding using LLMs and Planningcited by 139
- 2022ReACC: A Retrieval-Augmented Code Completion Frameworkcited by 117
- 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
- 2024Reducing hallucination in structured outputs via Retrieval-Augmented Generationcited by 92
- 2019Taxonomy of Real Faults in Deep Learning Systemscited by 90
- 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?cited by 89
- 2022CERT: Continual Pre-Training on Sketches for Library-Oriented Code Generationcited by 87
- 2024Searching for Best Practices in Retrieval-Augmented Generationcited by 83
- 2024Enhancing LLM Factual Accuracy with RAG to Counter Hallucinations: A Case Study on Domain-Specific Queries in Private Knowledge-Basescited by 76
- 2019A Comprehensive Study on Deep Learning Bug Characteristicscited by 65
- 2021Collaboration Challenges in Building ML-Enabled Systems: Communication, Documentation, Engineering, and Processcited by 56
- 2024Calibration and Correctness of Language Models for Codecited by 49
- 2024A Survey of Prompt Engineering Methods in Large Language Models for Different NLP Taskscited by 46
- 2023SkCoder: A Sketch-based Approach for Automatic Code Generationcited by 40
- 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Modelcited by 40
- 2024UniMS-RAG: A Unified Multi-source Retrieval-Augmented Generation for Personalized Dialogue Systemscited by 38
- 2020Adoption and Effects of Software Engineering Best Practices in Machine Learningcited by 33
- 2024Prompting Techniques for Secure Code Generation: A Systematic Investigationcited by 33
- 2024REAR: A Relevance-Aware Retrieval-Augmented Framework for Open-Domain Question Answeringcited by 28
- 2022Toward Understanding Deep Learning Framework Bugscited by 26
- 2021An Empirical Study on Deployment Faults of Deep Learning Based Mobile Applicationscited by 20
- 2023Domain Adaptive Code Completion via Language Models and Decoupled Domain Databasescited by 19
- 2022Bugs in Machine Learning-based Systems: A Faultload Benchmarkcited by 15
- 2024Are LLMs Correctly Integrated into Software Systems?cited by 13
50 most cited of 53 All 53 (JSON)
Built on by
Citing papers per year: 2025: 5; 2026: 2.
7 papers.
- 2025Hybrid Retrieval for Hallucination Mitigation in Large Language Models: A Comparative Analysiscited by 5
- 2026Memory Bank Compression for Continual Adaptation of Large Language Modelscited by 4
- 2026Taxonomy of the Retrieval System Framework: Pitfalls and Paradigmscited by 4
- 2025Balancing Content Size in RAG-Text2SQL Systemcited by 2
- 2025Isolating Language-Coding from Problem-Solving: Benchmarking LLMs with PseudoEvalcited by 2
- 2025Quality Assurance for LLM-RAG Systems: Empirical Insights from Tourism Application Testingcited by 0
- 2025Comparative Analysis of Neural Retriever-Reranker Pipelines for Retrieval-Augmented Generation over Knowledge Graphs in E-commerce Applicationscited by 0
- 2026Taxonomy of the Retrieval System Framework: Pitfalls and Paradigms27 Jan 2026
- 2026Memory Bank Compression for Continual Adaptation of Large Language Models2 Jan 2026
- 2025Comparative Analysis of Neural Retriever-Reranker Pipelines for Retrieval-Augmented Generation over Knowledge Graphs in E-commerce Applications14 Dec 2025
- 2025Hybrid Retrieval for Hallucination Mitigation in Large Language Models: A Comparative Analysis28 Feb 2025
- 2025Isolating Language-Coding from Problem-Solving: Benchmarking LLMs with PseudoEval26 Feb 2025
- 2025Quality Assurance for LLM-RAG Systems: Empirical Insights from Tourism Application Testing9 Feb 2025
- 2025Balancing Content Size in RAG-Text2SQL System28 Jan 2025
Similar, not cited
Close in wording, no citation either way
- 2026Mapping the RAG Landscape: A Four Axis Taxonomy of Efficiency, Defense, Interactivity, and Reasoning
- 2025Enhancing Retrieval-Augmented Generation: A Study of Best Practices
- 2024Toward Optimal Search and Retrieval for RAG
- 2024A Comprehensive Survey of Retrieval-Augmented Generation (RAG): Evolution, Current Landscape and Future Directions
- 2025A Systematic Review of Key Retrieval-Augmented Generation (RAG) Systems: Progress, Gaps, and Future Directions
- 2024Deploying Large Language Models With Retrieval Augmented Generation
- 2024Optimizing and Evaluating Enterprise Retrieval-Augmented Generation (RAG): A Content Design Perspective
- 2025Dynamic and Parametric Retrieval-Augmented Generation