Attention Beyond Neighborhoods: Reviving Transformer for Graph Clustering

Xuanting Xie, Bingheng Li, Erlin Pan, Rui Hou, Wenyu Chen, Zhao Kang

Main figure for Attention Beyond Neighborhoods: Reviving Transformer for Graph Clustering

Abstract

Attention mechanisms have become a cornerstone in modern neural networks, driving breakthroughs across diverse domains. However, their application to graph-structured data, where capturing topological connections is essential, remains underexplored and underperforming compared to Graph Neural Networks (GNNs), particularly in the graph clustering task. GNN tends to overemphasize neighborhood aggregation, leading to a homogenization of node representations. Conversely, Transformer tends to over-globalize, highlighting distant nodes at the expense of meaningful local patterns. This dichotomy raises a key question: Is attention inherently redundant for unsupervised graph learning? To address this, we conduct a comprehensive empirical analysis, uncovering the complementary weaknesses of GNN and Transformer in graph clustering. Motivated by these insights, we propose the Attentive Graph Clustering Network (AGCN)—a novel architecture that reinterprets the notion that ``graph is attention''. AGCN directly embeds the attention mechanism into the graph structure, enabling effective global information extraction while maintaining sensitivity to local topological cues. Our framework incorporates theoretical analysis to contrast AGCN behavior with GNN and Transformer and introduces two innovations: (1) a KV cache mechanism to improve computational efficiency, and (2) a pairwise margin contrastive loss to boost the discriminative capacity of the attention space. Extensive experimental results demonstrate that AGCN outperforms state-of-the-art methods.

Proposed method: AGCN

Benchmark Results

Tested on 3 datasets 1 baseline value reported too low Non-standard metric on 1 dataset

Tables show presented results in global context (best 3 papers + GCN + MLP).

Heterophilic Graphs

#ModelAccuracy ↑Paper
1
P^2GNN
0.9541 ±0.0272
2
ACM-GCN
0.9480 ±0.0380
3
RF-GCN
0.9429
24
MLP
0.9136 ±0.0070
138
SAGE
0.8269
203
DGCN
actual #203 vs paper #357 154 places worse
0.7790 ±0.0310
best reported
actual #203 vs paper #357 154 places worse
paper 0.6229
297
AGCN
0.6831
This paper
391
GMM
0.5886
This paper
400
RWR
0.5829
This paper
405
SELENE
0.5796
This paper
411
RGSL
0.5744
This paper
424
ARVGA
0.5623
This paper
472
DCRN
0.5132
This paper
481
MSGA
0.5077
This paper
530
CGC
0.4462
This paper
534
FGC
0.4410
This paper
546
DAEGC
0.4256
This paper

Heterophily Benchmark

#ModelAccuracy ↑Paper
1
Dir-Poly
0.9451 ±0.0022
2
D-CDE
0.9387 ±0.0041
3
LargeScaleNet
0.9358 ±0.0024
26
GraphSAGE
0.9106 ±0.0027
34
AGCN
0.8940
This paper
135
MLP
0.6665 ±0.0047
208
RGSL
0.3457
This paper
210
DGCN
0.3342
This paper
211
DCRN
0.3257
This paper
215
CGC
0.3016
This paper
219
ARVGA
0.2289
This paper
220
RWR
0.2273
This paper
221
GMM
0.2190
This paper
223
DAEGC
0.2123
This paper
225
MSGA
0.1931
This paper
227
FGC
0.1446
This paper

Hypergraph Benchmarks

UAT

Global leaderboard →

Default metric is F1. The paper reports 0 values on F1 , 12 values on ACC and 12 values on NMI .

Sorted by ACC. Highlighted rows are from other papers.

#ModelF1 ↑ defaultACC ↑NMI ↑Paper
1
AGCN
—
0.6084
0.3074
F1 —
NMI 0.3074
This paper
2
the idea
0.5840
—
—
3
two unsupervised strategies
0.5681 ± 0.0034
—
—
4
SCGC
—
0.5658
0.2807
F1 —
NMI 0.2807
This paper
5
CCGC
—
0.5634
0.2815
F1 —
NMI 0.2815
This paper
6
FGC
—
0.5303
0.2706
F1 —
NMI 0.2706
This paper
8
DGCN
—
0.5227
0.2354
F1 —
NMI 0.2354
This paper
9
SDCN
—
0.5225
0.2161
F1 —
NMI 0.2161
This paper
10
DyFSS
—
0.5143
0.2552
F1 —
NMI 0.2552
This paper
11
CGC
—
0.4958
0.1749
F1 —
NMI 0.1749
This paper
12
MVGRL
—
0.4416
0.2153
F1 —
NMI 0.2153
This paper
13
MCGC
—
0.4193
0.1664
F1 —
NMI 0.1664
This paper
14
SSGC
—
0.3674
0.0804
F1 —
NMI 0.0804
This paper
15
DFCN
—
0.3361
0.2649
F1 —
NMI 0.2649
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)