Training Dynamics of Contextual N-Grams in Language Models
Not on the map. Why?
Abstract (arXiv)
Prior work has shown the existence of contextual neurons in language models, including a neuron that activates on German text. We show that this neuron exists within a broader contextual n-gram circuit: we find late layer neurons which recognize and continue n-grams common in German text, but which only activate if the German neuron is active. We investigate the formation of this circuit throughout training and find that it is an example of what we call a second-order circuit. In particular, both the constituent n-gram circuits and the German detection circuit which culminates in the German neuron form with independent functions early in training - the German detection circuit partially through modeling German unigram statistics, and the n-grams by boosting appropriate completions. Only after both circuits have already formed do they fit together into a second-order circuit. Contrary to the hypotheses presented in prior work, we find that the contextual n-gram circuit forms gradually rather than in a sudden phase transition. We further present a range of anomalous observations such as a simultaneous phase transition in many tasks coinciding with the learning rate warm-up, and evidence that many context neurons form simultaneously early in training but are later unlearned.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Builds on 24 of its 35 references that are in the map. First posted on arXiv 1 Nov 2023.
Builds on
24 of 35 references.
References · 24
- 2022Locating and Editing Factual Associations in GPTcited by 2,691
- 2022Emergent Abilities of Large Language Modelscited by 2,512
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,411
- 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,786
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
- 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,165
- 2022Toy Models of Superpositioncited by 971
- 2022In-context Learning and Induction Headscited by 964
- 2023Progress measures for grokking via mechanistic interpretabilitycited by 839
- 2022Discovering Latent Knowledge in Language Models Without Supervisioncited by 767
- 2022Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Spacecited by 532
- 2020Fine-Tuning Pretrained Language Models: Weight Initializations, Data Orders, and Early Stoppingcited by 384
12 more
- 2023Finding Neurons in a Haystack: Case Studies with Sparse Probingcited by 334
- 2013Direct and Indirect Effectscited by 280
- 2018A mathematical theory of semantic development in deep neural networkscited by 186
- 2023The Hydra Effect: Emergent Self-repair in Language Model Computationscited by 156
- 2022Toward Transparent AI: A Survey on Interpreting the Inner Structures of Deep Neural Networkscited by 129
- 2023Explaining grokking through circuit efficiencycited by 111
- 2019BERTs of a feather do not generalize together: Large variability in generalization across models with similar test set performancecited by 89
- 2022Linear Connectivity Reveals Generalization Strategiescited by 56
- 2020Towards falsifiable interpretability researchcited by 53
- 2020Pretrained Language Model Embryology: The Birth of ALBERTcited by 30
- 2020LSTMs Compose (and Learn) Bottom-Upcited by 11
- 2023On the special role of class-selective neurons in early trainingcited by 5
Built on by
Citing papers per year: 2024: 7.
7 papers.
- 2024Do Llamas Work in English? On the Latent Language of Multilingual Transformerscited by 281
- 2024Universal Neurons in GPT2 Language Modelscited by 102
- 2024A Primer on the Inner Workings of Transformer-based Language Modelscited by 85
- 2024Progressive distillation induces an implicit curriculumcited by 15
- 2024Distributional Associations vs In-Context Reasoning: A Study of Feed-forward and Attention Layerscited by 12
- 2024Survival of the Fittest Representation: A Case Study with Modular Additioncited by 7
- 2024Representing Rule-based Chatbots with Transformerscited by 1
- 2024Progressive distillation induces an implicit curriculum7 Oct 2024
- 2024Representing Rule-based Chatbots with Transformers15 Jul 2024
- 2024Distributional Associations vs In-Context Reasoning: A Study of Feed-forward and Attention Layers5 Jun 2024
- 2024Survival of the Fittest Representation: A Case Study with Modular Addition27 May 2024
- 2024A Primer on the Inner Workings of Transformer-based Language Models30 Apr 2024
- 2024Do Llamas Work in English? On the Latent Language of Multilingual Transformers16 Feb 2024
- 2024Universal Neurons in GPT2 Language Models22 Jan 2024