Abstract
Token attribution—identifying which input tokens caused a model's output—is essential for interpretability but typically requires a choice between accurate but slow ablation methods or fast but unreliable raw attention weights. This paper introduces AT2 (Attribution with Attention), a method that learns to weight specific attention heads as features to predict the effects of token removal. By treating attention heads as specialized features, AT2 matches the quality of expensive "gold standard" techniques while remaining significantly faster than even a single backward pass.
Introduction
When a Large Language Model (LLM) generates a statement, understanding the underlying cause is critical for trust and debugging. This task, known as token attribution, currently faces a dilemma. Ablation-based methods, which remove input parts to measure output probability drops, are highly accurate but prohibitively expensive, requiring hundreds of inference passes. Conversely, raw attention weights are computationally free but often fail to correlate with actual model influence. The authors propose a middle ground: learning to use attention weights more effectively to predict the results of expensive ablations.
Methodology: Attribution with Attention (AT2)
The core innovation is Attribution with Attention (AT2). Rather than naively averaging attention weights across all heads and layers, AT2 treats the attention weights of every individual head as a separate feature.
The process involves two stages:
- Training (Amortization): On a small dataset, expensive random ablations are performed to find "ground truth" influence scores. A linear surrogate model is then trained to predict these scores using attention weights from different heads as inputs. This identifies which heads are "influence heads" and which are noise.
- Inference: Once coefficients are learned, attribution for new sentences is nearly instantaneous, requiring only a weighted sum of attention weights from the forward pass.
Crucially, AT2 is generalizable. Once a specific model (like Llama-3) is profiled, the learned coefficients work across different tasks without retraining.
Key Insights: The Specialized Roles of Attention Heads
A primary finding is that attention heads have specialized roles. While average attention is a poor proxy for influence, specific heads are incredibly predictive. By amplifying signal heads and ignoring noise, AT2 bridges the gap between attention and influence.
Furthermore, AT2 demonstrates strong generalization. Coefficients learned on a generic instruction-following dataset (Dolly 15k) perform excellently on specialized tasks like news summarization or multi-hop QA. This suggests that the way a model utilizes its attention heads is a fundamental characteristic of the architecture itself, not just the specific data it's processing.
Key Results
- Accuracy: AT2 performs on par with Example-Specific Surrogate Modeling (ESM) using 128–256 ablations, consistently outperforming gradient-based methods and naive attention averaging.
- Efficiency: AT2 is 2x faster than a single forward pass and 8x faster than a single backward pass. Compared to ablation methods requiring 32+ passes, the speedup is orders of magnitude.
- Downstream Utility: Using AT2 to prune irrelevant passages in HotpotQA led to higher F1 scores than using standard attention or more expensive attribution methods, as it effectively reduced the "lost in the middle" effect.
Limitations and Future Work
AT2 currently focuses on first-order effects, meaning it captures the influence of individual tokens but may miss complex interactions where tokens are only influential when present together. Additionally, while AT2 generalizes across tasks, the coefficients are specific to a model architecture and version. Future work could explore adding more features beyond just attention weights to capture higher-order interactions.
Summary updated