mlsanityData to 14 Oct 2026

HyperAttention: Long-context Attention in Near-Linear Time

arXiv 2310.05869 ↗First posted 9 Oct 2023cs.LG cs.AIcited by 85

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

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2020Language Models are Few-Shot Learnerscited by 32,419
  4. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
  5. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  6. 2020End-to-End Object Detection with Transformerscited by 7,414
  7. 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,811
  8. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
  9. 2020Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecastingcited by 2,169
  10. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
  11. 2020Big Bird: Transformers for Longer Sequencescited by 1,684
  12. 2020Reformer: The Efficient Transformercited by 1,668
18 more
  1. 2020Rethinking Attention with Performerscited by 1,601
  2. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
  3. 2021Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNetcited by 1,101
  4. 2021GLM: General Language Model Pretraining with Autoregressive Blank Infillingcited by 1,031
  5. 2023Textbooks Are All You Need II: phi-1.5 technical reportcited by 565
  6. 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 471
  7. 2023LongNet: Scaling Transformers to 1,000,000,000 Tokenscited by 204
  8. 2021Scatterbrain: Unifying Sparse and Low-rank Attention Approximationcited by 130
  9. 2023Fast Attention Requires Bounded Entriescited by 102
  10. 2021Pixelated Butterfly: Simple and Efficient Sparse training for Neural Network Modelscited by 76
  11. 2023KDEformer: Accelerating Transformers via Kernel Density Estimationcited by 58
  12. 2020SMYRF: Efficient Attention using Asymmetric Clusteringcited by 43
  13. 2020Kernel Density Estimation through Density Constrained Near Neighbor Searchcited by 29
  14. 2022ViTALiTy: Unifying Low-rank and Sparse Approximation for Vision Transformer Acceleration with a Linear Taylor Attentioncited by 29
  15. 2020Learning the Positions in CountSketchcited by 20
  16. 2020Near Input Sparsity Time Kernel Embeddings via Adaptive Samplingcited by 12
  17. 2016Heavy hitters via cluster-preserving clusteringcited by 10
  18. 2022Leverage Score Sampling for Tensor Product Matrices in Input Sparsity Timecited by 6

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 7; 2024: 29; 2025: 31; 2026: 18.

85 papers.

Sort:

By area:

  1. 2023Efficient Large Language Models: A Surveycited by 186
  2. 2024SeerAttention: Learning Intrinsic Sparse Attention in Your LLMscited by 124
  3. 2024Model Compression and Efficient Inference for Large Language Models: A Surveycited by 64
  4. 2024Human-inspired Episodic Memory for Infinite Context LLMscited by 62
  5. 2024SampleAttention: Near-Lossless Acceleration of Long Context LLM Inference with Adaptive Structured Sparse Attentioncited by 39
  6. 2025Tensor Product Attention Is All You Needcited by 31
  7. 2024The Fine-Grained Complexity of Gradient Computation for Training Large Language Modelscited by 30
  8. 2024Training Tensor Attention Efficiently: From Cubic to Almost Linear Timecited by 30
  9. 2024HashAttention: Semantic Sparsity for Faster Inferencecited by 24
  10. 2024Multi-Layer Transformers Gradient Can be Approximated in Almost Linear Timecited by 22
  11. 2024SubGen: Token Generation in Sublinear Time and Memorycited by 21
  12. 2024A Tighter Complexity Analysis of SparseGPTcited by 19
38 more
  1. 2024HSR-Enhanced Sparse Attention Accelerationcited by 19
  2. 2023Scaling TabPFN: Sketching and Feature Selection for Tabular Prior-Data Fitted Networkscited by 18
  3. 2023Why Softmax Attention Outperforms Linear Attentioncited by 15
  4. 2025L-MTP: Leap Multi-Token Prediction Beyond Adjacent Context for Large Language Modelscited by 15
  5. 2024What Can We Learn from State Space Models for Machine Learning on Graphs?cited by 13
  6. 2024Locality-Sensitive Hashing-Based Efficient Point Transformer with Applications in High-Energy Physicscited by 12
  7. 2024NoMAD-Attention: Efficient LLM Inference on CPUs Through Multiply-add-free Attentioncited by 12
  8. 2024A Training-free Sub-quadratic Cost Transformer Model Serving Framework With Hierarchically Pruned Attentioncited by 12
  9. 2024Addax: Utilizing Zeroth-Order Gradients to Improve Memory Efficiency and Performance of SGD for Fine-Tuning Language Modelscited by 11
  10. 2025Video Latent Flow Matching: Optimal Polynomial Projections for Video Interpolation and Extrapolationcited by 11
  11. 2025Streaming Attention Approximation via Discrepancy Theorycited by 11
  12. 2025Inference-time sparse attention with asymmetric indexingcited by 11
  13. 2024Fundamental Limitations on Subquadratic Alternatives to Transformerscited by 9
  14. 2024BUZZ: Beehive-structured Sparse KV Cache with Segmented Heavy Hitters for Efficient LLM Inferencecited by 9
  15. 2025Fast RoPE Attention: Combining the Polynomial Method and Fast Fourier Transformcited by 9
  16. 2024xT: Nested Tokenization for Larger Context in Large Imagescited by 8
  17. 2023The Expressibility of Polynomial based Attention Schemecited by 7
  18. 2025Low-Rank Thinningcited by 7
  19. 2025Tokenize Image Patches: Global Context Fusion for Effective Haze Removal in Large Imagescited by 7
  20. 2025Only Large Weights (And Not Skip Connections) Can Prevent the Perils of Rank Collapsecited by 7
  21. 2023A Theoretical Insight into Attack and Defense of Gradient Leakage in Transformercited by 6
  22. 2023One Pass Streaming Algorithm for Super Long Token Attention Approximation in Sublinear Spacecited by 6
  23. 2024The I/O Complexity of Attention, or How Optimal is Flash Attention?cited by 6
  24. 2024HashEvict: A Pre-Attention KV Cache Eviction Strategy using Locality-Sensitive Hashingcited by 6
  25. 2025vAttention: Verified Sparse Attentioncited by 6
  26. 2025Hold Onto That Thought: Assessing KV Cache Compression On Reasoningcited by 6
  27. 2026WildCat: Near-Linear Attention in Theory and Practicecited by 6
  28. 2025Compression Barriers for Autoregressive Transformerscited by 5
  29. 2025Subquadratic Algorithms and Hardness for Attention with Any Temperaturecited by 5
  30. 2025MonarchAttention: Zero-Shot Conversion to Fast, Hardware-Aware Structured Attentioncited by 5
  31. 2025Curse of High Dimensionality Issue in Transformer for Long-context Modelingcited by 5
  32. 2025RACE Attention: A Strictly Linear-Time Attention Layer for Training on Outrageously Large Contextscited by 5
  33. 2024Expanding Expressivity in Transformer Models with M"obiusAttentioncited by 4
  34. 2024Efficient Sparse PCA via Block-Diagonalizationcited by 4
  35. 2025PERK: Long-Context Reasoning as Test-Time Learningcited by 4
  36. 2025SAS: Simulated Attention Scorecited by 4
  37. 2025Improved Algorithms for Kernel Matrix-Vector Multiplication Under Sparsity Assumptionscited by 4
  38. 2026Nearly Optimal Attention Coresetscited by 4

50 most cited of 85 All 85 (JSON)