Cited by 54semigroups and automata theoryNatural Language Processing TechniquesTopic Modeling

On the Ability and Limitations of Transformers to Recognize Formal Languages

Open access
Bhattamishra, Satwik, Ahuja, Kabir, Goyal, Navin·2020·Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)

Abstract

Transformers have supplanted recurrent models in a large number of NLP tasks.However, the differences in their abilities to model different syntactic properties remain largely unknown.Past works suggest that LSTMs generalize very well on regular languages and have close connections with counter languages.In this work, we systematically study the ability of Transformers to model such languages as well as the role of its individual components in doing so.We first provide a construction of Transformers for a subclass of counter languages, including well-studied languages such as n-ary Boolean Expressions, Dyck-1, and its generalizations.In experiments, we find that Transformers do well on this subclass, and their learned mechanism strongly correlates with our construction.Perhaps surprisingly, in contrast to LSTMs, Transformers do well only on a subset of regular languages with degrading performance as we make languages more complex according to a well-known measure of complexity.Our analysis also provides insights on the role of self-attention mechanism in modeling certain behaviors and the influence of positional encoding schemes on the learning and generalization abilities of the model.

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

Crossref · 10.18653/v1/2020.emnlp-main.576

Cites

34 of 36 references verified0 citation errors · 0 not checkable

Statistics

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Cites

Flagged first, then by citations

Research works printed but not linked: 5

  1. Volker Diekert and Paul Gastin. 2008. First-order de- finable languages. In Logic and Automata: History and Perspectives [in Honor of Wolfgang Thomas], volume 2 of Texts in Logic and Games, pages 261- 306. Amsterdam University Press.
  2. Felix A Gers and E Schmidhuber. 2001. Lstm recur- rent networks learn simple context-free and context- sensitive languages. IEEE Transactions on Neural Networks, 12(6):1333-1340.
  3. Robert McNaughton and Seymour A. Papert. 1971. Counter-Free Automata (M.I.T. Research Mono- graph No. 65). The MIT Press.
  4. Joshua J. Michalenko, Ameesh Shah, Abhinav Verma, Swarat Chaudhuri, and Ankit B. Patel. 2019. Finite automata can be linearly decoded from language- recognizing RNNs. In International Conference on Learning Representations.
  5. Qinglong Wang, Kaixuan Zhang, II Ororbia, G Alexan- der, Xinyu Xing, Xue Liu, and C Lee Giles. 2018b. A comparative study of rule extraction for recurrent neural networks. arXiv preprint arXiv:1801.05420. · arXiv

Cited by

Sorted by citations

Authors
Bhattamishra, S., Ahuja, K., & Goyal, N.
Affiliations
  • Microsoft (United States) (US)
  • Microsoft Research (India) (IN)
Venue
Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)
Published
2020
Pages
7096-7116
OpenAlex
W3091917188
Cited by
48
References
34
Citations by year
2026: 5 · 2025: 8 · 2024: 5 · 2023: 12 · 2022: 9 · 2021: 8 · 2020: 1
FWCI
8.07
Type
conference paper
Language
en
Open access
Licence
cc-by
Locations
  • Conference on Empirical Methods in Natural Language Processing (EMNLP) (publishedVersion, cc-by)
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
Funders
Microsoft Research
Topics
  • Physical Sciences › Computer Science › Computational Theory and Mathematics › semigroups and automata theory
  • Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
Keywords
transformer models, formal language recognition, regular languages, self-attention, positional encoding, LSTM comparison, syntactic complexity

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review