Do Transformers Parse while Predicting the Masked Word?
Haoyu Zhao, Abhishek Panigrahi, Rong Ge, Sanjeev Arora
摘要
Pre-trained language models have been shown to encode linguistic structures like parse trees in their embeddings while being trained unsupervised. Some doubts have been raised whether the models are doing parsing or only some computation weakly correlated with it. Concretely: (a) Is it possible to explicitly describe transformers with realistic embedding dimensions, number of heads, etc. that are capable of doing parsing -or even approximate parsing? (b) Why do pre-trained models capture parsing structure? This paper takes a step toward answering these questions in the context of generative modeling with PCFGs. We show that masked language models like BERT or RoBERTa of moderate sizes can approximately execute the Inside-Outside algorithm for the English PCFG (Marcus et al., 1993) . We also show that the Inside-Outside algorithm is optimal for masked language modeling loss on the PCFG-generated data. We conduct probing experiments on models pre-trained on PCFG-generated data to show that this not only allows recovery of approximate parse tree, but also recovers marginal span probabilities computed by the Inside-Outside algorithm, which suggests an implicit bias of masked language modeling towards this algorithm. * When | P| < c| Ĩ|, we can simulate the computations in the final layer using c layers with | Ĩ| heads instead of | P| heads. Additionally, we can decrease the embedding size by only storing probabilities for relevant non-terminals.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 13 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Transformers are uninterpretable with myopic methods: a case study with bounded Dyck grammars 引用了 Inductive Biases and Variable Creation in Self-Attention Mechanisms
- Transformers are uninterpretable with myopic methods: a case study with bounded Dyck grammars 引用了 Perturbed Masking: Parameter-free Probing for Analyzing and Interpreting BERT
- Transformers are uninterpretable with myopic methods: a case study with bounded Dyck grammars 引用了 Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformers
- Inductive Biases and Variable Creation in Self-Attention Mechanisms 引用了 Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformers
- Sample Complexity and Representation Ability of Test-time Scaling Paradigms 引用了 Inductive Biases and Variable Creation in Self-Attention Mechanisms
- Sample Complexity and Representation Ability of Test-time Scaling Paradigms 引用了 Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformers
- Sample Complexity and Representation Ability of Test-time Scaling Paradigms 引用了 Exploring Length Generalization in Large Language Models
- Sample Complexity and Representation Ability of Test-time Scaling Paradigms 引用了 Promises and Pitfalls of Generative Masked Language Modeling: Theoretical Framework and Practical Guidelines
- Promises and Pitfalls of Generative Masked Language Modeling: Theoretical Framework and Practical Guidelines 引用了 Transformers are uninterpretable with myopic methods: a case study with bounded Dyck grammars
- Promises and Pitfalls of Generative Masked Language Modeling: Theoretical Framework and Practical Guidelines 引用了 Inductive Biases and Variable Creation in Self-Attention Mechanisms
- Promises and Pitfalls of Generative Masked Language Modeling: Theoretical Framework and Practical Guidelines 引用了 Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformers
引用它的顶会 Paper13
- Transformers are uninterpretable with myopic methods: a case study with bounded Dyck grammarsKaiyue Wen, Yuchen Li, Bingbin Liu, Andrej RisteskiNeurIPS 2023 · 32 次引用
- Sample Complexity and Representation Ability of Test-time Scaling ParadigmsBaihe Huang, Shanda Li, Tianhao Wu, Yiming Yang 等ICLR 2026 · 11 次引用
- Promises and Pitfalls of Generative Masked Language Modeling: Theoretical Framework and Practical GuidelinesYuchen Li, Alexandre Kirchmeyer, Aashay Mehta, Yilong Qin 等ICML 2024 · 5 次引用
- Deep networks learn to parse uniform-depth context-free languages from local statisticsJack T. Parley, Francesco Cagnetta, Matthieu WyartICML 2026 · 4 次引用
- Context-free Recognition with TransformersSelim Jerad, Anej Svete, Sophie Hao, Ryan Cotterell 等ICML 2026 · 3 次引用
它引用的 Paper16
- Exploring Length Generalization in Large Language ModelsCem Anil, Yuhuai Wu, Anders Andreassen, Aitor Lewkowycz 等NeurIPS 2022 · 267 次引用
- Perturbed Masking: Parameter-free Probing for Analyzing and Interpreting BERTZhiyong Wu, Yun Chen, Ben Kao, Qun LiuACL 2020 · 158 次引用
- Inductive Biases and Variable Creation in Self-Attention MechanismsBenjamin L. Edelman, Surbhi Goel, Sham M. Kakade, Cyril ZhangICML 2022 · 154 次引用
- Probing Natural Language Inference Models through Semantic FragmentsKyle Richardson, Hai Hu, Lawrence S. Moss, Ashish SabharwalAAAI 2020 · 152 次引用
- Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with TransformersColin Wei, Yining Chen, Tengyu MaNeurIPS 2022 · 117 次引用
相关 Paper
- How Transformers Represent Hierarchies: A Local-to-Global MechanismZhiling Zhou, Tianhao Wang, Zhuoran YangICML 2026
- Contextual Distortion Reveals Constituency: Masked Language Models are Implicit ParsersJiaxi Li, Wei LuACL 2023 · 3 次引用
- Unveiling the Black Box of PLMs with Semantic Anchors: Towards Interpretable Neural Semantic ParsingLunyiu Nie, Jiuding Sun, Yanlin Wang, Lun Du 等AAAI 2023 · 9 次引用
- What Do They Capture? - A Structural Analysis of Pre-Trained Language Models for Source CodeYao Wan, Wei Zhao, Hongyu Zhang, Yulei Sui 等ICSE 2022 · 66 次引用
- Probing for Constituency Structure in Neural Language ModelsDavid Arps, Younes Samih, Laura Kallmeyer, Hassan SajjadEMNLP Findings 2022 · 17 次引用
