测量Transformer中上下文信息的混合
Measuring the Mixing of Contextual Information in the Transformer
摘要:
Transformer架构通过自我注意力机制聚合输入信息,但是对于这些信息如何在整个模型中混合并没有清晰的理解。此外,最近的研究表明,注意力权重本身不足以描述信息流。在本文中,我们考虑了整个注意力块--多头注意力、剩余连接和层归一化--并定义了一个度量来测量每层内的令牌到令牌的交互。然后,我们汇总逐层解释,为模型预测提供输入归因得分。在实验中,我们表明,我们的方法,ALTI(聚合的逐层令牌到令牌的相互作用),提供了更忠实的解释和增强的鲁棒性比基于梯度的方法。
英文摘要:
The Transformer architecture aggregates input information through the self-attention mechanism, but there is no clear understanding of how this information is mixed across the entire model. Additionally, recent works have demonstrated that attention weights alone are not enough to describe the flow of information. In this paper, we consider the whole attention block -- multi-head attention, residual connection, and layer normalization -- and define a metric to measure token-to-token interactions within each layer. Then, we aggregate layer-wise interpretations to provide input attribution scores for model predictions. Experimentally, we show that our method, ALTI (Aggregation of Layer-wise Token-to-token Interactions), provides more faithful explanations and increased robustness than gradient-based methods.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。