A Simple and Effective L_2 Norm-Based Strategy for KV Cache Compression
Alessio Devoto, Yu Zhao, Simone Scardapane, Pasquale Minervini
摘要
The deployment of large language models (LLMs) is often hindered by the extensive memory requirements of the Key-Value (KV) cache, especially as context lengths increase. Existing approaches to reduce the KV cache size involve either fine-tuning the model to learn a compression strategy or leveraging attention scores to reduce the sequence length. We analyse the attention distributions in decoder-only Transformers-based models and observe that attention allocation patterns stay consistent across most layers. Surprisingly, we find a clear correlation between the L_2 norm and the attention scores over cached KV pairs, where a low L_2 norm of a key embedding usually leads to a high attention score during decoding. This finding indicates that the influence of a KV pair is potentially determined by the key embedding itself before being queried. Based on this observation, we compress the KV cache based on the L_2 norm of key embeddings. Our experimental results show that this simple strategy can reduce the KV cache size by 50% on language modelling and needle-in-a-haystack tasks and 90% on passkey retrieval tasks without losing accuracy. Moreover, without relying on the attention scores, this approach remains compatible with FlashAttention, enabling broader applicability.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 25 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Efficient Streaming Language Models with Attention Sinks 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Efficient Streaming Language Models with Attention Sinks 引用了 H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
- H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models 引用了 Efficient Streaming Language Models with Attention Sinks
- Efficient Streaming Language Models with Attention Sinks 引用了 Vision Transformers Need Registers
- InfiniPot-V: Memory-Constrained KV Cache Compression for Streaming Video Understanding 引用了 H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
- InfiniPot-V: Memory-Constrained KV Cache Compression for Streaming Video Understanding 引用了 KeyDiff: Key Similarity-Based KV Cache Eviction for Long-Context LLM Inference in Resource-Constrained Environments
- Mixing Importance with Diversity: Joint Optimization for KV Cache Compression in Large Vision-Language Models 引用了 InfiniPot-V: Memory-Constrained KV Cache Compression for Streaming Video Understanding
- Mixing Importance with Diversity: Joint Optimization for KV Cache Compression in Large Vision-Language Models 引用了 H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
- H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- KeyDiff: Key Similarity-Based KV Cache Eviction for Long-Context LLM Inference in Resource-Constrained Environments 引用了 Efficient Streaming Language Models with Attention Sinks
- KeyDiff: Key Similarity-Based KV Cache Eviction for Long-Context LLM Inference in Resource-Constrained Environments 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- KeyDiff: Key Similarity-Based KV Cache Eviction for Long-Context LLM Inference in Resource-Constrained Environments 引用了 H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
- KeyDiff: Key Similarity-Based KV Cache Eviction for Long-Context LLM Inference in Resource-Constrained Environments 引用了 Efficient Memory Management for Large Language Model Serving with PagedAttention
- Efficient Memory Management for Large Language Model Serving with PagedAttention 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Homogeneous Keys, Heterogeneous Values: Exploiting Local KV Cache Asymmetry for Long-Context LLMs 引用了 Efficient Streaming Language Models with Attention Sinks
- Homogeneous Keys, Heterogeneous Values: Exploiting Local KV Cache Asymmetry for Long-Context LLMs 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Homogeneous Keys, Heterogeneous Values: Exploiting Local KV Cache Asymmetry for Long-Context LLMs 引用了 H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
引用它的顶会 Paper25
- InfiniPot-V: Memory-Constrained KV Cache Compression for Streaming Video UnderstandingMinsoo Kim, Kyuhong Shim, Jungwook Choi, Simyung ChangNeurIPS 2025 · 62 次引用
- KeyDiff: Key Similarity-Based KV Cache Eviction for Long-Context LLM Inference in Resource-Constrained EnvironmentsJunyoung Park, Dalton Jones, Matthew J. Morse, Raghavv Goel 等NeurIPS 2025 · 47 次引用
- Mixing Importance with Diversity: Joint Optimization for KV Cache Compression in Large Vision-Language ModelsXuyang Liu, Xiyan Gui, Yuchao Zhang, Linfeng ZhangICLR 2026 · 16 次引用
- Let LLMs Speak Embedding Languages: Generative Text Embeddings via Iterative Contrastive RefinementYu-Che Tsai, Kuan-Yu Chen, Yuan-Chi Li, Yuan-Hao Chen 等ICLR 2026 · 11 次引用
- Homogeneous Keys, Heterogeneous Values: Exploiting Local KV Cache Asymmetry for Long-Context LLMsWanyun Cui, Mingwei XuNeurIPS 2025 · 7 次引用
它引用的 Paper13
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra 等NeurIPS 2022 · 5,493 次引用
- Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han 等ICLR 2024 · 1,714 次引用
- Efficient Memory Management for Large Language Model Serving with PagedAttentionWoosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng 等SOSP 2023 · 1,016 次引用
- H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language ModelsZhenyu Zhang, Ying Sheng, Tianyi Zhou, Tianlong Chen 等NeurIPS 2023 · 1,003 次引用
- Vision Transformers Need RegistersTimothée Darcet, Maxime Oquab, Julien Mairal, Piotr BojanowskiICLR 2024 · 769 次引用
相关 Paper
- RazorAttention: Efficient KV Cache Compression Through Retrieval HeadsHanlin Tang, Yang Lin, Jing Lin, Qingsen Han 等ICLR 2025
- Layer-Condensed KV Cache for Efficient Inference of Large Language ModelsHaoyi Wu, Kewei TuACL 2024
- AttentionPredictor: Temporal Patterns Matter for KV Cache CompressionQingyue Yang, Jie Wang, Xing Li, Zhihai Wang 等NeurIPS 2025 · 8 次引用
- Revisiting Multimodal KV Cache Compression: A Frequency-Domain-Guided Outlier-KV-Aware ApproachYaoxin Yang, Peng Ye, Xudong Tan, Chongjun Tu 等CVPR 2026 · 5 次引用
- SnapKV: LLM Knows What You are Looking for Before GenerationYuhong Li, Yingbing Huang, Bowen Yang, Bharat Venkitesh 等NeurIPS 2024 · 1,019 次引用
