Sneaking Syntax into Transformer Language Models with Tree Regularization
Not on the map. Why?
Abstract (arXiv)
While compositional accounts of human language understanding are based on a hierarchical tree-like process, neural models like transformers lack a direct inductive bias for such tree structures. Introducing syntactic inductive biases could unlock more robust and data-efficient learning in transformer language models (LMs), but existing methods for incorporating such structure greatly restrict models, either limiting their expressivity or increasing inference complexity. This work instead aims to softly inject syntactic inductive biases into given transformer circuits, through a structured regularizer. We introduce TreeReg, an auxiliary loss function that converts bracketing decisions from silver parses into a set of differentiable orthogonality constraints on vector hidden states. TreeReg integrates seamlessly with the standard LM objective, requiring no architectural changes. LMs pre-trained with TreeReg on natural language corpora such as WikiText-103 achieve up to 10% lower perplexities on out-of-distribution data and up to 9.5 point improvements in syntactic generalization, requiring less than half the training data to outperform standard LMs. TreeReg still provides gains for pre-trained LLMs: Continued pre-training of Sheared Llama with TreeReg results in improved syntactic generalization, and fine-tuning on MultiNLI with TreeReg mitigates degradation of performance on adversarial NLI benchmarks by 41.2 points. We release all code to guide future research.
Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Builds on 34 of its 57 references that are in the map. First posted on arXiv 28 Nov 2024.
Builds on
34 of 57 references.
References · 34
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2023GPT-4 Technical Reportcited by 18,396
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2016Pointer Sentinel Mixture Modelscited by 3,096
- 2017A Broad-Coverage Challenge Corpus for Sentence Understanding through Inferencecited by 2,682
- 2019Right for the Wrong Reasons: Diagnosing Syntactic Heuristics in Natural Language Inferencecited by 876
- 2019BLiMP: The Benchmark of Linguistic Minimal Pairs for Englishcited by 564
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 503
- 2023Sheared LLaMA: Accelerating Language Model Pre-training via Structured Pruningcited by 415
- 2023The Reversal Curse: LLMs trained on "A is B" fail to learn "B is A"cited by 407
- 2015Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networkscited by 306
22 more
- 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 288
- 2020A Systematic Assessment of Syntactic Generalization in Neural Language Modelscited by 165
- 2022Overcoming a Theoretical Limitation of Self-Attentioncited by 113
- 2016Recurrent Neural Network Grammarscited by 109
- 2021Self-Attention Networks Can Process Bounded Hierarchical Languagescited by 105
- 2018Ordered Neurons: Integrating Tree Structures into Recurrent Neural Networkscited by 101
- 2023Physics of Language Models: Part 1, Learning Hierarchical Language Structurescited by 83
- 2020Does syntax need to grow on trees? Sources of hierarchical inductive bias in sequence-to-sequence networkscited by 72
- 2018Linguistically-Informed Self-Attention for Semantic Role Labelingcited by 71
- 2019Tree Transformer: Integrating Tree Structures into Self-Attentioncited by 68
- 2023Grokking of Hierarchical Structure in Vanilla Transformerscited by 53
- 2019Can neural networks understand monotonicity reasoning?cited by 45
- 2018Finding Syntax in Human Encephalography with Beam Searchcited by 41
- 2022Transformer Grammars: Augmenting Transformer Language Models with Syntactic Inductive Biases at Scalecited by 41
- 2022Characterizing Intrinsic Compositionality in Transformers with Tree Projectionscited by 41
- 2016Tree-to-Sequence Attentional Neural Machine Translationcited by 28
- 2020Hierarchical Poset Decoding for Compositional Generalization in Languagecited by 26
- 2021Structural Guidance for Transformer Language Modelscited by 25
- 2021R2D2: Recursive Transformer based on Differentiable Tree for Interpretable Hierarchical Language Modelingcited by 19
- 2020Guiding Attention for Self-Supervised Learning with Transformerscited by 14
- 2015Compositional Distributional Semantics with Long Short Term Memorycited by 10
- 2024Generative Pretrained Structured Transformers: Unsupervised Syntactic Language Models at Scalecited by 10
Built on by
Citing papers per year: 2026: 3.
3 papers.
- 2026Deep networks learn to parse uniform-depth context-free languages from local statisticscited by 5
- 2026The Grammar of Transformers: A Systematic Review of Interpretability Research on Syntactic Knowledge in Language Modelscited by 1
- 2026Beyond Sequence Order: Syntax-Informed Positional Embeddings for Transformerscited by 0
- 2026Beyond Sequence Order: Syntax-Informed Positional Embeddings for Transformers6 Aug 2026
- 2026Deep networks learn to parse uniform-depth context-free languages from local statistics31 Jan 2026
- 2026The Grammar of Transformers: A Systematic Review of Interpretability Research on Syntactic Knowledge in Language Models9 Jan 2026