Transformers Meet Directed Graphs

Simon Geisler, Yujia Li, Daniel Mankowitz, Ali Taylan Cemgil, Stephan Günnemann +1 more
1/31/2023
60 citations
cs.LG
transformer-attention

No official code found. Best implementation: google-deepmind/digraph_transformer (122 stars, Python, last commit 2023-09-13).

Abstract

Transformers were originally proposed as a sequence-to-sequence model for text but have become vital for a wide range of modalities, including images, audio, video, and undirected graphs. However, transformers for directed graphs are a surprisingly underexplored topic, despite their applicability to ubiquitous domains, including source code and logic circuits.

Show full abstract

In this work, we propose two direction- and structure-aware positional encodings for directed graphs: (1) the eigenvectors of the Magnetic Laplacian - a direction-aware generalization of the combinatorial Laplacian; (2) directional random walk encodings. Empirically, we show that the extra directionality information is useful in various downstream tasks, including correctness testing of sorting networks and source code understanding. Together with a data-flow-centric graph construction, our model outperforms the prior state of the art on the Open Graph Benchmark Code2 relatively by 14.7%.

View on arXivView PDF

Code Implementations(1)

12211Python, ShellDec 14, 20223 years agoNOASSERTION

Similar Papers

Cite this paper

@article{geisler2023transformers,
  title  = {Transformers Meet Directed Graphs},
  author = {Simon Geisler and Yujia Li and Daniel Mankowitz and Ali Taylan Cemgil and Stephan Günnemann and Cosmin Paduraru},
  year   = {2023},
  eprint = {2302.00049},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2302.00049v3},
  journal = {ICML 2023 2023}
}

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/2302.00049.svg)](https://codeofpaper.com/paper/2302.00049)

Discussion