Abstract
Retrieval-augmented generation (RAG) extends large language models (LLMs) with external data sources to enhance factual correctness and domain coverage. Modern RAG pipelines rely on large datastores, leading to system challenges in latency-sensitive deployments, especially when limited GPU memory is available. To address these challenges, we propose TeleRAG, an efficient inference system that reduces RAG latency with minimal GPU memory requirements. The core innovation of TeleRAG is lookahead retrieval, a prefetching mechanism that anticipates required data and transfers it from CPU to GPU in parallel with LLM generation. By leveraging the modularity of RAG pipelines, the inverted file index (IVF) search algorithm, and similarities between queries, TeleRAG optimally overlaps data movement and computation. Experimental results show that TeleRAG reduces end-to-end RAG inference latency by up to 1.72x on average compared to state-of-the-art systems, enabling faster, more memory-efficient deployments of advanced RAG applications.
Introduction
Retrieval-Augmented Generation (RAG) has become a cornerstone for deploying Large Language Models (LLMs) in knowledge-intensive tasks. By retrieving relevant documents from an external corpus, RAG mitigates hallucinations and provides up-to-date information. However, as corpora grow to hundreds of gigabytes, a significant "memory-latency" trade-off emerges. Storing the entire index in GPU memory is often cost-prohibitive, while offloading to CPU memory introduces severe latency bottlenecks due to PCIe transfer speeds. TeleRAG addresses this by "looking ahead" to prefetch data, effectively hiding retrieval latency.
Lookahead Retrieval
The primary contribution of TeleRAG is the Lookahead Retrieval mechanism. In advanced RAG pipelines, an LLM often performs "pre-retrieval generation" to refine or expand a user's initial query ($q_{in}$) into a more precise query ($q_{out}$). TeleRAG exploits the semantic overlap between these two queries.
As illustrated in Figure 2, while the LLM is busy generating the refined query, TeleRAG uses the initial query to predict which data clusters in the Inverted File Index (IVF) are likely to be needed. It then asynchronously prefetches these clusters from CPU to GPU memory using Direct Memory Access (DMA). This strategy ensures that the data transfer cost is effectively "hidden" behind the LLM's computation time, optimizing the use of available hardware resources.
System Architecture
TeleRAG is designed to handle large-scale vector indices efficiently. The system architecture consists of a Vector Index component and a RAG Application flow that coordinates the prefetching and retrieval steps.
The retrieval process follows a hybrid approach:
- Predict & Prefetch: The initial query identifies target centroids in the IVF index. The system prefetches as much data as the LLM generation time allows.
- Hybrid Search: Once the refined query is available, TeleRAG searches the prefetched clusters on the GPU. If the refined query requires clusters not yet on the GPU, a concurrent search is performed on the CPU as a safety net.
- GPU-Accelerated Sorting: Results from both GPU and CPU searches are merged and sorted on the GPU to ensure high-speed ranking before being passed back to the LLM for post-retrieval generation.
Experimental Evaluation
TeleRAG was evaluated using a 61 GB Wikipedia datastore (21 million chunks) and standard QA datasets including NQ, HotpotQA, and TriviaQA. This setup represents a realistic scenario where the datastore exceeds the memory capacity of consumer-grade GPUs.
Key Results
- Latency Reduction: On a single NVIDIA RTX 4090, TeleRAG achieved up to a 1.53× reduction in end-to-end latency compared to typical CPU-offloaded baselines.
- Throughput Gains: In batched inference scenarios (batch size 8), the system demonstrated a 1.83× improvement in throughput.
- Scalability: In multi-GPU environments (e.g., NVIDIA H200), TeleRAG's cache-aware scheduler enabled near-linear scaling, reaching a 3.8× speedup on 4 GPUs.
- Efficiency: The system successfully ran a 61 GB datastore alongside a Llama-3-8B model on a single 24 GB GPU, maintaining high performance despite the memory constraints.
Conclusion
TeleRAG addresses the retrieval bottleneck in RAG systems by overlapping data movement with LLM computation. By utilizing the semantic "hint" provided by initial user queries, it enables low-latency, high-throughput inference even on hardware with limited GPU memory. This approach makes advanced, large-scale RAG applications more accessible and efficient for real-world deployment, providing a scalable solution for memory-constrained environments.
Summary updated