Transformers Meet Directed Graphs
Not on the map. Why?
Abstract (arXiv)
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%.
Key facts. Cited by 39 papers in the map (data through 7 Oct 2026). Builds on 43 of its 77 references that are in the map. First posted on arXiv 31 Jan 2023.
Builds on
43 of 77 references.
References · 43
- 2017Attention Is All You Needcited by 59,932
- 2016Semi-Supervised Classification with Graph Convolutional Networkscited by 11,282
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2016SGDR: Stochastic Gradient Descent with Warm Restartscited by 4,993
- 2020Open Graph Benchmark: Datasets for Machine Learning on Graphscited by 2,148
- 2016Convolutional Neural Networks on Graphs with Fast Localized Spectral Filteringcited by 2,085
- 2020Reformer: The Efficient Transformercited by 1,658
- 2020Rethinking Attention with Performerscited by 1,584
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2018Relational inductive biases, deep learning, and graph networkscited by 1,341
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2021Geometric Deep Learning: Grids, Groups, Graphs, Geodesics, and Gaugescited by 1,131
31 more
- 2022Recipe for a General, Powerful, Scalable Graph Transformercited by 702
- 2020A Generalization of Transformer Networks to Graphscited by 653
- 2018Attention, Learn to Solve Routing Problems!cited by 646
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
- 2021Rethinking Graph Transformers with Spectral Attentioncited by 468
- 2021High-Performance Large-Scale Image Recognition Without Normalizationcited by 359
- 2021Do Transformers Really Perform Bad for Graph Representation?cited by 318
- 2017Learning to Represent Programs with Graphscited by 219
- 2018Learning a SAT Solver from Single-Bit Supervisioncited by 198
- 2022Structure-Aware Transformer for Graph Representation Learningcited by 191
- 2022Pure Transformers are Powerful Graph Learnerscited by 188
- 2022Sign and Basis Invariant Networks for Spectral Graph Representation Learningcited by 176
- 2020Scaling Graph Neural Networks with Approximate PageRankcited by 174
- 2021GraphiT: Encoding Graph Structure in Transformerscited by 146
- 2021Global Self-Attention as a Replacement for Graph Convolutioncited by 113
- 2022Transformer for Graphs: An Overview from Architecture Perspectivecited by 107
- 2021MagNet: A Neural Network for Directed Graphscited by 104
- 2022Equivariant and Stable Positional Encoding for More Powerful Graph Neural Networkscited by 94
- 2021Language-Agnostic Representation Learning of Source Code from Structure and Contextcited by 63
- 2019Adversarial Examples for Models of Codecited by 61
- 2022CodeAttack: Code-Based Adversarial Attacks for Pre-trained Programming Language Modelscited by 48
- 2020Semantic Robustness of Models of Source Codecited by 43
- 2022Relational Attention: Generalizing Transformers for Graph-Structured Taskscited by 41
- 2020Adversarial Robustness for Codecited by 36
- 2021Generalization of Neural Combinatorial Solvers Through the Lens of Adversarial Robustnesscited by 35
- 2020Signal Processing on Directed Graphscited by 28
- 2022MSGNN: A Spectral Graph Neural Network Based on a Novel Magnetic Signed Laplaciancited by 28
- 2016Magnetic Eigenmaps for the Visualization of Directed Networkscited by 25
- 2020ProGraML: Graph-based Deep Learning for Program Optimization and Analysiscited by 23
- 2016Magnetic eigenmaps for community detection in directed networkscited by 22
- 2022A Library for Representing Python Programs as Graphs for Machine Learningcited by 4
Built on by
Citing papers per year: 2023: 5; 2024: 14; 2025: 16; 2026: 4.
39 papers.
Sort:
By area:
- 2023Edge Directionality Improves Learning on Heterophilic Graphscited by 88
- 2023Attending to Graph Transformerscited by 81
- 2023A Comprehensive Survey on Deep Graph Representation Learningcited by 72
- 2024Graph Transformers: A Surveycited by 32
- 2025Learning Efficient Positional Encodings with Graph Neural Networkscited by 21
- 2023HoloNets: Spectral Convolutions do extend to Directed Graphscited by 20
- 2024Comparing Graph Transformers via Positional Encodingscited by 20
- 2024Spatio-Spectral Graph Neural Networkscited by 17
- 2023Expressive Sign Equivariant Networks for Spectral Geometric Learningcited by 15
- 2025Biologically Plausible Brain Graph Transformercited by 9
- 2024Efficient Time Series Processing for Transformers and State-Space Models through Token Mergingcited by 7
- 2024What Are Good Positional Encodings for Directed Graphs?cited by 7
27 more
- 2024Commute Graph Neural Networkscited by 5
- 2025DualEquiNet: A Dual-Space Hierarchical Equivariant Network for Large Biomoleculescited by 5
- 2024Improving Graph Neural Networks by Learning Continuous Edge Directionscited by 3
- 2025Generating Directed Graphs with Dual Attention and Asymmetric Encodingcited by 3
- 2024Revisiting Edge Perturbation for Graph Neural Network in Graph Data Augmentation and Attackcited by 2
- 2024Improving Chinese Character Representation with Formation Treecited by 2
- 2024A Structure-Aware Lane Graph Transformer Model for Vehicle Trajectory Predictioncited by 2
- 2024Graph Neural Networks for Edge Signals: Orientation Equivariance and Invariancecited by 2
- 2025Efficient Learning on Large Graphs using a Densifying Regularity Lemmacited by 2
- 2025Generalizable Insights for Graph Transformers in Theory and Practicecited by 2
- 2024AUTONODE: A Neuro-Graphic Self-Learnable Engine for Cognitive GUI Automationcited by 1
- 2024A Benchmark on Directed Graph Representation Learning in Hardware Designscited by 1
- 2025Toward General Digraph Contrastive Learning: A Dual Spatial Perspectivecited by 1
- 2026Principled Latent Diffusion for Graphs via Laplacian Autoencoderscited by 1
- 2024Adaptive Critical Subgraph Mining for Cognitive Impairment Conversion Prediction with T1-MRI-based Brain Networkcited by 0
- 2025Rethinking Link Prediction for Directed Graphscited by 0
- 2025Understanding the Design Principles of Link Prediction in Directed Settingscited by 0
- 2025Using Subgraph GNNs for Node Classification:an Overlooked Potential Approachcited by 0
- 2025Toward Data-centric Directed Graph Learning: An Entropy-driven Approachcited by 0
- 2025The informativeness of the gradient revisitedcited by 0
- 2025Directed Homophily-Aware Graph Neural Networkcited by 0
- 2025SAFT: Structure-Aware Fine-Tuning of LLMs for AMR-to-Text Generationcited by 0
- 2025Long-Range Graph Wavelet Networkscited by 0
- 2025State Space Models over Directed Graphscited by 0
- 2026Size Transferability of Graph Transformers with Convolutional Positional Encodingscited by 0
- 2026Eigenbasis-Independent Learnable Spectral Positional Encodings for Directed Graphs via Hermitian Block Krylov Subspacescited by 0
- 2026Converse and Collision-Based Achievability for Node Localization with Hybrid Distance-Spectral Graph Positional Encodingscited by 0
- 2026Converse and Collision-Based Achievability for Node Localization with Hybrid Distance-Spectral Graph Positional Encodings31 Aug 2026
- 2026Eigenbasis-Independent Learnable Spectral Positional Encodings for Directed Graphs via Hermitian Block Krylov Subspaces8 Jul 2026
- 2026Size Transferability of Graph Transformers with Convolutional Positional Encodings16 Feb 2026
- 2026Principled Latent Diffusion for Graphs via Laplacian Autoencoders20 Jan 2026
- 2025Generalizable Insights for Graph Transformers in Theory and Practice11 Nov 2025
- 2025Toward General Digraph Contrastive Learning: A Dual Spatial Perspective18 Oct 2025
- 2025State Space Models over Directed Graphs17 Sep 2025
- 2025Long-Range Graph Wavelet Networks8 Sep 2025
- 2025SAFT: Structure-Aware Fine-Tuning of LLMs for AMR-to-Text Generation15 Jul 2025
- 2025Generating Directed Graphs with Dual Attention and Asymmetric Encoding19 Jun 2025
- 2025DualEquiNet: A Dual-Space Hierarchical Equivariant Network for Large Biomolecules10 Jun 2025
- 2025Directed Homophily-Aware Graph Neural Network28 May 2025
27 more
- 2025The informativeness of the gradient revisited28 May 2025
- 2025Toward Data-centric Directed Graph Learning: An Entropy-driven Approach2 May 2025
- 2025Efficient Learning on Large Graphs using a Densifying Regularity Lemma25 Apr 2025
- 2025Using Subgraph GNNs for Node Classification:an Overlooked Potential Approach9 Mar 2025
- 2025Understanding the Design Principles of Link Prediction in Directed Settings20 Feb 2025
- 2025Biologically Plausible Brain Graph Transformer13 Feb 2025
- 2025Rethinking Link Prediction for Directed Graphs8 Feb 2025
- 2025Learning Efficient Positional Encodings with Graph Neural Networks3 Feb 2025
- 2024Graph Neural Networks for Edge Signals: Orientation Equivariance and Invariance22 Oct 2024
- 2024Improving Graph Neural Networks by Learning Continuous Edge Directions18 Oct 2024
- 2024A Benchmark on Directed Graph Representation Learning in Hardware Designs9 Oct 2024
- 2024What Are Good Positional Encodings for Directed Graphs?30 Jul 2024
- 2024Graph Transformers: A Survey13 Jul 2024
- 2024Commute Graph Neural Networks30 Jun 2024
- 2024A Structure-Aware Lane Graph Transformer Model for Vehicle Trajectory Prediction30 May 2024
- 2024Spatio-Spectral Graph Neural Networks29 May 2024
- 2024Efficient Time Series Processing for Transformers and State-Space Models through Token Merging28 May 2024
- 2024Improving Chinese Character Representation with Formation Tree19 Apr 2024
- 2024Adaptive Critical Subgraph Mining for Cognitive Impairment Conversion Prediction with T1-MRI-based Brain Network20 Mar 2024
- 2024AUTONODE: A Neuro-Graphic Self-Learnable Engine for Cognitive GUI Automation15 Mar 2024
- 2024Revisiting Edge Perturbation for Graph Neural Network in Graph Data Augmentation and Attack10 Mar 2024
- 2024Comparing Graph Transformers via Positional Encodings22 Feb 2024
- 2023Expressive Sign Equivariant Networks for Spectral Geometric Learning4 Dec 2023
- 2023HoloNets: Spectral Convolutions do extend to Directed Graphs3 Oct 2023
- 2023Edge Directionality Improves Learning on Heterophilic Graphs17 May 2023
- 2023A Comprehensive Survey on Deep Graph Representation Learning11 Apr 2023
- 2023Attending to Graph Transformers8 Feb 2023
- 2023Edge Directionality Improves Learning on Heterophilic Graphscited by 88
- 2023Attending to Graph Transformerscited by 81
- 2023A Comprehensive Survey on Deep Graph Representation Learningcited by 72
- 2024Graph Transformers: A Surveycited by 32
- 2025Learning Efficient Positional Encodings with Graph Neural Networkscited by 21
- 2023HoloNets: Spectral Convolutions do extend to Directed Graphscited by 20
- 2024Comparing Graph Transformers via Positional Encodingscited by 20
- 2024Spatio-Spectral Graph Neural Networkscited by 17
- 2023Expressive Sign Equivariant Networks for Spectral Geometric Learningcited by 15
- 2025Biologically Plausible Brain Graph Transformercited by 9
- 2024What Are Good Positional Encodings for Directed Graphs?cited by 7
- 2024Commute Graph Neural Networkscited by 5
12 most cited of 37 All 37 (JSON)
- 2026Converse and Collision-Based Achievability for Node Localization with Hybrid Distance-Spectral Graph Positional Encodings31 Aug 2026
- 2026Eigenbasis-Independent Learnable Spectral Positional Encodings for Directed Graphs via Hermitian Block Krylov Subspaces8 Jul 2026
- 2026Size Transferability of Graph Transformers with Convolutional Positional Encodings16 Feb 2026
- 2025Generalizable Insights for Graph Transformers in Theory and Practice11 Nov 2025
- 2025Toward General Digraph Contrastive Learning: A Dual Spatial Perspective18 Oct 2025
- 2025State Space Models over Directed Graphs17 Sep 2025
- 2025Long-Range Graph Wavelet Networks8 Sep 2025
- 2025SAFT: Structure-Aware Fine-Tuning of LLMs for AMR-to-Text Generation15 Jul 2025
- 2025Generating Directed Graphs with Dual Attention and Asymmetric Encoding19 Jun 2025
- 2025DualEquiNet: A Dual-Space Hierarchical Equivariant Network for Large Biomolecules10 Jun 2025
- 2025Directed Homophily-Aware Graph Neural Network28 May 2025
- 2025The informativeness of the gradient revisited28 May 2025
12 newest of 37 All 37 (JSON)