
Spexphormer
Graphs and geometry155 ops56.8K params
A two-stage sparse graph transformer: a narrow net picks the attention edges, a wide net trains on them.
Graphs and geometry · 155 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.
About this model's family
Spexphormer is a graph transformer trained in two stages so that it fits in far less memory than a full-attention model or even an Exphormer-style sparse one. The problem it attacks is that graph transformers need memory quadratic in the number of nodes, which keeps them off large graphs. Sparse variants such as Exphormer help, but they may still need high-degree augmentations of the input graph and do nothing to thin an already dense one. The observation behind the method is that attention scores on graphs stay quite consistent as the width of the network changes.
So the authors first train a narrow network on the full expander-augmented graph, then keep only the connections its attention actually used and train a wider network on that much sparser graph. Sparsification happens layer by layer, keeping a fixed number of edges per node in each attention layer, so the attention pattern can differ from one layer to the next. Two small changes make the narrow and wide networks agree better: the value vectors are normalised to a common length under one learnable global scale, and the attention temperature is annealed from 1.0 down to 0.05 over training. Only the transformer half of Exphormer is used, not its dual message-passing plus transformer design.
Both captured members run the same Sp_Exphormer code in its Actor configuration, taking sampled neighbourhood batches of 64 core nodes and returning five-way node logits. In the repository the first stage is called the attention score estimator; its scores are saved to disk and the Spexphormer run reads them back to do the sampling. The paper's experiments cover twelve medium-sized graphs, six homophilic and six heterophilic, with Actor among the heterophilic ones.
Key idea. Train a narrow graph transformer first to learn which attention edges matter, then train the wide model only on those edges, cutting memory drastically while keeping accuracy.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{shirzad2024sparsergraphtransformers,
title={Even Sparser Graph Transformers},
author={Hamed Shirzad and Honghao Lin and Balaji Venkatachalam and Ameya Velingker and David Woodruff and Danica Sutherland},
year={2024},
eprint={2411.16278},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2411.16278},
}