The Impact of Depth on Compositional Generalization in Transformer Language Models

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Petty, Jackson, van Steenkiste, Sjoerd, Dasgupta, Ishita, Sha, Fei, Garrette, Dan, Linzen, Tal
Format: Preprint
Publié: 2023
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866916200493088768
author Petty, Jackson
van Steenkiste, Sjoerd
Dasgupta, Ishita
Sha, Fei
Garrette, Dan
Linzen, Tal
author_facet Petty, Jackson
van Steenkiste, Sjoerd
Dasgupta, Ishita
Sha, Fei
Garrette, Dan
Linzen, Tal
contents To process novel sentences, language models (LMs) must generalize compositionally -- combine familiar elements in new ways. What aspects of a model's structure promote compositional generalization? Focusing on transformers, we test the hypothesis, motivated by theoretical and empirical work, that deeper transformers generalize more compositionally. Simply adding layers increases the total number of parameters; to address this confound between depth and size, we construct three classes of models which trade off depth for width such that the total number of parameters is kept constant (41M, 134M and 374M parameters). We pretrain all models as LMs and fine-tune them on tasks that test for compositional generalization. We report three main conclusions: (1) after fine-tuning, deeper models generalize more compositionally than shallower models do, but the benefit of additional layers diminishes rapidly; (2) within each family, deeper models show better language modeling performance, but returns are similarly diminishing; (3) the benefits of depth for compositional generalization cannot be attributed solely to better performance on language modeling. Because model latency is approximately linear in the number of layers, these results lead us to the recommendation that, with a given total parameter budget, transformers can be made shallower than is typical without sacrificing performance.
format Preprint
id arxiv_https___arxiv_org_abs_2310_19956
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle The Impact of Depth on Compositional Generalization in Transformer Language Models
Petty, Jackson
van Steenkiste, Sjoerd
Dasgupta, Ishita
Sha, Fei
Garrette, Dan
Linzen, Tal
Computation and Language
To process novel sentences, language models (LMs) must generalize compositionally -- combine familiar elements in new ways. What aspects of a model's structure promote compositional generalization? Focusing on transformers, we test the hypothesis, motivated by theoretical and empirical work, that deeper transformers generalize more compositionally. Simply adding layers increases the total number of parameters; to address this confound between depth and size, we construct three classes of models which trade off depth for width such that the total number of parameters is kept constant (41M, 134M and 374M parameters). We pretrain all models as LMs and fine-tune them on tasks that test for compositional generalization. We report three main conclusions: (1) after fine-tuning, deeper models generalize more compositionally than shallower models do, but the benefit of additional layers diminishes rapidly; (2) within each family, deeper models show better language modeling performance, but returns are similarly diminishing; (3) the benefits of depth for compositional generalization cannot be attributed solely to better performance on language modeling. Because model latency is approximately linear in the number of layers, these results lead us to the recommendation that, with a given total parameter budget, transformers can be made shallower than is typical without sacrificing performance.
title The Impact of Depth on Compositional Generalization in Transformer Language Models
topic Computation and Language
url https://arxiv.org/abs/2310.19956