Explaining How Transformers Use Context to Build Predictions
Not on the map. Why?
Abstract (arXiv)
Language Generation Models produce words based on the previous context. Although existing methods offer input attributions as explanations for a model's prediction, it is still unclear how prior words affect the model's decision throughout the layers. In this work, we leverage recent advances in explainability of the Transformer and present a procedure to analyze models for language generation. Using contrastive examples, we compare the alignment of our explanations with evidence of the linguistic phenomena, and show that our method consistently aligns better than gradient-based and perturbation-based baselines. Then, we investigate the role of MLPs inside the Transformer and show that they learn features that help the model predict words that are grammatically acceptable. Lastly, we apply our method to Neural Machine Translation models, and demonstrate that they generate human-like source-target alignments for building predictions.
Key facts. Cited by 42 papers in the map (data through 7 Oct 2026). Builds on 39 of its 52 references that are in the map. First posted on arXiv 21 May 2023.
Builds on
39 of 52 references.
References · 39
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,464
- 2017Axiomatic Attribution for Deep Networkscited by 3,350
- 2013Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Mapscited by 2,348
- 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
- 2019BERT Rediscovers the Classical NLP Pipelinecited by 1,046
- 2022In-context Learning and Induction Headscited by 930
- 2019Attention is not Explanationcited by 916
- 2020Quantifying Attention Flow in Transformerscited by 759
- 2023Eliciting Latent Predictions from Transformers with the Tuned Lenscited by 579
27 more
- 2020Beyond English-Centric Multilingual Machine Translationcited by 559
- 2019BLiMP: The Benchmark of Linguistic Minimal Pairs for Englishcited by 553
- 2022Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Spacecited by 522
- 2023Dissecting Recall of Factual Associations in Auto-Regressive Language Modelscited by 512
- 2019Is Attention Interpretable?cited by 387
- 2016Assessing the Ability of LSTMs to Learn Syntax-Sensitive Dependenciescited by 350
- 2016Not Just a Black Box: Learning Important Features Through Propagating Activation Differencescited by 295
- 2016Understanding Neural Networks through Representation Erasurecited by 223
- 2015Visualizing and Understanding Neural Models in NLPcited by 199
- 2020A Diagnostic Study of Explainability Techniques for Text Classificationcited by 158
- 2019The Bottom-up Evolution of Representations in the Transformer: A Study with Machine Translation and Language Modeling Objectivescited by 139
- 2022Analyzing Transformers in Embedding Spacecited by 131
- 2019On Identifiability in Transformerscited by 115
- 2019Learning to Deceive with Attention-Based Explanationscited by 111
- 2022Interpreting Language Models with Contrastive Explanationscited by 91
- 2023Jump to Conclusions: Short-Cutting Transformers With Linear Transformationscited by 89
- 2023Inseq: An Interpretability Toolkit for Sequence Generation Modelscited by 78
- 2019Jointly Learning to Align and Translate with Transformer Modelscited by 75
- 2022Measuring the Mixing of Contextual Information in the Transformercited by 63
- 2014Extraction of Salient Sentences from Labelled Documentscited by 50
- 2021Incorporating Residual and Normalization Layers into Analysis of Masked Language Modelscited by 50
- 2022Towards Opening the Black Box of Neural Machine Translation: Source and Target Interpretations of the Transformercited by 45
- 2023Quantifying Context Mixing in Transformerscited by 43
- 2019Adding Interpretable Attention to Neural Translation Models Improves Word Alignmentcited by 30
- 2019Saliency-driven Word Alignment Interpretation for Neural Machine Translationcited by 27
- 2022How to Dissect a Muppet: The Structure of Transformer Embedding Spacescited by 19
- 2022A Multilingual Perspective Towards the Evaluation of Attribution Methods in Natural Language Inferencecited by 5
Built on by
Citing papers per year: 2023: 6; 2024: 14; 2025: 17; 2026: 5.
42 papers.
Sort:
By area:
- 2023Neurons in Large Language Models: Dead, N-gram, Positionalcited by 88
- 2024Usable XAI: 10 Strategies Towards Exploiting Explainability in the LLM Eracited by 45
- 2024On Large Language Models' Hallucination with Regard to Known Factscited by 43
- 2024Sharing Matters: Analysing Neurons Across Languages and Tasks in LLMscited by 33
- 2024Model Internals-based Answer Attribution for Trustworthy Retrieval-Augmented Generationcited by 25
- 2024The Hidden Space of Transformer Language Adapterscited by 16
- 2025LLMs as a synthesis between symbolic and distributed approaches to languagecited by 13
- 2024Correcting Negative Bias in Large Language Models through Negative Attention Score Alignmentcited by 12
- 2025Attributing Response to Context: A Jensen-Shannon Divergence Driven Mechanistic Study of Context Attribution in Retrieval-Augmented Generationcited by 12
- 2024Interpreting Context Look-ups in Transformers: Investigating Attention-MLP Interactionscited by 11
- 2025A Close Look at Decomposition-based XAI-Methods for Transformer Language Modelscited by 10
- 2025Interpretation Meets Safety: A Survey on Interpretation Methods and Tools for Improving LLM Safetycited by 10
30 more
- 2025InvisibleInk: High-Utility and Low-Cost Text Generation with Differential Privacycited by 10
- 2023Roles of Scaling and Instruction Tuning in Language Perception: Model vs. Human Attentioncited by 7
- 2023Quantifying the Plausibility of Context Reliance in Neural Machine Translationcited by 6
- 2025GrAInS: Gradient-based Attribution for Inference-Time Steering of LLMs and VLMscited by 6
- 2025Decoupling Positional and Symbolic Attention Behavior in Transformerscited by 6
- 2024A Large Encoder-Decoder Family of Foundation Models For Chemical Languagecited by 5
- 2024Context-Aware or Context-Insensitive? Assessing LLMs' Performance in Document-Level Translationcited by 5
- 2025B-cos LM: Efficiently Transforming Pre-trained Language Models for Improved Explainabilitycited by 4
- 2025Unsupervised Word-level Quality Estimation for Machine Translation Through the Lens of Annotators (Dis)agreementcited by 4
- 2025How Programming Concepts and Neurons Are Shared in Code Language Modelscited by 4
- 2024Counterfactuals As a Means for Evaluating Faithfulness of Attribution Methods in Autoregressive Language Modelscited by 3
- 2025LaTIM: Measuring Latent Token-to-Token Interactions in Mamba Modelscited by 3
- 2025The Unheard Alternative: Contrastive Explanations for Speech-to-Text Modelscited by 3
- 2023Why bother with geometry? On the relevance of linear decompositions of Transformer embeddingscited by 2
- 2023Explainable Identification of Hate Speech towards Islam using Graph Neural Networkscited by 2
- 2024Bridging Linguistic Structure and Mechanistic Interpretability for Conceptual Interpretation in Language Modelscited by 2
- 2025Which Words Matter Most in Zero-Shot Prompts?cited by 2
- 2025Steering Information Utility in Key-Value Memory for Language Model Post-Trainingcited by 2
- 2024When Only Time Will Tell: Interpreting How Transformers Process Local Ambiguities Through the Lens of Restart-Incrementalitycited by 1
- 2024Analyzing Context Contributions in LLM-based Machine Translationcited by 1
- 2024On Explaining with Attention Matricescited by 1
- 2025DePass: Unified Feature Attributing by Simple Decomposed Forward Passcited by 1
- 2026Contrastive Attribution in the Wild: An Interpretability Analysis of LLM Failures on Realistic Benchmarkscited by 1
- 2023Let the Models Respond: Interpreting Language Model Detoxification Through the Lens of Prompt Dependencecited by 0
- 2025Beyond the Sentence: A Survey on Context-Aware Machine Translation with Large Language Modelscited by 0
- 2025Mapping Scientific Literature with Large Language Models and Topic Modelingcited by 0
- 2026LANCET: Neural Intervention via Structural Entropy for Mitigating Faithfulness Hallucinations in LLMscited by 0
- 2026Internal Flow Signatures for Self-Checking and Refinement in LLMscited by 0
- 2026Layer-wise Target Propagation: Efficient Component Attribution through Target Centric Propagationcited by 0
- 2026Grad Detect: Gradient-Based Hallucination Detection in LLMscited by 0
- 2026Grad Detect: Gradient-Based Hallucination Detection in LLMs23 Jun 2026
- 2026Contrastive Attribution in the Wild: An Interpretability Analysis of LLM Failures on Realistic Benchmarks20 Apr 2026
- 2026Layer-wise Target Propagation: Efficient Component Attribution through Target Centric Propagation20 Mar 2026
- 2026Internal Flow Signatures for Self-Checking and Refinement in LLMs2 Feb 2026
- 2026LANCET: Neural Intervention via Structural Entropy for Mitigating Faithfulness Hallucinations in LLMs4 Jan 2026
- 2025DePass: Unified Feature Attributing by Simple Decomposed Forward Pass21 Oct 2025
- 2025Mapping Scientific Literature with Large Language Models and Topic Modeling17 Oct 2025
- 2025Decoupling Positional and Symbolic Attention Behavior in Transformers3 Oct 2025
- 2025The Unheard Alternative: Contrastive Explanations for Speech-to-Text Models30 Sep 2025
- 2025GrAInS: Gradient-based Attribution for Inference-Time Steering of LLMs and VLMs24 Jul 2025
- 2025Steering Information Utility in Key-Value Memory for Language Model Post-Training7 Jul 2025
- 2025InvisibleInk: High-Utility and Low-Cost Text Generation with Differential Privacy30 Jun 2025
30 more
- 2025Beyond the Sentence: A Survey on Context-Aware Machine Translation with Large Language Models9 Jun 2025
- 2025Interpretation Meets Safety: A Survey on Interpretation Methods and Tools for Improving LLM Safety5 Jun 2025
- 2025How Programming Concepts and Neurons Are Shared in Code Language Models1 Jun 2025
- 2025Unsupervised Word-level Quality Estimation for Machine Translation Through the Lens of Annotators (Dis)agreement29 May 2025
- 2025Attributing Response to Context: A Jensen-Shannon Divergence Driven Mechanistic Study of Context Attribution in Retrieval-Augmented Generation22 May 2025
- 2025A Close Look at Decomposition-based XAI-Methods for Transformer Language Models21 Feb 2025
- 2025LaTIM: Measuring Latent Token-to-Token Interactions in Mamba Models21 Feb 2025
- 2025B-cos LM: Efficiently Transforming Pre-trained Language Models for Improved Explainability18 Feb 2025
- 2025LLMs as a synthesis between symbolic and distributed approaches to language17 Feb 2025
- 2025Which Words Matter Most in Zero-Shot Prompts?5 Feb 2025
- 2024On Explaining with Attention Matrices24 Oct 2024
- 2024Analyzing Context Contributions in LLM-based Machine Translation21 Oct 2024
- 2024Context-Aware or Context-Insensitive? Assessing LLMs' Performance in Document-Level Translation18 Oct 2024
- 2024Counterfactuals As a Means for Evaluating Faithfulness of Attribution Methods in Autoregressive Language Models21 Aug 2024
- 2024Bridging Linguistic Structure and Mechanistic Interpretability for Conceptual Interpretation in Language Models5 Aug 2024
- 2024Correcting Negative Bias in Large Language Models through Negative Attention Score Alignment31 Jul 2024
- 2024A Large Encoder-Decoder Family of Foundation Models For Chemical Language24 Jul 2024
- 2024Model Internals-based Answer Attribution for Trustworthy Retrieval-Augmented Generation19 Jun 2024
- 2024Sharing Matters: Analysing Neurons Across Languages and Tasks in LLMs13 Jun 2024
- 2024On Large Language Models' Hallucination with Regard to Known Facts29 Mar 2024
- 2024Usable XAI: 10 Strategies Towards Exploiting Explainability in the LLM Era13 Mar 2024
- 2024Interpreting Context Look-ups in Transformers: Investigating Attention-MLP Interactions23 Feb 2024
- 2024The Hidden Space of Transformer Language Adapters20 Feb 2024
- 2024When Only Time Will Tell: Interpreting How Transformers Process Local Ambiguities Through the Lens of Restart-Incrementality20 Feb 2024
- 2023Explainable Identification of Hate Speech towards Islam using Graph Neural Networks2 Nov 2023
- 2023Roles of Scaling and Instruction Tuning in Language Perception: Model vs. Human Attention29 Oct 2023
- 2023Why bother with geometry? On the relevance of linear decompositions of Transformer embeddings10 Oct 2023
- 2023Quantifying the Plausibility of Context Reliance in Neural Machine Translation2 Oct 2023
- 2023Neurons in Large Language Models: Dead, N-gram, Positional9 Sep 2023
- 2023Let the Models Respond: Interpreting Language Model Detoxification Through the Lens of Prompt Dependence1 Sep 2023
- 2024Model Internals-based Answer Attribution for Trustworthy Retrieval-Augmented Generationcited by 25
- 2025Attributing Response to Context: A Jensen-Shannon Divergence Driven Mechanistic Study of Context Attribution in Retrieval-Augmented Generationcited by 12
- 2025InvisibleInk: High-Utility and Low-Cost Text Generation with Differential Privacycited by 10
- 2025InvisibleInk: High-Utility and Low-Cost Text Generation with Differential Privacy30 Jun 2025
- 2025Attributing Response to Context: A Jensen-Shannon Divergence Driven Mechanistic Study of Context Attribution in Retrieval-Augmented Generation22 May 2025
- 2024Model Internals-based Answer Attribution for Trustworthy Retrieval-Augmented Generation19 Jun 2024
- 2023Neurons in Large Language Models: Dead, N-gram, Positionalcited by 88
- 2024Usable XAI: 10 Strategies Towards Exploiting Explainability in the LLM Eracited by 45
- 2024On Large Language Models' Hallucination with Regard to Known Factscited by 43
- 2024Sharing Matters: Analysing Neurons Across Languages and Tasks in LLMscited by 33
- 2024The Hidden Space of Transformer Language Adapterscited by 16
- 2025LLMs as a synthesis between symbolic and distributed approaches to languagecited by 13
- 2024Correcting Negative Bias in Large Language Models through Negative Attention Score Alignmentcited by 12
- 2024Interpreting Context Look-ups in Transformers: Investigating Attention-MLP Interactionscited by 11
- 2025A Close Look at Decomposition-based XAI-Methods for Transformer Language Modelscited by 10
- 2023Roles of Scaling and Instruction Tuning in Language Perception: Model vs. Human Attentioncited by 7
- 2023Quantifying the Plausibility of Context Reliance in Neural Machine Translationcited by 6
- 2025Decoupling Positional and Symbolic Attention Behavior in Transformerscited by 6
12 most cited of 36 All 36 (JSON)
- 2026Grad Detect: Gradient-Based Hallucination Detection in LLMs23 Jun 2026
- 2026Contrastive Attribution in the Wild: An Interpretability Analysis of LLM Failures on Realistic Benchmarks20 Apr 2026
- 2026Layer-wise Target Propagation: Efficient Component Attribution through Target Centric Propagation20 Mar 2026
- 2026Internal Flow Signatures for Self-Checking and Refinement in LLMs2 Feb 2026
- 2026LANCET: Neural Intervention via Structural Entropy for Mitigating Faithfulness Hallucinations in LLMs4 Jan 2026
- 2025DePass: Unified Feature Attributing by Simple Decomposed Forward Pass21 Oct 2025
- 2025Mapping Scientific Literature with Large Language Models and Topic Modeling17 Oct 2025
- 2025Decoupling Positional and Symbolic Attention Behavior in Transformers3 Oct 2025
- 2025The Unheard Alternative: Contrastive Explanations for Speech-to-Text Models30 Sep 2025
- 2025Steering Information Utility in Key-Value Memory for Language Model Post-Training7 Jul 2025
- 2025Beyond the Sentence: A Survey on Context-Aware Machine Translation with Large Language Models9 Jun 2025
- 2025How Programming Concepts and Neurons Are Shared in Code Language Models1 Jun 2025
12 newest of 36 All 36 (JSON)