Graph Inductive Biases in Transformers without Message Passing

Liheng Ma, Chen Lin, Derek Lim, Adriana Romero-Soriano, Puneet K. Dokania +3 more
5/27/2023
cs.LGcs.AI

No official code found. Best implementation: LiamMa/GRIT (133 stars, MIT, last commit 2025-08-20). 1 more below.

Abstract

Transformers for graph data are increasingly widely studied and successful in numerous learning tasks. Graph inductive biases are crucial for Graph Transformers, and previous works incorporate them using message-passing modules and/or positional encodings. However, Graph Transformers that use message-passing inherit known issues of message-passing, and differ significantly from Transformers used in other domains, thus making transfer of research advances more difficult. On the other hand, Graph Transformers without message-passing often perform poorly on smaller datasets, where inductive biases are more crucial. To bridge this gap, we propose the Graph Inductive bias Transformer (GRIT) -- a new Graph Transformer that incorporates graph inductive biases without using message passing. GRIT is based on several architectural changes that are each theoretically and empirically justified, including: learned relative positional encodings initialized with random walk probabilities, a flexible attention mechanism that updates node and node-pair representations, and injection of degree information in each layer. We prove that GRIT is expressive -- it can express shortest path distances and various graph propagation matrices. GRIT achieves state-of-the-art empirical performance across a variety of graph datasets, thus showing the power that Graph Transformers without message-passing can deliver.

View on arXivView PDF

Code Implementations(2)

LiamMa/GRITCommunity100%
MIT

This is an official implementation for "GRIT: Graph Inductive Biases in Transformers without Message Passing".

13320Shell, PythonMay 22, 20231 years agoMIT

GRIT: Graph Inductive Biases in Transformers without Message Passing (ICML 2023)

00Oct 27, 20241 years ago

Similar Papers

Cite this paper

@article{ma2023graph,
  title  = {Graph Inductive Biases in Transformers without Message Passing},
  author = {Liheng Ma and Chen Lin and Derek Lim and Adriana Romero-Soriano and Puneet K. Dokania and Mark Coates and Philip Torr and Ser-Nam Lim},
  year   = {2023},
  eprint = {2305.17589},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.17589v1},
  journal = {ICML 2023 2023}
}

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/2305.17589.svg)](https://codeofpaper.com/paper/2305.17589)

Discussion