Lean Attention: Hardware-Aware Scalable Attention Mechanism for the Decode-Phase of Transformers
Not on the map. Why?
Abstract (arXiv)
Transformer-based models have emerged as one of the most widely used architectures for natural language processing, natural language generation, and image generation. The size of the state-of-the-art models has increased steadily reaching billions of parameters. These huge models are memory hungry and incur significant inference latency even on cutting edge AI-accelerators, such as GPUs. Specifically, the time and memory complexity of the attention operation is quadratic in terms of the total context length, i.e., prompt and output tokens. Thus, several optimizations such as key-value tensor caching and FlashAttention computation have been proposed to deliver the low latency demands of applications relying on such large models. However, these techniques do not cater to the computationally distinct nature of different phases during inference. To that end, we propose LeanAttention, a scalable technique of computing self-attention for the token-generation phase (decode-phase) of decoder-only transformer models. LeanAttention enables scaling the attention mechanism implementation for the challenging case of long context lengths by re-designing the execution flow for the decode-phase. We identify that the associative property of online softmax can be treated as a reduction operation thus allowing us to parallelize the attention computation over these large context lengths. We extend the "stream-K" style reduction of tiled calculation to self-attention to enable parallel computation resulting in an average of 2.6x attention execution speedup over FlashAttention-2 and up to 8.33x speedup for 512k context lengths.
Key facts. Cited by 16 papers in the map (data through 7 Oct 2026). Builds on 22 of its 34 references that are in the map. First posted on arXiv 17 May 2024.
Builds on
22 of 34 references.
References · 22
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023GPT-4 Technical Reportcited by 18,132
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
- 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,464
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,551
- 2019HuggingFace's Transformers: State-of-the-art Natural Language Processingcited by 2,201
- 2023Textbooks Are All You Need II: phi-1.5 technical reportcited by 559
- 2022Efficiently Scaling Transformer Inferencecited by 529
10 more
- 2023Ring Attention with Blockwise Transformers for Near-Infinite Contextcited by 448
- 2024Long-context LLMs Struggle with Long In-context Learningcited by 285
- 2024Data Engineering for Scaling Language Models to 128K Contextcited by 183
- 2018Online normalizer calculation for softmaxcited by 154
- 2020Data Movement Is All You Need: A Case Study on Optimizing Transformerscited by 108
- 2024Long Context Compression with Activation Beaconcited by 101
- 2023Full Stack Optimization of Transformer Inference: a Surveycited by 79
- 2023FlashDecoding++: Faster Large Language Model Inference on GPUscited by 70
- 2023Striped Attention: Faster Ring Attention for Causal Transformerscited by 52
- 2023Stream-K: Work-centric Parallel Decomposition for Dense Matrix-Matrix Multiplication on the GPUcited by 22
Built on by
Citing papers per year: 2024: 2; 2025: 6; 2026: 8.
16 papers.
Sort:
By area:
- 2024FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precisioncited by 507
- 2025FlashInfer: Efficient and Customizable Attention Engine for LLM Inference Servingcited by 248
- 2024POD-Attention: Unlocking Full Prefill-Decode Overlap for Faster LLM Inferencecited by 46
- 2025SwizzlePerf: Hardware-Aware LLMs for GPU Kernel Performance Optimizationcited by 11
- 2026Switch Attention: Towards Dynamic and Fine-grained Hybrid Transformerscited by 4
- 2025SALE : Low-bit Estimation for Efficient Sparse Attention in Long-context LLM Prefillingcited by 3
- 2026InnerQ: Hardware-Aware Tuning-Free Quantization of KV Cache for Large Language Modelscited by 2
- 2026ShuntServe: Cost-Efficient LLM Serving on Heterogeneous Spot GPU Clusterscited by 1
- 2025ATTENTION2D: Communication Efficient Distributed Self-Attention Mechanismcited by 0
- 2025Exact Causal Attention with 10% Fewer Operationscited by 0
- 2025Optimizing Attention on GPUs by Exploiting GPU Architectural NUMA Effectscited by 0
- 2026LLM-CoOpt: A Co-Design and Optimization Framework for Efficient LLM Inference on Heterogeneous Platformscited by 0
4 more
- 2026VTC: DNN Compilation with Virtual Tensors for Data Movement Eliminationcited by 0
- 2026ELSA: Exact Linear-Scan Attention for Fast and Memory-Light Vision Transformerscited by 0
- 2026FoldAttention: Declared-Reference Softmax for Fast Decode and Deterministic Backwardcited by 0
- 2026MOIRA: Mass-Oriented Indexing with Ragged Attention for Long-Context Decodingcited by 0
- 2026MOIRA: Mass-Oriented Indexing with Ragged Attention for Long-Context Decoding3 Oct 2026
- 2026FoldAttention: Declared-Reference Softmax for Fast Decode and Deterministic Backward27 Sep 2026
- 2026ShuntServe: Cost-Efficient LLM Serving on Heterogeneous Spot GPU Clusters17 Jun 2026
- 2026ELSA: Exact Linear-Scan Attention for Fast and Memory-Light Vision Transformers26 Apr 2026
- 2026Switch Attention: Towards Dynamic and Fine-grained Hybrid Transformers27 Mar 2026
- 2026InnerQ: Hardware-Aware Tuning-Free Quantization of KV Cache for Large Language Models26 Feb 2026
- 2026VTC: DNN Compilation with Virtual Tensors for Data Movement Elimination11 Feb 2026
- 2026LLM-CoOpt: A Co-Design and Optimization Framework for Efficient LLM Inference on Heterogeneous Platforms10 Feb 2026
- 2025Optimizing Attention on GPUs by Exploiting GPU Architectural NUMA Effects3 Nov 2025
- 2025Exact Causal Attention with 10% Fewer Operations5 Oct 2025
- 2025SwizzlePerf: Hardware-Aware LLMs for GPU Kernel Performance Optimization27 Aug 2025
- 2025SALE : Low-bit Estimation for Efficient Sparse Attention in Long-context LLM Prefilling30 May 2025
4 more
- 2025ATTENTION2D: Communication Efficient Distributed Self-Attention Mechanism20 Mar 2025
- 2025FlashInfer: Efficient and Customizable Attention Engine for LLM Inference Serving2 Jan 2025
- 2024POD-Attention: Unlocking Full Prefill-Decode Overlap for Faster LLM Inference23 Oct 2024
- 2024FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision11 Jul 2024
- 2025FlashInfer: Efficient and Customizable Attention Engine for LLM Inference Servingcited by 248
- 2026InnerQ: Hardware-Aware Tuning-Free Quantization of KV Cache for Large Language Modelscited by 2
- 2026ShuntServe: Cost-Efficient LLM Serving on Heterogeneous Spot GPU Clusterscited by 1
- 2026LLM-CoOpt: A Co-Design and Optimization Framework for Efficient LLM Inference on Heterogeneous Platformscited by 0
- 2026FoldAttention: Declared-Reference Softmax for Fast Decode and Deterministic Backwardcited by 0
- 2026MOIRA: Mass-Oriented Indexing with Ragged Attention for Long-Context Decodingcited by 0
- 2026MOIRA: Mass-Oriented Indexing with Ragged Attention for Long-Context Decoding3 Oct 2026
- 2026FoldAttention: Declared-Reference Softmax for Fast Decode and Deterministic Backward27 Sep 2026
- 2026ShuntServe: Cost-Efficient LLM Serving on Heterogeneous Spot GPU Clusters17 Jun 2026
- 2026InnerQ: Hardware-Aware Tuning-Free Quantization of KV Cache for Large Language Models26 Feb 2026
- 2026LLM-CoOpt: A Co-Design and Optimization Framework for Efficient LLM Inference on Heterogeneous Platforms10 Feb 2026
- 2025FlashInfer: Efficient and Customizable Attention Engine for LLM Inference Serving2 Jan 2025
- 2024FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precisioncited by 507
- 2024POD-Attention: Unlocking Full Prefill-Decode Overlap for Faster LLM Inferencecited by 46
- 2025SwizzlePerf: Hardware-Aware LLMs for GPU Kernel Performance Optimizationcited by 11
- 2026Switch Attention: Towards Dynamic and Fine-grained Hybrid Transformerscited by 4
- 2025SALE : Low-bit Estimation for Efficient Sparse Attention in Long-context LLM Prefillingcited by 3
- 2025ATTENTION2D: Communication Efficient Distributed Self-Attention Mechanismcited by 0
- 2025Exact Causal Attention with 10% Fewer Operationscited by 0
- 2025Optimizing Attention on GPUs by Exploiting GPU Architectural NUMA Effectscited by 0
- 2026VTC: DNN Compilation with Virtual Tensors for Data Movement Eliminationcited by 0
- 2026ELSA: Exact Linear-Scan Attention for Fast and Memory-Light Vision Transformerscited by 0
- 2026ELSA: Exact Linear-Scan Attention for Fast and Memory-Light Vision Transformers26 Apr 2026
- 2026Switch Attention: Towards Dynamic and Fine-grained Hybrid Transformers27 Mar 2026
- 2026VTC: DNN Compilation with Virtual Tensors for Data Movement Elimination11 Feb 2026
- 2025Optimizing Attention on GPUs by Exploiting GPU Architectural NUMA Effects3 Nov 2025
- 2025Exact Causal Attention with 10% Fewer Operations5 Oct 2025
- 2025SwizzlePerf: Hardware-Aware LLMs for GPU Kernel Performance Optimization27 Aug 2025
- 2025SALE : Low-bit Estimation for Efficient Sparse Attention in Long-context LLM Prefilling30 May 2025
- 2025ATTENTION2D: Communication Efficient Distributed Self-Attention Mechanism20 Mar 2025
- 2024POD-Attention: Unlocking Full Prefill-Decode Overlap for Faster LLM Inference23 Oct 2024
- 2024FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision11 Jul 2024