[论文解读] Attention is not Explanation
该论文表明,标准注意力权重在跨 NLP 任务中很少提供对模型预测的可信解释;对照的对抗注意力可以产生相同的输出,且与梯度/逐项舍弃特征重要性的相关性在 BiLSTM 编码器上尤为弱。
Attention mechanisms have seen wide adoption in neural NLP models. In addition to improving predictive performance, these are often touted as affording transparency: models equipped with attention provide a distribution over attended-to input units, and this is often presented (at least implicitly) as communicating the relative importance of inputs. However, it is unclear what relationship exists between attention weights and model outputs. In this work, we perform extensive experiments across a variety of NLP tasks that aim to assess the degree to which attention weights provide meaningful `explanations' for predictions. We find that they largely do not. For example, learned attention weights are frequently uncorrelated with gradient-based measures of feature importance, and one can identify very different attention distributions that nonetheless yield equivalent predictions. Our findings show that standard attention modules do not provide meaningful explanations and should not be treated as though they do. Code for all experiments is available at https://github.com/successar/AttentionExplanation.
研究动机与目标
- 评估注意力权重在跨 NLP 任务中是否与特征重要性度量(梯度和逐项剔除)相关。
- 评估替代的(对照/对抗性)注意力模式是否改变预测。
- 比较简单编码器,检验 BiLSTM 编码器中标准注意力机制的可解释性。
- 通过置换和对抗性注意力分析探索基于注意力的解释的鲁棒性。
提出的方法
- 模型结构包括带有加性或缩放点积注意力的 BiLSTM 编码器,并以简单前馈(平均)嵌入作为对比。
- 使用 Kendall τ 对注意力权重与特征重要性(梯度 τg 和逐项剔除 τloo)之间的相关性进行量化。
- 通过置换注意力权重并使用全变差距离(TVD)衡量输出变化来评估对照解释。
- 形式化搜索那些最大化与观测注意力的相异度(Jensen-Shannon 散度)且预测保持在 ϵ 阈值内的对抗性注意力分布。
- 在多样化的 NLP 任务/数据集上评估:SST、IMDB、ADR Tweets、20 Newsgroups、AG News、糖尿病/贫血(MIMIC)、CNN 问答、bAbI、SNLI。
实验结果
研究问题
- RQ11. 学得的注意力权重在各任务中是否与基于梯度的特征重要性和逐项剔除度量相关?
- RQ22. 替代的注意力配置(对照/对抗性)是否产生不同的预测,即注意力图是否是可信的解释?
- RQ33. 注意力与特征重要性之间的相关性在 BiLSTM 编码器和更简单的平均编码器之间有何差异?
- RQ44. 基于注意力的解释在问答/自然语言推理任务以及较长文本中是否更为可靠?
主要发现
- 注意力权重在各数据集上与基于梯度的特征重要性(τg)和逐项剔除(τloo)的相关性仅表现为微弱且不一致。
- 对抗性注意力分布可以产生与原始注意力几乎相同的预测,表明仅基于注意力的解释可能具有误导性。
- 随机置换注意力权重往往对输出影响很小,尤其是对 BiLSTM 编码器,表明注意力并未对预测进行紧密约束。
- 前馈(平均)编码器在注意力与特征重要性度量之间表现出比 BiLSTM 注意力更强的对齐。
- 在某些长文档数据集(如 MIMIC 任务)中,相关性更显著但仍然微弱,可能是由于更多的数据点使相关性更清晰。
- 总体而言,注意力机制提高了预测性能,但不能可靠地提供对模型决策的有意义解释。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。