NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusion

Jiayi Yao, Hanchen Li, Yuhan Liu, Siddhant Ray, Yihua Cheng, Qizheng Zhang, Kuntai Du, Shan Lu, Junchen Jiang

Serving Large Language Models (LLMs) for Retrieval-Augmented Generation (RAG) is a balancing act between speed and accuracy. While RAG provides models with the necessary context to answer complex queries, the "prefill" phase—where the model processes this context to generate Key-Value (KV) caches—is a major latency bottleneck.

CacheBlend introduces a novel way to fuse pre-computed KV caches from multiple text chunks, achieving the speed of simple cache reuse with the rigorous quality of a full recomputation.

TL;DR

CacheBlend is a system that speeds up RAG by intelligently merging pre-computed KV caches of retrieved text chunks. By selectively recomputing only a small fraction (~15%) of tokens to account for inter-chunk dependencies, it reduces Time-to-First-Token (TTFT) by up to 3.3x and boosts throughput by up to 5x with negligible loss in generation quality.

What Problem Does This Paper Address?

In RAG, a user query is typically prepended with several relevant text chunks retrieved from a database. Before the LLM can generate a single word, it must perform a "prefill" operation on this entire combined input. For long contexts, this is incredibly slow.

Existing solutions fall short:

  1. Prefix Caching: Only reuses the cache for the very first chunk (the prefix). If you have five retrieved chunks, four still require expensive recomputation.
  2. Full KV Reuse: Simply concatenates pre-computed caches for all chunks. While fast, this ignores cross-attention—the way tokens in one chunk need to "attend" to tokens in preceding chunks to understand the full context.

As shown in the figure below, ignoring cross-attention leads to a massive drop in quality, often resulting in the model "rambling" or giving incorrect answers because it cannot connect facts across different chunks.

Contrasting different KV cache strategies. Full KV reuse (c) is fast but low quality, while CacheBlend (d) aims for the best of both worlds.

Methods

The authors propose selective KV recompute. The core idea is that you don't need to recompute the entire KV cache to account for cross-attention; recomputing a small, strategically chosen subset of tokens is enough.

The CacheBlend Workflow:

  • Gradual Filtering: CacheBlend identifies "High-KV-Deviation" (HKVD) tokens—those whose pre-computed values differ most from what they would be in a full prefill. It recomputes all tokens on the first layer, identifies the most deviant ones, and then only recomputes a shrinking subset of these tokens in subsequent layers.
  • Pipelining: The system parallelizes the partial KV update of one layer with the fetching of the next layer's KV cache from storage (like an SSD or RAM) into GPU memory. This effectively hides the computational overhead of the recompute.
  • Loading Controller: An automated controller chooses the optimal recompute ratio and storage device to ensure that the recomputation time never exceeds the loading time, maintaining a smooth, low-latency pipeline.

Datasets

The researchers evaluated CacheBlend across four diverse datasets to test reasoning and summarization:

  • 2WikiMQA & Musique: Multi-hop question-answering datasets that require the model to synthesize information across multiple documents.
  • SAMSum & MultiNews: Datasets focused on dialogue and news summarization.
  • Extended Versions: The authors created synthetic "extended" versions of the QA datasets to simulate high-volume chunk reuse scenarios typical in production RAG systems.

Key Insights and Ideas

  • Attention Sparsity is a Superpower: The researchers found that in most layers, only 10-15% of tokens have significant cross-attention with other chunks. Recomputing just these "heavy hitters" recovers nearly all the model's accuracy.
  • Cross-Layer Correlation: A key "aha moment" was discovering that tokens with high deviation in one layer are highly likely to remain deviant in the next. This allows for the efficient "gradual filtering" mechanism that avoids checking every token on every layer.
  • Quality vs. Quantity: As shown in Figure 2, generation quality improves as more chunks are retrieved, but only if cross-attention is preserved. Without it, adding more context can actually hurt performance.
Generation quality (F1-score) improves with more chunks only when cross-attention is maintained.

Key Results

CacheBlend was tested on Mistral-7B, Yi-34B, and Llama-70B, showing impressive gains:

  • Latency: Reduced TTFT by 2.2x to 3.3x compared to a full prefill.
  • Throughput: Increased inference throughput by 2.8x to 5x.
  • Accuracy: Maintained generation quality within 0.01-0.03 of the "gold standard" full prefill (measured by F1 and Rouge-L scores), vastly outperforming simple KV reuse methods.
  • Hardware Efficiency: The pipelining approach allows KV caches to be stored on cheaper, slower NVMe SSDs without increasing user-perceived latency.

Limitations and Future Work

While highly effective, the authors note a few areas for further exploration:

  • Architecture Scope: The current insights are tailored to Transformer-based models. It remains to be seen how CacheBlend applies to emerging non-Transformer architectures like Mamba.
  • Quantization: The study primarily used 8-bit quantization; the impact on more aggressive 2-bit or 4-bit quantized KV caches is a candidate for future study.
  • Distributed Systems: The current implementation focuses on single-node serving. Extending this to share fused caches across a cluster of compute nodes is a logical next step.

For those interested in the implementation, the code is available at github.com/LMCache/LMCache.

Summary updated

BibTeX
@inproceedings{yao2025cacheblend,
  author = {Jiayi Yao and Hanchen Li and Yuhan Liu and Siddhant Ray and Yihua Cheng and Qizheng Zhang and Kuntai Du and Shan Lu and Junchen Jiang},
  title = {{CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusion}},
  booktitle = {EuroSys},
  year = {2025},
  doi = {10.1145/3689031.3696098},
}
Figure