Compressing KV Cache for Long-Context LLM Inference with Inter-Layer Attention Similarity
On the map: Efficient LLM inference and serving → KV cache optimization
Abstract (arXiv)
The rapid expansion of context window sizes in Large Language Models~(LLMs) has enabled them to tackle increasingly complex tasks involving lengthy documents. However, this progress comes at the cost of a substantial increase in memory usage during inference, primarily due to the linear growth of the key-value~(KV) cache. Existing KV cache compression methods often discard less relevant tokens, which can lead to significant performance degradation when critical information is lost. In this paper, we propose textscPoD~(Proximal tokens over Distant tokens), a novel KV cache compression framework that allocates memory according to token importance, retaining less important tokens in a more compact, shared form rather than discarding them entirely. Our approach is motivated by two key observations: (1) proximal tokens -- those at the beginning and end of the context -- are significantly more important for next-token prediction, and (2) attention scores for distant tokens are highly redundant across consecutive layers. Leveraging these insights, textscPoD preserves the full KV cache for proximal tokens, while for distant tokens, it shares key states across layers. Since attention scores are determined by both queries and keys, sharing key states enables multiple layers to reuse a single set of keys for distant tokens, substantially reducing KV cache memory without discarding essential context. We further introduce a lightweight post-training adaptation to enable the model to adjust to this new attention-sharing structure. Extensive experiments on both synthetic~(Needle in a Haystack) and real-world long-context benchmarks demonstrate that textscPoD reduces KV cache memory usage by up to 35% without compromising performance. Our method is orthogonal to existing token-selection-based techniques and can be combined with them for further KV cache compression.
Key facts. Cited by 11 papers in the map (data through 7 Oct 2026). Placed in KV cache optimization, one of 12 directions in Efficient LLM inference and serving. Builds on 24 of its 30 references that are in the map. First posted on arXiv 3 Dec 2024.
Builds on
24 of 30 references.
Closest ancestors · 2
Same direction, newest first
- 2024Quest: Query-Aware Sparsity for Efficient Long-Context LLM Inference16 Jun
- 2024Reducing Transformer Key-Value Cache Size with Cross-Layer Attention21 May
Other references · 22
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2020Longformer: The Long-Document Transformercited by 3,362
- 2024Gemini 1.5: Unlocking multimodal understanding across millions of tokens of contextcited by 3,175
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
- 2019ZeRO: Memory Optimizations Toward Training Trillion Parameter Modelscited by 1,278
- 2023AWQ: Activation-aware Weight Quantization for LLM Compression and Accelerationcited by 1,234
10 more
- 2024ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Toolscited by 1,096
- 2024DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Modelcited by 1,093
- 2019Fast Transformer Decoding: One Write-Head is All You Needcited by 700
- 2023LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compressioncited by 443
- 2023DeepSpeed Ulysses: System Optimizations for Enabling Training of Extreme Long Sequence Transformer Modelscited by 239
- 2024How to Train Long-Context Language Models (Effectively)cited by 141
- 2024LazyLLM: Dynamic Token Pruning for Efficient Long Context LLM Inferencecited by 70
- 2019Sharing Attention Weights for Fast Transformercited by 34
- 2021Leveraging redundancy in attention with Reuse Transformerscited by 33
- 2022Lifelong and Continual Learning Dialogue Systemscited by 9
Built on by
Citing papers per year: 2025: 6; 2026: 5.
11 papers.
- 2025Lookahead Q-Cache: Achieving More Consistent KV Cache Eviction via Pseudo Querycited by 15
- 2025KV Cache Compression for Inference Efficiency in LLMs: A Reviewcited by 12
- 2025Memory in Large Language Models: Mechanisms, Evaluation and Evolutioncited by 8
- 2026LycheeDecode: Accelerating Long-Context LLM Inference via Hybrid-Head Sparse Decodingcited by 5
- 2025Attention Basin: Why Contextual Position Matters in Large Language Modelscited by 2
- 2026Monte Carlo Estimation for KV Cache Evictioncited by 1
- 2025Round Attention: A Novel Round-Level Attention Mechanism to Accelerate LLM Inferencecited by 0
- 2025WindowKV: Task-Adaptive Group-Wise KV Cache Window Selection for Efficient LLM Inferencecited by 0
- 2026S3-Attention:Attention-Aligned Endogenous Retrieval for Memory-Bounded Long-Context Inferencecited by 0
- 2026FreqDepthKV: Frequency-Guided Depth Sharing for Robust KV Cache Compression in Long-Context LLM Inferencecited by 0
- 2026DepthWeave-KV: Token-Adaptive Cross-Layer Residual Factorization for Long-Context KV Cache Compressioncited by 0
- 2026Monte Carlo Estimation for KV Cache Eviction6 Oct 2026
- 2026DepthWeave-KV: Token-Adaptive Cross-Layer Residual Factorization for Long-Context KV Cache Compression7 Jul 2026
- 2026FreqDepthKV: Frequency-Guided Depth Sharing for Robust KV Cache Compression in Long-Context LLM Inference7 Jul 2026
- 2026LycheeDecode: Accelerating Long-Context LLM Inference via Hybrid-Head Sparse Decoding4 Feb 2026
- 2026S3-Attention:Attention-Aligned Endogenous Retrieval for Memory-Bounded Long-Context Inference25 Jan 2026
- 2025Memory in Large Language Models: Mechanisms, Evaluation and Evolution23 Sep 2025
- 2025KV Cache Compression for Inference Efficiency in LLMs: A Review8 Aug 2025
- 2025Attention Basin: Why Contextual Position Matters in Large Language Models7 Aug 2025
- 2025Lookahead Q-Cache: Achieving More Consistent KV Cache Eviction via Pseudo Query24 May 2025
- 2025WindowKV: Task-Adaptive Group-Wise KV Cache Window Selection for Efficient LLM Inference23 Mar 2025
- 2025Round Attention: A Novel Round-Level Attention Mechanism to Accelerate LLM Inference21 Feb 2025
Similar, not cited
Close in wording, no citation either way
- 2025KVCompose: Efficient Structured KV Cache Compression with Composite Tokens
- 2024SqueezeAttention: 2D Management of KV-Cache in LLM Inference via Layer-wise Optimal Budget
- 2026CompressKV: Semantic-Retrieval-Guided KV-Cache Compression for Resource-Efficient Long-Context LLM Inference
- 2025ChunkKV: Semantic-Preserving KV Cache Compression for Efficient Long-Context LLM Inference
- 2024TokenSelect: Efficient Long-Context Inference and Length Extrapolation for LLMs via Dynamic Token-Level KV Cache Selection
- 2024More Tokens, Lower Precision: Towards the Optimal Token-Precision Trade-off in KV Cache Compression
- 2026C2KV: Compressed and Composable KV Cache Reuse for Efficient LLM Inference
- 2024ClusterKV: Manipulating LLM KV Cache in Semantic Space for Recallable Compression