Lune

ICML2023Top-tier venue

Transformers Meet Directed Graphs

Simon Geisler, Yujia Li, Daniel J. Mankowitz, Ali Taylan Cemgil, Stephan Günnemann, Cosmin Paduraru

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. 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%.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

18 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Recipe for a General, Powerful, Scalable Graph Transformer cites Reformer: The Efficient Transformer
  • Recipe for a General, Powerful, Scalable Graph Transformer cites Rethinking Graph Transformers with Spectral Attention
  • Comparing Graph Transformers via Positional Encodings cites Rethinking Graph Transformers with Spectral Attention
  • Toward Effective Digraph Representation Learning: A Magnetic Adaptive Propagation based Approach cites Open Graph Benchmark: Datasets for Machine Learning on Graphs
  • Toward Effective Digraph Representation Learning: A Magnetic Adaptive Propagation based Approach cites HoloNets: Spectral Convolutions do extend to Directed Graphs
  • Toward Effective Digraph Representation Learning: A Magnetic Adaptive Propagation based Approach cites Transformers over Directed Acyclic Graphs
  • On the Connection Between MPNN and Graph Transformer cites Recipe for a General, Powerful, Scalable Graph Transformer
  • On the Connection Between MPNN and Graph Transformer cites Open Graph Benchmark: Datasets for Machine Learning on Graphs
  • On the Connection Between MPNN and Graph Transformer cites Rethinking Graph Transformers with Spectral Attention
  • HoloNets: Spectral Convolutions do extend to Directed Graphs cites Open Graph Benchmark: Datasets for Machine Learning on Graphs
  • Rethinking Graph Transformers with Spectral Attention cites Open Graph Benchmark: Datasets for Machine Learning on Graphs
  • Transformers over Directed Acyclic Graphs cites Recipe for a General, Powerful, Scalable Graph Transformer
  • Transformers over Directed Acyclic Graphs cites Open Graph Benchmark: Datasets for Machine Learning on Graphs
  • Transformers over Directed Acyclic Graphs cites Rethinking Graph Transformers with Spectral Attention
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers18

  1. On the Connection Between MPNN and Graph TransformerChen Cai, Truong Son Hy, Rose Yu, Yusu WangICML 2023 · 82 citations
  2. Transformers over Directed Acyclic GraphsYuankai Luo, Veronika Thost, Lei ShiNeurIPS 2023 · 43 citations
  3. Comparing Graph Transformers via Positional EncodingsMitchell Black, Zhengchao Wan, Gal Mishne, Amir Nayyeri et al.ICML 2024 · 27 citations
  4. HoloNets: Spectral Convolutions do extend to Directed GraphsChristian Koke, Daniel CremersICLR 2024 · 25 citations
  5. Toward Effective Digraph Representation Learning: A Magnetic Adaptive Propagation based ApproachXunkai Li, Daohan Su, Zhengyu Wu, Guang Zeng et al.WWW 2025 · 4 citations

Builds on19

  1. Open Graph Benchmark: Datasets for Machine Learning on GraphsWeihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong et al.NeurIPS 2020 · 3,935 citations
  2. Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 citations
  3. CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
  4. Recipe for a General, Powerful, Scalable Graph TransformerLadislav Rampásek, Michael Galkin, Vijay Prakash Dwivedi, Anh Tuan Luu et al.NeurIPS 2022 · 1,216 citations
  5. Rethinking Graph Transformers with Spectral AttentionDevin Kreuzer, Dominique Beaini, William L. Hamilton, Vincent Létourneau et al.NeurIPS 2021 · 854 citations

Related papers

  1. What Are Good Positional Encodings for Directed Graphs?Yinan Huang, Haoyu Peter Wang, Pan LiICLR 2025
  2. Homomorphism Counts as Structural Encodings for Graph LearningLinus Bao, Emily Jin, Michael M. Bronstein, Ismail Ilkan Ceylan et al.ICLR 2025
  3. MagNet: A Neural Network for Directed GraphsXitong Zhang, Yixuan He, Nathan Brugnone, Michael Perlmutter et al.NeurIPS 2021 · 223 citations
  4. On the Stability of Expressive Positional Encodings for GraphsYinan Huang, William Lu, Joshua Robinson, Yu Yang et al.ICLR 2024 · 32 citations
  5. Rotary Position Encodings for GraphsIsaac Reid, Arijit Sehanobish, Cederik Höfs, Bruno Mlodozeniec et al.ICML 2026
Dusk over the sea between two cliffs drawn in fine vertical lines