Diffusion Models for Graphs Benefit From Discrete State Spaces

Kilian Konstantin Haefeli, Karolis Martinkus, Nathanaël Perraudin, Roger Wattenhofer

TL;DR

Most graph diffusion models perturb adjacency matrices using continuous Gaussian noise, forcing networks to waste capacity learning how to produce discrete outputs. By switching to a discrete Markov noise process that directly flips edge states, this paper cuts denoising steps from 1,000 down to 32 (~30× speedup) while reducing generation error (MMD) by roughly 1.5×.

What Problem Does This Paper Address?

Denoising diffusion probabilistic models (DDPMs) and score-matching methods generate high-quality samples by learning to reverse a gradual noising process. However, when applied to graphs, existing models typically treat the discrete adjacency matrix as continuous data corrupted by Gaussian noise.

This mismatch introduces severe drawbacks:

  1. Wasted expressive capacity: The neural network spends significant representational power learning that intermediate states should map back to discrete {0, 1} adjacency values.
  2. Slow sampling: Continuous score-based graph models typically require 1,000 sampling steps to produce clean graph structures.
  3. Invalid intermediate states: At arbitrary steps $t$, intermediate samples are dense real-valued matrices rather than valid graphs.

Methods

The authors formulate a Discrete DDPM specifically tailored for simple symmetric graphs:

  • Discrete Forward Process: Each edge/non-edge entry $A_{ij}$ is represented as a one-hot state in $\{0, 1\}^2$. Noise is introduced via a transition matrix $Q_t = \begin{bmatrix} 1-\beta_t & \beta_t \\ \beta_t & 1-\beta_t \end{bmatrix}$, where $\beta_t$ controls the probability of flipping an edge state. Over time, the graph converges to a maximum-entropy discrete prior: an Erdős–Rényi random graph ($p = 0.5$).
  • Closed-Form Transitions: The cumulative transition $\bar{Q}_t = \prod_{\tau=1}^t Q_\tau$ allows jumping directly to any arbitrary timestep $t$ in closed form without simulating intermediate steps.
  • Loss Functions:
  • Variational Lower Bound ($L_{vb}$): Optimizes the KL divergence between the true posterior $q(A_{t-1}|A_t, A_0)$ and the parameterized reverse process $p_\theta(A_{t-1}|A_t)$.
  • Simplified Loss ($L_{simple}$): An alternative objective parameterized to predict the clean graph $A_0$ directly via cross-entropy: $\mathcal{L}_{simple} = -\mathbb{E} [(1 - 2\bar{\beta}_t + \frac{1}{T}) \log p_\theta(A_0 | A_t)]$, placing higher weight on less-noisy states.
  • Architecture: In addition to testing an existing edge-prediction network (EDP-GNN), the authors adopt a Provably Powerful Graph Network (PPGN), which offers higher theoretical expressivity with an architectural pipeline simpler than previous graph score-matching models.

Datasets

The authors evaluate their approach on four synthetic and real-world benchmark datasets:

  • Ego-small: 200 ego-networks extracted from the Citeseer citation dataset ($4 \le n \le 18$).
  • Community-small: 100 synthetic two-community graphs generated via Erdős–Rényi models ($12 \le n \le 20$).
  • SBM-27: 200 synthetic graphs generated via a 3-community Stochastic Block Model ($24 \le n \le 27$).
  • Planar-60: 200 synthetic 2D planar graphs with 60 nodes ($n = 60$), generated using Delaunay triangulations of uniformly distributed 2D points.

Key Insights and Ideas

  • Preserving graph discreteness throughout diffusion: Because every step in the chain is an actual discrete graph, the network never has to learn the continuous-to-discrete projection.
  • The discrete formulation drives performance, not just architecture: Switching EDP-GNN from Gaussian score-matching to discrete diffusion with $L_{simple}$ slashed its average MMD on Community-small from 0.320 to 0.026. This demonstrates that discrete state spaces—not merely expressive architectures—are the primary driver of performance.
  • Steep sampling efficiency gains: A discrete noising chain reaches peak sample quality in only 32 to 48 steps, whereas Gaussian score-based models fail to reach equivalent quality even after 1,024 steps.

Key Results

  • Higher Graph Quality: On Ego-small and Community-small, the discrete model (PPGN Lsimple) achieved a total average Maximum Mean Discrepancy (MMD across degree, clustering, and orbit statistics) of 0.019, outperforming prior continuous baselines such as EDP-Score (0.031) and SDE-Score (0.032).
  • Scaling to Larger, Structured Graphs: On the larger Planar-60 dataset, PPGN Lsimple achieved a total MMD of 0.035 (and 0.038 on SBM-27), whereas the continuous baseline EDP-Score struggled heavily, yielding a total MMD of 1.266 (and 0.800 on SBM-27).
  • Speedup: Inference required only 32 steps (256 steps for Planar-60) compared to the 1,000 steps required by Gaussian score-matching—delivering up to a 30× speedup.

Limitations and Future Work

  • Uniform Edge Flip Probabilities: The model uses identical transition rates $\beta_t$ for edge additions and edge removals. Setting asymmetric probabilities for edges versus non-edges could better reflect sparse real-world graphs.
  • Simple Graph Restriction: The formulation evaluates unweighted, non-attributed edges and unfeatured nodes. Extending discrete transition matrices to handle multi-relational graphs and categorical node/edge features is natural but left for future implementation.
  • Graph Scale: Evaluated graphs remain relatively small ($\le 60$ nodes); testing discrete diffusion on graphs with thousands of nodes remains an open challenge.

Summary updated

BibTeX
@inproceedings{haefeli2022diffusion,
  author = {Kilian Konstantin Haefeli and Karolis Martinkus and Nathanaël Perraudin and Roger Wattenhofer},
  title = {{Diffusion Models for Graphs Benefit From Discrete State Spaces}},
  booktitle = {LoG},
  year = {2022},
  url = {https://openreview.net/forum?id=CtsKBwhTMKg},
}
Figure