mlsanityData to 7 Oct 2026

Training Tensor Attention Efficiently: From Cubic to Almost Linear Time

arXiv 2405.16411 ↗First posted 26 May 2024cs.LG cs.AI cs.CLcited by 29

Not on the map. Why?

Abstract (arXiv)

Tensor Attention, a multi-view attention that is able to capture high-order correlations among multiple modalities, can overcome the representational limitations of classical matrix attention. However, the O(n3) time complexity of tensor attention poses a significant obstacle to its utilization in transformers, where n is the input sequence length. In this work, we prove that the backward gradient of tensor attention training can be computed in almost linear time n1+o(1), the same complexity as its forward computation under the bounded entries assumption. We provide a closed-form solution for the gradient and propose a fast computation method utilizing polynomial approximation methods and tensor algebraic techniques. Furthermore, we prove the necessity and tightness of our assumption through hardness analysis, showing that slightly weakening it renders the gradient problem unsolvable in truly subcubic time. Our theoretical results establish the feasibility of efficient higher-order transformer training and may facilitate practical applications of tensor attention architectures.

Key facts. Cited by 29 papers in the map (data through 7 Oct 2026). Builds on 60 of its 99 references that are in the map. First posted on arXiv 26 May 2024.

Builds on

60 of 99 references.

References · 60

  1. 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
  2. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  3. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  4. 2023Visual Instruction Tuningcited by 7,792
  5. 2023BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Modelscited by 6,069
  6. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  7. 2023Improved Baselines with Visual Instruction Tuningcited by 4,362
  8. 2022Flamingo: a Visual Language Model for Few-Shot Learningcited by 4,337
  9. 2022BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generationcited by 4,310
  10. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
  11. 2023Qwen Technical Reportcited by 3,273
  12. 2023MiniGPT-4: Enhancing Vision-Language Understanding with Advanced Large Language Modelscited by 2,689
38 more
  1. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,551
  2. 2023Qwen-VL: A Versatile Vision-Language Model for Understanding, Localization, Text Reading, and Beyondcited by 2,179
  3. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
  4. 2020Rethinking Attention with Performerscited by 1,584
  5. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
  6. 2023A Survey on Evaluation of Large Language Modelscited by 1,227
  7. 2023LLaMA-Adapter: Efficient Fine-tuning of Language Models with Zero-init Attentioncited by 776
  8. 2023Large Language Modelscited by 774
  9. 2023LLaMA-Adapter V2: Parameter-Efficient Visual Instruction Modelcited by 602
  10. 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 584
  11. 2021Linear Transformers Are Secretly Fast Weight Programmerscited by 471
  12. 2019CamemBERT: a Tasty French Language Modelcited by 368
  13. 2023Trained Transformers Learn Linear Models In-Contextcited by 331
  14. 2024LongRoPE: Extending LLM Context Window Beyond 2 Million Tokenscited by 302
  15. 2023Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspectivecited by 293
  16. 2024Massive Activations in Large Language Modelscited by 277
  17. 2022Transformers Learn Shortcuts to Automatacited by 260
  18. 2023LongLoRA: Efficient Fine-tuning of Long-Context Large Language Modelscited by 243
  19. 2024MM1: Methods, Analysis & Insights from Multimodal LLM Pre-trainingcited by 230
  20. 2023Large Language Models in Finance: A Surveycited by 223
  21. 2022The Parallelism Tradeoff: Limitations of Log-Precision Transformerscited by 191
  22. 2024Monitoring AI-Modified Content at Scale: A Case Study on the Impact of ChatGPT on AI Conference Peer Reviewscited by 160
  23. 2022On The Computational Complexity of Self-Attentioncited by 137
  24. 2024LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuningcited by 133
  25. 2023Representational Strengths and Limitations of Transformerscited by 132
  26. 2023Unlimiformer: Long-Range Transformers with Unlimited Length Inputcited by 127
  27. 2024The Hedgehog & the Porcupine: Expressive Linear Attentions with Softmax Mimicrycited by 119
  28. 2023Fast Attention Requires Bounded Entriescited by 102
  29. 2023Linear attention is (maybe) all you need (to understand transformer optimization)cited by 97
  30. 2017Recovery Guarantees for One-hidden-layer Neural Networkscited by 94
  31. 2019A Tensorized Transformer for Language Modelingcited by 85
  32. 2023HyperAttention: Long-context Attention in Near-Linear Timecited by 85
  33. 2023KDEformer: Accelerating Transformers via Kernel Density Estimationcited by 58
  34. 2023A Short Survey of Viewing Large Language Models in Legal Aspectcited by 51
  35. 2024Megalodon: Efficient LLM Pretraining and Inference with Unlimited Context Lengthcited by 46
  36. 2023How to Capture Higher-order Correlations? Generalizing Matrix Softmax Attention to Kronecker Computationcited by 44
  37. 2017Tensor Robust Principal Component Analysis: Exact Recovery of Corrupted Low-Rank Tensors via Convex Optimizationcited by 35
  38. 2022Linear Complexity Randomized Self-attention Mechanismcited by 31

50 most cited of 60 All 60 (JSON)

Built on by

Cited by year

Citing papers per year: 2024: 16; 2025: 13.

29 papers.

Sort:

By area:

  1. 2024Why Larger Language Models Do In-context Learning Differently?cited by 44
  2. 2024On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs)cited by 39
  3. 2024Do Large Language Models Have Compositional Ability? An Investigation into Limitations and Scalabilitycited by 39
  4. 2024Computational Limits of Low-Rank Adaptation (LoRA) Fine-Tuning for Transformer Modelscited by 31
  5. 2024Circuit Complexity Bounds for RoPE-based Transformer Architecturecited by 26
  6. 2024Multi-Layer Transformers Gradient Can be Approximated in Almost Linear Timecited by 22
  7. 2024Bypassing the Exponential Dependency: Looped Transformers Efficiently Learn In-context by Multi-step Gradient Descentcited by 21
  8. 2024The Computational Limits of State-Space Models and Mamba via the Lens of Circuit Complexitycited by 21
  9. 2024A Tighter Complexity Analysis of SparseGPTcited by 19
  10. 2024Looped ReLU MLPs May Be All You Need as Practical Programmable Computerscited by 19
  11. 2024HSR-Enhanced Sparse Attention Accelerationcited by 19
  12. 2025Your Vision-Language Model Can't Even Count to 20: Exposing the Failures of VLMs in Compositional Countingcited by 17
17 more
  1. 2024Provable Differentially Private Computation of the Cross-Attention Mechanismcited by 14
  2. 2024Theoretical Constraints on the Expressive Power of mathsfRoPE-based Tensor Attention Transformerscited by 12
  3. 2025Video Latent Flow Matching: Optimal Polynomial Projections for Video Interpolation and Extrapolationcited by 11
  4. 2024Towards Infinite-Long Prefix in Transformercited by 10
  5. 2025On Computational Limits of FlowAR Models: Expressivity and Efficiencycited by 10
  6. 2024Modern Hopfield Networks Require Chain-of-Thought to Solve mathsfNC1-Hard Problemscited by 9
  7. 2025Theoretical Guarantees for High Order Trajectory Refinement in Generative Flowscited by 9
  8. 2025Fast RoPE Attention: Combining the Polynomial Method and Fast Fourier Transformcited by 9
  9. 2025Only Large Weights (And Not Skip Connections) Can Prevent the Perils of Rank Collapsecited by 7
  10. 2025Scaling Law Phenomena Across Regression Paradigms: Multiple and Kernel Approachescited by 4
  11. 2025When Can We Solve the Weighted Low Rank Approximation Problem in Truly Subquadratic Time?cited by 3
  12. 2024Differentially Private Kernel Density Estimationcited by 2
  13. 2025Time and Memory Trade-off of KV-Cache Compression in Tensor Transformer Decodingcited by 2
  14. 2025Theoretical Foundation of Flow-Based Time Series Generation: Provable Approximation, Generalization, and Efficiencycited by 2
  15. 2025Fundamental Limits of Crystalline Equivariant Graph Neural Networks: A Circuit Complexity Perspectivecited by 0
  16. 2025Can Language Models Compose Skills In-Context?cited by 0
  17. 2025How Smoothing is N-simplicial Attention?cited by 0