PolynormerAttention
A linear-time graph transformer whose attention scores are coefficients of a high-degree polynomial of node features.
Graphs and geometry · 20 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.
At a glance
- Task
- Graphs and geometry
- Parameters
- 1.1M
- Operations
- 20
- Framework
- PyTorch
- Recurrent
- No
- Published
- ICLR 2024
- Cited by
- 7 (as of 19 October 2026)
- Authors
- Chenhui Deng, Zichao Yue, Zhiru Zhang
- Source
- torch_geometric 2.7.0
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
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.
Details
- Stable ID
- m2262
- Graph hash
- e7662cce36ff7be7981cbad0282ee83ad1c3af973d230c42cc2444eb4785e00f
- Skeleton hash
- 2024842084b64f678627340761e18c76e3094b2e98550c33337fd395024fdd46
- Architecture hash
- f536bb95725c26c1d0d34642c88a6d4a764f79e67f7501b3fbe65dcb3e167a4e
- Diagram SHA-256
- 0a6b384ca4db5dfe00241c85afeacd53d89bde4e5db197bdf10187288184d9a3
- 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
How this diagram was made
torch_geometric.nn.attention.PolynormerAttention(channels=512, heads=8, head_channels=64, beta=0.9, qkv_bias=False, qk_shared=True, dropout=0.0)
What it is
This page's module is the attention mechanism alone, the linear global attention computed with a kernel trick. By default the query and key share one set of weights.
Polynormer is a graph transformer for node classification that keeps linear complexity in the graph size while learning high-degree polynomial functions of the node features. It targets a known tension: graph transformers are theoretically more expressive than message-passing networks, but typical ones have at least quadratic complexity and cannot scale to large graphs.
Each layer of the base model multiplies an attention-weighted mix of the features elementwise by the features plus a bias. The paper proves that the polynomial expressivity of this base model increases exponentially with the number of layers. Imposing permutation equivariance on the coefficients through graph topology and through node features separately gives local and global attention models. Local attention uses a sparse attention matrix whose nonzero entries are scores between adjacent nodes. Global attention is linearized with a kernel trick that applies a sigmoid to the queries and keys. ReLU can optionally be added to each layer, and that version is denoted Polynormer-r.
The paper compares Polynormer against 22 GNN and graph transformer baselines on 13 node classification datasets with up to millions of nodes. On heterophilic graphs it reports that Polynormer surpasses all baselines on 4 of 5 datasets, with Polynormer-r ahead on all of them by up to 3.55% on minesweeper. On the large graphs Polynormer-r outperformed all baselines, with an accuracy gain of up to 4.06%.
Key idea. Polynormer learns high-degree, permutation-equivariant polynomials of node features through local-to-global attention whose coefficients are attention scores, at linear cost in graph size.
- polynormer
- polynomial-expressive graph transformer
- graph transformer
- linear attention
- node classification
- local-to-global attention
- equivariant polynomial
- heterophilic graphs
- polynormerattention
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{deng2024polynormerpolynomialexpressivegraphtransformer,
title={Polynormer: Polynomial-Expressive Graph Transformer in Linear Time},
author={Chenhui Deng and Zichao Yue and Zhiru Zhang},
year={2024},
eprint={2403.01232},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2403.01232},
}