KVCache Cache in the Wild: Characterizing and Optimizing KVCache Cache at a Large Cloud Provider

Jiahao Wang, Jinbo Han, Xingda Wei, Sijie Shen, Dingyan Zhang, Chenguang Fang, Rong Chen, Wenyuan Yu, Haibo Chen

Introduction

As Large Language Models (LLMs) become central to modern computing, the infrastructure required to serve them efficiently has become a critical bottleneck. One of the most effective techniques for reducing the computational cost of LLM inference is Key-Value (KV) Caching. By storing the intermediate mathematical states (KV pairs) of previously processed tokens, systems can skip redundant calculations when a new request shares a common prefix with a previous one.

Despite its importance, most research into KV cache management has relied on synthetic workloads or limited public datasets. This has resulted in a "knowledge gap" between academic optimization strategies and the realities of production environments. Researchers from SJTU and Alibaba Group have addressed this by performing the first systematic characterization of real-world LLM KV cache workloads using production traces from Alibaba Cloud (ALIYUN). Their findings reveal that standard, workload-agnostic eviction policies like Least Recently Used (LRU) are suboptimal for the diverse and predictable patterns found in the wild.

Characterizing Production Workloads

The study analyzed two weeks of production data across two distinct environments: Trace A (to-C), representing consumer-facing chatbot interactions, and Trace B (to-B), representing business-facing API calls. This analysis yielded several counter-intuitive insights that challenge common assumptions in LLM systems research.

The Dominance of Single-Turn Hits

While multi-turn conversations are often cited as the primary driver for KV reuse, the researchers found that in business (to-B) workloads, 97% of cache hits originate from single-turn API requests. This occurs because developers frequently prepend identical system prompts or instructions to thousands of independent calls. Consequently, the "head" of the prompt (the initial instructions) becomes a high-value asset for caching, even across unrelated user sessions.

Ephemeral Lifespans and Skewed Utility

The utility of cached blocks is highly skewed: approximately 10% of KV blocks contribute to 77% of all reuses. Furthermore, in API-heavy workloads, the lifespan of a KV block is remarkably short, with a P99 lifespan of just 97 seconds. This suggests that "Least Frequently Used" (LFU) policies are ill-suited for LLM serving, as they may retain "zombie" blocks that were popular briefly but are unlikely to be reused after a few minutes.

The Workload-Aware (WA) Eviction Policy

Leveraging these insights, the authors proposed a Workload-Aware (WA) eviction policy. Unlike LRU, which only considers the time of last access, the WA policy calculates a priority score for each block based on two primary factors:

  1. ReuseProb: An empirical probability that a specific request category (e.g., a second-turn chat message vs. a file-based query) will be reused within a specific timeframe. These probabilities were found to be remarkably stable for specific categories over time.
  2. Offset: The policy prioritizes "head" blocks (the beginning of a prompt). Statistically, the earlier a block appears in a sequence, the more likely it is to be part of a shared prefix that will be reused by future requests.

By combining these metrics, the system can more accurately predict which data is worth keeping in the limited GPU memory and which can be safely evicted.

Experimental Results

The researchers integrated the WA policy into vLLM, a leading open-source LLM serving engine, and evaluated it on a cluster of NVIDIA A800 GPUs. The results demonstrated significant improvements over standard baselines:

  • Cache Hit Rates: The WA policy achieved hit rates 8.1% to 23.9% higher than LRU, FIFO, or LFU.
  • Latency Reduction: Most importantly for end-users, the policy reduced the Queued Time to First Token (QTTFT)—the duration a request spends waiting in the queue before the model begins generating text—by 28.3% to 41.9%.
  • Memory Efficiency: The study also found that for models utilizing Group Query Attention (GQA), a relatively modest cache size (roughly 4x the GPU's resident memory) is sufficient to achieve near-ideal hit rates. This suggests that for many production scenarios, complex multi-tier storage hierarchies (such as SSD-based caching) may be unnecessary if the eviction policy is sufficiently intelligent.

Conclusion and Future Work

This research highlights the importance of using real-world data to inform systems design. By recognizing that LLM request patterns are highly predictable based on metadata and request types, the authors demonstrated that a workload-aware approach can significantly outperform general-purpose caching algorithms.

While the current study focused on single-instance optimization, the authors suggest that the next frontier lies in global scheduling. Applying workload-aware logic to decide which specific server in a large cluster should handle a request—based on the global state of KV caches—could lead to even greater efficiency gains in hyperscale LLM deployments.

Summary updated

BibTeX
@inproceedings{wang2025kvcache,
  author = {Jiahao Wang and Jinbo Han and Xingda Wei and Sijie Shen and Dingyan Zhang and Chenguang Fang and Rong Chen and Wenyuan Yu and Haibo Chen},
  title = {{KVCache Cache in the Wild: Characterizing and Optimizing KVCache Cache at a Large Cloud Provider}},
  booktitle = {USENIX ATC},
  year = {2025},
  doi = {10.48550/arxiv.2506.02634},
}
Figure