mlsanityData to 7 Oct 2026

The Impact of Depth on Compositional Generalization in Transformer Language Models

arXiv 2310.19956 ↗First posted 30 Oct 2023cs.CLcited by 37

Not on the map. Why?

Abstract (arXiv)

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.

Key facts. Cited by 37 papers in the map (data through 7 Oct 2026). Builds on 24 of its 42 references that are in the map. First posted on arXiv 30 Oct 2023.

Builds on

24 of 42 references.

References · 24

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  5. 2020Scaling Laws for Neural Language Modelscited by 6,411
  6. 2019Energy and Policy Considerations for Deep Learning in NLPcited by 1,242
  7. 2019Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Prunedcited by 844
  8. 2019Are Sixteen Heads Really Better than One?cited by 803
  9. 2018Universal Transformerscited by 613
  10. 2019Measuring Compositional Generalization: A Comprehensive Method on Realistic Datacited by 280
  11. 2020COGS: A Compositional Generalization Challenge Based on Semantic Interpretationcited by 260
  12. 2022Prompting GPT-3 To Be Reliablecited by 258
12 more
  1. 2021Saturated Transformers are Constant-Depth Threshold Circuitscited by 137
  2. 2021The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of Transformerscited by 117
  3. 2021Scale Efficiently: Insights from Pre-training and Fine-tuning Transformerscited by 105
  4. 2019Do Attention Heads in BERT Track Syntactic Dependencies?cited by 87
  5. 2021Making Transformers Solve Compositional Taskscited by 72
  6. 2020Compression of Deep Learning Models for Text: A Surveycited by 64
  7. 2022Evaluating the Impact of Model Scale for Compositional Generalization in Semantic Parsingcited by 50
  8. 2022Characterizing Intrinsic Compositionality in Transformers with Tree Projectionscited by 40
  9. 2023Injecting structural hints: Using language models to study inductive biases in language learningcited by 33
  10. 2022Coloring the Blank Slate: Pre-training Imparts a Hierarchical Inductive Bias to Sequence-to-sequence Modelscited by 28
  11. 2022Uncontrolled Lexical Exposure Leads to Overestimation of Compositional Generalization in Pretrained Modelscited by 26
  12. 2022Wide Attention Is The Way Forward For Transformers?cited by 8

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 10; 2025: 13; 2026: 14.

37 papers.

Sort:

By area:

  1. 2024Hopping Too Late: Exploring the Limitations of Large Language Models on Multi-Hop Queriescited by 78
  2. 2025A Little Depth Goes a Long Way: The Expressive Power of Log-Depth Transformerscited by 49
  3. 2024DenseFormer: Enhancing Information Flow in Transformers via Depth Weighted Averagingcited by 48
  4. 2024Theoretical limitations of multi-layer Transformercited by 43
  5. 2024How Does Code Pretraining Affect Language Model Task Performance?cited by 28
  6. 2024Do Large Language Models Perform Latent Multi-Hop Reasoning without Exploiting Shortcuts?cited by 26
  7. 2025Gemstones: A Model Suite for Multi-Faceted Scaling Lawscited by 19
  8. 2025Position: A Theory of Deep Learning Must Include Compositional Sparsitycited by 13
  9. 2024The Asymptotic Behavior of Attention in Transformerscited by 12
  10. 2025Exploring Diffusion Transformer Designs via Graftingcited by 12
  11. 2024Breaking Chains: Unraveling the Links in Multi-Hop Knowledge Unlearningcited by 8
  12. 2025Can Interpretation Predict Behavior on Unseen Data?cited by 8
25 more
  1. 2024Super Tiny Language Modelscited by 7
  2. 2024ALTA: Compiler-Based Analysis of Transformerscited by 7
  3. 2025Random Scaling of Emergent Capabilitiescited by 7
  4. 2025Scaling can lead to compositional generalizationcited by 7
  5. 2026Lost in Backpropagation: The LM Head is a Gradient Bottleneckcited by 6
  6. 2026TradeFM: A Generative Foundation Model for Trade-flow and Market Microstructurecited by 5
  7. 2024Interpreting token compositionality in LLMs: A robustness analysiscited by 4
  8. 2025Counterfactual reasoning: an analysis of in-context emergencecited by 4
  9. 2025Scaling Laws Meet Model Architecture: Toward Inference-Efficient LLMscited by 4
  10. 2025Are Transformers Able to Reason by Connecting Separated Knowledge in Training Data?cited by 3
  11. 2025Crown, Frame, Reverse: Layer-Wise Scaling Variants for LLM Pre-Trainingcited by 2
  12. 2025CompoST: A Benchmark for Analyzing the Ability of LLMs To Compositionally Interpret Questions in a QALD Settingcited by 1
  13. 2026Revisiting the Shape Convention of Transformer Language Modelscited by 1
  14. 2026The Deterministic Horizon: When Extended Reasoning Fails and Tool Delegation Becomes Necessarycited by 1
  15. 2026Variable-Width Transformerscited by 1
  16. 2025Exploring Compositional Generalization (in COGS/ReCOGS_pos) by Transformers using Restricted Access Sequence Processing (RASP)cited by 0
  17. 2026Generalization in LLM Problem Solving: The Case of the Shortest Pathcited by 0
  18. 2026Compositional Sparsity as an Inductive Bias for Neural Architecture Designcited by 0
  19. 2026STELLAR: Scaling 3D Perception Large Models for Autonomous Drivingcited by 0
  20. 2026Single-Pass, Depth-Selective Reading for Multi-Aspect Sentiment Analysiscited by 0
  21. 2026The Model Shape Behind Scaling Laws: A Gradient Superposition Perspectivecited by 0
  22. 2026Child-directed speech facilitates production, not comprehension, in BabyLMscited by 0
  23. 2026Why Knowing Both Hops Is Not Enough: Understanding Two-Hop Generalization in Language Modelscited by 0
  24. 2026Matryoshka Language Model Suitescited by 0
  25. 2026DepthBench: Measuring How Residual Connections Enable More Computational Depthcited by 0