arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.12352cs.LGcs.AI
收藏

通过注意力图实现图Transformer的机制可解释性

Towards Mechanistic Interpretability of Graph Transformers via Attention Graphs

Stanford University(斯坦福大学);University of Oxford(牛津大学);University of Cambridge(剑桥大学)

Batu El, Deepro Choudhury, Pietro Liò, Chaitanya K. Joshi

AI总结:

本文提出注意力图工具,基于GNN消息传递与Transformer自注意力的数学等价性,分析图Transformer的信息流动,发现其学习结构不相关于输入图,且异质性图中不同变体可殊途同归。

摘要:

我们引入了注意力图(Attention Graphs),这是一种基于图神经网络(GNNs)中消息传递与Transformer中自注意力机制之间数学等价性的新工具,用于图神经网络和图Transformer的机制可解释性。注意力图聚合了Transformer各层和各头的注意力矩阵,以描述信息在输入节点间的流动方式。通过在同质性和异质性节点分类任务上的实验,我们从网络科学的角度分析了注意力图,并发现:(1)当图Transformer被允许使用输入节点间的全对全注意力来学习最优图结构时,模型学到的注意力图往往不与输入/原始图结构相关;(2)对于异质性图,不同的图Transformer变体可以在利用不同信息流动模式的同时实现相似的性能。开源代码:https://github.com/batu-el/understanding-inductive-biases-of-gnns

英文摘要:

We introduce Attention Graphs, a new tool for mechanistic interpretability of Graph Neural Networks (GNNs) and Graph Transformers based on the mathematical equivalence between message passing in GNNs and the self-attention mechanism in Transformers. Attention Graphs aggregate attention matrices across Transformer layers and heads to describe how information flows among input nodes. Through experiments on homophilous and heterophilous node classification tasks, we analyze Attention Graphs from a network science perspective and find that: (1) When Graph Transformers are allowed to learn the optimal graph structure using all-to-all attention among input nodes, the Attention Graphs learned by the model do not tend to correlate with the input/original graph structure; and (2) For heterophilous graphs, different Graph Transformer variants can achieve similar performance while utilising distinct information flow patterns. Open source code: https://github.com/batu-el/understanding-inductive-biases-of-gnns

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑