LPFormer: An Adaptive Graph Transformer for Link Prediction
Harry Shomer, Yao Ma, Haitao Mao, Juanhui Li, Bo Wu, Jiliang Tang
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.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers9
- Mixture of Link Predictors on GraphsLi Ma, Haoyu Han, Juanhui Li, Harry Shomer et al.NeurIPS 2024 · 23 citations
- The Underappreciated Power of Vision Models for Graph Structural UnderstandingXinjian Zhao, Wei Pang, Zhongkai Xue, Xiangru Jian et al.NeurIPS 2025 · 7 citations
- A Scalable Pretraining Framework for Link Prediction with Efficient AdaptationYu Song, Zhigang Hua, Harry Shomer, Yan Xie et al.KDD 2025 · 1 citation
- ProGMLP: A Progressive Framework for GNN-to-MLP Knowledge Distillation with Efficient Trade-offsWeigang Lu, Ziyu Guan, Wei Zhao, Yaming Yang et al.AAAI 2026 · 1 citation
- Spectral Basis Learning for Expressive Graph Neural Networks in Link PredictionNiloofar Azizi, Nils M. Kriege, Nicholas J. A. Harvey, Horst BischofAAAI 2026
Builds on18
- Open Graph Benchmark: Datasets for Machine Learning on GraphsWeihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong et al.NeurIPS 2020 · 3,935 citations
- How Attentive are Graph Attention Networks?Shaked Brody, Uri Alon, Eran YahavICLR 2022 · 1,717 citations
- Do Transformers Really Perform Badly for Graph Representation?Chengxuan Ying, Tianle Cai, Shengjie Luo, Shuxin Zheng et al.NeurIPS 2021 · 1,632 citations
- Recipe for a General, Powerful, Scalable Graph TransformerLadislav Rampásek, Michael Galkin, Vijay Prakash Dwivedi, Anh Tuan Luu et al.NeurIPS 2022 · 1,216 citations
- Rethinking Graph Transformers with Spectral AttentionDevin Kreuzer, Dominique Beaini, William L. Hamilton, Vincent Létourneau et al.NeurIPS 2021 · 854 citations
Related papers
- Pure Message Passing Can Estimate Common Neighbor for Link PredictionKaiwen Dong, Zhichun Guo, Nitesh V. ChawlaNeurIPS 2024 · 30 citations
- Heuristic Learning with Graph Neural Networks: A Unified Framework for Link PredictionJuzheng Zhang, Lanning Wei, Zhen Xu, Quanming YaoKDD 2024 · 11 citations
- Adversarial Permutation Guided Node Representations for Link PredictionIndradyumna Roy, Abir De, Soumen ChakrabartiAAAI 2021 · 17 citations
- Subgraphormer: Unifying Subgraph GNNs and Graph Transformers via Graph ProductsGuy Bar-Shalom, Beatrice Bevilacqua, Haggai MaronICML 2024 · 13 citations
- Link Prediction on Multilayer Networks through Learning of Within-Layer and Across-Layer Node-Pair Structural Features and Node Embedding SimilarityLorenzo Zangari, Domenico Mandaglio, Andrea TagarelliWWW 2024 · 16 citations
