CLLGApr 25, 2024

Learning Syntax Without Planting Trees: Understanding Hierarchical Generalization in Transformers

CMUMicrosoft
arXiv:2404.16367v315 citationsh-index: 19TACL
AI Analysis

This work addresses the problem of understanding inductive biases in transformers for hierarchical generalization, which is incremental as it builds on prior observations without introducing new methods.

The study investigated why transformers trained on natural language data generalize to unseen syntactic structures, finding that the language modeling objective consistently enables hierarchical generalization, while other objectives often fail, and identified subnetworks within models that encode hierarchical structure.

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 Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes