Learning Syntax Without Planting Trees: Understanding Hierarchical Generalization in Transformers

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Ahuja, Kabir, Balachandran, Vidhisha, Panwar, Madhur, He, Tianxing, Smith, Noah A., Goyal, Navin, Tsvetkov, Yulia
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912275560923136
author Ahuja, Kabir
Balachandran, Vidhisha
Panwar, Madhur
He, Tianxing
Smith, Noah A.
Goyal, Navin
Tsvetkov, Yulia
author_facet Ahuja, Kabir
Balachandran, Vidhisha
Panwar, Madhur
He, Tianxing
Smith, Noah A.
Goyal, Navin
Tsvetkov, Yulia
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2404_16367
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Learning Syntax Without Planting Trees: Understanding Hierarchical Generalization in Transformers
Ahuja, Kabir
Balachandran, Vidhisha
Panwar, Madhur
He, Tianxing
Smith, Noah A.
Goyal, Navin
Tsvetkov, Yulia
Computation and Language
Machine Learning
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.
title Learning Syntax Without Planting Trees: Understanding Hierarchical Generalization in Transformers
topic Computation and Language
Machine Learning
url https://arxiv.org/abs/2404.16367