TL;DR
ALTI (Aggregation of Layer-wise Token-to-token Interactions) is a novel interpretability method that tracks how information flows through a Transformer by analyzing the entire attention block—including residual connections and layer normalization. By measuring the geometric proximity of transformed vectors, ALTI provides more faithful and robust input attribution scores than traditional gradient-based methods or simple attention weights.
What Problem Does This Paper Address?
Despite the dominance of Transformer models, we still lack a clear "X-ray" of their internal decision-making. For a long time, researchers relied on attention weights to explain model behavior. However, recent studies have shown that "attention is not explanation": these weights ignore the influence of residual (skip) connections, layer normalization, and the varying magnitudes of the vectors being processed.
The gap lies in the "mixing" process. In each layer, a token's representation is updated by looking at other tokens, but it also carries over a significant amount of its own previous state via skip connections. Existing methods like "Attention Rollout" try to account for this but often assume the skip connection and attention have equal weight, which isn't true in practice. This paper seeks a metric that captures the actual contribution of each input token to the final prediction by looking at the complete mathematical transformation within each layer.
Methods
The authors introduce ALTI, which works in three main steps:
- Attention Block Decomposition: They reformulate the entire attention block (Multi-Head Attention + Residual + Layer Norm) as a sum of transformed vectors. Essentially, the output for a token $i$ is shown to be a weighted sum of contributions from every token $j$ in the previous layer.
- Measuring Contribution via Proximity: Instead of just looking at weights, they measure how much a transformed input vector $T_i(x_j)$ contributes to the final output vector $y_i$ using Manhattan distance ($\ell_1$ norm). The logic is intuitive: if the transformed version of token $j$ is geometrically close to the resulting output $y_i$, then token $j$ was a primary driver of that update.
- Aggregation: To get a "global" view, they use a technique similar to rollout—multiplying these contribution matrices across all layers—to trace the path from the raw input tokens to the final hidden state used for classification.
Datasets
The authors evaluated ALTI across several diverse benchmarks:
- Sentiment Analysis (Text Classification): SST-2 (short sentences), IMDB, and Yelp (longer reviews).
- Syntactic Understanding: The Subject-Verb Agreement (SVA) task from Linzen et al. (2016), which tests if a model can identify the correct grammatical number of a verb across "distractor" words.
- Models: The method was tested on BERT, RoBERTa, and DistilBERT to ensure it wasn't architecture-specific.
Key Insights and Ideas
- The Anisotropy Problem: Contextual representations in Transformers are "anisotropic," meaning they tend to cluster in a narrow cone in vector space (see Figure 3). This makes simple cosine similarity a poor metric for contribution. ALTI's use of distance in the transformed space helps bypass this "bunching" effect.
- $\ell_1$ over $\ell_2$: Transformers often have "outlier dimensions"—specific coordinates with disproportionately large values. The authors found that the Manhattan distance ($\ell_1$) is more robust to these outliers than the Euclidean distance ($\ell_2$), leading to better explanations.
- Skip Connections are King: The analysis confirms that the residual connection often has a much larger impact on the final representation than the multi-head attention itself. ALTI naturally captures this, whereas weight-based methods miss it.
Key Results
- Superior Faithfulness: ALTI consistently outperformed gradient-based methods (like Integrated Gradients) and previous attention-based methods (like Globenc) in Comprehensiveness and Sufficiency metrics. For example, on the Yelp dataset, ALTI's comprehensiveness score was nearly double that of gradient methods, meaning it was much better at identifying the truly influential words.
- Robustness to Noise: One of the most striking results is ALTI's stability. Gradient-based methods can vary wildly if you change the random seed of the model's initialization, even if the model's final accuracy is the same. ALTI produces much more consistent attributions across different training runs.
- Long-Sequence Performance: While many methods work well on short sentences (SST-2), ALTI's advantage becomes much clearer on long documents (IMDB/Yelp), where it successfully ignores "filler" words and identifies key sentiment-bearing phrases like "food not good" or "stomach aches."
Limitations and Future Work
The primary limitation acknowledged by the authors is that ALTI measures the mixing of information up to the last hidden layer. It does not explicitly account for the final linear classifier (the "head") sitting on top of the Transformer. Consequently, it provides a general map of information flow rather than class-specific explanations (e.g., "why is this specifically Positive vs Negative").
Future work could involve integrating the final classification head into the contribution graph to provide even more targeted class-based attributions.
Summary updated