Abstract
Learning to generate graphs is challenging as a graph is a set of pairwise connected, unordered nodes encoding complex combinatorial structures. Recently, several works have proposed graph generative models based on normalizing flows or score-based diffusion models. However, these models need to generate nodes and edges in parallel from the same process, whose dimensionality is unnecessarily high. We propose NVDiff, which takes the VGAE structure and uses a score-based generative model (SGM) as a flexible prior to sample node vectors. By modeling only node vectors in the latent space, NVDiff significantly reduces the dimension of the diffusion process and thus improves sampling speed. Built on the NVDiff framework, we introduce an attention-based score network capable of capturing both local and global contexts of graphs. Experiments indicate that NVDiff significantly reduces computations and can model much larger graphs than competing methods. At the same time, it achieves superior or competitive performances over various datasets compared to previous methods.
Introduction
Generating graphs—whether they represent life-saving drug molecules or complex social networks—is a notoriously difficult task in machine learning. Because graphs are defined by a set of nodes and their pairwise connections (edges), the search space is combinatorial and massive.
Most modern graph generators fall into two camps: autoregressive (adding nodes and edges one by one) or one-shot (generating everything at once). Autoregressive models are slow and depend heavily on node ordering, which is arbitrary in a graph. One-shot models, particularly recent score-based diffusion models like GDSS, are promising but suffer from a "dimensionality curse." Because these models diffuse both nodes and edges, they deal with an adjacency matrix that grows quadratically ($N^2$) with the number of nodes. NVDiff addresses this by asking: Can we generate a graph by only diffusing a single vector for each node?
Methodology
NVDiff utilizes a Latent Score-based Generative Model (LSGM) framework. The process works in three main stages:
- The Encoder (VGAE): A Graph Neural Network (GNN) maps an input graph into a latent space where each node is represented by a vector ($Z$).
- The Diffusion Prior (SGM): Instead of a simple Gaussian prior, NVDiff uses a score-based diffusion process to learn the distribution of these latent node vectors. To ensure permutation equivariance, the authors use Multi-Head Attention (MHA) and introduce a global "contextual vector" ($g_0$) that attends to all node vectors, carrying global graph information through the denoising process.
- The Decoder: Once the diffusion process samples a set of node vectors, a specialized GNN decoder reconstructs the final node features and edges. Crucially, the edges are inferred from the relationships between the latent node vectors, rather than being diffused themselves.
Key Results and Insights
The authors evaluated NVDiff on molecular datasets (QM9, ZINC250K) and generic graph datasets (Community, Ego).
On the ZINC250K dataset, NVDiff achieved a Fréchet ChemNet Distance (FCD) of 4.019, significantly outperforming the previous best score-based model, GDSS (14.656). For generic graphs, NVDiff consistently produced the best (lowest) MMD scores for degree distribution and orbit counts, capturing the topological "soul" of the graphs better than autoregressive baselines.
A major advantage of NVDiff is its scalability. By reducing the diffusion space to node vectors ($O(N)$ complexity), the model avoids the quadratic bottleneck of edge diffusion. This allows it to handle larger graphs where previous state-of-the-art models hit Out-of-Memory (OOM) errors. In runtime tests, NVDiff was substantially faster than competitors like GDSS or EDP-GNN, with the performance gap widening as the number of nodes increased.
Conclusion
NVDiff demonstrates that explicit edge diffusion is not necessary if latent node vectors are sufficiently coordinated during the diffusion process. While currently an unconditional generator, its efficiency and performance on large-scale graphs mark a significant step forward in graph generative modeling. Future work includes extending the framework to conditional generation for targeted molecule design and improving raw chemical validity scores.
Summary updated