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.
翻译:我们显示,将图表作为节点特征集,并将结构和位置信息纳入变压器结构,能够超越古典古典古典古典古体神经网络(GNNS)所学的表现形式。我们的模型“GreaphiT”将此类信息编码为:(一) 利用基于图形正数确定内核的自我注意分数中的相对位置编码战略,以及(二) 列举和编码短长路径等地方子结构。我们彻底评估了许多分类和回归任务中的这两个想法,并独立地展示了这两个任务的有效性以及它们的组合。除了在标准基准上表现良好外,我们的模型还接受自然可视化机制,用于解释图表模型模型解释预测,使其在解释很重要的地方可能成为科学应用的强大候选方。代码见https://github.com/inria-thoth/GraphiT。