Manuscript Offprint

arXiv:2610.37921

FAD-KV: Adaptive Dictionary KV Caching for Efficient Reasoning Decoding

Yuxuan Zhu, David H. Yang, Parisa Shiravani, Mohammad Mohammadi Amiri, Tejaswini Pedapati, Subhajit Chaudhury, Keerthiram Murugesan, Pin-Yu Chen

ABSTRACT

Key-value (KV) caching is a core mechanism in large language models, where intermediate key and value representations are stored to accelerate autoregressive decoding. As generation length increases, KV cache memory and computation grow linearly, making compression critical for efficient long-output reasoning. Dictionary-based sparse KV compression is appealing because it represents each token's KV states as a sparse combination of learned basis elements (atoms) in a dictionary, preserving token-level structure without enforcing a global low-rank constraint. However, existing dictionary-based methods face two practical limitations during decoding: iterative sparse coding methods such as Orthogonal Matching Pursuit add decoding-time overhead, and static dictionaries may mismatch evolving KV distributions under test-time generation. While adaptive dictionary updates can reduce this mismatch, naive append-only strategies lead to dictionary growth during generation. We propose FAD-KV, a Fast Adaptive Dictionary KV caching framework for efficient reasoning decoding. FAD-KV integrates (i) a screening-based sparse coding scheme, where a one-shot Top-nn selection identifies a small candidate pool followed by lightweight coefficient refinement, and (ii) a fixed-size dictionary adaptation mechanism that reuses inactive atoms instead of expanding the dictionary. By controlling both sparse coding cost and adaptive dictionary growth, FAD-KV provides a memory-bounded and computation-efficient KV compression framework for long reasoning workloads. Experiments on reasoning and long-context benchmarks show that FAD-KV achieves a strong quality-efficiency trade-off while avoiding unbounded dictionary growth during decoding.

1 INTRODUCTION

Large language models (LLMs) increasingly rely on long-form reasoning during inference to solve tasks such as mathematical problem solving, code generation, and multi-step decision making (Nam et al., 2024; Setlur et al., 2024; Kumichev et al., 2024). In these settings, autoregressive decoding can produce long outputs and maintain a large effective context, making the key-value (KV) cache a major bottleneck. Since standard KV caching stores one key and one value vector for every processed token at every layer, its memory footprint and memory traffic grow linearly with sequence length, which can substantially reduce decoding efficiency in long-context and reasoning workloads (Xiao et al., 2023; Zhang et al., 2023; Liu et al., 2024; Tang et al., 2024; Kim et al., 2024).

A broad line of work studies KV cache compression through quantization (Hooper et al., 2024; Liu et al., 2024), token eviction or selection (Xiao et al., 2023; Zhang et al., 2023; Li et al., 2024; Tang et al., 2024; Zhu et al., 2025a), and low-rank or subspace approximation (Saxena et al., 2024; Lin et al., 2024). Dictionary-based sparse compression is a complementary direction: it represents each KV vector with a small number of atoms from a learned dictionary, preserving token-level information without directly evicting tokens or forcing all vectors into a shared low-rank subspace (Kim et al., 2024). However, applying dictionary-based KV compression to long reasoning decoding raises two

Figure

Figure 1: Motivation for FAD-KV. Diagnostics are computed using Llama-3.2-3B on MATH-500 with 4096-atom key/value dictionaries and sparsity s=8s = 8. (a)–(b) Decoding-time KV vectors have head-heavy dictionary correlations; we visualize value-vector scores as an example, and show that a small Top-nn screened pool recalls most full-OMP atoms. (c)–(d) many atoms remain inactive after prefill, and inactive capacity is common across prompts. These observations motivate screening-based sparse coding and fixed-size dictionary adaptation.

practical challenges. First, sparse coding with iterative solvers such as Orthogonal Matching Pursuit (OMP) can introduce noticeable per-token latency. Second, because the dictionary is learned offline, generated KV states may deviate from the calibration distribution during long reasoning. Adaptive dictionary updates can reduce this mismatch, but a naive append-only strategy causes the dictionary to grow during generation, weakening the memory savings of compression.

To make this concrete, dictionary-based KV compression represents each key or value vector x\boldsymbol{x} as a sparse linear combination of atoms from an offline-learned dictionary D=[d1,…,dN]\boldsymbol{D} = [\boldsymbol{d}_1, \ldots, \boldsymbol{d}_N], i.e., x≈Dy\boldsymbol{x} \approx \boldsymbol{D}\boldsymbol{y}. At inference time, a greedy sparse coding solver such as OMP selects a small support of atoms and estimates the corresponding sparse coefficient vector y\boldsymbol{y} for each incoming KV vector where ∥y∥0≤s\|\boldsymbol{y}\|_0 \leq s, where ss is the sparsity budget, and the compressed cache stores these sparse indices and coefficients instead of the dense vector. Full-dictionary OMP is expensive during autoregressive decoding because each greedy step scans all NN atoms using the current residual, refits the coefficients on the selected support, and repeats this process until the sparsity budget is reached. Since this encoding is repeated for every newly generated key and value vector, full OMP can add substantial decoding-time overhead. Meanwhile, because D\boldsymbol{D} is learned offline from calibration data, its reconstruction quality can degrade when generated KV states drift during long reasoning. A naive way to reduce this mismatch is to append new atoms from poorly reconstructed KV vectors, but such append-only adaptation makes the dictionary size grow with generation length. These two observations motivate our goal: reduce the sparse-coding search cost while keeping dictionary adaptation memory-bounded.

Our motivation is that both challenges can be addressed by exploiting two forms of unused structure in dictionary-based KV compression: sparse correlation structure during atom selection and inactive dictionary capacity during adaptation. We illustrate these structures with a diagnostic from our main experimental setting, using Llama-3.2-3B-Instruct (Grattafiori et al., 2024) model on MATH-500 dataset (Hendrycks et al., 2021; Lightman et al., 2023) with a dictionary of 4096-atom and sparsity budget s=8s = 8. For a KV vector x\boldsymbol{x} and unit-normalized dictionary atoms dj\boldsymbol{d}_j, we define the one-shot normalized correlation score as cj=∣dj⊤x∣/∥x∥2c_j = |\boldsymbol{d}_j^\top \boldsymbol{x}| / \|\boldsymbol{x}\|_2, and form a candidate pool by taking the Top-nn atoms under this score. For sparse coding, decoding-time KV vectors often have head-heavy dictionary correlations: as shown in Figure 1(a), only a small fraction of atoms has large normalized correlation cjc_j with the current KV vector x\boldsymbol{x}, visualized here using a representative value vector. More importantly, this high-score region already contains most atoms that full OMP would select. Figure 1(b) shows that a Top-256 pool recalls 85.7% of the full-OMP support while searching only 6.25% of the dictionary. This suggests that expensive full-dictionary OMP search is often unnecessary: one-shot screening can first prune the dictionary to a small high-recall candidate pool, after which lightweight atom selection and coefficient correction can operate only within this pool.

For dictionary adaptation, we observe that the offline dictionary also contains unused capacity at test time. The dictionary is trained on calibration activations, but long reasoning trajectories may shift away from this offline distribution, causing some KV vectors to be poorly reconstructed. A natural response is to append new atoms online, but repeated appends make the memory budget input-dependent and costly for longer outputs. In contrast, Figure 1(c) shows that 22.9% of dictionary atoms remain inactive after prefill for a representative prompt, and Figure 1(d) shows that the inactive capacity is common across prompts for both key and value dictionaries. This motivates fixed-size adaptation, where instead of growing the dictionary, we replace currently inactive atoms with context-relevant adaptive atoms.

We propose FAD-KV (Fast Adaptive Dictionary KV caching), a dictionary-based KV compression framework for efficient reasoning decoding. FAD-KV combines two inference-time mechanisms. First, it replaces full OMP over the entire dictionary with screening-based sparse approximation: a one-shot Top-nn step identifies a high-recall candidate pool, and a lightweight correction step selects and refits atoms inside this pool. Second, it replaces append-only dictionary growth with a fixed-size update rule that swaps inactive atoms with context-relevant adaptive atoms. As a result, FAD-KV controls both sparse coding overhead and dictionary memory growth under a strict memory budget. For related works, refer to Appendix A.1.

Our contributions are threefold. First, we identify two practical bottlenecks in dictionary-based KV compression for reasoning-heavy decoding: iterative sparse coding latency and unbounded adaptive dictionary growth under test-time distribution shift. Second, we propose FAD-KV, which combines screening-based sparse coding with fixed-size online dictionary adaptation. Third, we show that FAD-KV reduces sparse coding overhead and avoids adaptive dictionary growth while providing a strong quality-efficiency trade-off under a fixed memory budget.

References (59)