Permutation Invariant Graph Generation via Score-Based Generative Modeling

Chenhao Niu, Yang Song, Jiaming Song, Shengjia Zhao, Aditya Grover, Stefano Ermon

Abstract

Learning generative models for graph-structured data is challenging because graphs are discrete, combinatorial, and the underlying data distribution is invariant to the ordering of nodes. However, most existing methods rely on fixed node orderings or expensive graph matching, which introduces bias or limits scalability. This paper introduces a novel approach to generating graphs by modeling the "score" (the gradient of the log-density) of the graph distribution. By designing a permutation-equivariant Graph Neural Network (GNN) called EDP-GNN, the authors create a generative model that is inherently permutation-invariant, avoiding the biases of previous autoregressive or VAE-based methods.

Introduction

Generating graphs is a fundamental task in machine learning with applications ranging from drug discovery to social network analysis. A core difficulty is permutation invariance: a single graph with $N$ nodes can be represented by up to $N!$ different adjacency matrices depending on node ordering. Existing models like GraphRNN (autoregressive) require picking a specific traversal order (e.g., BFS), which introduces artificial bias. Variational Autoencoders (VAEs) often struggle with the computational cost of graph matching for loss calculation. This work seeks a method that treats all equivalent representations of a graph identically without needing a canonical order.

Methodology: Score-Based Modeling with EDP-GNN

The proposed method leverages Score-Based Generative Modeling. Instead of modeling the probability density $p(x)$ directly, the model learns the score function: $\nabla_x \log p(x)$.

EDP-GNN Architecture

The core of the approach is the Edgewise Dense Prediction GNN (EDP-GNN). This architecture is designed to be permutation equivariant: if the input node order is swapped, the output predicted scores for the edges swap accordingly. This mathematical property guarantees that the learned distribution is permutation invariant.

Overview of the EDP-GNN architecture, showing the multi-channel adjacency matrix transformations and the permutation-equivariant flow.

Key technical features include:

  • Multi-Channel Adjacency Matrices: EDP-GNN transforms the input into multiple channels of adjacency matrices, enabling the capture of complex structural features beyond simple connectivity.
  • Annealed Langevin Dynamics: Generation starts with a random noise matrix. The model uses the learned score function to iteratively "denoise" the matrix, moving it toward high-probability regions of the graph distribution.
  • Quantization: The continuous scores are thresholded to produce a discrete 0/1 adjacency matrix.

Key Insights and Results

A powerful theoretical insight of this work is that equivariance implies invariance: a permutation-equivariant score function automatically represents a permutation-invariant scalar density function.

Denoising as Discovery

Visualizing the intermediate layers of EDP-GNN reveals that the model learns to map a structureless noisy graph to a clean, structured one. The multi-channel approach allows the model to "discover" community structures during the generation process.

Visualization of the intermediate layers and channels in EDP-GNN, illustrating how the model progressively discovers graph structure.

Experimental Performance

The model was evaluated on benchmark datasets including Community-small and Ego-small.

  • Algorithm Learning: EDP-GNN significantly outperformed vanilla Graph Isomorphism Networks (GIN) in predicting edges for Shortest Path (SP) and Maximum Spanning Tree (MST) tasks. For weighted SP, EDP-GNN achieved 0.92 accuracy compared to GIN's 0.12.
  • Generation Quality: Using Maximum Mean Discrepancy (MMD) metrics, the model achieved results comparable to or better than state-of-the-art models like GraphRNN and GNF.

Conclusion

EDP-GNN provides a robust framework for permutation-invariant graph generation. While it shows strong performance on small graphs, future work must address scalability for larger networks, as the $O(N^2)$ memory requirement for full adjacency matrices remains a bottleneck. Additionally, improving the transition from continuous dynamics to discrete structures through more sophisticated sampling could further enhance generation quality.

Summary updated

BibTeX
@inproceedings{niu2020permutation,
  author = {Chenhao Niu and Yang Song and Jiaming Song and Shengjia Zhao and Aditya Grover and Stefano Ermon},
  title = {{Permutation Invariant Graph Generation via Score-Based Generative Modeling}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2020},
  url = {https://openreview.net/forum?id=xtPZtC1bBVQ},
}
Figure