mlsanityData to 14 Oct 2026

On the Computational Hardness of Transformers

arXiv 2603.11332 ↗First posted 11 Mar 2026cs.CC cs.LGcited by 0

Not on the map. Why?

Abstract (arXiv)

The transformer has revolutionized modern AI across language, vision, and beyond. It consists of L layers, each running H attention heads in parallel and feeding the combined output to the subsequent layer. In attention, the input consists of N tokens, each a vector of dimension m. The attention mechanism involves multiplying three N × m matrices, applying softmax to an intermediate product. Several recent works have advanced our understanding of the complexity of attention. Known algorithms for transformers compute each attention head independently. This raises a fundamental question that has recurred throughout TCS under the guise of ``direct sum'' problems: can multiple instances of the same problem be solved more efficiently than solving each instance separately? Many answers to this question, both positive and negative, have arisen in fields spanning communication complexity and algorithm design. Thus, we ask whether transformers can be computed more efficiently than LH independent evaluations of attention. In this paper, we resolve this question in the negative, and give the first non-trivial computational lower bounds for multi-head multi-layer transformers. In the small embedding regime (m = No(1)), computing LH attention heads separately takes LHN2 + o(1) time. We establish that this is essentially optimal under SETH. In the large embedding regime (m = N), one can compute LH attention heads separately using LHNω + o(1) arithmetic operations (plus exponents), where ω is the matrix multiplication exponent. We establish that this is optimal, by showing that LHNω - o(1) arithmetic operations are necessary when ω > 2. Our lower bound in the large embedding regime relies on a novel application of the Baur-Strassen theorem, a powerful algorithmic tool underpinning the famous backpropagation algorithm.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 44 of its 73 references that are in the map. First posted on arXiv 11 Mar 2026.

Builds on

44 of 73 references.

References · 44

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
  4. 2024The Llama 3 Herd of Modelscited by 14,715
  5. 2023Segment Anythingcited by 8,234
  6. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
  7. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
  8. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
  9. 2020GLU Variants Improve Transformercited by 1,804
  10. 2020Big Bird: Transformers for Longer Sequencescited by 1,684
  11. 2022Fast Inference from Transformers via Speculative Decodingcited by 1,653
  12. 2020Rethinking Attention with Performerscited by 1,601
32 more
  1. 2024Gemma: Open Models Based on Gemini Research and Technologycited by 916
  2. 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 288
  3. 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 216
  4. 2022The Parallelism Tradeoff: Limitations of Log-Precision Transformerscited by 193
  5. 2021Saturated Transformers are Constant-Depth Threshold Circuitscited by 139
  6. 2022On The Computational Complexity of Self-Attentioncited by 139
  7. 2023Representational Strengths and Limitations of Transformerscited by 133
  8. 2021Self-Attention Networks Can Process Bounded Hierarchical Languagescited by 105
  9. 2023Fast Attention Requires Bounded Entriescited by 102
  10. 2023HyperAttention: Long-context Attention in Near-Linear Timecited by 85
  11. 2024Transformers, parallel computation, and logarithmic depthcited by 79
  12. 2024RNNs are not Transformers (Yet): The Key Bottleneck on In-context Retrievalcited by 64
  13. 2024On Limitations of the Transformer Architecturecited by 63
  14. 2023Simple Hardware-Efficient Long Convolutions for Sequence Modelingcited by 62
  15. 2020RNNs can generate bounded hierarchical languages with optimal memorycited by 59
  16. 2023KDEformer: Accelerating Transformers via Kernel Density Estimationcited by 58
  17. 2024Theoretical limitations of multi-layer Transformercited by 45
  18. 2023PolySketchFormer: Fast Transformers via Sketching Polynomial Kernelscited by 36
  19. 2024One-layer transformers fail to solve the induction heads taskcited by 32
  20. 2024More Asymmetry Yields Faster Matrix Multiplicationcited by 27
  21. 2014Edit Distance Cannot Be Computed in Strongly Subquadratic Time (unless SETH is false)cited by 18
  22. 2025Strassen Attention, Split VC Dimension and Compositionality in Transformerscited by 12
  23. 2025Depth-Width tradeoffs in Algorithmic Reasoning of Graph Tasks with Transformerscited by 11
  24. 2025Unique Hard Attention: A Tale of Two Sidescited by 10
  25. 2024Fundamental Limitations on Subquadratic Alternatives to Transformerscited by 9
  26. 2025Subquadratic Algorithms and Hardness for Attention with Any Temperaturecited by 5
  27. 2025Fast attention mechanisms: a tale of parallelismcited by 3
  28. 2017SETH-Based Lower Bounds for Subset Sum and Bicriteria Pathcited by 2
  29. 2018Towards Tight Approximation Bounds for Graph Diameter and Eccentricitiescited by 2
  30. 2025Two Heads Are Better than One: Simulating Large Transformers with Small Onescited by 2
  31. 20214 vs 7 sparse undirected unweighted Diameter is SETH-hard at time n4/3cited by 1
  32. 2023Deterministic Sparse Pattern Matching via the Baur-Strassen Theoremcited by 1

Built on by

Not cited yet.