Logical Languages Accepted by Transformer Encoders with Hard Attention
Pablo Barceló, Alexander Kozachinskiy, Anthony Widjaja Lin, Vladimir V. Podolskii
摘要
We contribute to the study of formal languages that can be recognized by transformer encoders. We focus on two self-attention mechanisms: (1) UHAT (Unique Hard Attention Transformers) and (2) AHAT (Average Hard Attention Transformers). UHAT encoders are known to recognize only languages inside the circuit complexity class , i.e., accepted by a family of poly-sized and depth-bounded boolean circuits with unbounded fan-ins. On the other hand, AHAT encoders can recognize languages outside ), but their expressive power still lies within the bigger circuit complexity class , i.e., -circuits extended by majority gates. We first show a negative result that there is an -language that cannot be recognized by an UHAT encoder. On the positive side, we show that UHAT encoders can recognize a rich fragment of -languages, namely, all languages definable in first-order logic with arbitrary unary numerical predicates. This logic, includes, for example, all regular languages from . We then show that AHAT encoders can recognize all languages of our logic even when we enrich it with counting terms. We apply these results to derive new results on the expressive power of UHAT and AHAT up to permutation of letters (a.k.a. Parikh images).
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper19
- Masked Hard-Attention Transformers Recognize Exactly the Star-Free LanguagesAndy Yang, David Chiang, Dana AngluinNeurIPS 2024 · 被引用 58 次
- Characterizing the Expressivity of Fixed-Precision Transformer Language ModelsJiaoda Li, Ryan CotterellNeurIPS 2025 · 被引用 18 次
- Knee-Deep in C-RASP: A Transformer Depth HierarchyAndy Yang, Michaël Cadilhac, David ChiangNeurIPS 2025 · 被引用 15 次
- The Power of Hard Attention Transformers on Data Sequences: A formal language theoretic perspectivePascal Bergsträßer, Chris Köcher, Anthony Widjaja Lin, Georg ZetzscheNeurIPS 2024 · 被引用 7 次
- The Counting Power of TransformersMarco Sälzer, Chris Köcher, Alexander Kozachinskiy, Georg Zetzsche 等ICLR 2026 · 被引用 7 次
它引用的顶会 Paper5
- Thinking Like TransformersGail Weiss, Yoav Goldberg, Eran YahavICML 2021 · 被引用 183 次
- Tighter Bounds on the Expressivity of Transformer EncodersDavid Chiang, Peter Cholak, Anand PillayICML 2023 · 被引用 80 次
- On the Ability and Limitations of Transformers to Recognize Formal LanguagesSatwik Bhattamishra, Kabir Ahuja, Navin GoyalEMNLP 2020 · 被引用 7 次
- Overcoming a Theoretical Limitation of Self-AttentionDavid Chiang, Peter CholakACL 2022
- Self-Attention Networks Can Process Bounded Hierarchical LanguagesShunyu Yao, Binghui Peng, Christos H. Papadimitriou, Karthik NarasimhanACL 2021
相关 Paper
- Revisiting Padded Transformer Expressivity: Which Architectural Choices Matter and Which Don'tAnej Svete, William Merrill, Ryan Cotterell, Ashish SabharwalICML 2026 · 被引用 3 次
- A Logic for Expressing Log-Precision TransformersWilliam Merrill, Ashish SabharwalNeurIPS 2023 · 被引用 87 次
- Learning Linear Attention in Polynomial TimeMorris Yau, Ekin Akyürek, Jiayuan Mao, Joshua B. Tenenbaum 等NeurIPS 2025 · 被引用 7 次
- Exact Expressive Power of Transformers with PaddingWilliam Merrill, Ashish SabharwalNeurIPS 2025 · 被引用 21 次
- Characterizing the Expressivity of Local Attention in TransformersJiaoda Li, Ryan CotterellACL 2026 · 被引用 2 次
