论文标题

量化变压器的注意力流动

Quantifying Attention Flow in Transformers

论文作者

Abnar, Samira, Zuidema, Willem

论文摘要

在变压器模型中,“自我注意事项”将来自聚集的嵌入的信息结合到下一层中焦点嵌入的表示。因此,在变压器的层中,源自不同令牌的信息越来越混杂。这会使注意力不可靠,因为解释探针。在本文中,我们考虑了通过自我注意来量化信息流的问题。我们提出了两种方法,即当我们使用注意力权重作为输入令牌的相对相关性时,将注意力重量,注意力推广和注意力流视为投入权重,注意力推广和注意力流量的方法。我们表明,这些方法给出了有关信息流的互补观点,并且与原始关注相比,这两者都产生了更高的相关性与使用消融方法和输入梯度获得的输入令牌的重要性分数。

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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源