Papers › Do Transformers Really Perform Bad for Graph Representation?

Do Transformers Really Perform Bad for Graph Representation?

9 Jun 2021arXiv:2106.05234archive 2025-07-28

Chengxuan Ying, Tianle Cai, Shengjie Luo, Shuxin Zheng, Guolin Ke, Di He, Yanming Shen, Tie-Yan Liu

The Transformer architecture has become a dominant choice in many domains, such as natural language processing and computer vision. Yet, it has not achieved competitive performance on popular leaderboards of graph-level prediction compared to mainstream GNN variants. Therefore, it remains a mystery how Transformers could perform well for graph representation learning. In this paper, we solve this mystery by presenting Graphormer, which is built upon the standard Transformer architecture, and could attain excellent results on a broad range of graph representation learning tasks, especially on the recent OGB Large-Scale Challenge. Our key insight to utilizing Transformer in the graph is the necessity of effectively encoding the structural information of a graph into the model. To this end, we propose several simple yet effective structural encoding methods to help Graphormer better model graph-structured data. Besides, we mathematically characterize the expressive power of Graphormer and exhibit that with our ways of encoding the structural information of graphs, many popular GNN variants could be covered as the special cases of Graphormer.

PaperPDFCode

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

Code

Microsoft/Graphormer officialmentioned in papermentioned on GitHubpytorchMIT report
dpstart/graphormer_new mentioned on GitHubpytorchMIT report
ytchx1999/Graphormer mentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Tasks

Graph ClassificationGraph Property PredictionGraph RegressionGraph Representation LearningMolecular Property PredictionRepresentation Learning

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Graph Classification IMDb-B Graphormer Accuracy 77.500±2.646 #15 of 51 Archive leaderboard report
Graph Classification NCI1 Graphormer Accuracy 77.032±1.393 #44 of 69 Archive leaderboard report
Graph Classification NCI109 Graphormer Accuracy 74.879±1.183 #28 of 38 Archive leaderboard report
Graph Property Prediction ogbg-molhiv Graphormer + FPs Ext. data No #7 of 43 Archive leaderboard report
Graph Property Prediction ogbg-molhiv Graphormer + FPs Number of params 47085378 #7 of 43 Archive leaderboard report
Graph Property Prediction ogbg-molhiv Graphormer + FPs Test ROC-AUC 0.8225 ± 0.0001 #7 of 43 Archive leaderboard report
Graph Property Prediction ogbg-molhiv Graphormer + FPs Validation ROC-AUC 0.8396 ± 0.0001 #7 of 43 Archive leaderboard report
Graph Property Prediction ogbg-molhiv Graphormer Ext. data Yes #15 of 43 Archive leaderboard report
Graph Property Prediction ogbg-molhiv Graphormer Number of params 47183040 #15 of 43 Archive leaderboard report
Graph Property Prediction ogbg-molhiv Graphormer Test ROC-AUC 0.8051 ± 0.0053 #15 of 43 Archive leaderboard report
Graph Property Prediction ogbg-molhiv Graphormer Validation ROC-AUC 0.8310 ± 0.0089 #15 of 43 Archive leaderboard report
Graph Property Prediction ogbg-molhiv Graphormer (pre-trained on PCQM4M) Ext. data Yes #16 of 43 Archive leaderboard report
Graph Property Prediction ogbg-molhiv Graphormer (pre-trained on PCQM4M) Number of params 47183040 #16 of 43 Archive leaderboard report
Graph Property Prediction ogbg-molhiv Graphormer (pre-trained on PCQM4M) Test ROC-AUC 0.8051 ± 0.0053 #16 of 43 Archive leaderboard report
Graph Property Prediction ogbg-molhiv Graphormer (pre-trained on PCQM4M) Validation ROC-AUC 0.8310 ± 0.0089 #16 of 43 Archive leaderboard report
Graph Property Prediction ogbg-molpcba Graphormer Number of params 119529664 #5 of 36 Archive leaderboard report
Graph Property Prediction ogbg-molpcba Graphormer Test AP 0.3140 ± 0.0032 #5 of 36 Archive leaderboard report
Graph Property Prediction ogbg-molpcba Graphormer Validation AP 0.3227 ± 0.0024 #5 of 36 Archive leaderboard report
Graph Property Prediction ogbg-molpcba Graphormer (pre-trained on PCQM4M) Ext. data Yes #6 of 36 Archive leaderboard report
Graph Property Prediction ogbg-molpcba Graphormer (pre-trained on PCQM4M) Number of params 119529664 #6 of 36 Archive leaderboard report
Graph Property Prediction ogbg-molpcba Graphormer (pre-trained on PCQM4M) Test AP 0.3140 ± 0.0032 #6 of 36 Archive leaderboard report
Graph Property Prediction ogbg-molpcba Graphormer (pre-trained on PCQM4M) Validation AP 0.3227 ± 0.0024 #6 of 36 Archive leaderboard report
Graph Regression ESR2 Graphormer R2 OOM #9 of 9 Archive leaderboard report
Graph Regression ESR2 Graphormer RMSE OOM #9 of 9 Archive leaderboard report
Graph Regression F2 Graphormer R2 OOM #9 of 9 Archive leaderboard report
Graph Regression F2 Graphormer RMSE OOM #9 of 9 Archive leaderboard report
Graph Regression KIT Graphormer R2 OOM #9 of 9 Archive leaderboard report
Graph Regression KIT Graphormer RMSE OOM #9 of 9 Archive leaderboard report
Graph Regression Lipophilicity Graphormer R2 0.607±0.048 #14 of 23 Archive leaderboard report
Graph Regression Lipophilicity Graphormer RMSE 0.791±0.048 #14 of 23 Archive leaderboard report
Graph Regression PARP1 Graphormer R2 OOM #9 of 9 Archive leaderboard report
Graph Regression PARP1 Graphormer RMSE OOM #9 of 9 Archive leaderboard report
Graph Regression PCQM4M-LSC Graphormer Test MAE 13.28 #1 of 11 Archive leaderboard report
Graph Regression PCQM4M-LSC Graphormer Validation MAE 0.1234 #1 of 11 Archive leaderboard report
Graph Regression PCQM4Mv2-LSC Graphormer Test MAE - #13 of 20 Archive leaderboard report
Graph Regression PCQM4Mv2-LSC Graphormer Validation MAE 0.0864 #13 of 20 Archive leaderboard report
Graph Regression PGR Graphormer R2 OOM #9 of 9 Archive leaderboard report
Graph Regression PGR Graphormer RMSE OOM #9 of 9 Archive leaderboard report
Graph Regression ZINC-500k Graphormer-SLIM MAE 0.122 #25 of 36 Archive leaderboard report
Graph Regression ZINC-full Graphormer Test MAE 0.036±0.002 #10 of 19 Archive leaderboard report
Molecular Property Prediction ESOL Graphormer R2 0.908±0.021 #10 of 20 Archive leaderboard report
Molecular Property Prediction ESOL Graphormer RMSE 0.618±0.068 #10 of 20 Archive leaderboard report
Molecular Property Prediction FreeSolv Graphormer R2 0.927±0.005 #9 of 22 Archive leaderboard report
Molecular Property Prediction FreeSolv Graphormer RMSE 1.065±0.039 #9 of 22 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections