TMLR 2024

GraphFM: A generalist graph transformer that learns transferable representations across diverse domains

Divyansha Lachi, Mehdi Azabou, Vinam Arora, Eva L. Dyer

Main figure for GraphFM: A generalist graph transformer that learns transferable representations across diverse domains

Abstract

Graph neural networks (GNNs) are often trained on individual datasets, requiring specialized models and significant hyperparameter tuning due to the unique structures and features of each dataset. This approach limits the scalability and generalizability of GNNs, as models must be tailored for each specific graph type. To address these challenges, we introduce GraphFM, a scalable multi-graph pretraining approach designed for learning across diverse graph datasets. GraphFM uses a Perceiver-based encoder with learned latent tokens to compress domain-specific features into a shared latent space, enabling generalization across graph domains. We propose new techniques for scaling up graph training on datasets of different sizes, allowing us to train GraphFM on 152 distinct graph datasets, containing a total of 7.4 million nodes and 189 million edges. This allows us to study the effect of scale on pretraining across domains such as molecules, citation networks, and product graphs, and show that training on diverse datasets improves performance over single-source pretraining. Additionally, pretraining with a mixture of synthetic and real graphs enhances adaptability and stability, leading to competitive performance with state-of-the-art models across various node classification tasks. This approach reduces the burden of dataset-specific training and provides a single generalist model capable of performing across multiple diverse graph structures and tasks. Code is available at https://github.com/nerdslab/GraphFM.

Benchmark Results

Tested on 10 datasets 3 baseline values reported too low

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

Classic

#ModelAccuracy ↑Paper
1
GraphTARIF
0.9703 ±0.0019
2
GAT
0.9669 ±0.0014
3
GAT+T
0.9660 ±0.0007
7
SAGE
0.9643 ±0.0027
81
GraphFM-NFT
0.9437 ±0.0035
This paper
220
GraphFM-MFT
0.9301 ±0.0182
This paper
390
MLP
0.9128 ±0.0063
#ModelAccuracy ↑Paper
1
GraphTARIF
0.9461 ±0.0017
2
GCN
actual #2 vs paper #141 139 places worse
0.9412 ±0.0008
best reported
actual #2 vs paper #141 139 places worse
paper 0.8947 ±0.0046
paper 0.8947 ±0.0046 Δ at pub 0.0025 Δ today 0.0465
3
GAT
actual #3 vs paper #60 57 places worse
0.9398 ±0.0022
best reported
actual #3 vs paper #60 57 places worse
paper 0.9078 ±0.0013
8
SAGE
0.9351 ±0.0006
45
NAG
0.9122 ±0.0014
This paper
99
GraphFM-NFT
0.9007 ±0.0021
This paper
107
GraphFM-MFT
0.8995 ±0.0083
This paper
114
H2GCN
actual #114 vs paper #145 31 places worse
0.8986 ±0.0022
best reported
actual #114 vs paper #145 31 places worse
paper 0.8933 ±0.0027
paper 0.8933 ±0.0027 Δ at pub 0.0035 Δ today 0.0053
116
SAN
0.8983 ±0.0016
This paper
320
MLP
actual #320 vs paper #320
0.8463
actual #320 vs paper #320
paper 0.8463

Improvement within reported uncertainty; not highlighted.

paper 0.8463 Δ at pub 0.0028
#ModelAccuracy ↑Paper
1
GrokFormer
0.9831 ±0.0018
2
PolyFormer
0.9808 ±0.0027
3
SGFormer
0.9796 ±0.0081
9
GCN
0.9774 ±0.0035
35
GraphFM-NFT
0.9677 ±0.0012
This paper
38
GraphFM-MFT
0.9664 ±0.0017
This paper
58
MLP
0.9597 ±0.0007

TU Dortmund

#ModelAccuracy ↑Paper
1
MSH-GNN
0.9910 ±0.0030
2
ID-GNN+BEC
0.9830 ±0.0360
3
SupCosine
0.9830 ±0.0250
33
GraphFM
0.9380 ±0.0660
This paper
39
GIN
0.9330 ±0.0290
56
SAT
actual #56 vs paper #582 526 places worse
0.9260 ±0.0430
best reported
actual #56 vs paper #582 526 places worse
paper 0.8140 ±0.0820

Difference within reported uncertainty; not counted as underperformance.

paper 0.8140 ±0.0820 Δ at pub 0.0022 Δ today 0.1120
158
GraphSAGE
actual #158 vs paper #716 558 places worse
0.9040 ±0.0780
best reported
actual #158 vs paper #716 558 places worse
paper 0.7490 ±0.0870
paper 0.7490 ±0.0870 Δ at pub 0.1550
224
Graphormer
actual #224 vs paper #721 497 places worse
0.8960 ±0.0620
best reported
actual #224 vs paper #721 497 places worse
paper 0.7440 ±0.0740
403
MLP
0.8660 ±0.0495
504
Specformer
0.8370 ±0.0800
This paper
596
GT
actual #596 vs paper #705 109 places worse
0.8079 ±0.0098
best reported
actual #596 vs paper #705 109 places worse
paper 0.7550 ±0.0790

Difference within reported uncertainty; not counted as underperformance.

paper 0.7550 ±0.0790 Δ at pub 0.0529
#ModelAccuracy ↑Paper
1
MSH-GNN
0.9410 ±0.0330
2
GRDL
0.8260 ±0.0120
3
GMN
0.8225
32
GIN
0.7880 ±0.0410
55
SAT
actual #55 vs paper #420 365 places worse
0.7770 ±0.0320
best reported
actual #55 vs paper #420 365 places worse
paper 0.7170 ±0.0350
paper 0.7170 ±0.0350 Δ today 0.0600
122
GraphFM
0.7640 ±0.0370
This paper
128
Graphormer
actual #128 vs paper #468 340 places worse
0.7630 ±0.0270
best reported
actual #128 vs paper #468 340 places worse
paper 0.6840 ±0.0370
paper 0.6840 ±0.0370 Δ today 0.0790
149
MLP
0.7600 ±0.0320
155
GraphSAGE
actual #155 vs paper #324 169 places worse
0.7590 ±0.0320
best reported
actual #155 vs paper #324 169 places worse
paper 0.7380 ±0.0360

Difference within reported uncertainty; not counted as underperformance.

paper 0.7380 ±0.0360 Δ at pub 0.0210 Δ today 0.0210
409
Specformer
0.7200 ±0.0490
This paper
469
GT
0.6840 ±0.0330
This paper

Heterophilic Graphs

#ModelAccuracy ↑Paper
1
P^2GNN
0.9672 ±0.0147
2
DoG
0.9660 ±0.0210
3
GPF-plus
0.9583 ±0.0419
34
MLP
0.9230 ±0.0070
53
GraphSAGE
0.9000 ±0.0365
205
GraphFM-NFT
0.8216 ±0.0324
This paper
232
GraphFM-MFT
0.8081 ±0.0276
This paper
411
NAG
0.6837 ±0.0527
This paper
#ModelAccuracy ↑Paper
1
DiGGR
0.4535 ±0.0353
2
TRIGON
0.4402 ±0.0028
3
DoG
0.4320 ±0.0120
42
MLP
0.4026 ±0.0108
68
GraphSAGE
0.3899 ±0.0085
89
GraphFM-NFT
0.3801 ±0.0107
This paper
173
GraphFM-MFT
0.3629 ±0.0063
This paper
256
NAG
0.3433 ±0.0094
This paper
#ModelAccuracy ↑Paper
1
Hetero-S (GAT 8-layer)
0.8693
2
Dir-GNN+CNA
0.8586 ±0.0180
3
GAT
0.8560
52
GCN
0.7033
142
GraphFM-NFT
0.5912 ±0.0164
This paper
144
GraphFM-MFT
0.5864 ±0.0124
This paper
155
NAGphormer
0.5739 ±0.0002
This paper
162
SAN
actual #162 vs paper #229 67 places worse
0.5562 ±0.0043
best reported
actual #162 vs paper #229 67 places worse
paper 0.4432 ±0.0173
paper 0.4432 ±0.0173 Δ at pub 0.1130
169
MLP
0.5429
#ModelAccuracy ↑Paper
1
IBG-NN
0.7763 ±0.0179
2
Dir-GNN+CNA
0.7747 ±0.0128
3
DHGNN
0.7684 ±0.0161
46
GCN
0.6067
91
NAG
0.4993 ±0.0007
This paper
92
NAGphormer
0.4993 ±0.0007
This paper
133
GraphFM-NFT
0.4298 ±0.0162
This paper
135
GraphFM-MFT
0.4280 ±0.0154
This paper
166
SAN
0.3992 ±0.0214
This paper
172
MLP
0.3930 ±0.0079
#ModelAccuracy ↑Paper
1
DMD++
0.9190 ±0.0260
2
F-GREAD-BS
0.9059 ±0.0380
3
APPNP
0.9010 ±0.0350
37
MLP
0.8629 ±0.0450
59
GraphFM-NFT
0.8362 ±0.0321
This paper
62
GraphFM-MFT
0.8313 ±0.0235
This paper
63
GCN
0.8310 ±0.0320
137
NAG
0.6823 ±0.0599
This paper
SOTA performance (not significantly different from the best) Proposed method (this paper) Baseline / comparison (this paper) Global context (other papers) Best at pub — reported result worse than the best known when published (best reported in green) Best today — OK at publication; today's leaderboard best is elsewhere