Layer-Condensed KV Cache for Efficient Inference of Large Language Models
Haoyi Wu, Kewei Tu
摘要
Huge memory consumption has been a major bottleneck for deploying high-throughput large language models in real-world applications. In addition to the large number of parameters, the key-value (KV) cache for the attention mechanism in the transformer architecture consumes a significant amount of memory, especially when the number of layers is large for deep language models. In this paper, we propose a novel method that only computes and caches the KVs of a small number of layers, thus significantly saving memory consumption and improving inference throughput. Our experiments on large language models show that our method achieves up to 26× higher throughput than standard transformers and competitive performance in language modeling and downstream tasks. In addition, our method is orthogonal to existing transformer memory-saving techniques, so it is straightforward to integrate them with our model, achieving further improvement in inference efficiency. Our code is available at https://github.com/whyNLP/LCKV .
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 28 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Efficient Streaming Language Models with Attention Sinks 引用了 PIQA: Reasoning about Physical Commonsense in Natural Language
- Efficient Streaming Language Models with Attention Sinks 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Efficient Streaming Language Models with Attention Sinks 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- MiniCache: KV Cache Compression in Depth Dimension for Large Language Models 引用了 Efficient Streaming Language Models with Attention Sinks
- MiniCache: KV Cache Compression in Depth Dimension for Large Language Models 引用了 PIQA: Reasoning about Physical Commonsense in Natural Language
- MiniCache: KV Cache Compression in Depth Dimension for Large Language Models 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- MiniCache: KV Cache Compression in Depth Dimension for Large Language Models 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- MiniCache: KV Cache Compression in Depth Dimension for Large Language Models 引用了 Efficient Memory Management for Large Language Model Serving with PagedAttention
- FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- ChunkKV: Semantic-Preserving KV Cache Compression for Efficient Long-Context LLM Inference 引用了 Efficient Streaming Language Models with Attention Sinks
- ChunkKV: Semantic-Preserving KV Cache Compression for Efficient Long-Context LLM Inference 引用了 MiniCache: KV Cache Compression in Depth Dimension for Large Language Models
- ChunkKV: Semantic-Preserving KV Cache Compression for Efficient Long-Context LLM Inference 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- ChunkKV: Semantic-Preserving KV Cache Compression for Efficient Long-Context LLM Inference 引用了 Many-Shot In-Context Learning
- Efficient Memory Management for Large Language Model Serving with PagedAttention 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level Computation 引用了 Efficient Streaming Language Models with Attention Sinks
- Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level Computation 引用了 MiniCache: KV Cache Compression in Depth Dimension for Large Language Models
- Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level Computation 引用了 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level Computation 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level Computation 引用了 Efficient Memory Management for Large Language Model Serving with PagedAttention
引用它的顶会 Paper28
- Many-Shot In-Context LearningRishabh Agarwal, Avi Singh, Lei Zhang, Bernd Bohnet 等NeurIPS 2024 · 271 次引用
- MiniCache: KV Cache Compression in Depth Dimension for Large Language ModelsAkide Liu, Jing Liu, Zizheng Pan, Yefei He 等NeurIPS 2024 · 160 次引用
- Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level ComputationSangmin Bae, Yujin Kim, Reza Bayat, Sungnyun Kim 等NeurIPS 2025 · 143 次引用
- ChunkKV: Semantic-Preserving KV Cache Compression for Efficient Long-Context LLM InferenceXiang Liu, Zhenheng Tang, Peijie Dong, Zeyu Li 等NeurIPS 2025 · 71 次引用
- Cache-to-Cache: Direct Semantic Communication Between Large Language ModelsTianyu Fu, Zihan Min, Hanling Zhang, Jichao Yan 等ICLR 2026 · 59 次引用
它引用的 Paper16
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra 等NeurIPS 2022 · 5,493 次引用
- PIQA: Reasoning about Physical Commonsense in Natural LanguageYonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao 等AAAI 2020 · 2,916 次引用
- FlashAttention-2: Faster Attention with Better Parallelism and Work PartitioningTri DaoICLR 2024 · 2,600 次引用
- 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 次引用
相关 Paper
- PyramidInfer: Pyramid KV Cache Compression for High-throughput LLM InferenceDongjie Yang, Xiaodong Han, Yan Gao, Yao Hu 等ACL Findings 2024 · 31 次引用
- SqueezeAttention: 2D Management of KV-Cache in LLM Inference via Layer-wise Optimal BudgetZihao Wang, Bin Cui, Shaoduo GanICLR 2025
- A Simple and Effective L_2 Norm-Based Strategy for KV Cache CompressionAlessio Devoto, Yu Zhao, Simone Scardapane, Pasquale MinerviniEMNLP 2024 · 3 次引用
- Cost-Efficient Large Language Model Serving for Multi-turn Conversations with CachedAttentionBin Gao, Zhuomin He, Puru Sharma, Qingxuan Kang 等USENIX ATC 2024 · 273 次引用
- SpindleKV: A Novel KV Cache Reduction Method Balancing Both Shallow and Deep LayersZicong Tang, Luohe Shi, Zuchao Li, Baoyuan Qi 等ACL 2025 · 7 次引用
