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

Manuscript Offprint

arXiv:2609.37988

KV-Kaizen: Learning Context-Adaptive Cache Compression Choices

Joao Monteiro, Louis Béthune, Anastasiia Filippova, Sonia Laguna, David Grangier, Marco Cuturi

João Monteiro, Louis Béthune, Anastasiia Filippova, Sonia Laguna, David Grangier, Marco Cuturi

Apple

As the context size of text processed with an LLM grows, the size of KV caches can outstrip the memory allocated for the original model weights. This impacts LLM throughput negatively, since decoding is memory-bound and decode cost grows with cache size. Recent work has proposed to alleviate this bottleneck by discarding some of these tokens, keeping the most relevant bits and dropping the rest. Eviction introduces a tension, since a one-off decision to discard content may prove detrimental later. Instead, we focus on alternative choices that can lead to cache compression without evicting tokens. We achieve this by learning a selector that is able to produce, based on context, a per-layer cache configuration towards an overall compression budget. The selector operates along three axes: sharing one cache across layers (depth), caching at fewer bits (precision), or truncating the low-rank latent cache representations (rank). We call the resulting method KV-Kaizen, for the many small per-layer choices it compounds. We observe that these interventions taken independently and uniformly over all layers limit achievable compression because they degrade accuracy. Crucially, we observe that composing them locally and adaptively to the context can instead preserve accuracy while achieving large memory savings. At train time, a lightweight selector module is given access to the embeddings of the context sequence, and trained to pick at each layer a combination of these three axes, with a language modeling loss that is regularized by a budget constraint satisfaction loss. At inference, the selector runs once, before pre-fill. In evaluations on instruction following and reasoning tasks, our selectors reach the Pareto frontier of accuracy against cache size, against learning-free and post-hoc baselines. On long-context tasks, KV-Kaizen improves on eviction and can be composed with it, reaching a 32×32\times smaller decode-time cache on a 14B model while preserving accuracy. A 4×4\times cache size reduction incurs no accuracy degradation from 7B parameters up, and a compressed model is more accurate than a smaller uncompressed one with the same cache size. Together, these findings support pre-training large models and compressing them only afterwards.

Correspondence: João Monteiro: jmonteiro2@apple.com; Louis Béthune: l_bethune@apple.com; Anastasiia Filippova: a_filippova@apple.com; Sonia Laguna: sonia_laguna@apple.com; David Grangier: grangier@apple.com; Marco Cuturi: m_cuturi@apple.com.

1 Introduction

Attention-based LLMs trade memory for compute: a KV cache stores the key and value (KV) vectors of every prefilled or generated token, so that they are not recomputed at each decoding step. The memory this takes grows with the length and number of the sequences served. Qwen2.5-14B (Qwen Team et al., 2025), for instance, uses a cache memory of 192 KiB per token, so serving 32 sequences of 8k tokens fills up 48 GiB, more than the model weights in bf16. Naturally, that memory cache introduces a bottleneck: every decoded token reads all of the KV cache, so decoding is limited by memory bandwidth rather than by compute. A smaller cache therefore lets a model serve more and longer sequences, and decode at a higher throughput. The challenge thus becomes caching more efficiently without incurring information loss with respect to the original cache.

Smaller KVs. To alleviate these issues, recent works shrink KV caches by keeping positions that are deemed relevant, and drop the rest (Zhang et al., 2023; Cai et al., 2024; Qin et al., 2025). When such eviction strategies are query-independent, they run the risk of sacrificing tokens that could have proved useful for other queries. This failure can be mitigated by dropping KV at inference conditionally on a specific query (Li et al., 2024),

Compression Choices

Reuse previous KV

or Compress KV

Figure

Application of Choices at Prefill Time

Context

Amou daquela vez

como se fosse a última

Beijou sua mulher

como se fosse a última

E cada filho seu como

se fosse o único

E atravessou a rua com

seu passo tímido

Embedding Matrix

KV-Kaizen

2 ×

bidirectional

transformer

block

Choices

Layer 1

b = 16, d = r/4

no compression

reuse

b = 2, d = r/8

Layer 48

b = 4, d = r

Figure 1 Per-layer cache selection and composition of compression axes. The selector chooses among 16 width–precision pairs or, alternatively, a inherit/reuse action per layer. Producing a cache costs (d+dR)b(d + d_R)b bits per token; inheritance costs zero. The configuration is fixed during generation, including at prefill time. In theory, the maximal compression factor that could be attained for a 48 layers model such as Qwen2.5-14B could be in practice 8×8 \times (precision) times 10.7 (lowest rank), and depth 48, by reusing the first KV layer at all subsequent layers (Table 5). This would yield a maximal compression of 4108×4108 \times, though all of our experiments target far lower factors.

or by guiding eviction using a wide-reaching generic prompt (Zhu et al., 2025). Eyuboglu et al. (2026); Zweiger et al. (2026); Monteiro et al. (2026) have also proposed to learn compact KV cache representations of a fixed context one attends to repeatedly, by distilling the LLM's use of KV caches against a wide set of synthesized QAs relevant to the targeted context. A natural counterpart to these compaction/eviction approaches is cache compression without token selection. For instance, one can store the KV cache in low precision to reduce the amount of information that must be moved at every cache read (Hooper et al., 2024; Liu et al., 2024a), or target lower dimensional representations of KV states, as proposed with multi-head latent attention (MLA) (Liu et al., 2024b). Since the KV cache encodes tokens at every head and every layer, cache redundancies have been exploited so that groups of layers share the same KV states rather than producing their own cache (Brandon et al., 2024; Sun et al., 2024; Filippova et al., 2026), as recently showcased in Gemma-4 (Team et al., 2026) and DeepSeek-V4.1-Flash (DeepSeek-AI, 2026). However, applying these structural changes aggressively quickly results in performance degradation.

Learned Adaptive KV Compression Strategies. In this work, we compose three compression approaches: MLA's dimension or rank, the cache precision, and the effective depth determined by how layers are grouped to share a cache. We refer to this method as KV-Kaizen, in reference to the "kaizen" management method that leverages minor, gradual adjustments to improve an existing pipeline. The savings of these three approaches compound, combining multiple mild compression that yield high compression ratios that would prove too lossy if carried by a single direction. We learn by how much to push along each of precision, rank, and depth during supervised fine-tuning: a small selector reads the prompt and picks one option per layer. During inference, the selector runs once at the start of pre-fill, and its choice then holds for every generated token. Since we train selector and model together, the model adapts to the cache it will be served under. We evaluate KV-Kaizen on a range of models covering 1.5B to 32B parameters and different model families, on instruction following, reasoning tasks and long-context retrieval and question answering, against learning-free, post-hoc and manually designed baselines at matched cache sizes. Our contributions are:

  • We formulate depth, rank, and precision as a single per-layer choice under a shared budget, with all actions expressed in a common cost of bits per token. The budget can also be an input, so that one selector serves several (Section 3.5).

  • Cache size reductions due to rank, precision, and depth compose. We show that mild settings of the three cache reduction approaches we consider reach compression ratios none reaches alone. For instance, a 4×4\times cache size reduction gives accuracy comparable to the corresponding backbone in the evaluated models of at least 7B parameters. Trained selectors outperform the static and random configurations as shown in Figure 3 (Sections 3.2 and 3.3).

  • Token eviction composes with the non-eviction approaches we consider. As we do not evict tokens, eviction can be applied to the same cache and the two ratios multiply. On Qwen2.5-14B at 16k, a 4×4\times compression due to our cache configuration plus eviction to one position in eight gives a 32×32\times smaller cache at decode time, with no significant accuracy difference (Section 3.4).

  • Cache size reductions realize gains on a real device. Benchmarking the three approaches on device, we observe that composing them keeps peak memory nearly flat as sequences grow, and that most combinations decode faster than an uncompressed cache (Section 4).

References (61)