The great success of Transformer-based models benefits from the powerful multi-head self-attention mechanism, which learns token dependencies and encodes contextual information from the input. Prior work strives to attribute model decisions to individual input features with different saliency measures, but they fail to explain how these input features interact with each other to reach predictions. In this paper, we propose a self-attention attribution method to interpret the information interactions inside Transformer. We take BERT as an example to conduct extensive studies. Firstly, we apply self-attention attribution to identify the important attention heads, while others can be pruned with marginal performance degradation. Furthermore, we extract the most salient dependencies in each layer to construct an attribution tree, which reveals the hierarchical interactions inside Transformer. Finally, we show that the attribution results can be used as adversarial patterns to implement non-targeted attacks towards BERT.
翻译:以变异器为基础的模型的巨大成功得益于强大的多头自我注意机制,该机制从输入中学习象征性依赖性,并编码背景信息。先前的工作努力将模型决定归因于具有不同突出度的单个输入特征,但未能解释这些输入特征如何相互作用,以得出预测。在本文中,我们提出一种自我注意归属方法来解释变异器内部的信息互动。我们以BERT为例进行广泛的研究。首先,我们运用自我注意归属来确定重要的关注负责人,而其他人则可以随着边际性能退化而消化。此外,我们提取了每一层中最突出的相互依赖性,以构建一个归属树,揭示变异器内部的等级互动。最后,我们表明,归因结果可以用作对抗模式,对BERT实施非有针对性的攻击。