How Expressive are Transformers in Spectral Domain for Graphs?
Abstract
The recent works proposing transformer-based models for graphs have proven the inadequacy of Vanilla Transformer for graph representation learning. To understand this inadequacy, there is a need to investigate if spectral analysis of the transformer will reveal insights into its expressive power. Similar studies already established that spectral analysis of Graph neural networks (GNNs) provides extra perspectives on their expressiveness. In this work, we systematically study and establish the link between the spatial and spectral domain in the realm of the transformer. We further provide a theoretical analysis and prove that the spatial attention mechanism in the transformer cannot effectively capture the desired frequency response, thus, inherently limiting its expressiveness in spectral space. Therefore, we propose FeTA, a framework that aims to perform attention over the entire graph spectrum (i.e., actual frequency components of the graphs) analogous to the attention in spatial space. Empirical results suggest that FeTA provides homogeneous performance gain against vanilla transformer across all tasks on standard benchmarks and can easily be extended to GNN-based models with low-pass characteristics (e.g., GAT).
Benchmark Results
Tested on 6 datasets 2 baseline values reported too low
Tables show presented results in global context (best 3 papers + GCN + MLP).
Classic
| # | Model | MAE ↓ | Paper |
|---|---|---|---|
| 1 | TIGT | 0.0140
±0.0010 | |
| 2 | FloydNet | 0.0160 | |
| 3 | GSSC | 0.0190
±0.0010 | |
| 64 | FeTA + GCKN + 3RW | 0.0680
±0.0020 | This paper |
| 66 | FeTA + LapE | 0.0770
±0.0010 | This paper |
| 69 | GIN | 0.0880
±0.0020 | |
| 75 | FeTA + 3RW | 0.1040
±0.0050 | This paper |
| 83 | SAN-Full | 0.1390
±0.0060 | This paper |
| 85 | FeTA + LPE + Sparse | 0.1581
±0.0010 | This paper |
| 89 | FeTA + LPE + Full | 0.1836
±0.0020 | This paper |
| 90 | SAN-Sparse | 0.1980
±0.0040 | This paper |
| 91 | GraphiT-3RW + GCKN | 0.2110
±0.0100 | This paper |
| 92 | GT-sparse | 0.2260
±0.0140 | This paper |
| 94 | GraphiT-3RW | 0.2440
±0.0110 | This paper |
| 96 | Graph-Bert | 0.2670
±0.0120 | This paper |
| 97 | FeTA-GAT | 0.2790
±0.0080 | This paper |
| 104 | FeTA-Base | 0.4120
±0.0040 | This paper |
| 105 | GraphiT-LapE | 0.5070
±0.0030 | This paper |
| 106 | GT-full | 0.5980
±0.0490 | This paper |
| 108 | Vanilla Transformer | 0.6960
±0.0070 | This paper |
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 | |
| 151 | GraphiT-3RW + GCKN | 0.9050
±0.0700 | This paper |
| 217 | ChebNet | 0.8970
±0.0641 best reported | best at pub: Breaking the Limits of Message Passing Graph Neural Networks (ICML 2021) |
| 403 | MLP | 0.8660
±0.0495 | |
| 427 | GraphiT-LapE | 0.8580
±0.0590 | This paper |
| 513 | Vanilla Transformer | 0.8333
±0.0450 | This paper |
| 515 | GraphiT-3RW | 0.8330
±0.0630 | This paper |
| 531 | BankGCN | 0.8289
±0.0161 | This paper |
| # | Model | Accuracy ↑ | Paper |
|---|---|---|---|
| 1 | WL-MLP | 0.9954 | |
| 2 | GIN | 0.9934 | |
| 3 | GCN | 0.9727 | |
| 4 | GAT | 0.9623 best reported | best at pub: ifMixup: Interpolating Graph Pair to Regularize Graph Classification (AAAI 2021) best today: 1-WL Expressiveness Is (Almost) All You Need (2022) |
| 128 | BankGCN | 0.8206
±0.0175 | This paper |
| 131 | GraphSAGE | 0.8200
±0.0100 | |
| 144 | ChebNet | 0.8180
±0.0235 | This paper |
| 160 | GraphiT-3RW + GCKN | 0.8140
±0.0220 | This paper |
| 197 | SAN-Sparse | 0.8050
±0.0130 | This paper |
| 336 | GraphiT-3RW | 0.7760
±0.0360 | This paper |
| 419 | GraphiT-LapE | 0.7460
±0.0190 | This paper |
| 461 | SAN-Full | 0.7193
±0.0340 | This paper |
OGB
| # | Model | ROC-AUC ↑ | Paper |
|---|---|---|---|
| 1 | Multi-RF Fusion with Multi-GNN Blending | 0.8476
±0.0002 | |
| 2 | HyperFusion | 0.8475
±0.0003 | |
| 3 | PAS+FPs | 0.8420
±0.0015 | |
| 9 | GatedGCN | 0.8090
±0.0160 | |
| 14 | Graphormer | 0.8051
±0.0053 | This paper |
| 95 | FeTA + LPE + Sparse | 0.7810
±0.0030 | This paper |
| 103 | BankGCN | 0.7795
±0.0156 | This paper |
| 107 | SAN-Full | 0.7785
±0.0065 | This paper |
| 109 | GIN | 0.7780
±0.0182 | |
| 140 | GAT | 0.7717
±0.0137 best reported | best at pub: Do We Need Anisotropic Graph Neural Networks? (ICLR 2021) |
| 161 | FeTA + LPE + Full | 0.7688
±0.0057 | This paper |
| 168 | FeTA-GAT | 0.7669
±0.0017 | This paper |
| 170 | SAN-Sparse | 0.7661
±0.0062 | This paper |
| 245 | ChebNet | 0.7469
±0.0208 | This paper |
| 299 | FeTA-Base | 0.6759
±0.0183 | This paper |
| 302 | FeTA + LapE | 0.6680
±0.0218 | This paper |
| 304 | GraphiT-LapE | 0.6510
±0.0176 | This paper |
| 305 | GraphiT-3RW | 0.6422
±0.0494 | This paper |
| 307 | FeTA + 3RW | 0.5995
±0.0391 | This paper |
| 311 | GraphiT-3RW + GCKN | 0.5377
±0.0273 | This paper |
| 312 | FeTA + GCKN + 3RW | 0.5350
±0.0589 | This paper |
GNNBenchmark
| # | Model | Accuracy ↑ | Paper |
|---|---|---|---|
| 1 | GRPE-Small | 0.8159
±0.0019 | |
| 2 | TANGO-GPS | 0.8011
±0.0014 | |
| 3 | GRIT | 0.8003
±0.0028 | |
| 44 | FeTA + LPE + Sparse | 0.7722
±0.0011 | This paper |
| 49 | FeTA + LPE + Full | 0.7675
±0.0030 | This paper |
| 51 | SAN-Full | 0.7669
±0.0025 | This paper |
| 54 | GatedGCN | 0.7608
±0.0020 best reported | best at pub: Formatting Instructions for ICLR 2021 Conference Submissions (2020) best today: GRPE: Relative Positional Encoding for Graph Transformer (2022) |
| 58 | SAN-Sparse | 0.7574
±0.0011 | This paper |
| 64 | GT-sparse | 0.7317
±0.0066 | This paper |
| 65 | FeTA-GAT | 0.7185
±0.0045 | This paper |
| 66 | Graph-Bert | 0.7079
±0.0054 | This paper |
| 67 | GAT | 0.7059
±0.0045 | prev best: Formatting Instructions for ICLR 2021 Conference Submissions (2020) Improvement within reported uncertainty; not highlighted. |
| 68 | GraphiT-3RW + GCKN | 0.6966
±0.0089 | This paper |
| 70 | GCN | 0.6850
±0.0098 | prev best: Formatting Instructions for ICLR 2021 Conference Submissions (2020) Improvement within reported uncertainty; not highlighted. |
| 71 | FeTA + 3RW | 0.6857
±0.0216 | This paper |
| 75 | FeTA + GCKN + 3RW | 0.6751
±0.0286 | This paper |
| 79 | GIN | 0.6472
±0.0155 | prev best: SoGCN: Second-Order Graph Convolutional Networks (2021) |
| 80 | GraphSAGE | 0.6388
±0.0011 | |
| 105 | FeTA-Base | 0.3035
±0.0267 | This paper |
| 108 | GT-full | 0.2712
±0.0847 | This paper |
| 112 | GraphiT-3RW | 0.2131
±0.0048 | This paper |
| 114 | MLP | 0.2097
±0.0000 | |
| 115 | FeTA + LapE | 0.1937
±0.0382 | This paper |
| 116 | GraphiT-LapE | 0.1814
±0.0200 | This paper |
| # | Model | Accuracy ↑ | Paper |
|---|---|---|---|
| 1 | DeepGraph (48) | 0.9066
±0.0006 | |
| 2 | GRIT (our run) | 0.9041
±0.0023 | |
| 3 | GRIT 2-QiQRW | 0.9016
±0.0045 | |
| 59 | SAN-Full | 0.8658
±0.0004 | This paper |
| 65 | FeTA + LPE + Full | 0.8652
±0.0001 | This paper |
| 66 | GatedGCN | 0.8557
±0.0009 | prev best: Factorizable Graph Convolutional Networks (NeurIPS 2020) best today: IJCAI--23 Formatting Instructions (IJCAI 2023) |
| 71 | FeTA + LPE + Sparse | 0.8630
±0.0002 | This paper |
| 88 | GCN | 0.7189
±0.0033 | prev best: Factorizable Graph Convolutional Networks (NeurIPS 2020) best today: Recurrent Distance Filtering for Graph Representation Learning (ICML 2023) |
| 89 | GIN | 0.8559
±0.0001 best reported | best at pub: Factorizable Graph Convolutional Networks (NeurIPS 2020) best today: GNNBenchmark (JMLR 2023) Difference within reported uncertainty; not counted as underperformance. |
| 96 | GT-sparse | 0.8481
±0.0007 | This paper |
| 98 | FeTA-GAT | 0.8476
±0.0013 | This paper |
| 103 | SAN-Sparse | 0.8133
±0.0215 | This paper |
| 104 | FeTA + LapE | 0.7881
±0.0166 | This paper |
| 106 | FeTA-Base | 0.7865
±0.0251 | This paper |
| 107 | GAT | 0.7827
±0.0019 | prev best: SoGCN: Second-Order Graph Convolutional Networks (2021) Improvement within reported uncertainty; not highlighted. |
| 108 | FeTA + GCKN + 3RW | 0.7786
±0.0057 | This paper |
| 109 | FeTA + 3RW | 0.7729
±0.0115 | This paper |
| 110 | GraphiT-LapE | 0.7670
±0.0074 | This paper |
| 111 | GraphiT-3RW | 0.7669
±0.0092 | This paper |
| 112 | GraphiT-3RW + GCKN | 0.7585
±0.0019 | This paper |
| 114 | Graph-Bert | 0.7549
±0.0022 | This paper |
| 121 | GT-full | 0.5648
±0.0355 | This paper |
| 123 | MLP | 0.5052 | |
| 124 | GraphSAGE | 0.5052
±0.0000 |
