Theoretical Limitations of Self-Attention in Neural Sequence Models

By Michael Hahn. 2019

401 citations recorded by the source corpus.

Transformers are emerging as the new workhorse of NLP, showing great success across tasks. Unlike LSTMs, transformers process input sequences entirely through self-attention. Previous work has suggested that the computational capabilities of self-attention to process hierarchical structures are limited. In this work, we mathematically investigate the computational power of self-attention to model formal languages. Across both soft and hard attention, we show strong theoretical limitations of the computational abilities of self-attention, finding that it cannot model periodic finite-state languages, nor hierarchical structure, unless the number of layers or heads increases with input length. These limitations seem surprising given the practical success of self-attention and the prominent role assigned to hierarchical structure in linguistics, suggesting that natural language can be approximated well with models that are too weak for the formal languages typically assumed in theoretical linguistics.

Subfields: Artificial Intelligence, Model Architectures

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

  1. Yejin Choi
  2. Mohit Bansal
  3. Percy Liang
  4. Luke S. Zettlemoyer
  5. Jianfeng Gao
  6. Hannaneh Hajishirzi
  7. Noah A. Smith
  8. Quoc V. Le

In Model Architectures

  1. Ye Jia
  2. Percy Liang
  3. Samira Abnar
  4. Yu Zhang
  5. Mostafa Dehghani
  6. Stella Biderman
  7. Xiang Ren
  8. Di He

Citations in the corpus