Flow 0.320.26 0.440.29 0.700.25 0.700.22 0.710.22 0.700.22
Table 1: SpearmanR correlation of attention based importance with blank-out scores for 2000 samples from
the test set for the verb number prediction model.
3 Attention Rollout and Attention Flow
Attention rollout and attention ﬂow recursively
compute the token attentions in each layer of a
L1 L2 L3 L4 L5 L6
Raw 0.530.33 0.160.38 -0.060.42 0.000.47 0.240.40 0.460.35
Rollout 0.220.31 0.270.32 0.390.32 0.470.32 0.530.32 0.540.31
Flow 0.220.31 0.310.34 0.540.32 0.610.28 0.600.28 0.610.28
Table 2: SpearmanR correlation of attention based importance with input gradients for 2000 samples from
the test set for the verb number prediction model.
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.
Samira Abnar Willem Zuidema