TL;DR
Can generative diffusion models compete with standard Graph Neural Networks (GNNs) on graph classification? This paper shows that score-based graph diffusion models can match or outperform discriminative baselines on benchmark datasets when paired with a novel discriminative training objective, graph permutation sampling, and fast approximate model selection.
What Problem Does This Paper Address?
Diffusion models have achieved dominant generative performance across images, audio, and text, and have even demonstrated zero-shot classification capabilities in the image domain (by scoring class-conditional likelihoods via Bayes' theorem).
In the graph domain, however, using generative diffusion models for classification remains virtually unexplored. Graph structures introduce distinct challenges:
- Complex, discrete non-Euclidean topologies.
- Sensitivity to node ordering (lack of permutation invariance in many high-performing architectures).
- The computational bottleneck of evaluating exact likelihood via Ordinary Differential Equation (ODE) solvers.
The authors set out to determine whether graph diffusion models can serve as competitive graph classifiers.
Methods
The authors build on SwinGNN, an expressive, score-based continuous diffusion model for graphs. To adapt it for classification, they introduce several key modifications:
- Class Conditioning: Graph labels are embedded and added to the diffusion noise embeddings before each layer.
- Hybrid Training Objectives: While standard training minimizes denoising score matching error ($\mathcal{L}_{\text{DEN}}$), pure generative training fails as a zero-shot classifier. The authors introduce a classification objective ($\mathcal{L}_{\text{CLF}}$)—a variational lower bound on training cross-entropy derived from denoising errors—and a joint objective $\mathcal{L}_{\text{SUM}} = \mathcal{L}_{\text{DEN}} + \mathcal{L}_{\text{CLF}}$ that preserves both generation quality and discriminative ability.
- Permutation Data Augmentation & Voting: Because SwinGNN is not permutation-equivariant, adjacency matrices are randomly permuted during training batches. At test time, predictions are generated across multiple permuted adjacency matrices ($P \in \{1, 3, 5\}$) and aggregated via majority voting.
- Fast Approximate Checkpoint Selection: Evaluating exact likelihood on validation graphs requires solving reverse-time ODEs (~20 minutes per fold on IMDB-B). Instead, the authors use the fast variational loss $\mathcal{L}_{\text{CLF}}$ for validation (~0.5 seconds per fold), delivering a >2000× speedup that makes fine-grained checkpoint selection practical.
Datasets
- Synthetic $K$-Regular Graphs: A binary dataset containing 500 4-regular and 500 6-regular graphs with an 80/10/10 train/val/test split.
- IMDB-BINARY (IMDB-B): A standard benchmark of movie actor/actress ego-networks categorized into Action vs. Romance genres. Evaluated with and without node features using a standardized 10-fold cross-validation split.
Key Insights and Ideas
- Pure Generative Training Falls Short for Graphs: In images, score-based models can classify zero-shot using pure generative training. On graphs, models trained purely with $\mathcal{L}_{\text{DEN}}$ struggle (achieving only 55.0% on IMDB-B with single-permutation exact inference). Adding the discriminative loss $\mathcal{L}_{\text{CLF}}$ dramatically bridges this gap.
-
Permutations Approximate Isomorphism Classes: Non-equivariant diffusion architectures can be substantially regularized by viewing graph probability as the expectation over all isomorphic adjacency permutations: $$\mathbb{E}_{A \in \Pi(G)} [p(A \mid y)]$$ Ensembling over permutations at test time consistently improves accuracy and cushions the model from outlier predictions.
-
Joint Objectives Yield Dual Capabilities: Using $\mathcal{L}_{\text{SUM}}$ produces models that simultaneously achieve top-tier classification accuracy and generate structurally valid, realistic graphs (as measured by MMD metrics over degree, clustering, and orbit distributions).
Key Results
- Competitive with Discriminative SOTA: On IMDB-BINARY without node features, the proposed method achieves $71.4 \pm 5.2\%$ accuracy, exceeding the best discriminative baseline (GraphSAGE at $69.9 \pm 4.6\%$). With node features, it achieves $72.1 \pm 2.2\%$, surpassing GIN ($71.2 \pm 3.9\%$).
- Synthetic Graph Accuracy: On synthetic $K$-regular graphs, the method achieves 100.0% classification accuracy across multiple configurations.
- Permutation Scaling: Increasing test-time permutations from $P=1$ to $P=5$ consistently improves test accuracy by 2% to over 10% across different configurations on IMDB-BINARY.
- Validation Efficiency: Checkpoint selection via approximate inference completes in ~0.5s versus ~20 minutes with exact ODE solving.
Limitations and Future Work
- Benchmark Scale: Experiments are limited to binary classification on synthetic and small social network benchmarks (IMDB-B); scaling to large multi-class datasets (e.g., molecular graphs) remains to be shown.
- Training Cost & Variance: Training generative diffusion models with random permutation augmentation is compute-intensive, which constrained hyperparameter tuning across cross-validation folds and contributed to higher test variance in certain settings.
- Sampling Exploration: For approximate inference, 300 noise samples were drawn per graph; analyzing the trade-offs of sample counts and optimizing ODE truncation during inference are left for future research.
Summary updated