用梯度评分量化注意力头重要性,提升ViT可解释性。
GMAR: Gradient-Driven Multi-Head Attention Rollout for Vision Transformer Interpretability
- 基于梯度计算各注意力头重要性,加权融合生成可解释图。
- 在图像分类等任务中优于传统注意力滚出法。
- 适合关注ViT内部决策机制的研究者与开发者。
视觉变压器(ViT)在计算机视觉领域取得显著进展,通过自注意力机制在图像分类、目标检测和分割等任务中达到领先性能。其架构灵活性使其成为研究者与实践者的首选。然而,ViT复杂的多头注意力机制带来了显著的可解释性挑战,因预测过程仍不透明。一个关键局限是:并非所有注意力头都同样重要。忽略特定头的重要性凸显了现有可解释性方法的不足。为此,我们提出梯度驱动的多头注意力滚出(GMAR),利用梯度得分量化每个注意力头的重要性,并归一化后得到加权聚合注意力分数,有效捕捉各头的相对贡献。GMAR澄清了每头在预测中的作用,实现头级别的精确可解释性。实验结果表明,GMAR在多个任务中持续优于传统注意力滚出技术。本工作为基于Transformer的架构提供了实用贡献,建立了一个增强视觉变压器可解释性的稳健框架。
原文摘要 · Abstract (English)
The Vision Transformer (ViT) has made significant advancements in computer vision, utilizing self-attention mechanisms to achieve state-of-the-art performance across various tasks, including image classification, object detection, and segmentation. Its architectural flexibility and capabilities have made it a preferred choice among researchers and practitioners. However, the intricate multi-head attention mechanism of ViT presents significant challenges to interpretability, as the underlying prediction process remains opaque. A critical limitation arises from an observation commonly noted in transformer architectures: "Not all attention heads are equally meaningful." Overlooking the relative importance of specific heads highlights the limitations of existing interpretability methods. To address these challenges, we introduce Gradient-Driven Multi-Head Attention Rollout (GMAR), a novel method that quantifies the importance of each attention head using gradient-based scores. These scores are normalized to derive a weighted aggregate attention score, effectively capturing the relative contributions of individual heads. GMAR clarifies the role of each head in the prediction process, enabling more precise interpretability at the head level. Experimental results demonstrate that GMAR consistently outperforms traditional attention rollout techniques. This work provides a practical contribution to transformer-based architectures, establishing a robust framework for enhancing the interpretability of Vision Transformer models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。