HyperAttention: Long-context Attention in Near-Linear Time
Not on the map. Why?
Abstract (arXiv)
We present an approximate attention mechanism named HyperAttention to address the computational challenges posed by the growing complexity of long contexts used in Large Language Models (LLMs). Recent work suggests that in the worst-case scenario, quadratic time is necessary unless the entries of the attention matrix are bounded or the matrix has low stable rank. We introduce two parameters which measure: (1) the max column norm in the normalized attention matrix, and (2) the ratio of row norms in the unnormalized attention matrix after detecting and removing large entries. We use these fine-grained parameters to capture the hardness of the problem. Despite previous lower bounds, we are able to achieve a linear time sampling algorithm even when the matrix has unbounded entries or a large stable rank, provided the above parameters are small. HyperAttention features a modular design that easily accommodates integration of other fast low-level implementations, particularly FlashAttention. Empirically, employing Locality Sensitive Hashing (LSH) to identify large entries, HyperAttention outperforms existing methods, giving significant speed improvements compared to state-of-the-art solutions like FlashAttention. We validate the empirical performance of HyperAttention on a variety of different long-context length datasets. For example, HyperAttention makes the inference time of ChatGLM2 50% faster on 32k context length while perplexity increases from 5.6 to 6.3. On larger context length, e.g., 131k, with causal masking, HyperAttention offers 5-fold speedup on a single attention layer.
Key facts. Cited by 85 papers in the map (data through 14 Oct 2026). Builds on 30 of its 40 references that are in the map. First posted on arXiv 9 Oct 2023.
Builds on
30 of 40 references.
References · 30
- 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
- 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,811
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
- 2020Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecastingcited by 2,169
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
- 2020Big Bird: Transformers for Longer Sequencescited by 1,684
- 2020Reformer: The Efficient Transformercited by 1,668
18 more
- 2020Rethinking Attention with Performerscited by 1,601
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
- 2021Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNetcited by 1,101
- 2021GLM: General Language Model Pretraining with Autoregressive Blank Infillingcited by 1,031
- 2023Textbooks Are All You Need II: phi-1.5 technical reportcited by 565
- 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 471
- 2023LongNet: Scaling Transformers to 1,000,000,000 Tokenscited by 204
- 2021Scatterbrain: Unifying Sparse and Low-rank Attention Approximationcited by 130
- 2023Fast Attention Requires Bounded Entriescited by 102
- 2021Pixelated Butterfly: Simple and Efficient Sparse training for Neural Network Modelscited by 76
- 2023KDEformer: Accelerating Transformers via Kernel Density Estimationcited by 58
- 2020SMYRF: Efficient Attention using Asymmetric Clusteringcited by 43
- 2020Kernel Density Estimation through Density Constrained Near Neighbor Searchcited by 29
- 2022ViTALiTy: Unifying Low-rank and Sparse Approximation for Vision Transformer Acceleration with a Linear Taylor Attentioncited by 29
- 2020Learning the Positions in CountSketchcited by 20
- 2020Near Input Sparsity Time Kernel Embeddings via Adaptive Samplingcited by 12
- 2016Heavy hitters via cluster-preserving clusteringcited by 10
- 2022Leverage Score Sampling for Tensor Product Matrices in Input Sparsity Timecited by 6
Built on by
Citing papers per year: 2023: 7; 2024: 29; 2025: 31; 2026: 18.
85 papers.
Sort:
By area:
- 2023Efficient Large Language Models: A Surveycited by 186
- 2024SeerAttention: Learning Intrinsic Sparse Attention in Your LLMscited by 124
- 2024Model Compression and Efficient Inference for Large Language Models: A Surveycited by 64
- 2024Human-inspired Episodic Memory for Infinite Context LLMscited by 62
- 2024SampleAttention: Near-Lossless Acceleration of Long Context LLM Inference with Adaptive Structured Sparse Attentioncited by 39
- 2025Tensor Product Attention Is All You Needcited by 31
- 2024The Fine-Grained Complexity of Gradient Computation for Training Large Language Modelscited by 30
- 2024Training Tensor Attention Efficiently: From Cubic to Almost Linear Timecited by 30
- 2024HashAttention: Semantic Sparsity for Faster Inferencecited by 24
- 2024Multi-Layer Transformers Gradient Can be Approximated in Almost Linear Timecited by 22
- 2024SubGen: Token Generation in Sublinear Time and Memorycited by 21
- 2024A Tighter Complexity Analysis of SparseGPTcited by 19
38 more
- 2024HSR-Enhanced Sparse Attention Accelerationcited by 19
- 2023Scaling TabPFN: Sketching and Feature Selection for Tabular Prior-Data Fitted Networkscited by 18
- 2023Why Softmax Attention Outperforms Linear Attentioncited by 15
- 2025L-MTP: Leap Multi-Token Prediction Beyond Adjacent Context for Large Language Modelscited by 15
- 2024What Can We Learn from State Space Models for Machine Learning on Graphs?cited by 13
- 2024Locality-Sensitive Hashing-Based Efficient Point Transformer with Applications in High-Energy Physicscited by 12
- 2024NoMAD-Attention: Efficient LLM Inference on CPUs Through Multiply-add-free Attentioncited by 12
- 2024A Training-free Sub-quadratic Cost Transformer Model Serving Framework With Hierarchically Pruned Attentioncited by 12
- 2024Addax: Utilizing Zeroth-Order Gradients to Improve Memory Efficiency and Performance of SGD for Fine-Tuning Language Modelscited by 11
- 2025Video Latent Flow Matching: Optimal Polynomial Projections for Video Interpolation and Extrapolationcited by 11
- 2025Streaming Attention Approximation via Discrepancy Theorycited by 11
- 2025Inference-time sparse attention with asymmetric indexingcited by 11
- 2024Fundamental Limitations on Subquadratic Alternatives to Transformerscited by 9
- 2024BUZZ: Beehive-structured Sparse KV Cache with Segmented Heavy Hitters for Efficient LLM Inferencecited by 9
- 2025Fast RoPE Attention: Combining the Polynomial Method and Fast Fourier Transformcited by 9
- 2024xT: Nested Tokenization for Larger Context in Large Imagescited by 8
- 2023The Expressibility of Polynomial based Attention Schemecited by 7
- 2025Low-Rank Thinningcited by 7
- 2025Tokenize Image Patches: Global Context Fusion for Effective Haze Removal in Large Imagescited by 7
- 2025Only Large Weights (And Not Skip Connections) Can Prevent the Perils of Rank Collapsecited by 7
- 2023A Theoretical Insight into Attack and Defense of Gradient Leakage in Transformercited by 6
- 2023One Pass Streaming Algorithm for Super Long Token Attention Approximation in Sublinear Spacecited by 6
- 2024The I/O Complexity of Attention, or How Optimal is Flash Attention?cited by 6
- 2024HashEvict: A Pre-Attention KV Cache Eviction Strategy using Locality-Sensitive Hashingcited by 6
- 2025vAttention: Verified Sparse Attentioncited by 6
- 2025Hold Onto That Thought: Assessing KV Cache Compression On Reasoningcited by 6
- 2026WildCat: Near-Linear Attention in Theory and Practicecited by 6
- 2025Compression Barriers for Autoregressive Transformerscited by 5
- 2025Subquadratic Algorithms and Hardness for Attention with Any Temperaturecited by 5
- 2025MonarchAttention: Zero-Shot Conversion to Fast, Hardware-Aware Structured Attentioncited by 5
- 2025Curse of High Dimensionality Issue in Transformer for Long-context Modelingcited by 5
- 2025RACE Attention: A Strictly Linear-Time Attention Layer for Training on Outrageously Large Contextscited by 5
- 2024Expanding Expressivity in Transformer Models with M"obiusAttentioncited by 4
- 2024Efficient Sparse PCA via Block-Diagonalizationcited by 4
- 2025PERK: Long-Context Reasoning as Test-Time Learningcited by 4
- 2025SAS: Simulated Attention Scorecited by 4
- 2025Improved Algorithms for Kernel Matrix-Vector Multiplication Under Sparsity Assumptionscited by 4
- 2026Nearly Optimal Attention Coresetscited by 4
50 most cited of 85 All 85 (JSON)
- 2026HHR: Hierarchical Hash Retrieval for Efficient LLM Generation1 Oct 2026
- 2026CommunityKV: Efficient Long-Context Decoding via Graph Partitioning30 Sep 2026
- 2026Efficiently Approximating Attention Is Hard29 Sep 2026
- 2026ClusterAttention: A training-free speedup of bidirectional attention27 Aug 2026
- 2026Beyond Sparse Weights: When Is Attention Compressible?21 Aug 2026
- 2026ELSAA: Efficient Low-Rank and Sparse Attention Approximation for Training Transformers22 Jul 2026
- 2026HyperVAttention: Efficient Sparse Attention with Spatio-Temporal Clustering for Video Diffusion3 Jul 2026
- 2026Express Language Modeling9 Jun 2026
- 2026Approaching I/O-optimality for Approximate Attention22 May 2026
- 2026Multi-scale Coarse-to-fine Modeling for Test-time Human Motion Control14 May 2026
- 2026Positional LSH: Binary Block Matrix Approximation for Attention with Linear Biases10 May 2026
- 2026Nearly Optimal Attention Coresets7 May 2026
38 more
- 2026On the Computational Hardness of Transformers11 Mar 2026
- 2026HLA: Hadamard Linear Attention12 Feb 2026
- 2026WildCat: Near-Linear Attention in Theory and Practice10 Feb 2026
- 2026SLAY: Geometry-Aware Spherical Linearized Attention with Yat-Kernel4 Feb 2026
- 2026Every Bit Counts: A Theoretical Study of Precision-Expressivity Tradeoffs in Quantized Transformers2 Feb 2026
- 2026Sublinear Time Quantum Algorithm for Attention Approximation31 Jan 2026
- 2025Unifying Learning Dynamics and Generalization in Transformers Scaling Law26 Dec 2025
- 2025Hold Onto That Thought: Assessing KV Cache Compression On Reasoning12 Dec 2025
- 2025End-to-End Multi-Modal Diffusion Mamba15 Oct 2025
- 2025vAttention: Verified Sparse Attention7 Oct 2025
- 2025RACE Attention: A Strictly Linear-Time Attention Layer for Training on Outrageously Large Contexts5 Oct 2025
- 2025Towards Sampling Data Structures for Tensor Products in Turnstile Streams4 Oct 2025
- 2025Even Faster Kernel Matrix Linear Algebra via Density Estimation2 Oct 2025
- 2025Fast attention mechanisms: a tale of parallelism10 Sep 2025
- 2025DySK-Attn: A Framework for Efficient, Real-Time Knowledge Updating in Large Language Models via Dynamic Sparse Knowledge Attention10 Aug 2025
- 2025Improved Algorithms for Kernel Matrix-Vector Multiplication Under Sparsity Assumptions31 Jul 2025
- 2025DistrAttention: An Efficient and Flexible Self-Attention Mechanism on Modern GPUs23 Jul 2025
- 2025SAS: Simulated Attention Score10 Jul 2025
- 2025PERK: Long-Context Reasoning as Test-Time Learning8 Jul 2025
- 2025Two Heads Are Better than One: Simulating Large Transformers with Small Ones13 Jun 2025
- 2025Curse of High Dimensionality Issue in Transformer for Long-context Modeling28 May 2025
- 2025MonarchAttention: Zero-Shot Conversion to Fast, Hardware-Aware Structured Attention24 May 2025
- 2025L-MTP: Leap Multi-Token Prediction Beyond Adjacent Context for Large Language Models23 May 2025
- 2025Only Large Weights (And Not Skip Connections) Can Prevent the Perils of Rank Collapse22 May 2025
- 2025Subquadratic Algorithms and Hardness for Attention with Any Temperature20 May 2025
- 2025Fast RoPE Attention: Combining the Polynomial Method and Fast Fourier Transform17 May 2025
- 2025Efficient Attention via Pre-Scoring: Prioritizing Informative Keys in Transformers16 May 2025
- 2025Tokenize Image Patches: Global Context Fusion for Effective Haze Removal in Large Images13 Apr 2025
- 2025Radar: Fast Long-Context Decoding for Any Transformer13 Mar 2025
- 2025Attention Condensation via Sparsity Induced Regularized Training3 Mar 2025
- 2025Compression Barriers for Autoregressive Transformers21 Feb 2025
- 2025Low-Rank Thinning17 Feb 2025
- 2025Inference-time sparse attention with asymmetric indexing12 Feb 2025
- 2025Streaming Attention Approximation via Discrepancy Theory11 Feb 2025
- 2025Video Latent Flow Matching: Optimal Polynomial Projections for Video Interpolation and Extrapolation1 Feb 2025
- 2025Surface Vision Mamba: Leveraging Bidirectional State Space Model for Efficient Spherical Manifold Representation24 Jan 2025
- 2025Tensor Product Attention Is All You Need11 Jan 2025
- 2024HashAttention: Semantic Sparsity for Faster Inference19 Dec 2024
50 newest of 85 All 85 (JSON)
- 2024SubGen: Token Generation in Sublinear Time and Memorycited by 21
- 2024NoMAD-Attention: Efficient LLM Inference on CPUs Through Multiply-add-free Attentioncited by 12
- 2024BUZZ: Beehive-structured Sparse KV Cache with Segmented Heavy Hitters for Efficient LLM Inferencecited by 9
- 2024HashEvict: A Pre-Attention KV Cache Eviction Strategy using Locality-Sensitive Hashingcited by 6
- 2025Compression Barriers for Autoregressive Transformerscited by 5
- 2024ATP: Enabling Fast LLM Serving via Attention on Top Principal Keyscited by 1
- 2026Beyond Sparse Weights: When Is Attention Compressible?cited by 0
- 2026CommunityKV: Efficient Long-Context Decoding via Graph Partitioningcited by 0
- 2026CommunityKV: Efficient Long-Context Decoding via Graph Partitioning30 Sep 2026
- 2026Beyond Sparse Weights: When Is Attention Compressible?21 Aug 2026
- 2025Compression Barriers for Autoregressive Transformers21 Feb 2025
- 2024HashEvict: A Pre-Attention KV Cache Eviction Strategy using Locality-Sensitive Hashing13 Dec 2024
- 2024BUZZ: Beehive-structured Sparse KV Cache with Segmented Heavy Hitters for Efficient LLM Inference30 Oct 2024
- 2024NoMAD-Attention: Efficient LLM Inference on CPUs Through Multiply-add-free Attention2 Mar 2024
- 2024ATP: Enabling Fast LLM Serving via Attention on Top Principal Keys1 Mar 2024
- 2024SubGen: Token Generation in Sublinear Time and Memory8 Feb 2024
- 2024SeerAttention: Learning Intrinsic Sparse Attention in Your LLMscited by 124
- 2023Efficient Large Language Models: A Surveycited by 186
- 2024Model Compression and Efficient Inference for Large Language Models: A Surveycited by 64
- 2024Human-inspired Episodic Memory for Infinite Context LLMscited by 62
- 2024SampleAttention: Near-Lossless Acceleration of Long Context LLM Inference with Adaptive Structured Sparse Attentioncited by 39
- 2025Tensor Product Attention Is All You Needcited by 31
- 2024The Fine-Grained Complexity of Gradient Computation for Training Large Language Modelscited by 30
- 2024Training Tensor Attention Efficiently: From Cubic to Almost Linear Timecited by 30
- 2024HashAttention: Semantic Sparsity for Faster Inferencecited by 24
- 2024Multi-Layer Transformers Gradient Can be Approximated in Almost Linear Timecited by 22
- 2024A Tighter Complexity Analysis of SparseGPTcited by 19
- 2024HSR-Enhanced Sparse Attention Accelerationcited by 19
- 2023Scaling TabPFN: Sketching and Feature Selection for Tabular Prior-Data Fitted Networkscited by 18
12 most cited of 68 All 68 (JSON)
- 2026HHR: Hierarchical Hash Retrieval for Efficient LLM Generation1 Oct 2026
- 2026Efficiently Approximating Attention Is Hard29 Sep 2026
- 2026ClusterAttention: A training-free speedup of bidirectional attention27 Aug 2026
- 2026ELSAA: Efficient Low-Rank and Sparse Attention Approximation for Training Transformers22 Jul 2026
- 2026Express Language Modeling9 Jun 2026
- 2026Approaching I/O-optimality for Approximate Attention22 May 2026
- 2026Multi-scale Coarse-to-fine Modeling for Test-time Human Motion Control14 May 2026
- 2026Positional LSH: Binary Block Matrix Approximation for Attention with Linear Biases10 May 2026
- 2026Nearly Optimal Attention Coresets7 May 2026
- 2026On the Computational Hardness of Transformers11 Mar 2026
- 2026HLA: Hadamard Linear Attention12 Feb 2026
- 2026WildCat: Near-Linear Attention in Theory and Practice10 Feb 2026
12 newest of 68 All 68 (JSON)