HopFormer: Sparse Graph Transformers with Explicit Receptive Field Control
Abstract
Graph Transformers typically rely on explicit positional or structural encodings and dense global attention to incorporate graph topology. In this work, we show that neither is essential. We introduce HopFormer, a graph Transformer that injects structure exclusively through head-specific n-hop masked sparse attention, without the use of positional encodings or architectural modifications. This design provides explicit and interpretable control over receptive fields while enabling genuinely sparse attention whose computational cost scales linearly with mask sparsity. Through extensive experiments on both node-level and graph-level benchmarks, we demonstrate that our approach achieves competitive or superior performance across diverse graph structures. Our results further reveal that dense global attention is often unnecessary: on graphs with strong small-world properties, localized attention yields more stable and consistently high performance, while on graphs with weaker small-world effects, global attention offers diminishing returns. Together, these findings challenge prevailing assumptions in graph Transformer design and highlight sparsity-controlled attention as a principled and efficient alternative.
Benchmark Results
Tested on 3 datasets 17 baseline values reported too low
Tables show presented results in global context (best 3 papers + GCN + MLP).
Heterophilic Graphs
| # | Model | Accuracy ↑ | Paper |
|---|---|---|---|
| 1 | P^2GNN | 0.9672
±0.0147 | |
| 2 | DoG | 0.9660
±0.0210 | |
| 3 | GPF-plus | 0.9583
±0.0419 | |
| 32 | SGFormer | 0.9246
±0.0148 best reported | best at pub: GrokFormer: Graph Fourier Kolmogorov-Arnold Transformers (ICML 2024) |
| 34 | MLP | 0.9230
±0.0070 | |
| 46 | APPNP | 0.9131
±0.0197 best reported | best at pub: A Quasi-Wasserstein Loss for Learning Graph Neural Networks (WWW 2023) |
| 53 | GraphSAGE | 0.9000
±0.0365 | |
| 87 | Specformer | 0.8823
±0.0038 best reported | best at pub: GrokFormer: Graph Fourier Kolmogorov-Arnold Transformers (ICML 2024) |
| 155 | NodeFormer | 0.8463
±0.0347 best reported | best at pub: GrokFormer: Graph Fourier Kolmogorov-Arnold Transformers (ICML 2024) |
| 211 | GAT | 0.8162
±0.0645 best reported | best at pub: Equivariance Everywhere All At Once: A Recipe for Graph Foundation Models (2025) |
| 256 | HopFormer | 0.7937
±0.0270 | This paper |
| 257 | GCN | 0.7933
±0.0447 best reported | best at pub: Graph Wave Networks (WWW 2025) |
| 281 | Graphormer | 0.7748
±0.0127 | This paper |
| 296 | CoBFormer | 0.7652
±0.0238 best reported | best at pub: Deeper with Riemannian Geometry: Overcoming Oversmoothing and Oversquashing for Graph Foundation Models (NeurIPS 2025) Difference within reported uncertainty; not counted as underperformance. |
| 323 | GPS | 0.7478
±0.0127 | This paper |
| 371 | DIFFormer | 0.7207
±0.0337 | This paper |
| 388 | GRIT | 0.7027
±0.0382 | This paper |
| 426 | SAN | 0.6667
±0.0337 | This paper |
| 487 | DeGTA | 0.6126
±0.0127 | This paper |
| 498 | Graphtransformer | 0.6036
±0.0255 | This paper |
| 611 | Exphormer | 0.3784
±0.0221 | This paper |
| # | Model | Accuracy ↑ | Paper |
|---|---|---|---|
| 1 | P^2GNN | 0.9541
±0.0272 | |
| 2 | ACM-GCN | 0.9480
±0.0380 | |
| 3 | RF-GCN | 0.9429 | |
| 21 | APPNP | 0.9181
±0.0196 best reported | best at pub: LON-GNN: Spectral GNNs with Learnable Orthonormal Basis (2023) |
| 24 | MLP | 0.9136
±0.0070 | |
| 138 | SAGE | 0.8269 | |
| 158 | GAT | 0.8190
±0.0540 best reported | best at pub: Restructuring Graphs for Higher Homophily via Adaptive Spectral Clustering (AAAI 2022) |
| 170 | GCN | 0.8082
±0.0360 best reported | best at pub: Bayesian Neighborhood Adaptation for Graph Neural Networks (TMLR 2025) |
| 218 | HopFormer | 0.7657
±0.0412 | This paper |
| 235 | Specformer | 0.7478
±0.0255 | This paper |
| 256 | GPS | 0.7297
±0.0221 | This paper |
| 267 | SGFormer | 0.7207
±0.0127 | This paper |
| 276 | Graphormer | 0.7117
±0.0127 | This paper |
| 277 | CoBFormer | 0.7117
±0.0337 | This paper |
| 315 | SAN | 0.6667
±0.0337 | This paper |
| 323 | NodeFormer | 0.6577
±0.0459 | This paper |
| 331 | DIFFormer | 0.6486
±0.0441 | This paper |
| 332 | GRIT | 0.6486
±0.0584 | This paper |
| 440 | Exphormer | 0.5405
±0.0441 | This paper |
| 453 | DeGTA | 0.5315
±0.0459 | This paper |
| 556 | Graphtransformer | 0.3874
±0.0127 | This paper |
| # | Model | Accuracy ↑ | Paper |
|---|---|---|---|
| 1 | DiGGR | 0.4535
±0.0353 | |
| 2 | TRIGON | 0.4402
±0.0028 | |
| 3 | DoG | 0.4320
±0.0120 | |
| 19 | Specformer | 0.4193
±0.0104 best reported | best at pub: GrokFormer: Graph Fourier Kolmogorov-Arnold Transformers (ICML 2024) |
| 23 | SGFormer | 0.4169
±0.0063 best reported | best at pub: GrokFormer: Graph Fourier Kolmogorov-Arnold Transformers (ICML 2024) |
| 41 | APPNP | 0.4046
±0.0064 best reported | best at pub: A Quasi-Wasserstein Loss for Learning Graph Neural Networks (WWW 2023) |
| 42 | MLP | 0.4026
±0.0108 | |
| 67 | Exphormer | 0.3901
±0.0069 best reported | best at pub: Even Sparser Graph Transformers (NeurIPS 2024) |
| 68 | GraphSAGE | 0.3899
±0.0085 | |
| 98 | DeGTA | 0.3787
±0.0100 best reported | best at pub: Graph Triple Attention Network: A Decoupled Perspective (2024) |
| 99 | Graphormer | 0.3785
±0.0029 best reported | best at pub: Hierarchical Graph Transformer with Adaptive Node Sampling (NeurIPS 2022) Difference within reported uncertainty; not counted as underperformance. |
| 116 | HopFormer | 0.3736
±0.0016 | This paper |
| 124 | GPS | 0.3721
±0.0117 | This paper |
| 125 | CoBFormer | 0.3719
±0.0088 | This paper |
| 135 | GCN | 0.3690 best reported | best at pub: Beyond Low-frequency Information in Graph Convolutional Networks (AAAI 2021) |
| 136 | NodeFormer | 0.3690
±0.0100 best reported | best at pub: Even Sparser Graph Transformers (NeurIPS 2024) |
| 141 | DIFFormer | 0.3682
±0.0110 | This paper |
| 182 | GAT | 0.3605
±0.0035 best reported | best at pub: Hierarchical Graph Transformer with Adaptive Node Sampling (NeurIPS 2022) |
| 381 | Graphtransformer | 0.2873
±0.0006 | This paper |
