KV Cache Optimization Strategies for Scalable and Efficient LLM Inference
Organizations: Dell Technologies, Hopkinton, MA 01748, USA · Dell Technologies, Santa Clara, CA 95054, USA
Abstract
The key-value (KV) cache is a foundational optimization in Transformer-based large language models (LLMs), eliminating redundant recomputation of past token representations during autoregressive generation. However, its memory footprint scales linearly with context length, imposing critical bottlenecks on GPU memory capacity, memory bandwidth, and inference throughput as production LLMs push context windows from thousands to millions of tokens. Efficient KV cache management has thus become a first-order challenge for scalable LLM deployment. This paper provides a systematic review of recent KV cache optimization techniques, organizing them into five principal directions: cache eviction, cache compression, hybrid memory solutions, novel attention mechanisms, and combination strategies. For each category we analyze the underlying mechanisms, deployment trade-offs, and empirical performance across memory reduction, throughput, and model accuracy metrics. We further map techniques to seven practical deployment scenarios, including long-context single requests, high-throughput datacenter serving, edge devices, multi-turn conversations, and accuracy-critical reasoning, providing actionable guidance for practitioners selecting among competing approaches. Our analysis reveals that no single technique dominates across all settings; instead, the optimal strategy depends on context length, hardware constraints, and workload characteristics, pointing toward adaptive, multi-stage optimization pipelines as a promising direction for future research.
Figures & tables
| Technique | Optimization Goal | Tradeoffs | Representative Methods | Good for |
|---|---|---|---|---|
| Cache Eviction | Memory Footprint, Decoding Latency | Accuracy and quality | H 2 O, SnapKV, NACL, InfiniPot, Hashevict, MorphKV, RocketKV, KVzip, Ada-KV | Long-context single requests, Edge devices, Minimal model modification |
| Cache Compression | KV cache size, Throughput | Dequantization and reconstruction overhead, Accuracy | KIVI, MiniCache, PALU, KVQuant | Bandwidth-bound workloads, Edge devices, Ultra-long contexts |
| Hybrid memory solution | TTFT in long-context, System efficiency | Hardware requirement, complexity in management | PagedAttention, InfiniGen, LayerKV, INF2, KVPR, Oneiros, CLO | High - throughput serving, Multi-tenant datacenter serving |
| New Attention Calculation | computational complexity, Inference Speed | Accuracy, model retraining | Linear, Log-Linear, Local Linear, KIMI Linear | Agentic/Long-horizon Tasks |
| Combination Methods | Throughput/Latency Balance | Complexity in design and management | FlexGen, Q-Hitter, ShadowKV, TailorKV | Consumer-Grade Hardware and Diverse Workloads, balanced performance |
| Method | Mechanism | Phase | Overview |
|---|---|---|---|
| H 2 O [ 1 ] | Evict top K noncritical tokens | Decoding | Retains a balance of Heavy - Hitter tokens (H2) and the most recent tokens |
| SnapKV [ 2 ] | Retain critical tokens and their context | After Prefill | Identifies critical attention features by voting from observation window and uses pooling for clustering |
| NACL [ 9 ] | Hybrid Proxy and Random Eviction | Prefill | Performs a single, global eviction during encoding |
| InfiniPot [ 10 ] | Continual Context Distillation | Prefill | Enables processing of infinite context within a fixed memory budget |
| HASHEVICT [ 11 ] | Attention - Free LSH Ranking | Decoding | Uses Locality - Sensitive Hashing (LSH) and Hamming Distance to estimate token importance |
| MorphKV [ 13 ] | Correlation - aware selection | Decoding | Maintains a constant - sized cache for long - response tasks while eliminating early - token bias |
| Method | Mechanism | Granularity | Outlier handle |
|---|---|---|---|
| KIVI [ 5 ] | Asymmetric Quantization | Key : Per-channel; Value : Per-token | Keeps a small amount of residual cache in full precision |
| KVQuant [ 20 ] | Non-Uniform Quantization (NUQ) | Key : Per-channel (Pre-RoPE); Value : Per-token | Isolates the top 1% of outliers into a separate sparse fp16 representation |
| MiniCache [ 21 ] | Cross-Layer KV Merge | NA | Keeps highly distinct unmergeable state pairs in full precision |
| PALU [ 19 ] | Hidden-dimension compression with Low-Rank Projection and Reconstruction | Per-token per head group latent vector | Assigns higher ranks to critical layers |
| Method | Offload destination | Mechanism | Key optimization |
|---|---|---|---|
| Paged Attention [ 22 ] | CPU Memory (DRAM) | Paging the KV cache, inspired by virtual memory | Reducing memory fragmentation and enabling cache sharing |
| InfiniGen [ 23 ] | CPU Memory (DRAM) | Attention speculation and prefetching | Reducing PCIe transfer volume by only fetching essential data |
| LayerKV [ 24 ] | CPU Memory (DRAM) | Layer - wise management and SLO - aware scheduler to balance GPU/CPU residency | Reducing TTFT by minimizing queuing delays |
| INF2 [ 25 ] | Host Memory + NVMe SSDs (CSDs) | Attention - Near Storage (ANS) via Computational Storage Devices (CSDs) | High throughput for long - context models by leveraging internal storage bandwidth |
| KVPR [ 26 ] | CPU Memory (DRAM) | Overlapping partial cache recomputation on the GPU with asynchronous transfer | Minimizing GPU idle time caused by limited PCIe bandwidth |
| Oneiros [ 27 ] | CPU Memory (DRAM) | Parameter remapping to repurpose GPU memory from inactive models into KV cache space | Optimizing multi - tenant serving by reclaiming memory from idle models |
| Method | Mechanism | Training Time Complexity | Decoding Time Complexity per step | Decoding Space Complexity (Total Memory) | Features |
|---|---|---|---|---|---|
| Softmax | Scaled Dot - Product Attention & Multi - Head Attention | High expressivity, high cost | |||
| Linear | Replaces softmax with a linear dot - product of kernel feature maps | Limited expressivity and low cost | |||
| Log Linear | Replaces the fixed - size hidden state with a logarithmically growing set of hidden states | Balances efficiency and expressiveness | |||
| Local Linear | Use Local Linear Regression to perform query - specific local linear fitting | Superior bias–variance trade - off; high cost | |||
| KIMI Linear | Hybrid architecture (KDA + Multi - Head Latent Attention) | Mainly due to KDA | Outperforms full attention, but requires hybridization (e.g., 3:1 ratio with full attention) to maintain global information flow |
| Technique | Memory | Speedups | Accuracy loss | Tradeoffs |
|---|---|---|---|---|
| H 2 O [ 1 ] | Up to 5–10 memory reduction | Up to 29 throughput improvement; 1.9 lower latency compare to FlexGen | Comparable to baseline | accumulated-attention bias; risk of heavy - hitter loss |
| SnapKV [ 2 ] | 8.2 memory efficiency | 3.6 generation speedup | Comparable to baseline | Does not optimize prefill; cannot extend inherent model context limits |
| NACL [ 9 ] | Up to 5 KV reduction | O(1) single-shot eviction; major prefill simplification | 95% performance retention | Proxy-token selection heuristic; limited ultra-long behavior |
| InfiniPot [ 10 ] | Tested with 4k to 1M tokens | “Performance regardless of context length” | Consistent performance regardless of context length and optimizing memory use | Fixed compression ratio may not be optimal for all data types |
| HASHEVICT [ 11 ] | 30–70% compression | 1.5–2 prefill speedup against baseline methods such as H 2 O, Scissorshands, and 17 prefill/2 decoding speed against FastGen | Decent performance except at very small budgets (e.g., 10% capacity) | Irreversible eviction; quality drops sharply at 10% cache budget |
| MorphKV [ 13 ] | Up to 5 over Full-Attention. | Up to 4.68 faster than SnapKV | Comparable to SnapKV | Performance is sensitive to hyperparameters like window size and fusion functions |
KV-Cache Management
Key-value (KV) cache management reduces and coordinates Transformer attention state to make long-context inference faster and more memory-efficient.
See all 199 papers