Is Attention Interpretable?

Sofia Serrano, Noah A. Smith
6/9/2019
cs.CL
transformer-attention

Official code: serrano-s/attn-tests (49 stars, Python, last commit 2019-07-28).

Abstract

Attention mechanisms have recently boosted performance on a range of NLP tasks. Because attention layers explicitly weight input components' representations, it is also often assumed that attention can be used to identify information that models found important (e.g., specific contextualized word tokens).

Show full abstract

We test whether that assumption holds by manipulating attention weights in already-trained text classification models and analyzing the resulting differences in their predictions. While we observe some ways in which higher attention weights correlate with greater impact on model predictions, we also find many ways in which this does not hold, i.e., where gradient-based rankings of attention weights better predict their effects than their magnitudes. We conclude that while attention noisily predicts input components' overall importance to a model, it is by no means a fail-safe indicator.

View on arXivView PDF

Code Implementations(1)

Checking the interpretability of attention on text classification models

492Python, JsonnetFeb 5, 20197 years ago

Similar Papers

Cite this paper

@article{serrano2019attention,
  title  = {Is Attention Interpretable?},
  author = {Sofia Serrano and Noah A. Smith},
  year   = {2019},
  eprint = {1906.03731},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1906.03731}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1906.03731.svg)](https://codeofpaper.com/paper/1906.03731)

Discussion