
SGFormerAttention
Graphs and geometry28 ops12.3K params
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
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.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
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.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@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},
}