All models

Exphormer

A graph transformer whose sparse attention follows expander graph edges, virtual nodes and the input graph's edges.

Graphs and geometry · 683 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (76 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
111K
Operations
683
Framework
PyTorch
Recurrent
No
Published
ICML 2023
Cited by
26 (as of 22 October 2026)
Authors
Hamed Shirzad, Ameya Velingker, Balaji Venkatachalam and others
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m939
Graph hash
a2fc04e75998a8544660683636b41c15600bec54400cb00664b122245eaac684
Skeleton hash
09742d5333df97d4b8bf1e55fa420e5d545acfc675a003b074fa2e4bb2e9c538
Architecture hash
d8e7e5067a7eccb98dedfb710d1f4b3ffa56cb2b998776280a7c69908fc963be
Diagram SHA-256
15709a81e93d78b0e12025709681f7ef2a7e043aa2577247f7a2c5f362ae2322
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

This model is built from the repository's MNIST configuration, in which each graph is the 8-nearest neighbor graph of an image's superpixels and the task is 10-class graph classification.

About this model's family

Exphormer is a sparse attention mechanism for graph transformers: rather than every node attending to every other node, attention follows a small set of edges, and the cost is only linear in the size of the graph. The paper starts from the observation that it is hard to scale graph transformers to large graphs while keeping accuracy competitive with message-passing networks.

Attention runs over an interaction graph with three types of edges. The first come from a random regular expander graph of constant degree, a sparse graph that still introduces many short paths between distant nodes. The second connect a small number of virtual nodes to all the non-virtual nodes, and the third are the input graph's own edges, so each node attends to its immediate neighbors. The authors always use the local edges, but report that expander graphs and virtual nodes are not always helpful, and use both or only one depending on the dataset.

The models keep the GraphGPS architecture and replace only its transformer part. In the paper's comparison inside GraphGPS, Exphormer outperforms the BigBird and Performer sparse attention variants on each of four highlighted datasets. On ogbn-arxiv, a citation graph of over 160K papers where a dense transformer did not fit in memory on a 40GB GPU, the paper reports a test accuracy of 0.7244.

Key idea. The paper builds a sparse graph attention mechanism from expander graphs and virtual global nodes, giving graph transformers complexity linear in the size of the graph.

  • Exphormer
  • Exphormers
  • sparse transformers for graphs
  • graph transformer
  • expander graph
  • virtual nodes
  • sparse attention
  • graph classification
  • scalable graph transformer

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{shirzad2023exphormersparsetransformersgraphs,
      title={Exphormer: Sparse Transformers for Graphs}, 
      author={Hamed Shirzad and Ameya Velingker and Balaji Venkatachalam and Danica J. Sutherland and Ali Kemal Sinop},
      year={2023},
      eprint={2303.06147},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2303.06147}, 
}