All models

SwinGNN

Non-invariant graph diffusion model that denoises adjacency matrices with shifted-window self-attention.

Graphs and geometry · 786 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 (52 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
15.3M
Operations
786
Framework
PyTorch
Recurrent
No
Published
TMLR 2024
Cited by
1 (as of 30 October 2026)
Authors
Qi Yan, Zhengyang Liang, Yang Song 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
m20677
Graph hash
bfbdbf50f6d8b2e08fd3545a730555035e19b327445a15bb2881a93eff0bbd07
Skeleton hash
6f01150755b55e881b31c646647241d9496c205a1760cac088ea9299aca54d72
Architecture hash
c5f560558b70bfdd13c2ba448315d4c54680d22afadd74d2a6523f4fa37c2c7a
Diagram SHA-256
b44197866e929ce66793ec576895d52f481b7e6199d5751131e10d5ce9af9a77
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

SwinGNN is a non-invariant diffusion model for graph generation. The paper argues that permutation-invariant diffusion models are harder to train because their effective target distributions exhibit more modes. Invariant sampling is recovered afterwards by randomly permuting the generated graphs, which the paper shows provably converts any graph generative model to a permutation-invariant one.

The network treats each edge value in the input matrix as a token and updates the tokens with self-attention. Attention is computed inside local windows, and regular and shifted windows alternate to approximate dense edge-to-edge interactions, a technique taken from SwinTransformers. Downsampling layers split the edge representation tensor into four half-sized tensors by index parity along rows and columns, which builds a hierarchy of graph representations.

Training adopts the network preconditioning of the Elucidating Diffusion Model (EDM). It also uses self-conditioning, which lets the diffusion model rely on a sample it created itself. The paper tries two sizes, standard SwinGNN with 60-dim tokens and SwinGNN-L with 96-dim tokens. On the grid dataset the paper reports training approximately 7 times faster and inference about 4 times faster than DiGress with a similar number of trainable parameters.

Key idea. SwinGNN is a non-invariant graph diffusion model that approximates 2-WL message passing with shifted-window self-attention and regains permutation-invariant sampling by randomly permuting generated graphs.

  • SwinGNN
  • graph generation
  • graph diffusion model
  • permutation invariance
  • non-invariant diffusion model
  • molecule generation
  • 2-WL message passing
  • shifted window self-attention
  • adjacency matrix denoising

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

Cite the paper

@misc{yan2024swingnnrethinkingpermutationinvariance,
      title={SwinGNN: Rethinking Permutation Invariance in Diffusion Models for Graph Generation}, 
      author={Qi Yan and Zhengyang Liang and Yang Song and Renjie Liao and Lele Wang},
      year={2024},
      eprint={2307.01646},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2307.01646}, 
}