Pure Transformers are Powerful Graph Learners

Jinwoo Kim, Tien Dat Nguyen, Seonwoo Min, Sungjun Cho, Moontae Lee +2 more
7/6/2022
cs.LGcs.AI

Official code: jw9730/tokengt (350 stars, MIT, PyTorch, last commit 2023-04-11).

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 https://github.com/jw9730/tokengt.

View on arXivView PDF

Code Implementations(1)

jw9730/tokengtOfficial100%
PyTorchMIT

[NeurIPS'22] Tokenized Graph Transformer (TokenGT), in PyTorch

35052Shell, CythonJun 29, 20223 years agoMIT
equivariancegnngraphhypergraphpytorch+2 more

Cite this paper

@article{kim2022pure,
  title  = {Pure Transformers are Powerful Graph Learners},
  author = {Jinwoo Kim and Tien Dat Nguyen and Seonwoo Min and Sungjun Cho and Moontae Lee and Honglak Lee and Seunghoon Hong},
  year   = {2022},
  eprint = {2207.02505},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2207.02505v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2207.02505.svg)](https://codeofpaper.com/paper/2207.02505)

Discussion