Graph Transformers for Large Graphs

Vijay Prakash Dwivedi, Yozen Liu, A. Luu, Xavier Bresson, Neil Shah, Tong Zhao

Main figure for Graph Transformers for Large Graphs

Abstract

Transformers have recently emerged as powerful neural networks for graph learning, showcasing state-of-the-art performance on several graph property prediction tasks. However, these results have been limited to small-scale graphs, such as ligand molecules with fewer than a hundred atoms, where the computational feasibility of the global attention mechanism is possible. The next goal is to scale up these architectures to handle very large graphs on the scale of millions or even billions of nodes. With large-scale graphs, global attention learning is proven impractical due to its quadratic complexity w.r.t. the number of nodes. On the other hand, neighborhood sampling techniques become essential to manage large graph sizes, yet finding the optimal trade-off between speed and accuracy with sampling techniques remains challenging. This work advances representation learning on single large-scale graphs with a focus on identifying model characteristics and critical design constraints for developing scalable graph transformer (GT) architectures. We argue such GT requires layers that can adeptly learn both local and global graph representations while swiftly sampling the graph topology. As such, a key innovation of this work lies in the creation of a fast neighborhood sampling technique coupled with a local attention mechanism that encompasses a 4-hop reception field, but achieved through just 2-hop operations. This local node embedding is then integrated with a global node embedding, acquired via another self-attention layer with an approximate global codebook, before finally sent through a downstream layer for node predictions. The proposed GT framework, named LargeGT, overcomes previous computational bottlenecks and is validated on three large-scale node classification benchmarks. We report a $3 $ speedup and $16.8\

Benchmark Results

Tested on 3 datasets

Tables show presented results in global context (best 3 papers + GCN + MLP).

OGB

#ModelAccuracy ↑Paper
1
Jacobi
0.8968
2
GPR
0.8953
3
LEMP4HG
0.8939
4
SAGE
0.8933
120
GOAT-local-δ
0.8117 ±0.0012
This paper
149
GOAT-full-δ
0.7988 ±0.0020
This paper
153
LargeGT-full
0.7981 ±0.0025
This paper
192
LargeGT-local
0.7895 ±0.0080
This paper
228
GAT-δ
0.7738 ±0.0059
This paper
236
GraphSAGE-δ
0.7662 ±0.0093
This paper
263
NAGphormer-δ
0.7528 ±0.0004
This paper
335
GOAT-global-δ
0.7028 ±0.0195
This paper
351
MLP
0.6605 ±0.0020
372
GT-sparse-δ
0.6076
This paper
#ModelAccuracy ↑Paper
1
SGC
0.7910
2
GAMLP
0.7036 ±0.0002
3
GLEM-GNN
0.7036 ±0.0002
35
SAGE
0.6644 ±0.0017
65
LargeGT-full
0.6473 ±0.0005
This paper
84
GOAT-full-δ
0.6112 ±0.0010
This paper
95
MLP
0.4960 ±0.0030

LINKX Benchmarks

#ModelAccuracy ↑Paper
1
FaberNet
0.7510 ±0.0003
2
LargeScaleNet
0.7505 ±0.0005
3
DirGNN
0.7395 ±0.0005
6
LargeGT-full
0.7021 ±0.0012
This paper
8
LargeGT-local
0.6819 ±0.0311
This paper
13
NAGphormer-δ
0.6011 ±0.0005
This paper
16
GCN
0.5102 ±0.0006
18
GOAT-full-δ
0.5028 ±0.0014
This paper
19
GraphSAGE-δ
0.4843 ±0.0021
This paper
21
GT-sparse-δ
0.4781
This paper
22
GAT-δ
0.4592 ±0.0022
This paper
24
GOAT-global-δ
0.4265 ±0.0007
This paper
25
GOAT-local-δ
0.4095 ±0.0016
This paper
32
MLP
0.3150
SOTA performance (not significantly different from the best) Proposed method (this paper) Baseline / comparison (this paper) Global context (other papers)