KDD 2023

LPFormer: An Adaptive Graph Transformer for Link Prediction

Harry Shomer, Yao Ma, Haitao Mao, Juanhui Li, Bo Wu, Jiliang Tang

Main figure for LPFormer: An Adaptive Graph Transformer for Link Prediction

Abstract

Link prediction is a common task on graph-structured data that has seen applications in a variety of domains. Classically, hand-crafted heuristics were used for this task. Heuristic measures are chosen such that they correlate well with the underlying factors related to link formation. In recent years, a new class of methods has emerged that combines the advantages of message-passing neural networks (MPNN) and heuristics methods. These methods perform predictions by using the output of an MPNN in conjunction with a ``pairwise encoding'' that captures the relationship between nodes in the candidate link. They have been shown to achieve strong performance on numerous datasets. However, current pairwise encodings often contain a strong inductive bias, using the same underlying factors to classify all links. This limits the ability of existing methods to learn how to properly classify a variety of different links that may form from different factors. To address this limitation, we propose a new method, LPFormer, which attempts to adaptively learn the pairwise encodings for each link. LPFormer models the link factors via an attention module that learns the pairwise encoding that exists between nodes by modeling multiple factors integral to link prediction. Extensive experiments demonstrate that LPFormer can achieve SOTA performance on numerous datasets while maintaining efficiency. The code is available at The code is available at https://github.com/HarryShomer/LPFormer.

Proposed method: LPFormer

Benchmark Results

Tested on 3 datasets 2 baseline values reported too low

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

OGB

#ModelHits@50 ↑Paper
1
PROXI
0.7650 ±0.0027
2
OGB Leader
0.7129 ±0.0018
3
GIDN
0.7096 ±0.0055
6
LPFormer
0.6814 ±0.0051
This paper
9
GCN
actual #9 vs paper #91 82 places worse
0.6621 ±0.0033
best reported
actual #9 vs paper #91 82 places worse
paper 0.4475 ±0.0107
best at pub: GNNBenchmark (JMLR 2023)
paper 0.4475 ±0.0107 Δ at pub 0.0421 Δ today 0.2146
23
AA
0.6435
This paper
26
RA
0.6400
This paper
28
SAGE
actual #28 vs paper #81 53 places worse
0.5944 ±0.0137
best reported
actual #28 vs paper #81 53 places worse
paper 0.4810 ±0.0081
paper 0.4810 ±0.0081 Δ at pub 0.0653 Δ today 0.1134
41
GraphSAGE
0.5463 ±0.0112
94
MLP
0.4438 ±0.0347
#ModelHits@100 ↑Paper
1
OGB Leader
0.6524 ±0.0150
2
PRB
0.6347 ±0.0175
3
LPFormer
0.6332 ±0.0063
This paper
14
SAGE
0.5013 ±0.0055
23
MLP
0.4600
39
AA
0.3245
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)