Gophormer: Ego-Graph Transformer for Node Classification

Jianan Zhao, Chaozhuo Li, Qianlong Wen, Yiqi Wang, Yuming Liu, Hao Sun, Xing Xie, Yanfang Ye

Main figure for Gophormer: Ego-Graph Transformer for Node Classification

Abstract

Transformers have achieved remarkable performance in a myriad of fields including natural language processing and computer vision. However, when it comes to the graph mining area, where graph neural network (GNN) has been the dominant paradigm, transformers haven't achieved competitive performance, especially on the node classification task. Existing graph transformer models typically adopt fully-connected attention mechanism on the whole input graph and thus suffer from severe scalability issues and are intractable to train in data insufficient cases. To alleviate these issues, we propose a novel Gophormer model which applies transformers on ego-graphs instead of full-graphs. Specifically, Node2Seq module is proposed to sample ego-graphs as the input of transformers, which alleviates the challenge of scalability and serves as an effective data augmentation technique to boost model performance. Moreover, different from the feature-based attention strategy in vanilla transformers, we propose a proximity-enhanced attention mechanism to capture the fine-grained structural bias. In order to handle the uncertainty introduced by the ego-graph sampling, we further propose a consistency regularization and a multi-sample inference strategy for stabilized training and testing, respectively. Extensive experiments on six benchmark datasets are conducted to demonstrate the superiority of Gophormer over existing graph transformers and popular GNNs, revealing the promising future of graph transformers.

Proposed method: Gophormer

Benchmark Results

Tested on 2 datasets 4 baseline values reported too low

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

Classic

#ModelAccuracy ↑Paper
1
CNA
0.9575 ±0.0058
2
IS-GIB
0.9390 ±0.0187
3
EERM
0.9112 ±0.0145
20
APPNP
actual #20 vs paper #59 39 places worse
0.8142 ±0.0026
best reported
actual #20 vs paper #59 39 places worse
paper 0.7933 ±0.0035
paper 0.7933 ±0.0035 Δ at pub 0.0117 Δ today 0.0209
35
GAT
actual #35 vs paper #47 12 places worse
0.8013 ±0.0062
actual #35 vs paper #47 12 places worse
paper 0.8013 ±0.0062
paper 0.8013 ±0.0062 Δ at pub 0.0153
44
GCN
actual #44 vs paper #54 10 places worse
0.7943 ±0.0026
actual #44 vs paper #54 10 places worse
paper 0.7943 ±0.0026
paper 0.7943 ±0.0026 Δ at pub 0.0263
46
Gophormer
0.8023 ±0.0009
This paper
61
GraphSAGE
actual #61 vs paper #61
0.7923 ±0.0053
actual #61 vs paper #61
paper 0.7923 ±0.0053
paper 0.7923 ±0.0053 Δ at pub 0.0393
62
JKNet
actual #62 vs paper #81 19 places worse
0.7920
best reported
actual #62 vs paper #81 19 places worse
paper 0.7843 ±0.0031
paper 0.7843 ±0.0031 Δ at pub 0.0077
259
SAGE
0.7361 ±0.0190
350
MLP
0.7289 ±0.0010
582
SAN
0.7064 ±0.0097
This paper
708
GT-sparse
0.6738 ±0.0076
This paper
744
Graphormer
0.6621 ±0.0083
This paper
839
GT-full
0.5875 ±0.0106
This paper

Heterogeneous Graph Benchmarks

#ModelMicro-F1 ↑Paper
1
LMSPS
0.9566 ±0.0020
2
PSHGCN
0.9561 ±0.0012
3
RpHGNN
0.9555 ±0.0029
21
GCN
actual #21 vs paper #112 91 places worse
0.9460 ±0.0031
best reported
actual #21 vs paper #112 91 places worse
paper 0.8362 ±0.0013
23
GAT
actual #23 vs paper #111 88 places worse
0.9448 ±0.0022
best reported
actual #23 vs paper #111 88 places worse
paper 0.8419 ±0.0019
best at pub: Heterogeneous Graph Benchmarks (KDD 2021)
paper 0.8419 ±0.0019 Δ at pub 0.0920 Δ today 0.1029
46
GraphSAGE
actual #46 vs paper #108 62 places worse
0.9306 ±0.0047
best reported
actual #46 vs paper #108 62 places worse
paper 0.8473 ±0.0028
paper 0.8473 ±0.0028 Δ today 0.0833
88
GIN
0.8720
104
Gophormer
0.8520 ±0.0020
This paper
109
JKNet
0.8457 ±0.0028
This paper
111
APPNP
0.8440 ±0.0017
This paper
116
SAN
0.8311 ±0.0032
This paper
127
GT-sparse
0.8104 ±0.0027
This paper
128
Graphormer
0.8093 ±0.0039
This paper
144
GT-full
0.7815 ±0.0041
This paper
176
MLP
0.6447 ±0.0136
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) Best at pub — reported value improved over the best known when published Best today — OK at publication; today's leaderboard best is elsewhere