Saturated Transformers are Constant-Depth Threshold Circuits
Top Cited Papers
Open Access
- 12 August 2022
- journal article
- research article
- Published by MIT Press in Transactions of the Association for Computational Linguistics
- Vol. 10, 843-856
Abstract
Transformers have become a standard neural network architecture for many NLP problems, motivating theoretical analysis of their power in terms of formal languages. Recent work has shown that transformers with hard attention are quite limited in power (Hahn, 2020), as they can be simulated by constant-depth AND/OR circuits (Hao et al., 2022). However, hard attention is a strong assumption, which may complicate the relevance of these results in practice. In this work, we analyze the circuit complexity of transformers with saturated attention: a generalization of hard attention that more closely captures the attention patterns learnable in practical transformers. We first show that saturated transformers transcend the known limitations of hard-attention transformers. We then prove saturated transformers with floating-point values can be simulated by constant-depth threshold circuits, giving the class TC0 as an upper bound on the formal languages they recognize.Keywords
All Related Versions
This publication has 13 references indexed in Scilit:
- Theoretical Limitations of Self-Attention in Neural Sequence ModelsTransactions of the Association for Computational Linguistics, 2020
- RNNs can generate bounded hierarchical languages with optimal memory2020
- Sequential Neural Networks as Automata2019
- On the Practical Computational Power of Finite Precision RNNs for Language Recognition2018
- Rational Recurrences2018
- Computational Complexity2009
- A Catalog of Complexity Classes1990
- Machine Models and Simulations1990
- Parity, circuits, and the polynomial-time hierarchy1981
- A History of the Prime Number TheoremThe American Mathematical Monthly, 1973