On The Computational Complexity of Self-Attention
By Feyza Duman Keles, Pruthuvi Maheshakya Wijewardena, Chinmay Hegde. International Conference on Algorithmic Learning Theory, 2022
298 citations recorded by the source corpus.
Transformer architectures have led to remarkable progress in many state-of-art applications. However, despite their successes, modern transformers rely on the self-attention mechanism, whose time- and space-complexity is quadratic in the length of the input. Several approaches have been proposed to speed up self-attention mechanisms to achieve sub-quadratic running time; however, the large majority of these works are not accompanied by rigorous error guarantees. In this work, we establish lower bounds on the computational complexity of self-attention in a number of scenarios. We prove that the time complexity of self-attention is necessarily quadratic in the input length, unless the Strong Exponential Time Hypothesis (SETH) is false. This argument holds even if the attention computation is performed only approximately, and for a variety of attention mechanisms. As a complement to our lower bounds, we show that it is indeed possible to approximate dot-product self-attention using finite Taylor series in linear-time, at the cost of having an exponential dependence on the polynomial order.
Subfields: Artificial Intelligence, Electrical and Electronic Engineering
View Paper: https://www.semanticscholar.org/paper/ac2e15fbfe3ea338725f5d33d17a5a687609c431
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Artificial Intelligence
- Tri Dao
- Christopher R'e
- Atri Rudra
- Daniel Y. Fu
- Khaled Kamal Saab
- Armin W. Thomas
- Alexander J. Ratner
- Albert Gu
In Electrical and Electronic Engineering
Citations in the corpus
- Hungry Hungry Hippos: Towards Language Modeling with State Space Models (2022, background): “, 2022b), though their time complexity is still quadratic in N , which is a lower-bound for attention (Keles et al., 2022).”