SwinGNN: Rethinking Permutation Invariance in Diffusion Models for Graph Generation
Qi Yan, Zhengyang Liang, Yang Song, Renjie Liao, Lele Wang
TL;DR
SwinGNN rethinks permutation invariance in graph diffusion by embracing a non-invariant backbone that uses a 2-WL-inspired edge-to-edge transformer with shifted-window attention, coupled with an invariant-sampling trick via random permutations. The authors show that invariant losses induce target distributions with exponentially many modes, making learning harder, and demonstrate that invariant sampling can be achieved without invariant losses. Through SGD-based diffusion with EDM preconditioning and self-conditioning, SwinGNN achieves state-of-the-art results on synthetic, protein, and molecule graph generation tasks, while remaining scalable to graphs with hundreds of nodes. The combination of architectural design, training/sampling techniques, and a simple permutation-based sampling fix yields practical, high-quality graph generation with strong empirical validation and broad applicability.
Abstract
Diffusion models based on permutation-equivariant networks can learn permutation-invariant distributions for graph data. However, in comparison to their non-invariant counterparts, we have found that these invariant models encounter greater learning challenges since 1) their effective target distributions exhibit more modes; 2) their optimal one-step denoising scores are the score functions of Gaussian mixtures with more components. Motivated by this analysis, we propose a non-invariant diffusion model, called $\textit{SwinGNN}$, which employs an efficient edge-to-edge 2-WL message passing network and utilizes shifted window based self-attention inspired by SwinTransformers. Further, through systematic ablations, we identify several critical training and sampling techniques that significantly improve the sample quality of graph generation. At last, we introduce a simple post-processing trick, $\textit{i.e.}$, randomly permuting the generated graphs, which provably converts any graph generative model to a permutation-invariant one. Extensive experiments on synthetic and real-world protein and molecule datasets show that our SwinGNN achieves state-of-the-art performances. Our code is released at https://github.com/qiyan98/SwinGNN.
