mlsanityData to 7 Oct 2026

Do Transformers Parse while Predicting the Masked Word?

arXiv 2303.08117 ↗First posted 14 Mar 2023cs.CL cs.LGcited by 48

Not on the map. Why?

Abstract (arXiv)

Pre-trained language models have been shown to encode linguistic structures, e.g. dependency and constituency parse trees, in their embeddings while being trained on unsupervised loss functions like masked language modeling. Some doubts have been raised whether the models actually are doing parsing or only some computation weakly correlated with it. We study questions: (a) Is it possible to explicitly describe transformers with realistic embedding dimension, 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 also give a construction of transformers with 50 layers, 15 attention heads, and 1275 dimensional embeddings in average such that using its embeddings it is possible to do constituency parsing with >70% F1 score on PTB dataset. 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.

Key facts. Cited by 48 papers in the map (data through 7 Oct 2026). Builds on 32 of its 59 references that are in the map. First posted on arXiv 14 Mar 2023.

Builds on

32 of 59 references.

References · 32

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  2. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  3. 2016Understanding intermediate layers using linear classifier probescited by 1,279
  4. 2022In-context Learning and Induction Headscited by 930
  5. 2023Progress measures for grokking via mechanistic interpretabilitycited by 822
  6. 2020A Primer in BERTology: What we know about how BERT workscited by 807
  7. 2019Designing and Interpreting Probes with Control Taskscited by 608
  8. 2018What you can cram into a single vector: Probing sentence embeddings for linguistic propertiescited by 452
  9. 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 404
  10. 2022Transformers Learn Shortcuts to Automatacited by 260
  11. 2019Visualizing and Measuring the Geometry of BERTcited by 215
  12. 2022Exploring Length Generalization in Large Language Modelscited by 204
20 more
  1. 2017What do Neural Machine Translation Models Learn about Morphology?cited by 165
  2. 2020Probing Pretrained Language Models for Lexical Semanticscited by 156
  3. 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
  4. 2021Saturated Transformers are Constant-Depth Threshold Circuitscited by 137
  5. 2022Should You Mask 15% in Masked Language Modeling?cited by 117
  6. 2020Perturbed Masking: Parameter-free Probing for Analyzing and Interpreting BERTcited by 109
  7. 2021Self-Attention Networks Can Process Bounded Hierarchical Languagescited by 105
  8. 2021Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformerscited by 101
  9. 2020On the Computational Power of Transformers and its Implications in Sequence Modelingcited by 85
  10. 2020O(n) Connections are Expressive Enough: Universal Approximability of Sparse Transformerscited by 82
  11. 2021How to Train BERT with an Academic Budgetcited by 80
  12. 2019Probing Natural Language Inference Models through Semantic Fragmentscited by 64
  13. 2021Syntax-BERT: Improving Pre-trained Transformers with Syntax Treescited by 51
  14. 2021Probing BERT in Hyperbolic Spacescited by 50
  15. 2020Are Pre-trained Language Models Aware of Phrases? Simple but Strong Baselines for Grammar Inductioncited by 47
  16. 2020A Tale of a Probe and a Parsercited by 40
  17. 2020Syntax-Enhanced Pre-trained Modelcited by 29
  18. 2021Do Syntactic Probes Probe Syntax? Experiments with Jabberwocky Probingcited by 28
  19. 2020Parsing as Pretrainingcited by 19
  20. 2022Probing for Constituency Structure in Neural Language Modelscited by 13

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 19; 2024: 11; 2025: 10; 2026: 8.

48 papers.

Sort:

By area:

  1. 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Modelscited by 805
  2. 2023Large Language Modelscited by 774
  3. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
  4. 2023Mechanistically analyzing the effects of fine-tuning on procedurally defined taskscited by 110
  5. 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 101
  6. 2023Physics of Language Models: Part 1, Learning Hierarchical Language Structurescited by 83
  7. 2023Exposing Attention Glitches with Flip-Flop Language Modelingcited by 74
  8. 2023JoMA: Demystifying Multilayer Transformers via JOint Dynamics of MLP and Attentioncited by 52
  9. 2023The Closeness of In-Context Learning and Weight Shifting for Softmax Regressioncited by 41
  10. 2024Towards a theory of how the structure of language is acquired by deep neural networkscited by 38
  11. 2023A Fast Optimization View: Reformulating Single Layer Attention in LLM Based on Tensor and SVM Trick, and Solving It in Matrix Multiplication Timecited by 30
  12. 2023Transformers are uninterpretable with myopic methods: a case study with bounded Dyck grammarscited by 30
36 more
  1. 2024Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamicscited by 27
  2. 2023When can transformers reason with abstract symbols?cited by 23
  3. 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannotcited by 21
  4. 2024Looped ReLU MLPs May Be All You Need as Practical Programmable Computerscited by 19
  5. 2024How transformers learn structured data: insights from hierarchical filteringcited by 18
  6. 2025Learning curves theory for hierarchically compositional data with power-law distributed featurescited by 17
  7. 2023Why Softmax Attention Outperforms Linear Attentioncited by 15
  8. 2024Progressive distillation induces an implicit curriculumcited by 15
  9. 2025Is the Reversal Curse a Binding Problem? Uncovering Limitations of Transformers from a Basic Generalization Failurecited by 13
  10. 2025Sample Complexity and Representation Ability of Test-time Scaling Paradigmscited by 12
  11. 2023Transparency at the Source: Evaluating and Interpreting Language Models With Access to the True Distributioncited by 10
  12. 2025On the Query Complexity of Verifier-Assisted Language Generationcited by 10
  13. 2023Local Convergence of Approximate Newton Method for Two Layer Nonlinear Regressioncited by 9
  14. 2023Solving Tensor Low Cycle Rank Approximationcited by 8
  15. 2024Training Dynamics of Transformers to Recognize Word Co-occurrence via Gradient Flow Analysiscited by 8
  16. 2023The Expressibility of Polynomial based Attention Schemecited by 7
  17. 2023How Well Do Large Language Models Understand Syntax? An Evaluation by Asking Natural Language Questionscited by 7
  18. 2024Promises and Pitfalls of Generative Masked Language Modeling: Theoretical Framework and Practical Guidelinescited by 6
  19. 2025Scaling Laws and Representation Learning in Simple Hierarchical Languages: Transformers vs. Convolutional Architecturescited by 5
  20. 2026Provable Learning of Random Hierarchy Models and Hierarchical Shallow-to-Deep Chainingcited by 5
  21. 2024Simulating Weighted Automata over Sequences and Trees with Transformerscited by 4
  22. 2026Deep networks learn to parse uniform-depth context-free languages from local statisticscited by 4
  23. 2023Approximating CKY with Transformerscited by 3
  24. 2024Punctuation Restoration Improves Structure Understanding Without Supervisioncited by 3
  25. 2026Context-Free Recognition with Transformerscited by 3
  26. 2026Biased Generalization in Diffusion Modelscited by 3
  27. 2025Efficient Knowledge Distillation via Curriculum Extractioncited by 2
  28. 2024Representing Rule-based Chatbots with Transformerscited by 1
  29. 2025Towards Sampling Data Structures for Tensor Products in Turnstile Streamscited by 1
  30. 2026Learn from your own latents and not from tokens: A sample-complexity theorycited by 1
  31. 2026An expressivity analysis of hierarchical modelling in deep transformers via bounded-depth grammarscited by 1
  32. 2025Limit Analysis for Symbolic Multi-step Reasoning Tasks with Information Propagation Rules Based on Transformerscited by 0
  33. 2025Optimality and NP-Hardness of Transformers in Learning Markovian Dynamical Functionscited by 0
  34. 2025ToMMeR -- Efficient Entity Mention Detection from Large Language Modelscited by 0
  35. 2026Sampling Data with Chains of Forward-Backward Diffusion Stepscited by 0
  36. 2026A theoretical model for task routing in mixture-of-expert transformerscited by 0