CacheWeaver: Cache-Aware Evidence Ordering for Efficient Grounded RAG Inference

Kaizhen Tan, Rong Gu, Mingyuan Li
6/18/2026
cs.CL
rag

No confident code implementation found for this paper.

Abstract

Retrieval-Augmented Generation (RAG) improves factual grounding, but it also lengthens prompts and raises prefill cost. Prefix caching in serving engines such as vLLM reduces this cost only when requests share the same token prefix. In grounded generation, however, adjacent queries may retrieve overlapping evidence in different orders, so set overlap does not become reusable prefix overlap. We present CacheWeaver, a lightweight prompt-layer method for cache-aware evidence ordering. The method keeps a prefix tree over recently served evidence sequences and uses a greedy walk to place the most reusable prefix first, while leaving the serving engine and retrieved evidence set unchanged. Across three vLLM configurations, the method lowers median time-to-first-token (TTFT) by about 20-33 percent relative to retrieval-order prefix caching, without hurting answer quality in our QA tests. The greedy policy reaches 97.5 percent of the median TTFT gain from oracle ordering, indicating that most reusable prefix locality can be recovered by a simple scheduling layer between retrieval and inference.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{tan2026cacheweaver,
  title  = {CacheWeaver: Cache-Aware Evidence Ordering for Efficient Grounded RAG Inference},
  author = {Kaizhen Tan and Rong Gu and Mingyuan Li},
  year   = {2026},
  eprint = {2606.19667},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.19667v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2606.19667.svg)](https://codeofpaper.com/paper/2606.19667)

Discussion