Hierarchical Graph Transformer with Adaptive Node Sampling
Abstract
The Transformer architecture has achieved remarkable success in a number of domains including natural language processing and computer vision. However, when it comes to graph-structured data, transformers have not achieved competitive performance, especially on large graphs. In this paper, we identify the main deficiencies of current graph transformers: (1) Existing node sampling strategies in Graph Transformers are agnostic to the graph characteristics and the training process. (2) Most sampling strategies only focus on local neighbors and neglect the long-range dependencies in the graph. We conduct experimental investigations on synthetic datasets to show that existing sampling strategies are sub-optimal. To tackle the aforementioned problems, we formulate the optimization strategies of node sampling in Graph Transformer as an adversary bandit problem, where the rewards are related to the attention weights and can vary in the training procedure. Meanwhile, we propose a hierarchical attention scheme with graph coarsening to capture the long-range interactions while reducing computational complexity. Finally, we conduct extensive experiments on real-world datasets to demonstrate the superiority of our method over existing graph transformers and popular GNNs. Our code is open-sourced at https://github.com/zaixizhang/ANS-GT.
Benchmark Results
Tested on 4 datasets 7 baseline values reported too low
Tables show presented results in global context (best 3 papers + GCN + MLP).
OGB
| # | Model | Accuracy ↑ | Paper |
|---|---|---|---|
| 1 | Jacobi | 0.8968 | |
| 2 | GPR | 0.8953 | |
| 3 | LEMP4HG | 0.8939 | |
| 4 | SAGE | 0.8933 | |
| 6 | GCN | 0.8868 best reported | best at pub: PaSca: a Graph Neural Architecture Search System under the Scalable Paradigm (WWW 2022) |
| 83 | GraphSAGE | 0.8287 best reported | |
| 96 | ANS-GT | 0.8215
±0.0030 | This paper |
| 154 | GPRGNN | 0.7976
±0.0059 | This paper |
| 351 | MLP | 0.6605
±0.0020 |
| # | Model | Accuracy ↑ | Paper |
|---|---|---|---|
| 1 | GIANT-XRT | 0.7612
±0.0016 | |
| 2 | GEGCN | 0.7576
±0.0064 | |
| 3 | AGDN | 0.7522
±0.0007 | |
| 23 | GCN | 0.7300
±0.0017 best reported | |
| 24 | ANS-GT | 0.7284
±0.0034 | This paper |
| 25 | GraphSAGE | 0.7277
±0.0016 best reported | |
| 26 | SAGE | 0.7267
±0.0031 | |
| 55 | GPRGNN | 0.7168
±0.0044 best reported | best today: Node-oriented Spectral Filtering for Graph Neural Networks (2022) |
| 107 | MLP | 0.5765
±0.0012 |
Heterophilic Graphs
| # | Model | Accuracy ↑ | Paper |
|---|---|---|---|
| 1 | DiGGR | 0.4535
±0.0353 | |
| 2 | TRIGON | 0.4402
±0.0028 | |
| 3 | DoG | 0.4320
±0.0120 | |
| 41 | APPNP | 0.4046
±0.0064 best reported | best at pub: Convolutional Neural Networks on Graphs with Chebyshev Approximation, Revisited (NeurIPS 2022) best today: A Quasi-Wasserstein Loss for Learning Graph Neural Networks (WWW 2023) |
| 42 | MLP | 0.4026
±0.0108 | |
| 47 | ANS-GT | 0.4010
±0.0112 | This paper |
| 45 | GT | 0.4010 best reported | |
| 52 | GPRGNN | 0.3927
±0.0021 | |
| 68 | GraphSAGE | 0.3855
±0.0046 | prev best: Deformable Graph Transformer (2022) |
| 83 | SAN | 0.3824
±0.0053 | This paper |
| 99 | Graphormer | 0.3785
±0.0029 | prev best: Deformable Graph Transformer (2022) |
| 114 | Gophormer | 0.3750
±0.0042 | This paper |
| 135 | GCN | 0.3690 best reported | best at pub: Beyond Low-frequency Information in Graph Convolutional Networks (AAAI 2021) |
| 176 | H_2GCN | 0.3622
±0.0033 | prev best: Non-Local Graph Neural Networks (2020) Improvement within reported uncertainty; not highlighted. |
| 182 | GAT | 0.3605
±0.0035 | prev best: Restructuring Graphs for Higher Homophily via Adaptive Spectral Clustering (AAAI 2022) Improvement within reported uncertainty; not highlighted. |
| 266 | GIN | 0.3410
±0.0030 | |
| 281 | JKNet | 0.3342
±0.0028 | prev best: Deformable Graph Transformer (2022) |
| # | Model | Accuracy ↑ | Paper |
|---|---|---|---|
| 1 | Hetero-S (GAT 8-layer) | 0.8693 | |
| 2 | Dir-GNN+CNA | 0.8586
±0.0180 | |
| 3 | GAT | 0.8560 best reported | best at pub: Restructuring Graphs for Higher Homophily via Adaptive Spectral Clustering (AAAI 2022) best today: The Heterophilic Snowflake Hypothesis: Training and Empowering GNNs for Heterophilic Graphs (KDD 2024) |
| 32 | JKNet | 0.6292
±0.0049 | prev best: Optimization-Induced Graph Implicit Nonlinear Diffusion (ICML 2022) best today: The Heterophilic Snowflake Hypothesis: Training and Empowering GNNs for Heterophilic Graphs (KDD 2024) |
| 52 | GCN | 0.7033 best reported | best at pub: Non-Local Graph Neural Networks (2020) best today: Understanding Heterophily for Graph Neural Networks (ICML 2024) |
| 72 | GPRGNN | 0.6748
±0.0040 best reported | best at pub: Simplifying approach to Node Classification in Graph Neural Networks (2021) best today: $P^2$GNN: Two Prototype Sets to boost GNN Performance (2026) |
| 79 | APPNP | 0.6670
±0.0270 best reported | best at pub: Restructuring Graphs for Higher Homophily via Adaptive Spectral Clustering (AAAI 2022) |
| 84 | ANS-GT | 0.6542
±0.0071 | This paper |
| 108 | SAGE | 0.6340
±0.0300 | |
| 115 | GraphSAGE | 0.6215
±0.0042 | prev best: Simplifying approach to Node Classification in Graph Neural Networks (2021) |
| 121 | H_2GCN | 0.6120
±0.0095 | prev best: Non-Local Graph Neural Networks (2020) Improvement within reported uncertainty; not highlighted. |
| 148 | GT | 0.5786
±0.0120 | This paper |
| 154 | Gophormer | 0.5740
±0.0014 | This paper |
| 162 | SAN | 0.5562
±0.0043 | This paper |
| 169 | MLP | 0.5429 | |
| 265 | Graphormer | 0.3681
±0.0196 | This paper |
