KDD 2023

On Structural Expressive Power of Graph Transformers

Wenhao Zhu, Tianyu Wen, Guojie Song, Liang Wang, Bo Zheng

Main figure for On Structural Expressive Power of Graph Transformers

Abstract

Graph Transformer has recently received wide attention in the research community with its outstanding performance, yet its structural expressive power has not been well analyzed. Inspired by the connections between Weisfeiler-Lehman (WL) graph isomorphism test and graph neural network (GNN), we introduce SEG-WL test (Structural Encoding enhanced Global Weisfeiler-Lehman test), a generalized graph isomorphism test algorithm as a powerful theoretical tool for exploring the structural discriminative power of graph Transformers. We theoretically prove that the SEG-WL test is an expressivity upper bound on a wide range of graph Transformers, and the representational power of SEG-WL test can be approximated by a simple Transformer network arbitrarily under certain conditions. With the SEG-WL test, we show how graph Transformers' expressive power is determined by the design of structural encodings, and present conditions that make the expressivity of graph Transformers beyond WL test and GNNs. Moreover, motivated by the popular shortest path distance encoding, we follow the theory-oriented principles and develop a provably stronger structural encoding method, Shortest Path Induced Subgraph (SPIS) encoding. Our theoretical findings provide a novel and practical paradigm for investigating the expressive power of graph Transformers, and extensive synthetic and real-world experiments empirically verify the strengths of our proposed methods.

Proposed method: Graphormer-SPIS

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 #237 198 places worse
0.9330 ±0.0290
best reported
actual #39 vs paper #237 198 places worse
paper 0.8940 ±0.0540

Difference within reported uncertainty; not counted as underperformance.

paper 0.8940 ±0.0540 Δ at pub 0.0390
61
Graphormer-SPIS
0.9248 ±0.0587
This paper
63
GCN
actual #63 vs paper #429 366 places worse
0.9220 ±0.0440
best reported
actual #63 vs paper #429 366 places worse
paper 0.8576 ±0.0875

Difference within reported uncertainty; not counted as underperformance.

paper 0.8576 ±0.0875 Δ at pub 0.0334 Δ today 0.0644
99
Graphormer-SPD
0.9139 ±0.0735
This paper
146
P-WL
0.9051 ±0.0134
This paper
158
GraphSAGE
actual #158 vs paper #446 288 places worse
0.9040 ±0.0780
best reported
actual #158 vs paper #446 288 places worse
paper 0.8510 ±0.0760

Difference within reported uncertainty; not counted as underperformance.

paper 0.8510 ±0.0760 Δ at pub 0.0530
174
Graphormer-Neighbor
0.9035 ±0.0701
This paper
183
GAT
actual #183 vs paper #465 282 places worse
0.9010 ±0.0580
best reported
actual #183 vs paper #465 282 places worse
paper 0.8459 ±0.0630

Difference within reported uncertainty; not counted as underperformance.

paper 0.8459 ±0.0630 Δ at pub 0.0551 Δ today 0.0551
313
FGW
0.8842 ±0.0567
This paper
403
MLP
0.8660 ±0.0495
438
Graphormer-id
0.8549 ±0.0851
This paper
718
SAGE
0.7490 ±0.0870
#ModelAccuracy ↑Paper
1
MSH-GNN
0.9410 ±0.0330
2
GRDL
0.8260 ±0.0120
3
GMN
0.8225
25
Graphormer-SPIS
0.7941 ±0.0146
This paper
32
GIN
actual #32 vs paper #154 122 places worse
0.7880 ±0.0410
best reported
actual #32 vs paper #154 122 places worse
paper 0.7590 ±0.0280

Difference within reported uncertainty; not counted as underperformance.

paper 0.7590 ±0.0280 Δ at pub 0.0110 Δ today 0.0290
38
Graphormer-SPD
0.7859 ±0.0435
This paper
47
Graphormer-Neighbor
0.7812 ±0.0362
This paper
49
GAT
actual #49 vs paper #437 388 places worse
0.7800 ±0.0300
best reported
actual #49 vs paper #437 388 places worse
paper 0.7115 ±0.0712
67
SAGE
0.7726 ±0.0228
75
Graphormer-id
0.7719 ±0.0407
This paper
102
GSN
actual #102 vs paper #282 180 places worse
0.7660 ±0.0500
best reported
actual #102 vs paper #282 180 places worse
paper 0.7460 ±0.0500

Difference within reported uncertainty; not counted as underperformance.

paper 0.7460 ±0.0500 Δ today 0.0200
139
RetGK
actual #139 vs paper #139
0.7620 ±0.0050
actual #139 vs paper #139
paper 0.7620 ±0.0050
paper 0.7620 ±0.0050 Δ at pub 0.0100
148
GCN
0.7600 ±0.0320
This paper
149
MLP
0.7600 ±0.0320
155
GraphSAGE
actual #155 vs paper #155
0.7590 ±0.0320
actual #155 vs paper #155
paper 0.7590 ±0.0320
prev best: GNNBenchmark (JMLR 2023)

Improvement within reported uncertainty; not highlighted.

paper 0.7590 ±0.0320 Δ at pub 0.0034
212
P-WL
0.7531 ±0.0073
This paper
289
FGW
0.7455 ±0.0274
This paper

MoleculeNet

#ModelRMSE ↓Paper
1
Graphormer-SPIS
0.4840 ±0.0050
This paper
2
Graphormer-SPD
0.4920 ±0.0040
This paper
3
conan-FGW
0.5140 ±0.0190
5
GAT
actual #5 vs paper #5
0.5520 ±0.0070
actual #5 vs paper #5
paper 0.5520 ±0.0070
paper 0.5520 ±0.0070 Δ at pub 0.1020
7
GCN
actual #7 vs paper #7
0.5640 ±0.0150
actual #7 vs paper #7
paper 0.5640 ±0.0150
prev best: Memory-Based Graph Networks (ICLR 2020)
paper 0.5640 ±0.0150 Δ at pub 0.4060
13
MoleculeNet
0.5800
This paper
18
GraphSAGE
0.6010 ±0.0080
This paper
22
Graphormer-id
0.6120 ±0.0020
This paper
25
GIN
actual #25 vs paper #25
0.6260 ±0.0170
actual #25 vs paper #25
paper 0.6260 ±0.0170

Improvement within reported uncertainty; not highlighted.

paper 0.6260 ±0.0170 Δ at pub 0.0390
29
Graphormer-Neighbor
0.6390 ±0.0340
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 at pub — reported value improved over the best known when published