Exphormer: Sparse Transformers for Graphs
Hamed ShirzadAmeya VelingkerBalaji VenkatachalamDanica J. SutherlandAli Kemal Sinop
Proposes a scalable graph transformer framework that uses expander graphs and virtual global nodes to achieve linear complexity while preserving the expressive power and theoretical guarantees of dense global attention.
Graph transformers are a powerful class of machine learning models for analyzing interconnected networks, such as molecules, social systems, and citation webs. While traditional graph neural networks often struggle to capture long-range relationships, standard dense graph transformers can capture these dependencies but suffer from quadratic computational and memory scaling. This quadratic bottleneck makes standard transformers prohibitively expensive or impossible to run on large graphs or with standard batch sizes. Previous sparse transformer alternatives, mostly adapted from natural language processing, frequently degrade predictive accuracy and still incur substantial computational overhead on graph data.
The article introduces and evaluates Exphormer, a graph-centric sparse attention framework designed to scale graph transformers to large networks while matching or exceeding the accuracy of dense models and local message-passing networks. Exphormer achieves linear computational and memory complexity relative to the number of nodes and edges by combining three complementary connectivity patterns: local neighborhoods from the input graph, random expander graphs of constant degree that facilitate rapid global information mixing, and virtual global connector nodes that serve as global storage sinks.
The authors conducted comprehensive empirical evaluations across 15 benchmark datasets encompassing image-derived graphs, synthetic community detection benchmarks, malware call graphs, molecular properties, and large citation and co-purchasing networks with up to 169,000 nodes and 1.1 million edges. The primary findings establish that Exphormer consistently outperforms existing sparse attention mechanisms, such as BigBird and Performer, across all evaluated tasks. Furthermore, Exphormer matches or beats dense graph transformers while using substantially fewer parameters (for instance, utilizing 90,000 parameters versus 340,000 on the Pattern dataset) and enabling much larger training batch sizes (such as scaling to a batch size of 256 on the MalNet-Tiny dataset where dense models ran out of memory at a batch size of 16). Exphormer achieved state-of-the-art results on several long-range graph benchmarks and scaled effectively to large graphs where standard transformers failed completely due to memory limits.
These findings demonstrate that organizations can deploy highly accurate, long-range graph transformer architectures at a fraction of the computational and hardware expense previously required. By reducing memory constraints from quadratic to linear, Exphormer mitigates hardware risks, shortens training runtimes, and extends state-of-the-art transformer modeling to large enterprise-scale graphs that were previously intractable. Additionally, theoretical analyses confirm that Exphormer retains spectral approximation and universal function approximation capabilities.
Practitioners implementing Exphormer should tailor the architecture to the specific graph domain, as ablation experiments indicate domain-dependent trade-offs: molecular tasks benefit heavily from virtual global nodes, whereas image-derived graphs benefit more from expander graph connections to avoid global information bottlenecks. While the empirical results are robust across diverse public benchmarks, the authors note that hyperparameter tuning over expander degrees and virtual node counts is necessary, and finding optimal network parameters for specific graph isomorphism tasks remains a theoretical rather than guaranteed algorithmic capability.
- Paper: Recipe for a General, Powerful, Scalable Graph Transformer, Ladislav Rampásek et al. (2022). This paper establishes the GraphGPS blueprint combining local message passing with linear global attention, which Exphormer directly adopts and accelerates using expander graphs.
- Paper: Big Bird: Transformers for Longer Sequences, Manzil Zaheer et al. (2020). This foundational work introduces sparse attention patterns utilizing global tokens, local windows, and expander/random graph mechanisms that motivate Exphormer's architectural design on graphs.
- Paper: Do Transformers Really Perform Badly for Graph Representation?, Chengxuan Ying et al. (2021). This paper introduces Graphormer and demonstrates how structural and positional encodings enable Transformers to capture graph-structured inductive biases effectively.
- Paper: Rethinking Attention with Performers, Krzysztof Choromanski et al. (2021). This work establishes linear-complexity attention approximations that provide foundational context for scalable transformer attention mechanisms.
- Paper: Your Transformer May Not be as Powerful as You Expect, Shengjie Luo et al. (2022). This paper analyzes the expressive power and theoretical limits of relative positional encodings in Transformer architectures, underpinning theoretical considerations in graph transformers.
- Paper: A Generalization of ViT/MLP-Mixer to Graphs, Xiaoxin He et al. (2023). This paper extends efficient, scalable graph representation learning by generalizing vision transformers and MLP-Mixer architectures with linear complexity via graph patching.
- Paper: Specformer: Spectral Graph Neural Networks Meet Transformers, Deyu Bo et al. (2023). This work investigates transformers operating directly across the graph spectral domain to capture global context and overcome spatial limitations.
- Paper: On Over-Squashing in Message Passing Neural Networks: The Impact of Width, Depth, and Topology, Francesco Di Giovanni et al. (2023). This work analyzes over-squashing and topological bottlenecks in message-passing architectures, providing deep theoretical foundations for why sparse global attention models like Exphormer are essential.
