Skip to main content
QUICK REVIEW

[论文解读] GraphiT: Encoding Graph Structure in Transformers

Grégoire Mialon, Dexiong Chen|arXiv (Cornell University)|Jun 10, 2021
Advanced Graph Neural Networks参考文献 29被引用 42
一句话总结

GraphiT 表明,当通过核基相对位置编码和局部子结构 (GCKN) 特征进行增强时,原生 Transformer 在图任务上可以超越 GNNs,在各种基准测试中实现具有竞争力甚至更优的结果,并提供可解释的注意力驱动模体。

ABSTRACT

We show that viewing graphs as sets of node features and incorporating structural and positional information into a transformer architecture is able to outperform representations learned with classical graph neural networks (GNNs). Our model, GraphiT, encodes such information by (i) leveraging relative positional encoding strategies in self-attention scores based on positive definite kernels on graphs, and (ii) enumerating and encoding local sub-structures such as paths of short length. We thoroughly evaluate these two ideas on many classification and regression tasks, demonstrating the effectiveness of each of them independently, as well as their combination. In addition to performing well on standard benchmarks, our model also admits natural visualization mechanisms for interpreting graph motifs explaining the predictions, making it a potentially strong candidate for scientific applications where interpretation is important. Code available at https://github.com/inria-thoth/GraphiT.

研究动机与目标

  • 将变换器架构用于图结构数据,作为传统 GNN 的替代方案的动机。
  • 开发将图结构通过位置编码和局部子结构特征注入到变换器中的方法。
  • 评估基于核的相对位置编码和 GCKN 派生特征在分类和回归基准测试中的影响。
  • 提供可视化技术以解释注意力并识别有意义的图模体。

提出的方法

  • 使用作用于节点特征的普通 Transformer 编码器处理图。
  • 在注意力中引入相对位置编码,使用图上的正定核(如扩散核、随机游走核)。
  • 通过 Graph Convolutional Kernel Networks (GCKN) 路径特征,以局部子结构表示丰富节点特征。
  • 结合相对位置编码和结构感知的节点特征,并与基于拉普拉斯的 LapPE 和 GCKN 基线进行比较。
  • 在全局注意力与局部注意力(全通信 vs 邻域聚合)之间及跨数据集的消融实验。
  • 提供基于注意力的可视化,以识别区分性的图模体和子结构。

实验结果

研究问题

  • RQ1在具备图感知位置编码的前提下,原生 Transformer 是否在图分类和回归任务上优于 GNN?
  • RQ2对图而言,基于核的相对位置编码是否优于基于拉普拉斯的绝对位置编码(LapPE)?
  • RQ3哪种结构编码和相对位置编码的组合在各数据集上能取得最佳性能?
  • RQ4注意力分数是否揭示与化学或生物学已知子结构相一致的有意义的图模体?

主要发现

Method / DatasetMUTAGPROTEINSPTCNCI1ZINC (no edge feat.)
MF [11]81.5 b1 11.071.9 b1 5.257.3 b1 6.980.6 b1 2.50.387 b1 0.019
GCN [18]78.9 b1 10.175.8 b1 5.554.0 b1 6.375.9 b1 1.60.367 b1 0.011
GAT [37]80.3 b1 8.574.8 b1 4.155.0 b1 6.076.8 b1 2.10.384 b1 0.007
GIN [40]82.6 b1 6.273.1 b1 4.655.0 b1 8.781.7 b1 1.70.387 b1 0.015
GCKN-subtree [7]87.8 b1 9.472.0 b1 3.762.1 b1 6.479.6 b1 1.80.474 b1 0.001
[12]79.3 b1 11.665.8 b1 3.158.4 b1 8.278.9 b1 1.10.359 b1 0.014
[12] + LapPE83.9 b1 6.570.1 b1 3.257.7 b1 3.180.0 b1 1.90.323 b1 0.013
Transformers (T)82.2 b1 6.375.6 b1 4.958.1 b1 10.570.0 b1 4.50.696 b1 0.007
T + LapPE85.8 b1 5.974.6 b1 2.755.6 b1 5.074.6 b1 1.90.507 b1 0.003
T + Adj PE87.2 b1 9.872.4 b1 4.959.9 b1 5.979.7 b1 2.00.243 b1 0.005
T + 2-step RW kernel85.3 b1 6.972.8 b1 4.562.0 b1 9.478.0 b1 1.50.243 b1 0.010
T + 3-step RW kernel83.3 b1 6.376.2 b1 4.461.0 b1 6.277.6 b1 3.60.244 b1 0.011
T + Diffusion kernel82.7 b1 7.674.6 b1 4.259.1 b1 7.478.9 b1 1.60.255 b1 0.010
T + GCKN84.4 b1 7.869.5 b1 3.861.5 b1 5.878.1 b1 5.10.274 b1 0.011
T + GCKN + 2-step RW kernel90.4 b1 5.872.5 b1 4.658.4 b1 7.681.0 b1 1.80.213 b1 0.016
T + GCKN + Adj PE90.5 b1 7.071.1 b1 6.957.9 b1 4.281.4 b1 2.20.211 b1 0.010
  • GraphiT 的变体在 MUTAG、PROTEINS、PTC 和 NCI1 数据集上达到与常见 GNN 相当或更优的表现。
  • 在 ZINC 回归任务中,具有结构和相对位置编码的 GraphiT 相较于所有先前基线取得了显著的领先。
  • GCKN-path 特征在多组数据集上经常优于 LapPE,尤其是当与邻接矩阵基或 RW 基的相对编码结合时。
  • 在节点特征中结合结构编码(如 GCKN-path)与相对位置编码,能在若干基准测试(包括 ZINC)上获得最佳总体结果。
  • 相对核基位置编码通常优于 LapPE,两者结合可带来显著提升。
  • 注意力可视化揭示了在化学上有意义的亚结构(如硝基基团),对致突变性预测有贡献。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。