Quantifying Attention Flow in Transformers

By Samira Abnar, Willem H. Zuidema. 2020

1,293 citations recorded by the source corpus.

In the Transformer model, “self-attention” combines information from attended embeddings into the representation of the focal embedding in the next layer. Thus, across layers of the Transformer, information originating from different tokens gets increasingly mixed. This makes attention weights unreliable as explanations probes. In this paper, we consider the problem of quantifying this flow of information through self-attention. We propose two methods for approximating the attention to input tokens given attention weights, attention rollout and attention flow, as post hoc methods when we use attention weights as the relative relevance of the input tokens. We show that these methods give complementary views on the flow of information, and compared to raw attention, both yield higher correlations with importance scores of input tokens obtained using an ablation method and input gradients.

Subfields: Artificial Intelligence, Model Architectures

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Sergey Levine
  2. Quoc V. Le
  3. Mohit Bansal
  4. Trevor Darrell
  5. Cordelia Schmid
  6. Jianfeng Gao
  7. Ruslan Salakhutdinov
  8. Yoshua Bengio

In Model Architectures

  1. Yi Tay
  2. Mostafa Dehghani
  3. Donald Metzler
  4. Dara Bahri
  5. Cordelia Schmid
  6. Emilio Parisotto
  7. Jai Gupta
  8. Alan L. Yuille

Citations in the corpus