Graph transformers
What it is
Attention over all nodes with structural encodings (shortest paths, Laplacians, random walks) injected as bias.
When to use it
Long-range graph tasks where message passing's locality and over-smoothing hurt.
Caveats
Full attention over all node pairs costs quadratic time and memory, which limits graph size. They depend on good positional and structural encodings, and on small datasets they can overfit and lose to simpler GNNs.
Key ideas
- Every node attends to every other node, not just its neighbours
- Graph structure enters through positional and structural encodings
- Sidesteps the over-squashing of local message passing
Related architectures
Original paper
Do Transformers Really Perform Bad for Graph Representation? (2021, arXiv)