Learning Syntax Without Planting Trees: Understanding When and Why Transformers Generalize Hierarchically
Transformers trained on natural language data have been shown to learn its hierarchical structure and generalize to sentences with unseen syntactic structures without explicitly encoding any structural bias. In this work, we investigate sources of inductive bias in transformer models and their training that could cause such generalization behavior to emerge. We extensively experiment with transformer models trained on multiple synthetic datasets and with different training objectives and show that while other objectives e.g. sequence-to-sequence modeling, prefix language modeling, often failed to lead to hierarchical generalization, models trained with the language modeling objective consistently learned to generalize hierarchically. We then conduct pruning experiments to study how transformers trained with the language modeling objective encode hierarchical structure. When pruned, we find joint existence of subnetworks within the model with different generalization behaviors (subnetworks corresponding to hierarchical structure and linear order). Finally, we take a Bayesian perspective to further uncover transformers' preference for hierarchical generalization: We establish a correlation between whether transformers generalize hierarchically on a dataset and whether the simplest explanation of that dataset is provided by a hierarchical grammar compared to regular grammars exhibiting linear generalization.
Code (1)
Tasks
Inductive BiasLanguage ModelingLanguage ModellingMethods 이 논문이 사용한 방법론
Similar Papers 제목 키워드 기반
Tree-Planted Transformers: Unidirectional Transformer Language Models with Implicit Syntactic Supervision
Syntactic Language Models (SLMs) can be trained efficiently to reach relatively high performance; however, they have trouble with inference efficiency due to the explicit generation of syntactic structures. In this paper…
Continual LearningSyntax-BERT: Improving Pre-trained Transformers with Syntax Trees
Pre-trained language models like BERT achieve superior performances in various NLP tasks without explicit consideration of syntactic information. Meanwhile, syntactic information has been proved to be crucial for the suc…
Natural Language UnderstandingClimate benefits of afforestation and reforestation with varying species mixtures and densities in the north-western boreal lands
The boreal forest plays a crucial role as a global carbon sink. This study uses two 250-year simulations of Canada's Taiga Plains, an area targeted by the 2 Billion Trees Program to evaluate afforestation and reforestati…
Darwinian spreading and quality thinning in even-aged boreal forest stands
Darwinian spreading of vigor, in addition to quality distribution, is introduced in a tree growth model. The size of any tree, within an even-aged stand, is taken as a measure of an inherited productive capacity, and the…
Benchmarking Language Models for Code Syntax Understanding
Pre-trained language models have demonstrated impressive performance in both natural language processing and program understanding, which represent the input as a token sequence without explicitly modeling its structure.…
Benchmarking