Towards Understanding Systems Trade-offs in Retrieval-Augmented Generation Model Inference
Michael Shen, Muhammad Umar, Kiwan Maeng, G. Edward Suh, Udit Gupta
TL;DR
This paper provides a systems-oriented examination of retrieval-augmented generation (RAG) for large language models, framing a taxonomy of the RAG pipeline and building an extensible framework to study latency, throughput, and memory across offline datastore construction and online inference. Key findings show that retrieval adds substantial overhead, notably in TTFT latency and end-to-end latency, with retrieval strategy and index choice driving large accuracy–latency trade-offs. Memory and scalability emerge as critical constraints: memory-heavy indices deliver higher recall but require terabytes of memory, while memory-efficient options reduce memory use at recall costs, and datastore size can dramatically reduce throughput, motivating distributed retrieval and careful design. The work outlines concrete directions for system-level optimizations, including future exploration of sparse retrievers, query transformations, re-ranking, and end-to-end evaluation to enable practical, efficient production deployment of RAG-based LLMs.
Abstract
The rapid increase in the number of parameters in large language models (LLMs) has significantly increased the cost involved in fine-tuning and retraining LLMs, a necessity for keeping models up to date and improving accuracy. Retrieval-Augmented Generation (RAG) offers a promising approach to improving the capabilities and accuracy of LLMs without the necessity of retraining. Although RAG eliminates the need for continuous retraining to update model data, it incurs a trade-off in the form of slower model inference times. Resultingly, the use of RAG in enhancing the accuracy and capabilities of LLMs often involves diverse performance implications and trade-offs based on its design. In an effort to begin tackling and mitigating the performance penalties associated with RAG from a systems perspective, this paper introduces a detailed taxonomy and characterization of the different elements within the RAG ecosystem for LLMs that explore trade-offs within latency, throughput, and memory. Our study reveals underlying inefficiencies in RAG for systems deployment, that can result in TTFT latencies that are twice as long and unoptimized datastores that consume terabytes of storage.
