Lune

ACL2025顶会

Squeezed Attention: Accelerating Long Context Length LLM Inference

Coleman Richard Charles Hooper, Sehoon Kim, Hiva Mohammadzadeh, Monishwaran Maheswaran, Sebastian Zhao, June Paik, Michael W. Mahoney, Kurt Keutzer, Amir Gholami

摘要

Emerging Large Language Model (LLM) applications require long input context in order to perform complex tasks like document analysis and code generation. For these long context length applications, the length of the input prompt poses a significant challenge in terms of inference efficiency since the inference costs increase linearly with sequence length. However, for many of these applications, much of the context in the prompt is fixed across different user inputs, thereby providing the opportunity to perform offline optimizations in order to process user inputs quickly, as they are received. We propose Squeezed Attention to accelerate LLM applications where a large portion of the input context is fixed. We first leverage K-means clustering offline to group the keys for the fixed context based on semantic similarity and represent each cluster with a single centroid value. During inference, we compare query tokens from the user input with the centroids to predict which keys from the fixed context are semantically relevant, and then compute exact attention using only the important keys, thereby reducing bandwidth and computational costs. We also present a hierarchical version of our algorithm which can reduce the complexity of attention from linear to logarithmic with respect to the fixed context length. We evaluate our method on various long-context benchmarks including LongBench, where it achieves a 3.1× reduction in KV budget with no noticeable accuracy loss and up to an 8× reduction with only a 0.5 point accuracy gap for the LLaMA-2-7B-32K, LWM-Text-Chat-1M, and Longchat-7B-v1.5-32K models. Futhermore, we implement kernels for centroid comparison and sparse FlashAttention with important keys, achieving more than 4× speedups during both the prefill and generation phases for long-context inference. Our code is available at https://github.com/ SqueezeAILab/SqueezedAttention . Le ve l 2 Cl us te rs Le ve l 1 Cl us te rs Ke ys Query Key

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 20 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • InfiniPot-V: Memory-Constrained KV Cache Compression for Streaming Video Understanding 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • InfiniPot-V: Memory-Constrained KV Cache Compression for Streaming Video Understanding 引用了 Model Tells You What to Discard: Adaptive KV Cache Compression for LLMs
  • Big Bird: Transformers for Longer Sequences 引用了 Compressive Transformers for Long-Range Sequence Modelling
  • KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantization 引用了 Model Tells You What to Discard: Adaptive KV Cache Compression for LLMs
  • Multipole Attention for Efficient Long Context Reasoning 引用了 KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantization
  • Multipole Attention for Efficient Long Context Reasoning 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • Multipole Attention for Efficient Long Context Reasoning 引用了 RetrievalAttention: Accelerating Long-Context LLM Inference via Vector Retrieval
  • FreeKV: Boosting KV Cache Retrieval for Efficient LLM Inference 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning 引用了 Big Bird: Transformers for Longer Sequences
  • RetrievalAttention: Accelerating Long-Context LLM Inference via Vector Retrieval 引用了 Big Bird: Transformers for Longer Sequences
  • RetrievalAttention: Accelerating Long-Context LLM Inference via Vector Retrieval 引用了 Model Tells You What to Discard: Adaptive KV Cache Compression for LLMs
  • Sparse Attention Adaptation for Long Reasoning 引用了 Big Bird: Transformers for Longer Sequences
  • Sparse Attention Adaptation for Long Reasoning 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • Sparse Attention Adaptation for Long Reasoning 引用了 Model Tells You What to Discard: Adaptive KV Cache Compression for LLMs
  • Sparse Attention Adaptation for Long Reasoning 引用了 RetrievalAttention: Accelerating Long-Context LLM Inference via Vector Retrieval
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper20

  1. RetrievalAttention: Accelerating Long-Context LLM Inference via Vector RetrievalDi Liu, Meng Chen, Baotong Lu, Huiqiang Jiang 等NeurIPS 2025 · 148 次引用
  2. InfiniPot-V: Memory-Constrained KV Cache Compression for Streaming Video UnderstandingMinsoo Kim, Kyuhong Shim, Jungwook Choi, Simyung ChangNeurIPS 2025 · 62 次引用
  3. FreeKV: Boosting KV Cache Retrieval for Efficient LLM InferenceGuangda Liu, Chengwei Li, Zhenyu Ning, Jing Lin 等ICLR 2026 · 17 次引用
  4. Sparse Attention Adaptation for Long ReasoningYizhao Gao, Shuming Guo, Shijie Cao, Yuqing Xia 等ICLR 2026 · 17 次引用
  5. Multipole Attention for Efficient Long Context ReasoningColeman Hooper, Sebastian Zhao, Luca Manolache, Sehoon Kim 等NeurIPS 2025 · 14 次引用

它引用的 Paper15

  1. Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie 等NeurIPS 2020 · 3,159 次引用
  2. FlashAttention-2: Faster Attention with Better Parallelism and Work PartitioningTri DaoICLR 2024 · 2,600 次引用
  3. Compressive Transformers for Long-Range Sequence ModellingJack W. Rae, Anna Potapenko, Siddhant M. Jayakumar, Chloe Hillier 等ICLR 2020 · 833 次引用
  4. KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache QuantizationColeman Hooper, Sehoon Kim, Hiva Mohammadzadeh, Michael W. Mahoney 等NeurIPS 2024 · 738 次引用
  5. Model Tells You What to Discard: Adaptive KV Cache Compression for LLMsSuyu Ge, Yunan Zhang, Liyuan Liu, Minjia Zhang 等ICLR 2024 · 432 次引用

相关 Paper

  1. ClusterAttn: KV Cache Compression under Intrinsic Attention ClusteringMinwei Zhang, Haifeng Sun, Jingyu Wang, Shaolong Li 等ACL 2025 · 5 次引用
  2. SALE : Low-bit Estimation for Efficient Sparse Attention in Long-context LLM PrefillingXiaodong Ji, Hailin Zhang, Fangcheng Fu, Bin CuiICML 2026 · 3 次引用
  3. SqueezeAttention: 2D Management of KV-Cache in LLM Inference via Layer-wise Optimal BudgetZihao Wang, Bin Cui, Shaoduo GanICLR 2025
  4. LongLoRA: Efficient Fine-tuning of Long-Context Large Language ModelsYukang Chen, Shengju Qian, Haotian Tang, Xin Lai 等ICLR 2024 · 254 次引用
  5. SCBench: A KV Cache-Centric Analysis of Long-Context MethodsYucheng Li, Huiqiang Jiang, Qianhui Wu, Xufang Luo 等ICLR 2025
黄昏的海面,两侧是细线勾勒的悬崖