[论文解读] Learning to Explain: Supervised Token Attribution from Transformer Attention Patterns
ExpNet 是一个轻量级的解释器,通过对人类推理进行监督学习,将变换器注意力模式映射到标记级重要性,在 SST-2、CoLA 和 HateXplain 的跨任务泛化中超越基线,在 F1 指标上表现优异。
Explainable AI (XAI) has become critical as transformer-based models are deployed in high-stakes applications including healthcare, legal systems, and financial services, where opacity hinders trust and accountability. Transformers self-attention mechanisms have proven valuable for model interpretability, with attention weights successfully used to understand model focus and behavior (Xu et al., 2015); (Wiegreffe and Pinter, 2019). However, existing attention-based explanation methods rely on manually defined aggregation strategies and fixed attribution rules (Abnar and Zuidema, 2020a); (Chefer et al., 2021), while model-agnostic approaches (LIME, SHAP) treat the model as a black box and incur significant computational costs through input perturbation. We introduce Explanation Network (ExpNet), a lightweight neural network that learns an explicit mapping from transformer attention patterns to token-level importance scores. Unlike prior methods, ExpNet discovers optimal attention feature combinations automatically rather than relying on predetermined rules. We evaluate ExpNet in a challenging cross-task setting and benchmark it against a broad spectrum of model-agnostic methods and attention-based techniques spanning four methodological families.
研究动机与目标
- 在基于变换器的 NLP 模型中,为可靠且与人类对齐的解释提供动机。
- 提出一个从注意力模式学习的监督式解释器,而不是固定的启发式。
- 证明解释在各种 NLP 任务中的跨任务泛化能力。
- 在广泛的基线方法中进行评估并分析架构贡献。
提出的方法
- 从 BERT 的最后一层为每个标记提取双向注意力特征:任务到标记(CLS 到标记)和标记到任务(标记到 CLS),覆盖所有头部。
- 用一个 2H 维特征向量表示每个标记,结合所有头部的注意力值。
- 训练一个轻量级的 MLP(ExpNet)将标记特征映射到带有 sigmoid 输出的二元重要性分数。
- 以人类提供的逐词推理对 ExpNet 进行监督,使之与标记预测对齐,将单词标签映射到子词标记。
- 用焦点损失处理类别不平衡,并应用正确预测筛选,仅在分类器预测正确的实例上训练。
- 在 SST-2、CoLA 和 HateXplain 上使用逐任务留一法的跨任务协议,使用标记水平 F1 和 AUROC 评估解释。

实验结果
研究问题
- RQ1从注意力模式到标记重要性的学习映射是否能在 NLP 任务之间实现泛化?
- RQ2在跨任务设置中,ExpNet 与模型无关基线和基于注意力的基线相比如何?
- RQ3ExpNet 哪些架构组件对跨域解释质量的贡献最大?
主要发现
- ExpNet 在跨任务评估中在所有三个任务上实现了最高的标记 F1。
- 在 CoLA 上,ExpNet 的 F1 = 0.468 ± 0.079,相较于最佳基线(GradCAM: 0.356)实现了 31% 的相对提升。
- 在 HateXplain 上,ExpNet 的 F1 = 0.473 ± 0.007,相较于最强基线(GradCAM: 0.396)提升了 19%。
- 在 SST-2 上,ExpNet 的 F1 = 0.398 ± 0.024,较最佳基线(GAE/MGAE: 0.350)高出 14%。
- ExpNet 通过在两个数据集上训练并在保留的第三个数据集上评估,展示了跨任务泛化能力超越任务微调的基线。
- ExpNet 的 AUROC 一直具有竞争力,通常高于 0.7,且在 SST-2 上方法的 AUROC 处于首位。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。