Interpreting Context Look-ups in Transformers: Investigating Attention-MLP Interactions
Not on the map. Why?
Abstract (arXiv)
Understanding the inner workings of large language models (LLMs) is crucial for advancing their theoretical foundations and real-world applications. While the attention mechanism and multi-layer perceptrons (MLPs) have been studied independently, their interactions remain largely unexplored. This study investigates how attention heads and next-token neurons interact in LLMs to predict new words. We propose a methodology to identify next-token neurons, find prompts that highly activate them, and determine the upstream attention heads responsible. We then generate and evaluate explanations for the activity of these attention heads in an automated manner. Our findings reveal that some attention heads recognize specific contexts relevant to predicting a token and activate a downstream token-predicting neuron accordingly. This mechanism provides a deeper understanding of how attention heads work with MLP neurons to perform next-token prediction. Our approach offers a foundation for further research into the intricate workings of LLMs and their impact on text generation and understanding.
Key facts. Cited by 11 papers in the map (data through 7 Oct 2026). Builds on 20 of its 38 references that are in the map. First posted on arXiv 23 Feb 2024.
Builds on
20 of 38 references.
References · 20
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Locating and Editing Factual Associations in GPTcited by 2,609
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,734
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,307
- 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,130
- 2022Mass-Editing Memory in a Transformercited by 976
- 2022In-context Learning and Induction Headscited by 930
- 2019Attention is not Explanationcited by 916
- 2021Knowledge Neurons in Pretrained Transformerscited by 590
- 2022Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Spacecited by 522
8 more
- 2019Is Attention Interpretable?cited by 387
- 2023Finding Neurons in a Haystack: Case Studies with Sparse Probingcited by 328
- 2017Learning to Generate Reviews and Discovering Sentimentcited by 147
- 2021An Interpretability Illusion for BERTcited by 94
- 2023Detecting Edit Failures In Large Language Models: An Improved Specificity Benchmarkcited by 62
- 2023Explaining How Transformers Use Context to Build Predictionscited by 42
- 2023The Larger They Are, the Harder They Fail: Language Models do not Recognize Identifier Swaps in Pythoncited by 29
- 2023Neuron to Graph: Interpreting Language Model Neurons at Scalecited by 26
Built on by
Citing papers per year: 2024: 4; 2025: 3; 2026: 4.
11 papers.
- 2024A Primer on the Inner Workings of Transformer-based Language Modelscited by 83
- 2024Quantifying Feature Space Universality Across Large Language Models via Sparse Autoencoderscited by 25
- 2024The Quest for the Right Mediator: Surveying Mechanistic Interpretability Through the Lens of Causal Mediation Analysiscited by 24
- 2024Intrinsic Self-correction for Enhanced Morality: An Analysis of Internal Mechanisms and the Superficial Hypothesiscited by 15
- 2025Capturing Polysemanticity with PRISM: A Multi-Concept Feature Description Frameworkcited by 9
- 2026Spectral Attention Steering for Prompt Highlightingcited by 6
- 2025Interpreting Language Models Through Concept Descriptions: A Surveycited by 3
- 2025Time Course MechInterp: Analyzing the Evolution of Components and Knowledge in Large Language Modelscited by 0
- 2026DySem: Uncovering Dynamic Semantic Components of Large Language Models for Calculating Semantic Textual Similaritycited by 0
- 2026Affinity-Aware Sharding for Delayed Tensor Parallelismcited by 0
- 2026When Can Attention Heads Be Statically Defined?cited by 0
- 2026When Can Attention Heads Be Statically Defined?28 Sep 2026
- 2026Affinity-Aware Sharding for Delayed Tensor Parallelism12 Sep 2026
- 2026DySem: Uncovering Dynamic Semantic Components of Large Language Models for Calculating Semantic Textual Similarity28 May 2026
- 2026Spectral Attention Steering for Prompt Highlighting1 Mar 2026
- 2025Interpreting Language Models Through Concept Descriptions: A Survey1 Oct 2025
- 2025Capturing Polysemanticity with PRISM: A Multi-Concept Feature Description Framework18 Jun 2025
- 2025Time Course MechInterp: Analyzing the Evolution of Components and Knowledge in Large Language Models3 Jun 2025
- 2024Quantifying Feature Space Universality Across Large Language Models via Sparse Autoencoders9 Oct 2024
- 2024The Quest for the Right Mediator: Surveying Mechanistic Interpretability Through the Lens of Causal Mediation Analysis2 Aug 2024
- 2024Intrinsic Self-correction for Enhanced Morality: An Analysis of Internal Mechanisms and the Superficial Hypothesis21 Jul 2024
- 2024A Primer on the Inner Workings of Transformer-based Language Models30 Apr 2024