arXiv:2610.30791cs.LGOct 2026

Manuscript Offprint

arXiv:2610.30791

Gandalf: Flash Shall Not Die! Increasing Flash Storage Lifetime for KV Cache Offloading in LLM Serving

Maharani A. P. Irawan, Kuntai Du, Jiayi Yao, Dongjoo Seo, Yuyang Huang, Haryadi S. Gunawi, Junchen Jiang

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

Maharani A. P. Irawan*

The University of Chicago

USA

Kuntai Du

TensorMesh Inc.

USA

Jiayi Yao

The University of Chicago

USA

Dongjoo Seo

Samsung Semiconductor

USA

Yuyang Huang

The University of Chicago

USA

Haryadi S. Gunawi

The University of Chicago

USA

Junchen Jiang †^{\dagger}

TensorMesh Inc.

USA

Abstract

KV caching reduces the serving cost of large language models (LLMs), but the growing KV cache footprint is increasingly exceeds GPU and host-memory capacity. Therefore, people use SSD to expand the KV cache storage capacity with high I/O bandwidth. However, in production LLM workload, such as multi-round conversation and LLM agents, the total amount of KV cache writes significantly exceeds SSD capacity, shortening SSD lifetime from years to months. To improve SSD lifetime, a natural solution is to reduce the KV cache writes by gating the KV cache writes via historical access patterns. However, that significantly lowers the KV cache hit rate (and increase the LLM serving cost) since KV caches from different attention types might have identical historical access pattern but different future access patterns. Our insight is that, to reduce KV cache writes without hurting KV cache hit rate, one need to not only consider the access pattern, but also application-level information such as the attention type of KV cache. Leveraging this observation, we propose GANDALF, the first SSD KV cache offloading system with SSD life time awareness. GANDALF prioritize the admission of full-attention KV cache into SSD over the cache generated by other types of attention, which significantly increases SSD lifetime without sacrificing cache hit rate. Our evaluation shows that GANDALF extends the SSD lifetime by 7.3× on average, while having negligible impact on cache hit rate across multiple workload traces and wide range of hardware capacity. GANDALF design can be extended to other flash-based storage, such as High Bandwidth Flash (HBF).

1 Introduction

Large language models (LLMs) have demonstrated strong capabilities in multi-round conversations and agentic workflows, garnering wide adoption. These workloads accumulate conversation histories, tool outputs, and intermediate states, resulting in increasingly long and frequently reused contexts. However, recomputing the attention key-value (KV) states for these contexts at every rounds substantially increases inference latency and cost. Hence, people store all KV caches in their system to avoid recomputation and increase cache hit rate [1, 32]. Production workloads generates Terabytes of KV-cache per day at the amount that exceeds the capacity of GPU and host memory, motivating the use of higher-capacity storage tiers. Flash-based storage, e.g. NVMe SSDs, provides a scalable and comparatively cost-effective tier for storing these caches [29].

Figure

Figure 1: Using historical access pattern creates a trade-off between cache hit rate and SSD lifetime. GANDALF maintains cache hit rate while increasing SSD lifetime.

Table 1: Reuse pattern of first round's KV caches in multi-round conversation

Type2nd-round3rd-roundFuture roundsReuse count
Full attn✓✓✓NroundsN_{\text{rounds}}
Linear attn✓✕✕1

This additional capacity comes with an endurance challenge because SSDs can only handle a finite volume of writes before they are worn out [4]. Under production workloads, aggressive KV-cache admission improves cache-hit rate but generates substantial write volume, exhausting SSD endurance within days to months. Therefore, existing production-level systems came up with simple filtering techniques that gates SSD admission, trading potential cache hits for fewer writes. Frequency-based solutions, for example, offloads a KV cache to SSD only if it has demonstrated N×N \times reuse, with NN as a hyperparameter [30, 35]. However, even with such filtering, the aggregate KV-cache write volume remains excessive for practical SSD endurance. This raises a central question:

How can we improve the SSD lifetime without sacrificing KV caching performance benefit?

The key challenge lies in predicting the future reuse of KV caches such that we can selectively retain only the most reusable caches to make the most of SSD's capacity. Future prediction is difficult, but we found application-specific property that strongly correlates with reuse pattern. We leverage two observations: (1) Recent LLMs increasingly employ hybrid architectures that combine full-attention layers with linear- or sparse-attention layers, and (2) These different attention layer types produce KV caches with substantially different reuse patterns under emerging mainstream workloads: multi-round conversations and agentic workflows. In particular,

*Part of this work was done while the author was an intern at TensorMesh Inc.

†^{\dagger} Also with The University of Chicago.

Maharani A. P. Irawan, Kuntai Du, Jiayi Yao, Dongjoo Seo, Yuyang Huang, Haryadi S. Gunawi, and Junchen Jiang

states from linear- and sparse-attention layers are reused less frequently than KV caches from full-attention layers.

Consider a multi-round conversation workload use-case, which reuse pattern illustrated in Table 1. At the beginning of each new round, the full-attention KV entries for the entire preceding context is needed. This pattern repeats for every new round, hence these KV entries are reused across all future rounds. In contrast, a linear-attention layer's state and sliding-window cache is only needed to generate the immediate next round's response, and is then discarded, hence every state is only reused once.

This reuse pattern heterogeneity motivates attention-type-aware cache placement. Writing large, one-time use linear-attention states to SSD provides little cache hit benefit while consuming both write endurance and cache capacity. Layer type can therefore serve as a practical placement signal, allowing us to utilize SSDs to expand cache capacity while minimizing endurance loss. We propose an attention layer-aware placement policy that caches short-lived linear-attention states in host memory while keeping longer-lived full-attention KV caches on SSD.

However, there are 2 practical challenges that entail this placement policy.

First, this placement policy is too rigid: the size of CPU DRAM and SSD is fixed, but workload can generate different amounts of different attention states. Particularly, a workload with many concurrent sessions can generate a large number of reusable linear-attention states that exceeds the available DRAM capacity, similarly, a workload with long contexts can generate a large number of reusable full-attention KV caches that exceeds the available SSD capacity. We call this a hardware-to-utilization imbalance. This imbalance forces frequent cache eviction on the saturated tier despite available capacity elsewhere in the storage hierarchy, thus lowering cache-hit rate. Worse, if the overutilization happens in SSD, the resulting write churn can consume its endurance budget more rapidly and further shorten its lifetime. Therefore, we design a capacity-aware placement policy that filters SSD admission based on utilization and pressure of each tier, balancing cache hit rate against SSD endurance.

Second, such rigid placement moves cache hit from DRAM to SSD, which can hurt TTFT because SSD bandwidth is substantially lower than DRAM bandwidth. Hence, transferring large full-attention KV caches from SSD may hurt TTFT.

We explore the potential of attention-type-aware placement using an offline oracle that jointly optimizes SSD admission and cache eviction decisions, biased towards our tier placement. The oracle reveals two complementary design principles. First, placement must adapt to tier capacity and selectively persist KV caches on SSD to preserve the prefix-hit boundary. Second, admission and eviction must be optimized jointly: admitting a new cache has cost and benefit. It benefits future reuse, but it has write cost and replacement cost—cost of replacing other cache entries, may or may not already pay for its promised benefit. An SSD admission is beneficial only when its expected reuse value exceeds the sum of write cost and the value of the entries it evicts. Together, these principles characterize the best attainable trade-off among SSD lifetime, cache-hit rate, and TTFT. We then distill the oracle's decisions into an online, capacity-aware policy that estimates future reuse from historical access patterns.

Table 2: Under KV cache offloading workloads, SSDs may last less than a year—far short of their five-year warranty.

WorkloadModelKV cache size (TB)SSD lifetime (y)
Claude Code cc-traces-062126Qwen3.5-27B980.4
Kimi-K32400.2
Claude Code cc-traces-060826Qwen3.5-27B810.4
Kimi-K31990.2

Contributions. Our work makes the following contributions:

(1) We are the first to show that the SSD lifetime is significantly lower than its factory guarantee in production-scale SSD-based KV cache offloading.

(2) We show that, leveraging application-level information (the attention type corresponds to each KV cache objects), we can significantly reduce the write volume and increase SSD life time with negligible impact on KV cache hit rate.

(3) We propose GANDALF, a KV caching system that can increase SSD lifetime by 7.3×7.3 \times (on average) with negligible impact on hit rate across a wide range of LLMs and hardware capacity.

Although this paper only demonstrates GANDALF on SSD, but the technique is extendable to other flash-based storage devices, such as High Bandwidth Flash (HBF).

References (14)