Lune

EMNLP2020顶会

On the Ability and Limitations of Transformers to Recognize Formal Languages

Satwik Bhattamishra, Kabir Ahuja, Navin Goyal

摘要

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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 109 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • What Algorithms can Transformers Learn? A Study in Length Generalization 引用了 Thinking Like Transformers
  • What Algorithms can Transformers Learn? A Study in Length Generalization 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • Thinking Like Transformers 引用了 A Formal Hierarchy of RNN Architectures
  • Thinking Like Transformers 引用了 Are Transformers universal approximators of sequence-to-sequence functions?
  • Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection 引用了 Thinking Like Transformers
  • Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection 引用了 Are Transformers universal approximators of sequence-to-sequence functions?
  • Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • Learning to Encode Position for Transformer with Continuous Dynamical Model 引用了 Are Transformers universal approximators of sequence-to-sequence functions?
  • Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective 引用了 Thinking Like Transformers
  • Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective 引用了 Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection
  • Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective 引用了 Are Transformers universal approximators of sequence-to-sequence functions?
  • Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • What Can Transformers Learn In-Context? A Case Study of Simple Function Classes 引用了 Thinking Like Transformers
  • What Can Transformers Learn In-Context? A Case Study of Simple Function Classes 引用了 Are Transformers universal approximators of sequence-to-sequence functions?
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper109

  1. What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 883 次引用
  2. Towards Revealing the Mystery behind Chain of Thought: A Theoretical PerspectiveGuhao Feng, Bohang Zhang, Yuntian Gu, Haotian Ye 等NeurIPS 2023 · 470 次引用
  3. Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm SelectionYu Bai, Fan Chen, Huan Wang, Caiming Xiong 等NeurIPS 2023 · 356 次引用
  4. What Algorithms can Transformers Learn? A Study in Length GeneralizationHattie Zhou, Arwen Bradley, Etai Littwin, Noam Razin 等ICLR 2024 · 189 次引用
  5. Thinking Like TransformersGail Weiss, Yoav Goldberg, Eran YahavICML 2021 · 183 次引用

它引用的 Paper3

  1. Are Transformers universal approximators of sequence-to-sequence functions?Chulhee Yun, Srinadh Bhojanapalli, Ankit Singh Rawat, Sashank J. Reddi 等ICLR 2020 · 481 次引用
  2. Learning to Encode Position for Transformer with Continuous Dynamical ModelXuanqing Liu, Hsiang-Fu Yu, Inderjit S. Dhillon, Cho-Jui HsiehICML 2020 · 139 次引用
  3. A Formal Hierarchy of RNN ArchitecturesWilliam Merrill, Gail Weiss, Yoav Goldberg, Roy Schwartz 等ACL 2020 · 6 次引用

相关 Paper

  1. Simplicity Bias in Transformers and their Ability to Learn Sparse Boolean FunctionsSatwik Bhattamishra, Arkil Patel, Varun Kanade, Phil BlunsomACL 2023 · 7 次引用
  2. How Can Self-Attention Networks Recognize Dyck-n Languages?Javid Ebrahimi, Dhruv Gelda, Wei ZhangEMNLP Findings 2020 · 13 次引用
  3. Not all quantifiers are equal: Probing Transformer-based language models' understanding of generalised quantifiersTharindu Madusanka, Iqra Zahid, Hao Li, Ian Pratt-Hartmann 等EMNLP 2023 · 2 次引用
  4. Characterizing the Expressivity of Fixed-Precision Transformer Language ModelsJiaoda Li, Ryan CotterellNeurIPS 2025 · 18 次引用
  5. Separations in the Representational Capabilities of Transformers and Recurrent ArchitecturesSatwik Bhattamishra, Michael Hahn, Phil Blunsom, Varun KanadeNeurIPS 2024 · 36 次引用
黄昏的海面,两侧是细线勾勒的悬崖