Grokking of Hierarchical Structure in Vanilla Transformers
Not on the map. Why?
Abstract (arXiv)
For humans, language production and comprehension is sensitive to the hierarchical structure of sentences. In natural language processing, past work has questioned how effectively neural sequence models like transformers capture this hierarchical structure when generalizing to structurally novel inputs. We show that transformer language models can learn to generalize hierarchically after training for extremely long periods -- far beyond the point when in-domain accuracy has saturated. We call this phenomenon structural grokking. On multiple datasets, structural grokking exhibits inverted U-shaped scaling in model depth: intermediate-depth models generalize better than both very deep and very shallow transformers. When analyzing the relationship between model-internal properties and grokking, we find that optimal depth for grokking can be identified using the tree-structuredness metric of citetmurty2023projections. Overall, our work provides strong evidence that, with extended training, vanilla transformers discover and use hierarchical structure.
Key facts. Cited by 53 papers in the map (data through 14 Oct 2026). Builds on 15 of its 24 references that are in the map. First posted on arXiv 30 May 2023.
Builds on
15 of 24 references.
References · 15
- 2017Attention Is All You Needcited by 60,361
- 2017The Implicit Bias of Gradient Descent on Separable Datacited by 655
- 2022Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasetscited by 629
- 2015Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networkscited by 306
- 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 288
- 2016Using the Output Embedding to Improve Language Modelscited by 272
- 2022Omnigrok: Grokking Beyond Algorithmic Datacited by 146
- 2021Saturated Transformers are Constant-Depth Threshold Circuitscited by 139
- 2021The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of Transformerscited by 117
- 2020Does syntax need to grow on trees? Sources of hierarchical inductive bias in sequence-to-sequence networkscited by 72
- 2018The Importance of Being Recurrent for Modeling Hierarchical Structurecited by 42
- 2022Characterizing Intrinsic Compositionality in Transformers with Tree Projectionscited by 41
Built on by
Citing papers per year: 2023: 9; 2024: 20; 2025: 12; 2026: 12.
53 papers.
Sort:
By area:
- 2023Sudden Drops in the Loss: Syntax Acquisition, Phase Transitions, and Simplicity Bias in MLMscited by 124
- 2024On Memorization of Large Language Models in Logical Reasoningcited by 117
- 2024Grokked Transformers are Implicit Reasoners: A Mechanistic Journey to the Edge of Generalizationcited by 79
- 2023Towards a Mechanistic Interpretation of Multi-Step Reasoning Capabilities of Language Modelscited by 50
- 2023Interpretability Illusions in the Generalization of Simplified Modelscited by 25
- 2024Mechanistic?cited by 25
- 2024Learning Syntax Without Planting Trees: Understanding Hierarchical Generalization in Transformerscited by 24
- 2024Implicit Geometry of Next-token Prediction: From Language Sparsity Patterns to Model Representationscited by 24
- 2024A Philosophical Introduction to Language Models -- Part I: Continuity With Classic Debatescited by 23
- 2024Learned feature representations are biased by complexity, learning order, position, and morecited by 23
- 2024Self-attention Networks Localize When QK-eigenspectrum Concentratescited by 19
- 2023Stack Attention: Improving the Ability of Transformers to Model Hierarchical Patternscited by 17
38 more
- 2025Hidden Breakthroughs in Language Model Trainingcited by 15
- 2025Latent learning: episodic memory complements parametric learning by enabling flexible reuse of experiencescited by 15
- 2024Towards Empirical Interpretation of Internal Circuits and Properties in Grokked Transformers on Modular Polynomialscited by 14
- 2023Grokking Beyond Neural Networks: An Empirical Exploration with Model Complexitycited by 13
- 2024Beyond Scaling Laws: Understanding Transformer Performance with Associative Memorycited by 12
- 2024Generalizations across filler-gap dependencies in neural language modelscited by 12
- 2024Delving into the Reversal Curse: How Far Can Large Language Models Generalize?cited by 11
- 2024The Heuristic Core: Understanding Subnetwork Generalization in Pretrained Language Modelscited by 10
- 2024Sometimes I am a Tree: Data Drives Unstable Hierarchical Generalizationcited by 10
- 2026Why Larger Models Learn More: Effects of Capacity, Interference, and Rare-Task Retentioncited by 10
- 2024Theoretical Insights into Fine-Tuning Attention Mechanism: Generalization and Optimizationcited by 9
- 2025Can Interpretation Predict Behavior on Unseen Data?cited by 8
- 2025Flatness is Necessary, Neural Collapse is Not: Rethinking Generalization via Grokkingcited by 8
- 2025Random Scaling of Emergent Capabilitiescited by 7
- 2026Early-Warning Signals of Grokking via Loss-Landscape Geometrycited by 7
- 2023Bridging Lottery Ticket and Grokking: Understanding Grokking from Inner Structure of Networkscited by 6
- 2024HDT: Hierarchical Document Transformercited by 6
- 2025Enhancing Transformers for Generalizable First-Order Logical Entailmentcited by 6
- 2023On the effect of curriculum learning with developmental data for grammar acquisitioncited by 5
- 2024Philosophy of Cognitive Science in the Age of Deep Learningcited by 5
- 2023The semantic landscape paradigm for neural networkscited by 4
- 2024The Fine Line: Navigating Large Language Model Pretraining with Down-streaming Capability Analysiscited by 4
- 2023ChapGTP, ILLC's Attempt at Raising a BabyLM: Improving Data Efficiency by Automatic Task Formationcited by 3
- 2024Sneaking Syntax into Transformer Language Models with Tree Regularizationcited by 3
- 2025Not All Explanations for Deep Learning Phenomena Are Equally Valuablecited by 3
- 2024Rule Extrapolation in Language Models: A Study of Compositional Generalization on OOD Promptscited by 2
- 2025Egalitarian Gradient Descent: A Simple Approach to Accelerated Grokkingcited by 2
- 2026Dissociating Decodability and Causal Use in Bracket-Sequence Transformerscited by 2
- 2025The Structural Sources of Verb Meaning Revisited: Large Language Models Display Syntactic Bootstrappingcited by 1
- 2025Bearing Syntactic Fruit with Stack-Augmented Neural Networkscited by 1
- 2026Is Grokking Worthwhile? Functional Analysis and Transferability of Generalization Circuits in Transformerscited by 1
- 2026The Grammar of Transformers: A Systematic Review of Interpretability Research on Syntactic Knowledge in Language Modelscited by 1
- 2026A Unified Assessment of the Poverty of the Stimulus Argument for Neural Language Modelscited by 1
- 2026Grokking as Structural Inference: Transformers Need Bayesian Lottery Ticketscited by 1
- 2026A Pre-Training Analogue of Grokking in Language Models: Tracing Delayed Grammatical Generalizationcited by 1
- 2026Natural Ungrokking: Asymmetric Control of Which Rules Survive Pretrainingcited by 1
- 2026Developmental approach reveals the statistical learning of Neural Language Models: Transformers generalize from the most abstract statistical patternscited by 1
- 2025Exploring Compositional Generalization (in COGS/ReCOGS_pos) by Transformers using Restricted Access Sequence Processing (RASP)cited by 0
50 most cited of 53 All 53 (JSON)
- 2026Neural Language Models Learn the Contextual Distributions of Dependency Structures: a statistical learning theory to compositionality28 Sep 2026
- 2026Developmental approach reveals the statistical learning of Neural Language Models: Transformers generalize from the most abstract statistical patterns25 Jun 2026
- 2026Natural Ungrokking: Asymmetric Control of Which Rules Survive Pretraining24 Jun 2026
- 2026A Pre-Training Analogue of Grokking in Language Models: Tracing Delayed Grammatical Generalization29 May 2026
- 2026Why Larger Models Learn More: Effects of Capacity, Interference, and Rare-Task Retention28 May 2026
- 2026Grokking as Structural Inference: Transformers Need Bayesian Lottery Tickets15 May 2026
- 2026Dissociating Decodability and Causal Use in Bracket-Sequence Transformers24 Apr 2026
- 2026Early-Warning Signals of Grokking via Loss-Landscape Geometry19 Feb 2026
- 2026A Unified Assessment of the Poverty of the Stimulus Argument for Neural Language Models10 Feb 2026
- 2026Is Grokking Worthwhile? Functional Analysis and Transferability of Generalization Circuits in Transformers14 Jan 2026
- 2026The Grammar of Transformers: A Systematic Review of Interpretability Research on Syntactic Knowledge in Language Models9 Jan 2026
- 2026Spectral Archaeology: The Causal Topology of Model Evolution6 Jan 2026
38 more
- 2025Do Syntactic Categories Help in Developmentally Motivated Curriculum Learning for Language Models?11 Nov 2025
- 2025Bearing Syntactic Fruit with Stack-Augmented Neural Networks5 Nov 2025
- 2025Egalitarian Gradient Descent: A Simple Approach to Accelerated Grokking6 Oct 2025
- 2025Flatness is Necessary, Neural Collapse is Not: Rethinking Generalization via Grokking22 Sep 2025
- 2025Latent learning: episodic memory complements parametric learning by enabling flexible reuse of experiences19 Sep 2025
- 2025The Structural Sources of Verb Meaning Revisited: Large Language Models Display Syntactic Bootstrapping17 Aug 2025
- 2025Can Interpretation Predict Behavior on Unseen Data?8 Jul 2025
- 2025Not All Explanations for Deep Learning Phenomena Are Equally Valuable29 Jun 2025
- 2025Hidden Breakthroughs in Language Model Training18 Jun 2025
- 2025Exploring Compositional Generalization (in COGS/ReCOGS_pos) by Transformers using Restricted Access Sequence Processing (RASP)21 Apr 2025
- 2025Random Scaling of Emergent Capabilities24 Feb 2025
- 2025Enhancing Transformers for Generalizable First-Order Logical Entailment1 Jan 2025
- 2024Sometimes I am a Tree: Data Drives Unstable Hierarchical Generalization5 Dec 2024
- 2024Sneaking Syntax into Transformer Language Models with Tree Regularization28 Nov 2024
- 2024On Memorization of Large Language Models in Logical Reasoning30 Oct 2024
- 2024Delving into the Reversal Curse: How Far Can Large Language Models Generalize?24 Oct 2024
- 2024Generalizations across filler-gap dependencies in neural language models23 Oct 2024
- 2024Mechanistic?7 Oct 2024
- 2024Theoretical Insights into Fine-Tuning Attention Mechanism: Generalization and Optimization3 Oct 2024
- 2024Rule Extrapolation in Language Models: A Study of Compositional Generalization on OOD Prompts9 Sep 2024
- 2024Implicit Geometry of Next-token Prediction: From Language Sparsity Patterns to Model Representations27 Aug 2024
- 2024HDT: Hierarchical Document Transformer11 Jul 2024
- 2024Grokked Transformers are Implicit Reasoners: A Mechanistic Journey to the Edge of Generalization23 May 2024
- 2024Beyond Scaling Laws: Understanding Transformer Performance with Associative Memory14 May 2024
- 2024Learned feature representations are biased by complexity, learning order, position, and more9 May 2024
- 2024Philosophy of Cognitive Science in the Age of Deep Learning7 May 2024
- 2024Learning Syntax Without Planting Trees: Understanding Hierarchical Generalization in Transformers25 Apr 2024
- 2024The Fine Line: Navigating Large Language Model Pretraining with Down-streaming Capability Analysis1 Apr 2024
- 2024The Heuristic Core: Understanding Subnetwork Generalization in Pretrained Language Models6 Mar 2024
- 2024Towards Empirical Interpretation of Internal Circuits and Properties in Grokked Transformers on Modular Polynomials26 Feb 2024
- 2024Self-attention Networks Localize When QK-eigenspectrum Concentrates3 Feb 2024
- 2024A Philosophical Introduction to Language Models -- Part I: Continuity With Classic Debates8 Jan 2024
- 2023Interpretability Illusions in the Generalization of Simplified Models6 Dec 2023
- 2023On the effect of curriculum learning with developmental data for grammar acquisition31 Oct 2023
- 2023Bridging Lottery Ticket and Grokking: Understanding Grokking from Inner Structure of Networks30 Oct 2023
- 2023Grokking Beyond Neural Networks: An Empirical Exploration with Model Complexity26 Oct 2023
- 2023Towards a Mechanistic Interpretation of Multi-Step Reasoning Capabilities of Language Models23 Oct 2023
- 2023ChapGTP, ILLC's Attempt at Raising a BabyLM: Improving Data Efficiency by Automatic Task Formation17 Oct 2023
50 newest of 53 All 53 (JSON)
- 2023Sudden Drops in the Loss: Syntax Acquisition, Phase Transitions, and Simplicity Bias in MLMscited by 124
- 2023Interpretability Illusions in the Generalization of Simplified Modelscited by 25
- 2024Learning Syntax Without Planting Trees: Understanding Hierarchical Generalization in Transformerscited by 24
- 2024Implicit Geometry of Next-token Prediction: From Language Sparsity Patterns to Model Representationscited by 24
- 2024A Philosophical Introduction to Language Models -- Part I: Continuity With Classic Debatescited by 23
- 2024Learned feature representations are biased by complexity, learning order, position, and morecited by 23
- 2024Self-attention Networks Localize When QK-eigenspectrum Concentratescited by 19
- 2023Stack Attention: Improving the Ability of Transformers to Model Hierarchical Patternscited by 17
- 2025Hidden Breakthroughs in Language Model Trainingcited by 15
- 2025Latent learning: episodic memory complements parametric learning by enabling flexible reuse of experiencescited by 15
- 2024Towards Empirical Interpretation of Internal Circuits and Properties in Grokked Transformers on Modular Polynomialscited by 14
- 2023Grokking Beyond Neural Networks: An Empirical Exploration with Model Complexitycited by 13
12 most cited of 47 All 47 (JSON)
- 2026Neural Language Models Learn the Contextual Distributions of Dependency Structures: a statistical learning theory to compositionality28 Sep 2026
- 2026Developmental approach reveals the statistical learning of Neural Language Models: Transformers generalize from the most abstract statistical patterns25 Jun 2026
- 2026Natural Ungrokking: Asymmetric Control of Which Rules Survive Pretraining24 Jun 2026
- 2026A Pre-Training Analogue of Grokking in Language Models: Tracing Delayed Grammatical Generalization29 May 2026
- 2026Why Larger Models Learn More: Effects of Capacity, Interference, and Rare-Task Retention28 May 2026
- 2026Grokking as Structural Inference: Transformers Need Bayesian Lottery Tickets15 May 2026
- 2026Dissociating Decodability and Causal Use in Bracket-Sequence Transformers24 Apr 2026
- 2026Early-Warning Signals of Grokking via Loss-Landscape Geometry19 Feb 2026
- 2026A Unified Assessment of the Poverty of the Stimulus Argument for Neural Language Models10 Feb 2026
- 2026The Grammar of Transformers: A Systematic Review of Interpretability Research on Syntactic Knowledge in Language Models9 Jan 2026
- 2026Spectral Archaeology: The Causal Topology of Model Evolution6 Jan 2026
- 2025Do Syntactic Categories Help in Developmentally Motivated Curriculum Learning for Language Models?11 Nov 2025
12 newest of 47 All 47 (JSON)