← Deep dives

Deep dives · 2026-11-27 · Advanced · By bombong

Distributed KV Cache Storage: Extending the Cache to CPU, SSD and Remote Memory

The KV cache grows in proportion to context length and the number of concurrent requests, so it quickly fills GPU HBM. Serving systems are therefore evolving to extend the cache into tiers of CPU DRAM, SSD and remote memory, and to hide the cost of loading it back.

Contents
Key points
  • The KV cache trades computation for storage, and because HBM is small, it has been extended into larger, slower tiers (DRAM, SSD, remote memory).
  • The main cost is not capacity but the time it takes to move data. That is why batched transfers, overlapping computation with transfer, and prefetching are at the center of the design.
  • In PD disaggregation, which splits prefill and decode across different GPUs, KV cache transfer becomes the bottleneck, and the benefit depends on load and the transfer path.
  • Policies that decide what goes in which tier, and whether to compress or discard it, have a large effect on performance.
  • Recent work is moving toward lossless compression, large memory pools, and cache management that uses agents' context-management signals.

Why the KV cache had to move off the GPU

An LLM is an autoregressive model that generates tokens one at a time. To avoid recomputing all previous tokens each time a new token is generated, it stores the Key and Value values used by attention in each layer; this is the KV cache. The problem is size. As the FlashOffloading study paper points out, the KV cache grows in proportion to sequence length and the number of concurrent requests, so long-context inference quickly runs into the capacity of the GPU's high-bandwidth memory (HBM), and the number of requests that can be handled at once drops.

The second reason is reuse. When many requests share the same beginning (prefix), as in multi-turn conversations, repeated questions about the same document, or agents, keeping a KV cache longer after it is built saves more recomputation. LMCache paper reports from real usage statistics that the total amount of KV cache stored by users grew quickly and far exceeded GPU memory capacity, and argues that the cache should be moved off the GPU and shared across queries and across inference engines.

The third is a change in serving architecture. As PD disaggregation (prefill-decode disaggregation), which assigns the prefill stage that processes the whole prompt at once and the decode stage that generates tokens one by one to different GPUs, has become widespread, the KV cache built by the prefill GPU must now be moved to the decode GPU. The cache has changed from data that stays inside a single GPU into data that travels between nodes.

Key idea: a cache split into desk, shelves and stacks

Think of a library reading room. GPU HBM is the desk: within easiest reach, but it holds only a few books. CPU DRAM is the shelf right next to it: it holds more, but fetching a book takes time. SSD is the basement stacks, and remote memory is the stacks in another building. The farther away, the larger and cheaper, but the slower. Distributed KV cache storage acts as the librarian, keeping books you use often on the desk, books you will need soon on the shelf, and books you may need again someday in the stacks.

The Kareto study paper describes KV caching as a way of trading computation for memory: instead of recomputing, you fetch stored values. So for this trade to pay off, fetching must take less time than recomputing. This is why designs that add more tiers ultimately come down to the question of how fast and how far in advance data can be moved.

Three trade-offs are involved. Gaining capacity means accepting transfer latency; reducing transfer volume through compression means accepting quality loss or decompression cost; and sharing the cache across engines means accepting management complexity and security burden. The studies that follow offer different answers to which of these costs to reduce and how.

How it works

Step 1 is lookup. When a new request arrives, the system checks whether a KV cache for the beginning of its prompt already exists somewhere. If it is in HBM, it is used immediately; if it is in DRAM or SSD, it is loaded onto the GPU. If it is nowhere, it is computed fresh through prefill. Reusing stored cache this way avoids reprocessing the prompt, which reduces TTFT (time to first token).

Step 2 is hiding the cost of movement. LMCache paper cites as its key contributions batched data movement, which moves data in bundles rather than small pieces one at a time, and pipelining, which overlaps computation with I/O. FlashOffloading paper offloads the KV cache entirely to host DRAM, but keeps a rotating HBM cache for prefill and a hot cache holding frequently used blocks for decode, and reduces latency with kernels that overlap computation and loading. The underlying concern is that even if offloading the cache raises concurrency, it will not translate into real throughput if the time to load it back increases latency.

Step 3 is placement and eviction across tiers. When HBM fills up, blocks less likely to be used are moved down to a lower tier (eviction), and blocks that will be used again are moved up (promotion). Policies that decide which blocks to move down or up and when, and whether to compress them or leave them as they are, are attached here.

Step 4 is connecting to the engine. LMCache places modular connectors between the inference engines (vLLM, SGLang) and the cache tier, so the cache tier can keep working even as the engines change quickly. It also provides a separate control API for coordinating the cache across GPU, CPU, storage and network tiers. In effect, the cache becomes an independent storage tier rather than an internal data structure of a particular engine.

How a tiered KV cache worksNew request → Prefix lookup; Prefix lookup → GPU HBM(Hit); GPU HBM → Decoding(Attention); GPU HBM → CPU DRAM(Evict · load); CPU DRAM → SSD(Evict · promote); Remote memory → CPU DRAM(Prefetch); Placement · eviction policy → SSD(Decide)New requestPromptPrefix lookupPrefix alreadycomputed?GPU HBMFastest · smallestDecodingToken generationCPU DRAMLarger and slowerSSDHigh capacity ·long-term storageRemote memoryCXL · memory poolPlacement ·eviction policyWhat goes whereHitAttentionEvict · loadEvict · promotePrefetchDecide
How a tiered KV cache works A new request first looks for a stored prefix cache. Tiers get larger and slower toward the bottom, and blocks move between tiers through eviction and promotion.

How it evolved: from tiers outside the engine to remote memory

The first line of work builds a separate KV cache tier outside the engine. LMCache paper is an open-source tier that takes the KV cache produced by vLLM and SGLang off the GPU, stores it, and shares it across engines and queries; it supports both prefix reuse and inter-engine transfer in PD disaggregation. Combined with vLLM, it reported up to 15x higher throughput on workloads such as multi-round question answering. FlashOffloading paper served GLM-5.2 in an Ascend910C-based PD disaggregation setup and, under a 30 ms time-per-output-token constraint, raised prefill throughput by up to 1.38x and decode throughput by up to 1.91x.

The second line uses remote memory outside the GPU. CXL-SpecKV paper offloads the KV cache to remote FPGA memory over a CXL (Compute Express Link) connection, predicts and prefetches cache entries that will be needed, and compresses and decompresses on the FPGA, cutting memory bandwidth requirements by up to 4x. It reported up to 3.2x higher throughput and 2.8x lower memory cost than a GPU-only baseline.

The third line deals with inter-node transfer in PD disaggregation. A study re-evaluating disaggregated serving paper systematically compared several KV transfer paths and concluded that the performance gains of PD disaggregation are not guaranteed and depend on request load and the transfer medium. Tuning GPU frequency separately for each stage also did not lead to energy savings. SmartGen paper targets environments with narrow inter-node bandwidth, such as rented cloud, by sending only the important KV entries first during prefill and fetching the rest on demand or sending them later during decode, cutting time to the second token by up to 4.3x.

The fourth line is placement policy. EVICPRESS paper observes that earlier work treated eviction and compression separately, and uses a utility function that jointly decides lossy compression and eviction for the caches of all contexts, raising the cache hit rate on fast devices. Kareto paper searched for tiered storage configurations through multi-objective optimization that weighs cost, throughput and latency together, achieving up to 9.3% higher throughput than a fixed 1024 GB DRAM configuration.

Where it is heading

First, lossless compression to effectively enlarge tiers. LoomKV paper, a system built on top of LMCache and vLLM, takes issue with the fact that lossy compression changes KV values and outputs. By shrinking the high byte of BF16 values with calibrated codes, it stored BF16 KV at 0.71 of the original size and FP8 KV at 0.85–0.87. On the AgentX workload, the compressed tier behaved like an uncompressed tier 1.4x larger, and near the point where performance drops sharply under LMCache's LRU eviction policy, it showed 2.7–3.6x the goodput (useful throughput that meets constraints) and 1.9–3.1x lower mean TTFT compared with the uncompressed version. It also cut TTFT for repeated prompts by up to 1.7x by promoting data from SSD to DRAM.

Second, expansion to large memory pools. XM-Sparse paper observes that offloading to host memory is limited by PCIe bandwidth and host memory capacity, and uses scale-up memory pools such as X-Mem. However, it found that even with a memory pool, the frequently used KV buffer and the indexer key cache for sparse attention take up much of HBM, so decode throughput is still bound by HBM capacity. It therefore offloads both caches aggressively, but splits their handling to match each one's access pattern: one is fetched on demand and the other is prefetched. It is implemented on SGLang.

Third, agent-aware cache management. Evolving Infra paper points out that existing PD disaggregation systems rely on coarse signals and end up evicting KV cache that the agent will use again. It separates compute allocation from KV cache management and adds a distributed KV manager that drives cache eviction and transfer using the agent's context-management signals. On up to 256 GB300 GPUs, it reported up to 4.1x lower mean end-to-end latency and up to 14x lower P95 TTFT than NVIDIA's Dynamo. This reflects a shift in cache policy from generic recency of use toward lifetime information supplied directly by the application.

Effect of LoomKV lossless compression

0.71BF16 KV storage size (vs. original)
1.4xEffective capacity vs. original tier
2.7–3.6xGoodput vs. original
Values reported in the LoomKV paper. They show the compressed storage size and the effect on the AgentX workload.

Limitations and open issues: when to use it and when to avoid it

The biggest issue is that the benefits depend on conditions. The study re-evaluating disaggregated serving paper found that the gains of PD disaggregation vary with request load and the KV transfer medium and are not guaranteed. As SmartGen paper points out, when inter-node bandwidth is narrow, as in rented cloud, large KV cache transfers quickly saturate the network. Before adding tiers, measure the bandwidth and load patterns of your own environment first.

Second, the price of compression. Lossy compression reduces transfer volume but, as LoomKV paper points out, changes KV values and outputs. Some approaches, like EVICPRESS paper, manage the quality impact by including it in a utility function; others, like LoomKV, choose lossless compression and give up some compression ratio. Whether the service requires outputs identical to the original becomes the deciding factor.

Third, policy tuning. Kareto paper reported that cost, throughput and latency are so intertwined that finding the optimum analytically is difficult. As with the sharp performance drop under LRU eviction that LoomKV showed, performance can fall suddenly the moment the working set exceeds cache capacity. Do not look only at the average hit rate; increase the load step by step and check TTFT tail latency.

The practical criteria can be summarized as follows. For workloads with repeated prefixes, such as multi-turn conversations, repeated queries on the same document, or agents, an external tier brings large gains. Conversely, if most prompts are short and different each time, there is little cache to reuse and only the movement cost may increase. Also, pooling many users' caches in one store exposes data containing token information more widely to infrastructure operators and other tenants, so tenant isolation and access control must be designed alongside it.

Checklist before adopting a tiered KV cache

Workload

  • Do many requests share repeated prefixes?
  • Have you identified where the working set exceeds cache capacity?

Infrastructure

  • Have you measured inter-node and PCIe bandwidth?
  • Does PD disaggregation actually pay off under your load?

Quality · operations

  • Does the service tolerate lossy compression?
  • Are you watching TTFT tail latency rather than the average?
  • Have you designed tenant isolation and access control?
The decision criteria from the main text, organized as a checklist.

Further reading

For the big picture, start with LMCache paper. It handles offloading and prefill-decode (PD) disaggregated transfer in a single layer and explains its structural choice of connectors and a control API. Reading LoomKV paper next shows concretely how compression changes capacity and TTFT on top of that same layer.

If you are interested in techniques that hide latency, read FlashOffloading paper. If you are deciding whether to adopt PD disaggregation, read the disaggregated serving reassessment study paper together with SmartGen paper. The former shows when there is no gain, and the latter shows how to hold up under narrow bandwidth.

For policy design, it helps to read EVICPRESS paper and Kareto paper side by side. For hardware expansion, see CXL-SpecKV paper and XM-Sparse paper, and for operations tailored to agent workloads, see Evolving Infra paper.

Related terms

KV cache HBM Prompt caching PagedAttention Inference engine TTFT Quantization Interconnect

References

Foundational papers

Recent research

Written by AI from the listed references and reviewed. Please check the original sources for details.