提出可解释AI新方法,精准追踪Transformer模型决策中的上下文依赖与层次化信息流。
Explainable AI: Context-Aware Layer-Wise Integrated Gradients for Explaining Transformer Models
- 基于分层积分梯度,融合注意力机制,实现上下文感知的逐层归因。
- 在情感分析、仇恨言论检测等任务中,比现有方法更敏感且可视化更清晰。
- 适合研究可解释性、模型调试或需理解决策过程的AI应用开发者。
Transformer模型在多领域任务中表现卓越,但其深层表征使预测难以解释。现有可解释方法依赖最终层归因,仅捕捉局部词元级重要性或全局注意力模式,缺乏对词元间依赖关系和结构组件的上下文感知,也未能揭示相关性在各层间的演化过程及结构如何影响决策。为此,我们提出 extbf{上下文感知分层积分梯度(CA-LIG)框架},在每个Transformer模块内计算分层积分梯度,并将词元级归因与类别特定注意力梯度融合,生成带符号、上下文敏感的归因图,能同时捕捉支持与反向证据,并追踪相关性在层间的层级流动。我们在多种任务与模型上评估该框架,包括使用BERT的情感分析、长文本与多分类文档分类,使用XLM-R和AfroLM在低资源语言下的仇恨言论检测,以及使用Masked Autoencoder视觉Transformer进行图像分类。结果表明,无论在何种任务或架构下,CA-LIG均提供更忠实的归因,对上下文依赖更敏感,可视化更清晰、语义更连贯,显著优于现有方法。这表明CA-LIG为深度神经网络决策提供了更全面、上下文感知且可靠的解释,推动了可解释性实践与理论认知的进步。
原文摘要 · Abstract (English)
Transformer models achieve state-of-the-art performance across domains and tasks, yet their deeply layered representations make their predictions difficult to interpret. Existing explainability methods rely on final-layer attributions, capture either local token-level attributions or global attention patterns without unification, and lack context-awareness of inter-token dependencies and structural components. They also fail to capture how relevance evolves across layers and how structural components shape decision-making. To address these limitations, we proposed the \textbf{Context-Aware Layer-wise Integrated Gradients (CA-LIG) Framework}, a unified hierarchical attribution framework that computes layer-wise Integrated Gradients within each Transformer block and fuses these token-level attributions with class-specific attention gradients. This integration yields signed, context-sensitive attribution maps that capture supportive and opposing evidence while tracing the hierarchical flow of relevance through the Transformer layers. We evaluate the CA-LIG Framework across diverse tasks, domains, and transformer model families, including sentiment analysis and long and multi-class document classification with BERT, hate speech detection in a low-resource language setting with XLM-R and AfroLM, and image classification with Masked Autoencoder vision Transformer model. Across all tasks and architectures, CA-LIG provides more faithful attributions, shows stronger sensitivity to contextual dependencies, and produces clearer, more semantically coherent visualizations than established explainability methods. These results indicate that CA-LIG provides a more comprehensive, context-aware, and reliable explanation of Transformer decision-making, advancing both the practical interpretability and conceptual understanding of deep neural models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。