DistrAttention: An Efficient and Flexible Self-Attention Mechanism on Modern GPUs
Not on the map. Why?
Abstract (arXiv)
The Transformer architecture has revolutionized deep learning, delivering the state-of-the-art performance in areas such as natural language processing, computer vision, and time series prediction. However, its core component, self-attention, has the quadratic time complexity relative to input sequence length, which hinders the scalability of Transformers. The exsiting approaches on optimizing self-attention either discard full-contextual information or lack of flexibility. In this work, we design DistrAttention, an effcient and flexible self-attention mechanism with the full context. DistrAttention achieves this by grouping data on the embedding dimensionality, usually referred to as d. We realize DistrAttention with a lightweight sampling and fusion method that exploits locality-sensitive hashing to group similar data. A block-wise grouping framework is further designed to limit the errors introduced by locality sensitive hashing. By optimizing the selection of block sizes, DistrAttention could be easily integrated with FlashAttention-2, gaining high-performance on modern GPUs. We evaluate DistrAttention with extensive experiments. The results show that our method is 37% faster than FlashAttention-2 on calculating self-attention. In ViT inference, DistrAttention is the fastest and the most accurate among approximate self-attention mechanisms. In Llama3-1B, DistrAttention still achieves the lowest inference time with only 1% accuray loss.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 24 of its 45 references that are in the map. First posted on arXiv 23 Jul 2025.
Builds on
24 of 45 references.
References · 24
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2020End-to-End Object Detection with Transformerscited by 7,414
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
- 2020Training data-efficient image transformers & distillation through attentioncited by 4,586
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
- 2020Longformer: The Long-Document Transformercited by 3,413
- 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,811
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
12 more
- 2020Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecastingcited by 2,169
- 2020Reformer: The Efficient Transformercited by 1,668
- 2020Linformer: Self-Attention with Linear Complexitycited by 1,474
- 2023FLatten Transformer: Vision Transformer using Focused Linear Attentioncited by 171
- 2021Primer: Searching for Efficient Transformers for Language Modelingcited by 164
- 2023Agent Attention: On the Integration of Softmax and Linear Attentioncited by 90
- 2017TensorFlow-Serving: Flexible, High-Performance ML Servingcited by 85
- 2023HyperAttention: Long-context Attention in Near-Linear Timecited by 85
- 2022Hydra Attention: Efficient Attention with Many Headscited by 55
- 2024A Survey on Transformer Compressioncited by 46
- 2023Primal-Attention: Self-attention through Asymmetric Kernel SVD in Primal Representationcited by 29
- 2024Model Quantization and Hardware Acceleration for Vision Transformers: A Comprehensive Surveycited by 13
Built on by
Not cited yet.