GraphiT: Encoding Graph Structure in Transformers

G. Mialon, Dexiong Chen, Margot Selosse, J. Mairal

Main figure for GraphiT: Encoding Graph Structure in Transformers

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. 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..

Benchmark Results

Tested on 3 datasets 1 baseline value reported too low

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

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
39
GIN
actual #39 vs paper #539 500 places worse
0.9330 ±0.0290
best reported
actual #39 vs paper #539 500 places worse
paper 0.8260 ±0.0620
paper 0.8260 ±0.0620 Δ at pub 0.0946 Δ today 0.1070
63
GCN
actual #63 vs paper #649 586 places worse
0.9220 ±0.0440
best reported
actual #63 vs paper #649 586 places worse
paper 0.7890 ±0.1010

Difference within reported uncertainty; not counted as underperformance.

paper 0.7890 ±0.1010 Δ at pub 0.1020 Δ today 0.1330
153
T + GCKN + Adj PE
0.9050 ±0.0700
This paper
158
GraphSAGE
0.9040 ±0.0780
183
GAT
actual #183 vs paper #611 428 places worse
0.9010 ±0.0580
best reported
actual #183 vs paper #611 428 places worse
paper 0.8030 ±0.0850

Difference within reported uncertainty; not counted as underperformance.

paper 0.8030 ±0.0850 Δ at pub 0.0980 Δ today 0.0980
349
GCKN-subtree
0.8780 ±0.0940
This paper
385
T + Adj PE
0.8720 ±0.0980
This paper
403
MLP
0.8660 ±0.0495
429
T + LapPE
0.8580 ±0.0590
This paper
443
T + 2-step RW kernel
0.8530 ±0.0690
This paper
477
T + GCKN
0.8440 ±0.0780
This paper
539
T + Diffusion kernel
0.8270 ±0.0760
This paper
563
Transformers (T)
0.8220 ±0.0630
This paper
582
MF
0.8150 ±0.1100
This paper
639
dwivedi2021generalization
0.7930 ±0.1160
This paper
#ModelAccuracy ↑Paper
1
WL-MLP
0.9954
2
GIN
actual #2 vs paper #146 144 places worse
0.9934
best reported
actual #2 vs paper #146 144 places worse
paper 0.8170 ±0.0170
best at pub: Provably Powerful Graph Networks (NeurIPS 2019)
paper 0.8170 ±0.0170 Δ at pub 0.0100 Δ today 0.1764
3
GCN
actual #3 vs paper #396 393 places worse
0.9727
best reported
actual #3 vs paper #396 393 places worse
paper 0.7590 ±0.0160
best at pub: Hierarchical Graph Capsule Network (AAAI 2020)
paper 0.7590 ±0.0160 Δ at pub 0.0775 Δ today 0.2137
4
GAT
actual #4 vs paper #367 363 places worse
0.7680 ±0.0210
actual #4 vs paper #367 363 places worse
paper 0.7680 ±0.0210

Improvement within reported uncertainty; not highlighted.

paper 0.7680 ±0.0210 Δ at pub 0.0190 Δ today 0.1943
131
GraphSAGE
0.8200 ±0.0100
161
T + GCKN + Adj PE
0.8140 ±0.0220
This paper
190
MF
0.8060 ±0.0250
This paper
240
T + Adj PE
0.7970 ±0.0200
This paper
246
GCKN-subtree
0.7960 ±0.0180
This paper
271
dwivedi2021generalization
0.7890 ±0.0110
This paper
272
T + Diffusion kernel
0.7890 ±0.0160
This paper
316
T + GCKN
0.7810 ±0.0510
This paper
320
T + 2-step RW kernel
0.7800 ±0.0150
This paper
420
T + LapPE
0.7460 ±0.0190
This paper
483
Transformers (T)
0.7000 ±0.0450
This paper
#ModelAccuracy ↑Paper
1
MSH-GNN
0.9410 ±0.0330
2
GRDL
0.8260 ±0.0120
3
GMN
0.8225
32
GIN
actual #32 vs paper #360 328 places worse
0.7880 ±0.0410
best reported
actual #32 vs paper #360 328 places worse
paper 0.7310 ±0.0460

Difference within reported uncertainty; not counted as underperformance.

paper 0.7310 ±0.0460 Δ at pub 0.0300 Δ today 0.0570
49
GAT
actual #49 vs paper #271 222 places worse
0.7800 ±0.0300
best reported
actual #49 vs paper #271 222 places worse
paper 0.7480 ±0.0410

Difference within reported uncertainty; not counted as underperformance.

paper 0.7480 ±0.0410 Δ at pub 0.0110 Δ today 0.0320
67
SAGE
0.7726 ±0.0228
148
GCN
actual #148 vs paper #163 15 places worse
0.7580 ±0.0550
actual #148 vs paper #163 15 places worse
paper 0.7580 ±0.0550
prev best: Hierarchical Graph Capsule Network (AAAI 2020)

Improvement within reported uncertainty; not highlighted.

paper 0.7580 ±0.0550 Δ at pub 0.0015
149
MLP
0.7600 ±0.0320
188
Transformers (T)
0.7560 ±0.0490
This paper
284
T + LapPE
0.7460 ±0.0270
This paper
285
T + Diffusion kernel
0.7460 ±0.0420
This paper
374
T + 2-step RW kernel
0.7280 ±0.0450
This paper
393
T + Adj PE
0.7240 ±0.0490
This paper
411
GCKN-subtree
0.7200 ±0.0370
This paper
414
MF
0.7190 ±0.0520
This paper
439
T + GCKN + Adj PE
0.7110 ±0.0690
This paper
458
Dwivedi and Bresson + LapPE
0.7010 ±0.0320
This paper
463
T + GCKN
0.6950 ±0.0380
This paper
480
Dwivedi and Bresson
0.6580 ±0.0310
This paper
SOTA performance (not significantly different from the best) 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