Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Structure-Aware Transformer for Graph Representation Learning

About

The Transformer architecture has gained growing attention in graph representation learning recently, as it naturally overcomes several limitations of graph neural networks (GNNs) by avoiding their strict structural inductive biases and instead only encoding the graph structure via positional encoding. Here, we show that the node representations generated by the Transformer with positional encoding do not necessarily capture structural similarity between them. To address this issue, we propose the Structure-Aware Transformer, a class of simple and flexible graph Transformers built upon a new self-attention mechanism. This new self-attention incorporates structural information into the original self-attention by extracting a subgraph representation rooted at each node before computing the attention. We propose several methods for automatically generating the subgraph representation and show theoretically that the resulting representations are at least as expressive as the subgraph representations. Empirically, our method achieves state-of-the-art performance on five graph prediction benchmarks. Our structure-aware framework can leverage any existing GNN to extract the subgraph representation, and we show that it systematically improves performance relative to the base GNN model, successfully combining the advantages of GNNs and Transformers. Our code is available at https://github.com/BorgwardtLab/SAT.

Dexiong Chen, Leslie O'Bray, Karsten Borgwardt• 2022

Related benchmarks

TaskDatasetResultRank
Node ClassificationCora
Accuracy79.63
885
Node ClassificationCiteseer
Accuracy74.88
804
Node ClassificationPubmed
Accuracy87.92
742
Graph ClassificationPROTEINS
Accuracy71.7
742
Graph ClassificationMUTAG
Accuracy81.4
697
Node ClassificationChameleon
Accuracy49.69
549
Node ClassificationSquirrel
Accuracy40.08
500
Graph ClassificationNCI1
Accuracy54.99
460
Node ClassificationCornell
Accuracy41.67
426
Node ClassificationWisconsin
Accuracy57.6
410
Showing 10 of 67 rows

Other info

Code

Follow for update