# Grammar Sparsity Sets How Transformers Learn Random Languages

arXiv: https://arxiv.org/abs/2611.29692 · HTML: https://mlsanity.com/paper/2611.29692/

## Key facts

- No citing papers in the map yet (data through 24 Nov 2026).
- Builds on 10 of its 20 references that are in the map.
- Submitted 22 Nov 2026, announced 24 Nov 2026.

## Builds on (most cited first, 10 of 10)

- [BERT Rediscovers the Classical NLP Pipeline](https://mlsanity.com/paper/1905.05950/) (2019)
- [Physics of Language Models: Part 1, Learning Hierarchical Language Structures](https://mlsanity.com/paper/2305.13673/) (2023)
- [How Deep Neural Networks Learn Compositional Data: The Random Hierarchy Model](https://mlsanity.com/paper/2307.02129/) (2023)
- [Do Transformers Parse while Predicting the Masked Word?](https://mlsanity.com/paper/2303.08117/) (2023)
- [Towards a theory of how the structure of language is acquired by deep neural networks](https://mlsanity.com/paper/2406.00048/) (2024)
- [A Provably Correct Algorithm for Deep Learning that Actually Works](https://mlsanity.com/paper/1803.09522/) (2018)
- [Emergence of order in random languages](https://mlsanity.com/paper/1902.07516/) (2019)
- [Deep networks learn to parse uniform-depth context-free languages from local statistics](https://mlsanity.com/paper/2602.06065/) (2026)
- [Learn from your own latents and not from tokens: A sample-complexity theory](https://mlsanity.com/paper/2605.27734/) (2026)
- [Language models as tools for investigating the distinction between possible and impossible natural languages](https://mlsanity.com/paper/2512.09394/) (2025)

## Abstract (arXiv)

We study language acquisition by transformers trained on the Random Language Model: a synthetic hierarchical grammar with random production rules, whose sparsity is controlled by a single parameter and whose conditional entropies are known exactly. On depth-two grammars, we find that sparsity sets both the order and the speed of learning. Dense grammars are learnt one level at a time: a token is predicted from its sibling after tpropto V steps and from the full context only after tpropto V3, so the two stages are separated by a plateau that widens with V. Sparse grammars are learnt all at once, at tpropto√ V, with a smaller exponent than even the first stage of a dense one. The exponents 1 and 1/2 already appear at depth one, where we derive them for a linear model trained with Adam.
