HopFormer: Sparse Graph Transformers with Explicit Receptive Field Control

Sanggeon Yun, Raheeb Hassan, Ryozo Masukawa, Sungheon Jeong, Mohsen Imani

Main figure for 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.

Proposed method: HopFormer

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

#ModelAccuracy ↑Paper
1
P^2GNN
0.9672 ±0.0147
2
DoG
0.9660 ±0.0210
3
GPF-plus
0.9583 ±0.0419
32
SGFormer
actual #32 vs paper #308 276 places worse
0.9246 ±0.0148
best reported
actual #32 vs paper #308 276 places worse
paper 0.7568 ±0.0221
paper 0.7568 ±0.0221 Δ at pub 0.1678
34
MLP
0.9230 ±0.0070
46
APPNP
actual #46 vs paper #574 528 places worse
0.9131 ±0.0197
best reported
actual #46 vs paper #574 528 places worse
paper 0.5405
paper 0.5405 Δ at pub 0.3726
53
GraphSAGE
0.9000 ±0.0365
87
Specformer
actual #87 vs paper #269 182 places worse
0.8823 ±0.0038
best reported
actual #87 vs paper #269 182 places worse
paper 0.7838 ±0.0221
paper 0.7838 ±0.0221 Δ at pub 0.0985
155
NodeFormer
actual #155 vs paper #399 244 places worse
0.8463 ±0.0347
best reported
actual #155 vs paper #399 244 places worse
paper 0.6937 ±0.0255
paper 0.6937 ±0.0255 Δ at pub 0.1526
211
GAT
actual #211 vs paper #613 402 places worse
0.8162 ±0.0645
best reported
actual #211 vs paper #613 402 places worse
paper 0.3604 ±0.1469
paper 0.3604 ±0.1469 Δ at pub 0.4558
256
HopFormer
0.7937 ±0.0270
This paper
257
GCN
actual #257 vs paper #600 343 places worse
0.7933 ±0.0447
best reported
actual #257 vs paper #600 343 places worse
paper 0.4505 ±0.0709
best at pub: Graph Wave Networks (WWW 2025)
paper 0.4505 ±0.0709 Δ at pub 0.3428
281
Graphormer
0.7748 ±0.0127
This paper
296
CoBFormer
actual #296 vs paper #342 46 places worse
0.7652 ±0.0238
best reported
actual #296 vs paper #342 46 places worse
paper 0.7387 ±0.0637

Difference within reported uncertainty; not counted as underperformance.

paper 0.7387 ±0.0637 Δ at pub 0.0265
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
#ModelAccuracy ↑Paper
1
P^2GNN
0.9541 ±0.0272
2
ACM-GCN
0.9480 ±0.0380
3
RF-GCN
0.9429
21
APPNP
actual #21 vs paper #533 512 places worse
0.9181 ±0.0196
best reported
actual #21 vs paper #533 512 places worse
paper 0.4414 ±0.0127
paper 0.4414 ±0.0127 Δ at pub 0.4767
24
MLP
0.9136 ±0.0070
138
SAGE
0.8269
158
GAT
actual #158 vs paper #563 405 places worse
0.8190 ±0.0540
best reported
actual #158 vs paper #563 405 places worse
paper 0.3513 ±0.0441
paper 0.3513 ±0.0441 Δ at pub 0.4677
170
GCN
actual #170 vs paper #566 396 places worse
0.8082 ±0.0360
best reported
actual #170 vs paper #566 396 places worse
paper 0.3243 ±0.0441
paper 0.3243 ±0.0441 Δ at pub 0.4839
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
#ModelAccuracy ↑Paper
1
DiGGR
0.4535 ±0.0353
2
TRIGON
0.4402 ±0.0028
3
DoG
0.4320 ±0.0120
19
Specformer
actual #19 vs paper #162 143 places worse
0.4193 ±0.0104
best reported
actual #19 vs paper #162 143 places worse
paper 0.3647 ±0.0087
paper 0.3647 ±0.0087 Δ at pub 0.0546
23
SGFormer
actual #23 vs paper #114 91 places worse
0.4169 ±0.0063
best reported
actual #23 vs paper #114 91 places worse
paper 0.3746 ±0.0084
paper 0.3746 ±0.0084 Δ at pub 0.0423
41
APPNP
actual #41 vs paper #397 356 places worse
0.4046 ±0.0064
best reported
actual #41 vs paper #397 356 places worse
paper 0.2798 ±0.0017
paper 0.2798 ±0.0017 Δ at pub 0.1248
42
MLP
0.4026 ±0.0108
67
Exphormer
actual #67 vs paper #194 127 places worse
0.3901 ±0.0069
best reported
actual #67 vs paper #194 127 places worse
paper 0.3577 ±0.0045
best at pub: Even Sparser Graph Transformers (NeurIPS 2024)
paper 0.3577 ±0.0045 Δ at pub 0.0324
68
GraphSAGE
0.3899 ±0.0085
98
DeGTA
actual #98 vs paper #234 136 places worse
0.3787 ±0.0100
best reported
actual #98 vs paper #234 136 places worse
paper 0.3507 ±0.0067
paper 0.3507 ±0.0067 Δ at pub 0.0280
99
Graphormer
actual #99 vs paper #127 28 places worse
0.3785 ±0.0029
best reported
actual #99 vs paper #127 28 places worse
paper 0.3713 ±0.0057

Difference within reported uncertainty; not counted as underperformance.

paper 0.3713 ±0.0057 Δ at pub 0.0072
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
actual #135 vs paper #410 275 places worse
0.3690
best reported
actual #135 vs paper #410 275 places worse
paper 0.2713 ±0.0089
paper 0.2713 ±0.0089 Δ at pub 0.0977
136
NodeFormer
actual #136 vs paper #223 87 places worse
0.3690 ±0.0100
best reported
actual #136 vs paper #223 87 places worse
paper 0.3520 ±0.0047
best at pub: Even Sparser Graph Transformers (NeurIPS 2024)
paper 0.3520 ±0.0047 Δ at pub 0.0170
141
DIFFormer
0.3682 ±0.0110
This paper
182
GAT
actual #182 vs paper #386 204 places worse
0.3605 ±0.0035
best reported
actual #182 vs paper #386 204 places worse
paper 0.2842 ±0.0121
paper 0.2842 ±0.0121 Δ at pub 0.0763
381
Graphtransformer
0.2873 ±0.0006
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)