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