Effective Attention Sheds Light On Interpretability

Kaiser Sun, Ana Marasović
5/18/2021
cs.CL
transformer-attention

Official code: KaiserWhoLearns/Effective-Attention-Interpretability (11 stars, Python, last commit 2021-05-16).

Abstract

An attention matrix of a transformer self-attention sublayer can provably be decomposed into two components and only one of them (effective attention) contributes to the model output. This leads us to ask whether visualizing effective attention gives different conclusions than interpretation of standard attention.

Show full abstract

Using a subset of the GLUE tasks and BERT, we carry out an analysis to compare the two attention matrices, and show that their interpretations differ. Effective attention is less associated with the features related to the language modeling pretraining such as the separator token, and it has more potential to illustrate linguistic features captured by the model for solving the end-task. Given the found differences, we recommend using effective attention for studying a transformer's behavior since it is more pertinent to the model output by design.

View on arXivView PDF

Code Implementations(1)

Effective Attention Sheds Light On Interpretability - Findings of ACL2021

111Python, Jupyter NotebookMay 16, 20215 years ago

Similar Papers

Cite this paper

@article{sun2021effective,
  title  = {Effective Attention Sheds Light On Interpretability},
  author = {Kaiser Sun and Ana Marasović},
  year   = {2021},
  eprint = {2105.08855},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2105.08855}
}

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/2105.08855.svg)](https://codeofpaper.com/paper/2105.08855)

Discussion