HyperAIHyperAI

Command Palette

Search for a command to run...

5 months ago

Do Transformers Really Perform Bad for Graph Representation?

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

Do Transformers Really Perform Bad for Graph Representation?

Abstract

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.

Code Repositories

Benchmarks

BenchmarkMethodologyMetrics
graph-classification-on-imdb-bGraphormer
Accuracy: 77.500±2.646
graph-classification-on-nci1Graphormer
Accuracy: 77.032±1.393
graph-classification-on-nci109Graphormer
Accuracy: 74.879±1.183
graph-property-prediction-on-ogbg-molhivGraphormer
Ext. data: Yes
Number of params: 47183040
Test ROC-AUC: 0.8051 ± 0.0053
Validation ROC-AUC: 0.8310 ± 0.0089
graph-property-prediction-on-ogbg-molhivGraphormer + FPs
Ext. data: No
Number of params: 47085378
Test ROC-AUC: 0.8225 ± 0.0001
Validation ROC-AUC: 0.8396 ± 0.0001
graph-property-prediction-on-ogbg-molhivGraphormer (pre-trained on PCQM4M)
Ext. data: Yes
Number of params: 47183040
Test ROC-AUC: 0.8051 ± 0.0053
Validation ROC-AUC: 0.8310 ± 0.0089
graph-property-prediction-on-ogbg-molpcbaGraphormer
Number of params: 119529664
Test AP: 0.3140 ± 0.0032
Validation AP: 0.3227 ± 0.0024
graph-property-prediction-on-ogbg-molpcbaGraphormer (pre-trained on PCQM4M)
Ext. data: Yes
Number of params: 119529664
Test AP: 0.3140 ± 0.0032
Validation AP: 0.3227 ± 0.0024
graph-regression-on-esr2Graphormer
R2: OOM
RMSE: OOM
graph-regression-on-f2Graphormer
R2: OOM
RMSE: OOM
graph-regression-on-kitGraphormer
R2: OOM
RMSE: OOM
graph-regression-on-lipophilicityGraphormer
R2: 0.607±0.048
RMSE: 0.791±0.048
graph-regression-on-parp1Graphormer
R2: OOM
RMSE: OOM
graph-regression-on-pcqm4m-lscGraphormer
Test MAE: 13.28
Validation MAE: 0.1234
graph-regression-on-pcqm4mv2-lscGraphormer
Test MAE: -
Validation MAE: 0.0864
graph-regression-on-pgrGraphormer
R2: OOM
RMSE: OOM
graph-regression-on-zinc-500kGraphormer-SLIM
MAE: 0.122
graph-regression-on-zinc-fullGraphormer
Test MAE: 0.036±0.002
molecular-property-prediction-on-esolGraphormer
R2: 0.908±0.021
RMSE: 0.618±0.068
molecular-property-prediction-on-freesolvGraphormer
R2: 0.927±0.005
RMSE: 1.065±0.039

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
Do Transformers Really Perform Bad for Graph Representation? | Papers | HyperAI