Learning to Attribute with Attention
Not on the map. Why?
Abstract (arXiv)
Given a sequence of tokens generated by a language model, we may want to identify the preceding tokens that influence the model to generate this sequence. Performing such token attribution is expensive; a common approach is to ablate preceding tokens and directly measure their effects. To reduce the cost of token attribution, we revisit attention weights as a heuristic for how a language model uses previous tokens. Naive approaches to attribute model behavior with attention (e.g., averaging attention weights across attention heads to estimate a token's influence) have been found to be unreliable. To attain faithful attributions, we propose treating the attention weights of different attention heads as features. This way, we can learn how to effectively leverage attention weights for attribution (using signal from ablations). Our resulting method, Attribution with Attention (AT2), reliably performs on par with approaches that involve many ablations, while being significantly more efficient. To showcase the utility of AT2, we use it to prune less important parts of a provided context in a question answering setting, improving answer quality. We provide code for AT2 at https://github.com/MadryLab/AT2 .
Key facts. Cited by 11 papers in the map (data through 7 Oct 2026). Builds on 53 of its 67 references that are in the map. First posted on arXiv 18 Apr 2025.
Builds on
53 of 67 references.
References · 53
- 2017Attention Is All You Needcited by 59,932
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,146
- 2016"Why Should I Trust You?": Explaining the Predictions of Any Classifiercited by 5,040
- 2024Qwen2.5 Technical Reportcited by 4,713
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2013Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Mapscited by 2,348
- 2024Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phonecited by 1,883
38 more
- 2016MS MARCO: A Human Generated MAchine Reading COmprehension Datasetcited by 1,591
- 2017SmoothGrad: removing noise by adding noisecited by 1,097
- 2019Attention is not Explanationcited by 916
- 2019DROP: A Reading Comprehension Benchmark Requiring Discrete Reasoning Over Paragraphscited by 883
- 2016Abstractive Text Summarization Using Sequence-to-Sequence RNNs and Beyondcited by 809
- 2020Quantifying Attention Flow in Transformerscited by 759
- 2023AGIEval: A Human-Centric Benchmark for Evaluating Foundation Modelscited by 701
- 2023Measuring Faithfulness in Chain-of-Thought Reasoningcited by 668
- 2019Attention is not not Explanationcited by 629
- 2023Enabling Large Language Models to Generate Text with Citationscited by 584
- 2019ERASER: A Benchmark to Evaluate Rationalized NLP Modelscited by 523
- 2023Towards Measuring the Representation of Subjective Global Opinions in Language Modelscited by 424
- 2019Is Attention Interpretable?cited by 387
- 2022Teaching language models to support answers with verified quotescited by 290
- 2022RARR: Researching and Revising What Language Models Say, Using Language Modelscited by 286
- 2023TRAK: Attributing Model Behavior at Scalecited by 273
- 2021Measuring Attribution in Natural Language Generation Modelscited by 253
- 2024Retrieval Head Mechanistically Explains Long-Context Factualitycited by 219
- 2015Visualizing and Understanding Neural Models in NLPcited by 199
- 2022Datamodels: Predicting Predictions from Training Datacited by 186
- 2020Causal Mediation Analysis for Interpreting Neural NLP: The Case of Gender Biascited by 183
- 2024Lookback Lens: Detecting and Mitigating Contextual Hallucinations in Large Language Models Using Only Attention Mapscited by 140
- 2021FastSHAP: Real-Time Shapley Value Estimationcited by 123
- 2024Are self-explanations from Large Language Models faithful?cited by 101
- 2024ContextCite: Attributing Model Generation to Contextcited by 93
- 2022Interpreting Language Models with Contrastive Explanationscited by 91
- 2023Attention Sorting Combats Recency Bias In Long Context Language Modelscited by 89
- 2019Attention Interpretability Across NLP Taskscited by 71
- 2024Attention Heads of Large Language Models: A Surveycited by 65
- 2016"What is Relevant in a Text Document?": An Interpretable Machine Learning Approachcited by 53
- 2023Sequential Integrated Gradients: a simple but effective method for explaining language modelscited by 52
- 2019When and Why is Document-level Context Useful in Neural Machine Translation?cited by 45
- 2021Evaluating the Faithfulness of Importance Measures in NLP by Recursively Masking Allegedly Important Tokens and Retrainingcited by 31
- 2024Peering into the Mind of Language Models: An Approach for Attribution in Contextual Question Answeringcited by 25
- 2024Model Internals-based Answer Attribution for Trustworthy Retrieval-Augmented Generationcited by 25
- 2024AttriBoT: A Bag of Tricks for Efficiently Approximating Leave-One-Out Context Attributioncited by 23
- 2024Stochastic Amortization: A Unified Approach to Accelerate Feature and Data Attributioncited by 21
- 2024Decomposing and Editing Predictions by Modeling Model Computationcited by 19
50 most cited of 53 All 53 (JSON)
Built on by
Citing papers per year: 2025: 6; 2026: 5.
11 papers.
- 2025Attributing Response to Context: A Jensen-Shannon Divergence Driven Mechanistic Study of Context Attribution in Retrieval-Augmented Generationcited by 12
- 2025The Atlas of In-Context Learning: How Attention Heads Shape In-Context Retrieval Augmentationcited by 11
- 2026The Why Behind the Action: Unveiling Internal Drivers via Agentic Attributioncited by 8
- 2025AttnTrace: Contextual Attribution of Prompt Injection and Knowledge Corruptioncited by 5
- 2026Do LLMs Encode Functional Importance of Reasoning Tokens?cited by 4
- 2025MaxShapley: Towards Incentive-compatible Generative Search with Fair Context Attributioncited by 3
- 2025Explaining the Reasoning of Large Language Models Using Attribution Graphscited by 3
- 2025Citation Failure: Definition, Analysis and Efficient Mitigationcited by 0
- 2026Real-Time Visual Attribution Streaming in Thinking Modelcited by 0
- 2026FlashRT: Towards Computationally and Memory Efficient Red-Teaming for Prompt Injection and Knowledge Corruptioncited by 0
- 2026When the Agent Becomes the Kernel: A Systematization of Security on the Path to AI-Native Operating Systemscited by 0
- 2026When the Agent Becomes the Kernel: A Systematization of Security on the Path to AI-Native Operating Systems20 Sep 2026
- 2026FlashRT: Towards Computationally and Memory Efficient Red-Teaming for Prompt Injection and Knowledge Corruption30 Apr 2026
- 2026Real-Time Visual Attribution Streaming in Thinking Model17 Apr 2026
- 2026The Why Behind the Action: Unveiling Internal Drivers via Agentic Attribution21 Jan 2026
- 2026Do LLMs Encode Functional Importance of Reasoning Tokens?6 Jan 2026
- 2025Explaining the Reasoning of Large Language Models Using Attribution Graphs17 Dec 2025
- 2025MaxShapley: Towards Incentive-compatible Generative Search with Fair Context Attribution5 Dec 2025
- 2025Citation Failure: Definition, Analysis and Efficient Mitigation23 Oct 2025
- 2025AttnTrace: Contextual Attribution of Prompt Injection and Knowledge Corruption5 Aug 2025
- 2025Attributing Response to Context: A Jensen-Shannon Divergence Driven Mechanistic Study of Context Attribution in Retrieval-Augmented Generation22 May 2025
- 2025The Atlas of In-Context Learning: How Attention Heads Shape In-Context Retrieval Augmentation21 May 2025