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.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了最后一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper109
- What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 被引用 883 次
- Towards Revealing the Mystery behind Chain of Thought: A Theoretical PerspectiveGuhao Feng, Bohang Zhang, Yuntian Gu, Haotian Ye 等NeurIPS 2023 · 被引用 470 次
- Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm SelectionYu Bai, Fan Chen, Huan Wang, Caiming Xiong 等NeurIPS 2023 · 被引用 356 次
- What Algorithms can Transformers Learn? A Study in Length GeneralizationHattie Zhou, Arwen Bradley, Etai Littwin, Noam Razin 等ICLR 2024 · 被引用 189 次
- Thinking Like TransformersGail Weiss, Yoav Goldberg, Eran YahavICML 2021 · 被引用 183 次
它引用的顶会 Paper3
- Are Transformers universal approximators of sequence-to-sequence functions?Chulhee Yun, Srinadh Bhojanapalli, Ankit Singh Rawat, Sashank J. Reddi 等ICLR 2020 · 被引用 481 次
- Learning to Encode Position for Transformer with Continuous Dynamical ModelXuanqing Liu, Hsiang-Fu Yu, Inderjit S. Dhillon, Cho-Jui HsiehICML 2020 · 被引用 139 次
- A Formal Hierarchy of RNN ArchitecturesWilliam Merrill, Gail Weiss, Yoav Goldberg, Roy Schwartz 等ACL 2020 · 被引用 6 次
相关 Paper
- Simplicity Bias in Transformers and their Ability to Learn Sparse Boolean FunctionsSatwik Bhattamishra, Arkil Patel, Varun Kanade, Phil BlunsomACL 2023 · 被引用 7 次
- 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 次
- Separations in the Representational Capabilities of Transformers and Recurrent ArchitecturesSatwik Bhattamishra, Michael Hahn, Phil Blunsom, Varun KanadeNeurIPS 2024 · 被引用 36 次
- Neural Networks and the Chomsky HierarchyGrégoire Delétang, Anian Ruoss, Jordi Grau-Moya, Tim Genewein 等ICLR 2023 · 被引用 45 次
- Characterizing the Expressivity of Fixed-Precision Transformer Language ModelsJiaoda Li, Ryan CotterellNeurIPS 2025 · 被引用 18 次
