Skip to main content
QUICK REVIEW

[Paper Review] Exphormer: Sparse Transformers for Graphs

Hamed Shirzad, Ameya Velingker|arXiv (Cornell University)|Mar 10, 2023
Advanced Graph Neural NetworksComputer Science7 citations
TL;DR

Exphormer introduces a sparse attention mechanism for graph transformers using virtual global nodes and expander graphs to achieve linear complexity in graph size, enabling scalable, accurate modeling on large graphs. It achieves state-of-the-art performance on multiple benchmarks, including 72.44% accuracy on ogbn-arxiv, and scales to graphs with up to 169K nodes where full-attention models fail due to memory constraints.

ABSTRACT

Graph transformers have emerged as a promising architecture for a variety of graph learning and representation tasks. Despite their successes, though, it remains challenging to scale graph transformers to large graphs while maintaining accuracy competitive with message-passing networks. In this paper, we introduce Exphormer, a framework for building powerful and scalable graph transformers. Exphormer consists of a sparse attention mechanism based on two mechanisms: virtual global nodes and expander graphs, whose mathematical characteristics, such as spectral expansion, pseduorandomness, and sparsity, yield graph transformers with complexity only linear in the size of the graph, while allowing us to prove desirable theoretical properties of the resulting transformer models. We show that incorporating Exphormer into the recently-proposed GraphGPS framework produces models with competitive empirical results on a wide variety of graph datasets, including state-of-the-art results on three datasets. We also show that Exphormer can scale to datasets on larger graphs than shown in previous graph transformer architectures. Code can be found at \url{https://github.com/hamed1375/Exphormer}.

Motivation & Objective

  • To address the quadratic memory and computational complexity of standard graph transformers, which limits scalability to large graphs.
  • To improve the performance and efficiency of sparse attention mechanisms in graph neural networks beyond sequence-optimized designs like BigBird and Performer.
  • To develop a theoretically grounded sparse attention mechanism that maintains expressive power while reducing parameters and training time.
  • To enable training of graph transformers on large-scale datasets (e.g., ogbn-arxiv with 169K nodes) that are infeasible for full-attention models due to memory constraints.
  • To integrate the sparse attention mechanism into the GraphGPS framework for competitive performance across diverse graph learning tasks.

Proposed method

  • Introduces virtual global nodes that connect to all other nodes, adding O(|V|) edges to provide long-range inductive bias.
  • Employs expander graphs as sparse overlay networks with O(|V|) edges, leveraging their spectral expansion and small diameter for efficient message passing.
  • Combines local neighborhoods, virtual nodes, and expander edges to form a hybrid attention mechanism that spectrally approximates full self-attention.
  • Uses mathematical properties of expanders—such as pseudorandomness and spectral approximation—to ensure the model captures global dependencies with minimal edges.
  • Implements the architecture within the GraphGPS framework, allowing modular integration with message-passing GNNs and various positional encodings.
  • Employs linear complexity attention by restricting attention to local neighbors, virtual nodes, and expander graph edges, reducing O(|V|²) complexity to O(|V|).

Experimental results

Research questions

  • RQ1Can a sparse attention mechanism based on virtual nodes and expander graphs achieve competitive performance with full-attention graph transformers while scaling to larger graphs?
  • RQ2Does the combination of expander graphs and virtual nodes provide better inductive bias for graph representation learning than existing sparse attention mechanisms?
  • RQ3Can Exphormer train on large graphs (e.g., ogbn-arxiv with 169K nodes) where full-attention models fail due to memory constraints?
  • RQ4How do the individual components—local neighborhoods, virtual nodes, and expander edges—contribute to performance, and which can be removed without loss?
  • RQ5Does Exphormer outperform or match the performance of full-attention models and other sparse transformers on standard graph benchmarks?

Key findings

  • Exphormer achieves state-of-the-art accuracy of 72.44% on ogbn-arxiv, a large-scale citation network with 169K nodes and 1.1M edges, where full-attention models fail due to memory constraints.
  • On the Amazon-Computer dataset, Exphormer achieves 90.74% accuracy, matching the best non-transformer method and outperforming other sparse transformers.
  • Exphormer enables training with a batch size of 256 on MalNet-Tiny, compared to only 16 with full-attention GraphGPS, due to reduced memory usage.
  • The model with both virtual nodes and expander edges achieves 72.44% accuracy on ogbn-arxiv, outperforming the version with only virtual nodes (72.22%) and significantly improving over MPNN baselines.
  • Exphormer scales to graphs with up to 35K nodes (e.g., Coauthor CS), where standard GraphGPS with full attention fails due to OOM issues.
  • Ablation studies show that while local neighborhoods consistently improve performance, the relative contribution of virtual nodes versus expander edges varies by dataset, with both components being beneficial in combination.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.