RAGCache: Efficient Knowledge Caching for Retrieval-Augmented Generation
Chao Jin, Zili Zhang, Xuanlin Jiang, Fangyue Liu, Xin Liu, Xuanzhe, Liu, Xin Jin

TL;DR
RAGCache introduces a multilevel caching system that significantly reduces latency and improves throughput in retrieval-augmented generation by caching knowledge states and overlapping retrieval with inference.
Contribution
It presents a novel dynamic caching system with a knowledge tree structure and a retrieval-aware replacement policy for RAG systems.
Findings
Reduces time to first token by up to 4x.
Improves throughput by up to 2.1x.
Optimizes RAG performance with dynamic knowledge caching.
Abstract
Retrieval-Augmented Generation (RAG) has shown significant improvements in various natural language processing tasks by integrating the strengths of large language models (LLMs) and external knowledge databases. However, RAG introduces long sequence generation and leads to high computation and memory costs. We propose RAGCache, a novel multilevel dynamic caching system tailored for RAG. Our analysis benchmarks current RAG systems, pinpointing the performance bottleneck (i.e., long sequence due to knowledge injection) and optimization opportunities (i.e., caching knowledge's intermediate states). Based on these insights, we design RAGCache, which organizes the intermediate states of retrieved knowledge in a knowledge tree and caches them in the GPU and host memory hierarchy. RAGCache proposes a replacement policy that is aware of LLM inference characteristics and RAG retrieval patterns.…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTopic Modeling · Caching and Content Delivery · Recommender Systems and Techniques
MethodsAttention Is All You Need · Weight Decay · Byte Pair Encoding · Refunds@Expedia|||How do I get a full refund from Expedia? · Dense Connections · Residual Connection · Softmax · Adam · Attentive Walk-Aggregating Graph Neural Network · Linear Warmup With Linear Decay
