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.
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
| # | Model | Accuracy ↑ | Paper |
|---|---|---|---|
| 1 | MSH-GNN | 0.9910
±0.0030 | |
| 2 | ID-GNN+BEC | 0.9830
±0.0360 | |
| 3 | SupCosine | 0.9830
±0.0250 | |
| 39 | GIN | 0.9330
±0.0290 best reported | best at pub: ProtGNN: Towards Self-Explaining Graph Neural Networks (AAAI 2021) Difference within reported uncertainty; not counted as underperformance. |
| 61 | Graphormer-SPIS | 0.9248
±0.0587 | This paper |
| 63 | GCN | 0.9220
±0.0440 best reported | best at pub: Breaking the Limits of Message Passing Graph Neural Networks (ICML 2021) best today: Depth-Adaptive Graph Neural Networks via Learnable Bakry-Émery Curvature (KDD 2025) Difference within reported uncertainty; not counted as underperformance. |
| 99 | Graphormer-SPD | 0.9139
±0.0735 | This paper |
| 146 | P-WL | 0.9051
±0.0134 | This paper |
| 158 | GraphSAGE | 0.9040
±0.0780 best reported | best at pub: Asynchronous Neural Networks for Learning in Graphs (2022) Difference within reported uncertainty; not counted as underperformance. |
| 174 | Graphormer-Neighbor | 0.9035
±0.0701 | This paper |
| 183 | GAT | 0.9010
±0.0580 best reported | best at pub: Breaking the Limits of Message Passing Graph Neural Networks (ICML 2021) best today: The Expressive Power of Graph Neural Networks: A Survey (2023) Difference within reported uncertainty; not counted as underperformance. |
| 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 |
| # | Model | Accuracy ↑ | 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 | 0.7880
±0.0410 best reported | best at pub: CI-GNN: A Granger Causality-Inspired Graph Neural Network for Interpretable Brain Network-Based Psychiatric Diagnosis (2023) best today: Permutation-Invariant graph partitioning: How graph neural networks capture structural interactions? (2023) Difference within reported uncertainty; not counted as underperformance. |
| 38 | Graphormer-SPD | 0.7859
±0.0435 | This paper |
| 47 | Graphormer-Neighbor | 0.7812
±0.0362 | This paper |
| 49 | GAT | 0.7800
±0.0300 best reported | |
| 67 | SAGE | 0.7726
±0.0228 | |
| 75 | Graphormer-id | 0.7719
±0.0407 | This paper |
| 102 | GSN | 0.7660
±0.0500 best reported | best today: Multi-Scale Harmonic Encoding for Feature-Wise Graph Message Passing (2025) Difference within reported uncertainty; not counted as underperformance. |
| 139 | RetGK | 0.7620
±0.0050 | prev best: Wasserstein Embedding for Graph Learning (ICLR 2020) |
| 148 | GCN | 0.7600
±0.0320 | This paper |
| 149 | MLP | 0.7600
±0.0320 | |
| 155 | GraphSAGE | 0.7590
±0.0320 | prev best: GNNBenchmark (JMLR 2023) Improvement within reported uncertainty; not highlighted. |
| 212 | P-WL | 0.7531
±0.0073 | This paper |
| 289 | FGW | 0.7455
±0.0274 | This paper |
MoleculeNet
| # | Model | RMSE ↓ | 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 | 0.5520
±0.0070 | prev best: Optimal Transport Graph Neural Networks (2020) |
| 7 | GCN | 0.5640
±0.0150 | prev best: Memory-Based Graph Networks (ICLR 2020) |
| 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 | 0.6260
±0.0170 | prev best: Optimal Transport Graph Neural Networks (2020) Improvement within reported uncertainty; not highlighted. |
| 29 | Graphormer-Neighbor | 0.6390
±0.0340 | This paper |
