GraphiT: Encoding Graph Structure in Transformers

Grégoire Mialon, Dexiong Chen, Margot Selosse, Julien Mairal
6/10/2021
cs.LG
transformer-attentiongnn

Official code: inria-thoth/GraphiT (111 stars, Python, last commit 2021-07-06).

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

Official Pytorch Implementation of GraphiT

11113Python, C++Jun 9, 20215 years ago

Similar Papers

Cite this paper

@article{mialon2021graphit,
  title  = {GraphiT: Encoding Graph Structure in Transformers},
  author = {Grégoire Mialon and Dexiong Chen and Margot Selosse and Julien Mairal},
  year   = {2021},
  eprint = {2106.05667},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2106.05667}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2106.05667.svg)](https://codeofpaper.com/paper/2106.05667)

Discussion