arXiv(opens in a new tab)cs.CLOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.13060

KV-Repurpose: A Testbed for Evaluating Non-Prefix KV-Cache Reuse

Taiga Ikeda, Daisuke Miyashita, Jun Deguchi

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

KV-cache reuse in large language model serving is commonly limited to exact prompt prefixes, preventing reuse when the same retrieved document appears after different system prompts, conversation histories, or dynamic metadata. We present KV-Repurpose, an open-source, vLLM-based system for developing and evaluating segment-wise KV-cache reuse beyond exact prefixes. The system combines cache-aware segment scheduling, prompt construction, capacity management, workload generation, and runtime monitoring. Experiments on long-context benchmarks show that naive segment reuse largely preserves output quality for single-document question answering and summarization, while exposing clear limitations in cross-document reasoning. Under a Zipfian RAG-style workload in which 20% of requests share a fixed prefix, KV-Repurpose achieves a substantially higher token-level cache hit rate than prefix caching at the same 30 GB cache capacity, 63.9% versus 3.3%, resulting in lower TTFT. Even with 1 TB of cache capacity, prefix caching reaches only a 17.9% hit rate in this workload. Source code is available under the Apache-2.0 license at https://github.com/taiga333/eval-kv-repurpose.

1 Introduction

Large language models (LLMs) are now widely deployed in applications such as conversational assistants, document summarization, retrieval-augmented generation (RAG), and code generation. As recent models have become capable of processing increasingly long inputs, demand for long-context inference in practical deployments has grown rapidly. For many LLM serving workloads, however, processing long prompts remains computationally expensive and can substantially increase time to first token (TTFT) (Gim et al., 2024).

Figure

Figure 1: Motivation.

To avoid repeated prefill computation across requests, modern LLM serving engines employ prefix caching (Kwon et al., 2023; Zheng et al., 2024). Prefix caching stores the key-value (KV) states computed for previously processed prefixes and reuses them when subsequent requests share the same prefix. It is particularly effective in workloads with recurring prefixes, such as multi-turn conversations (Gao et al., 2024a) and in-context learning (Brown et al., 2020).

By contrast, in RAG workloads (Lewis et al., 2021; Gao et al., 2024b), the composition and ordering of retrieved documents often vary across requests. As a result, requests may contain substantial overlapping content while failing to share an exact prefix. Widely used serving engines (Liu et al., 2025), however, primarily optimize exact-prefix reuse and do not yet support the reuse of the corresponding KV states in such cases 1^{1}, potentially leading to redundant computation, increased TTFT, and reduced inference throughput. It can also increase pressure on KV-cache capacity across the memory and storage hierarchy, including dedicated context-memory systems (Anschel et al., 2026).

1^{1}https://github.com/LMCache/LMCache/issues/3238

Prior work has explored techniques for preserving or recovering model quality when cached KV states are reused beyond exact-prefix matches (Agarwal et al., 2025). Building on this line of research, we revisit such reuse from a systems perspective and broadly refer to it as KV-Repurpose in this paper (Figure 1). Our goal is neither to claim to be the first to introduce the concept of repurposing nor to propose a state-of-the-art method for mitigating the accuracy degradation caused by repurposing. Rather, we seek to reassess the practical value of KV-Repurpose in large-scale, long-context inference.

However, simple and reproducible baselines for integrating non-prefix KV-cache reuse into modern serving engines remain limited, making it difficult to assess its practical value and compare more sophisticated techniques on a common basis. We therefore develop a testbed for naive KV-Repurpose that enables systematic evaluation of both serving performance and output quality in long-context inference settings. Using this system, we demonstrate the potential benefits of KV-Repurpose through representative synthetic workloads motivated by RAG deployments. Our contributions are as follows:

• We integrate segment-wise, non-prefix KV-cache reuse into vLLM as a research baseline.

• We develop an end-to-end evaluation system covering cache generation, prompt construction, eviction, and runtime monitoring.

• We empirically characterize the conditions under which naive reuse preserves model quality and those under which it fails.

• We evaluate the system on a model with more than 100 billion parameters and demonstrate substantial improvements in cache-capacity efficiency and latency under long-context, Zipfian RAG-style workloads.

References (10)