Pure Transformers are Powerful Graph Learners
Abstract
We show that standard Transformers without graph-specific modifications can lead to promising results in graph learning both in theory and practice. Given a graph, we simply treat all nodes and edges as independent tokens, augment them with token embeddings, and feed them to a Transformer. With an appropriate choice of token embeddings, we prove that this approach is theoretically at least as expressive as an invariant graph network (2-IGN) composed of equivariant linear layers, which is already more expressive than all message-passing Graph Neural Networks (GNN). When trained on a large-scale graph dataset (PCQM4Mv2), our method coined Tokenized Graph Transformer (TokenGT) achieves significantly better results compared to GNN baselines and competitive results compared to Transformer variants with sophisticated graph-specific inductive bias. Our implementation is available at.
Benchmark Results
Tested on 1 dataset
Tables show presented results in global context (best 3 papers + GCN + MLP).
OGB
| # | Model | MAE ↓ | Paper |
|---|---|---|---|
| 1 | DeMol | 0.0603 | |
| 2 | TGT-At | 0.0671 | |
| 3 | TGT-At (+RDKit) | 0.0683 | |
| 46 | TokenGT (Lap) | 0.0910 | This paper |
| 49 | TokenGT (Lap) + Performer | 0.0935 | This paper |
| 58 | GIN-VN | 0.1083 | prev best: GRPE: Relative Positional Encoding for Graph Transformer (2022) |
| 60 | GCN-VN | 0.1152 | This paper |
| 63 | GAT-VN | 0.1192 | This paper |
| 64 | GIN | 0.1195 | |
| 69 | GAT | 0.1302 | This paper |
| 83 | Transformer | 0.2340 | This paper |
