All models

SGFormer

SGFormer, a graph model that adds one layer of linear global attention to a shallow GNN for node prediction.

Graphs and geometry · 233 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 (12 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

Family
SGFormer
Parameters
213.8K
Operations
233
Framework
PyTorch
Recurrent
No
Published
NeurIPS (arXiv 2023)
Cited by
64 (as of 21 October 2026)
Authors
Qitian Wu, Wentao Zhao, Chenxiao Yang 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
m2673
Graph hash
33de61df18f25fe4dee931a9fb23a71efe2c5efee4a8421b409878e4996253a8
Skeleton hash
d295a939828650a469b84ae724a60fea8577742a41b287bc2d4cd1784809e3ea
Architecture hash
31d5a3586897becf0ebc269f7a53e99892af69ead9b4335d2830ff1709a4be20
Diagram SHA-256
037a9a998f4dfa1096728ae920e90f235cada8371b5d70ab816e955a1de47785
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

SGFormer is a graph model with a simple architecture: a one-layer global attention and a shallow graph neural network (GNN). The name is short for Simplified Graph Transformers. The authors wrote it against a trend they saw in graph Transformers, which stack deep multi-head attention layers as vision and language models do.

Here a single attention layer lets the information of each node reach arbitrary nodes within the batch. The attention function is linear in the number of nodes, where the paper puts the Softmax attention of the original Transformers at quadratic cost. Graph structure enters at the output layer, where the attention result is combined with embeddings propagated by a GNN. That GNN can be a simple architecture such as GCN. SGFormer does not require positional encodings, feature or graph pre-processing, extra loss functions or edge embeddings.

The paper reports that SGFormer scales to the web-scale graph ogbn-papers100M, which has 0.1B nodes. On medium-sized graphs it reports speedups of up to 37x in training time and 141x in inference time over scalable Transformers. The authors' repository says SGFormer is built upon their previous works NodeFormer and DIFFormer.

Key idea. The paper shows that a one-layer attention model combined with a vanilla GCN gives competitive results on node property prediction benchmarks.

  • sgformer
  • simplified graph transformers
  • graph transformer
  • large graphs
  • linear attention
  • global attention
  • node classification
  • node property prediction
  • graph neural network

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

Cite the paper

@misc{wu2024sgformersimplifyingempoweringtransformers,
      title={SGFormer: Simplifying and Empowering Transformers for Large-Graph Representations}, 
      author={Qitian Wu and Wentao Zhao and Chenxiao Yang and Hengrui Zhang and Fan Nie and Haitian Jiang and Yatao Bian and Junchi Yan},
      year={2024},
      eprint={2306.10759},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2306.10759}, 
}