Why is Attention Not So Interpretable?

Bing Bai, Jian Liang, Guanhua Zhang, Hao Li, Kun Bai, Fei WangOpenReview 2020

TL;DR

This paper identifies "combinatorial shortcuts" as a key reason why attention mechanisms, often used for model interpretability, can be misleading. They propose and validate two methods, random attention pretraining and mask-neutral learning, to mitigate these shortcuts and improve the reliability of attention-based explanations.

What Problem Does This Paper Address?

Interpreting machine learning models is crucial, especially in critical domains. Attention mechanisms are a popular tool for this, with the intuition that attention weights highlight important input features. However, recent research suggests this isn't always true; attention weights can focus on seemingly irrelevant tokens and don't always correlate with other importance measures. This has led to a debate about whether attention is truly interpretable. This paper tackles this problem by proposing a specific cause for this lack of interpretability: "combinatorial shortcuts."

The core idea is that attention mechanisms might not just be highlighting important parts of the input, but the attention weights themselves might encode additional information that downstream model components exploit. This means the weights aren't purely indicators of importance but are also used as a form of "encoding layer," leading to potentially misleading interpretations.

Methods

The authors propose two main methods to combat combinatorial shortcuts:

  • Random Attention Pretraining: This method first trains the downstream part of the attention model using randomly generated attention masks. This forces the downstream layers to learn from unbiased inputs. Then, the attention layer is trained independently while keeping the downstream layers fixed. This ensures the attention layer learns to provide unbiased importance estimates.
  • Mask-Neutral Learning with Instance Weighting: This approach uses instance weighting to create a "mask-neutral distribution." The idea is to re-weight the training data such that the learned model is less dependent on the specific masks used, encouraging it to rely more on the actual input features for prediction. This method aims to recover a distribution where masks are unrelated to labels, thereby mitigating shortcuts.

The paper also theoretically analyzes combinatorial shortcuts from a causal effect estimation perspective, framing different attention masks as different "treatments."

Datasets

The paper uses the following datasets for their experiments:

  • IMDB: A dataset for text classification.
  • Yelp P.: Another text classification dataset.
  • MNIST: A binary classification subset (digits 3 and 8) for image classification.
  • Fashion-MNIST (F-MNIST): A binary classification subset (Pullover and Shirt) for image classification.

Key Insights and Ideas

  • Combinatorial Shortcuts: The central insight is that attention weights can carry information beyond just highlighting important features. Downstream model components can exploit these weights themselves, turning them into a form of encoding rather than a pure importance indicator.
  • Attention as Encoding: This implies that attention mechanisms, when suffering from combinatorial shortcuts, are not simply "pointing" to important information but are actively contributing to the model's decision-making in a way that obscures true importance.
  • Causal Perspective: Framing attention as a causal inference problem helps to understand why biased estimations lead to shortcuts. Randomization is key to unbiased causal inference, and attention mechanisms, by their nature, often don't provide this.
  • Two-Pronged Solution: The proposed methods (pretraining and mask-neutral learning) offer practical ways to address the issue, with one focusing on initial unbiased training and the other on re-weighting to achieve mask neutrality.

Key Results

  • Mitigation of Shortcuts: Experiments show that both "Pretraining" and "Weighting" methods significantly reduce the attention weights assigned to default, non-informative tokens (like "[SEP]", ",", ".") across various models and datasets. This indicates a successful mitigation of combinatorial shortcuts.
  • Improved Interpretability: When applied to an interpretability model (L2X), the proposed methods lead to improved post-hoc accuracy scores, demonstrating that more reliable explanations can be generated. For instance, the "Weighting" method achieved a post-hoc accuracy of 94.3% on IMDB, compared to 89.2% for the baseline L2X.
  • Task-Specific Performance: The effectiveness of the methods can vary by task. For text classification, adding the model's output to the query (as in L2X with ŷ) sometimes decreased performance, while Pretraining was more effective. For image classification, the opposite was observed, suggesting differences in how features contribute to predictions across modalities.

Limitations and Future Work

  • Assumptions for Mask-Neutral Learning: The mask-neutral learning method relies on specific assumptions (e.g., regarding the relationship between features, labels, and selection indicators) that may not always hold in practice.
  • Efficiency of Pretraining: While theoretically sound, random attention pretraining might be less efficient for high-dimensional inputs as it needs to explore a vast space of masks.
  • Tuning for Weighting: The effectiveness of mask-neutral learning with instance weighting depends on accurate estimation of P(Y|M), which can be challenging as this probability changes during training.
  • Future Work: The paper suggests that these methods can be extended to multi-class classification problems. Further exploration into the theoretical underpinnings and practical applications of these techniques is implied.

Summary updated

BibTeX
@misc{bai2020why,
  author = {Bing Bai and Jian Liang and Guanhua Zhang and Hao Li and Kun Bai and Fei Wang},
  title = {{Why is Attention Not So Interpretable?}},
  year = {2020},
  url = {https://openreview.net/forum?id=pQhnag-dIt},
  howpublished = {OpenReview},
}
Figure