[论文解读] XAI for Transformers: Better Explanations through Conservative Propagation
该论文将 Layer-wise Relevance Propagation (LRP) 扩展到 Transformer,通过为注意力头和 LayerNorm 引入保守传播规则,解决基于梯度的方法的守恒失败,并在 NLP、视觉和图形领域实现最先进的解释性能。
Transformers have become an important workhorse of machine learning, with numerous applications. This necessitates the development of reliable methods for increasing their transparency. Multiple interpretability methods, often based on gradient information, have been proposed. We show that the gradient in a Transformer reflects the function only locally, and thus fails to reliably identify the contribution of input features to the prediction. We identify Attention Heads and LayerNorm as main reasons for such unreliable explanations and propose a more stable way for propagation through these layers. Our proposal, which can be seen as a proper extension of the well-established LRP method to Transformers, is shown both theoretically and empirically to overcome the deficiency of a simple gradient-based approach, and achieves state-of-the-art explanation performance on a broad range of Transformer models and datasets.
研究动机与目标
- 由于 Transformer 的复杂性及潜在的公平性问题,推动可解释 AI 的需求
- 分析应用于 Transformer 时梯度基解释的守恒性质
- 发展在注意力头和 LayerNorm 上具有理论根据的、保守传播的 LRP 规则
- 在 NLP、视觉和图任务中对所提出方法与强基线进行经验验证
提出的方法
- 将 Gradient × Input (GI) 解释框架置于 Layer-wise Relevance Propagation (LRP) 形式化中,以评估 Transformer 模块的守恒性
- 识别 Attention Heads 与 LayerNorm 为 GI 传播中守恒性中断的关键源
- 通过将门控/重标定项视为常数(detach)并应用线性层 LRP 规则,推导 AH-rule(注意力头规则)与 LN-rule(LayerNorm 规则)的保守 LRP 规则
- 提供一个简便实现技巧:通过 y_j = sum_i x_i [p_ij].detach() 和 y_i = (x_i - E[x]) / [sqrt(epsilon+Var[x])] .detach() 计算解释,然后运行 GI 以获得解释
- 证明这些 AH 与 LN 规则能够保持守恒,并在多个数据集上获得比 GI 更好的经验解释效果
实验结果
研究问题
- RQ1梯度基解释是否可以在 Transformer 架构中实现保守,以真实地对预测进行归因?
- RQ2哪些 Transformer 组件会破坏 GI 的守恒性,我们如何修改传播规则来解决它们?
- RQ3针对注意力头和 LayerNorm 的保守 LRP 规则是否在 NLP、视觉和图任务中提升定性与定量的解释质量?
- RQ4与标准基准上的最先进 Transformer 解释方法相比,所提出的方法有何表现?
主要发现
- 在 Transformer 中 GI 的守恒性被违反,尤其是由于注意力头和 LayerNorm 引起
- 采用 AH-rule 与 LN-rule 的 LRP 能保持守恒,在实验中比 GI 提供更真实的分配
- LRP(AH+LN) 在 NLP 与图数据集上在 AUAC(激活)与 AU-MSE(剪枝)方面始终表现最佳,优于 GI 和若干基线
- 来自 LRP(AH) 与 LRP(AH+LN) 的定性解释聚焦于显著的标记或超像素,减少对实体的虚假强调
- 该方法可扩展到 Transformer 与 Graphormer 模型,并在计算效率上优于某些扰动基或仅注意力的方法
- 该方法使在情感分析模型(如 DistilBERT 在 SST-2)中进行偏见分析成为可能,通过将相关性归因于性别化姓名与实体,而无需生成对抗性样本
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。