Neural Graph Generator: Feature-Conditioned Graph Generation using Latent Diffusion Models

Iakovos Evdaimon, Giannis Nikolentzos, Michail Chatzianastasis, Hadi Abdine, Michalis VazirgiannisarXiv 2024 · DOI

Abstract

Generating graphs that adhere to specific structural constraints is a complex task in domains ranging from drug discovery to social network analysis. We present the Neural Graph Generator (NGG), a novel framework that leverages latent diffusion models to generate graphs conditioned on desired structural properties. By operating in a compressed latent space rather than on raw adjacency matrices, NGG achieves high efficiency and scalability. Our results demonstrate that NGG significantly outperforms state-of-the-art Large Language Models (LLMs) in both generation accuracy and speed, while maintaining the ability to generalize to unseen graph configurations.

Introduction

Realistic graph generation is essential for modeling complex systems. However, existing methods often face a trade-off between simplicity and computational feasibility. Traditional models like Erdős–Rényi are too simple to capture complex patterns, while deep learning approaches that operate directly on large adjacency matrices suffer from quadratic complexity. Furthermore, "controlling" the output of these models—such as requesting a specific clustering coefficient or degree distribution—typically requires retraining from scratch.

The Neural Graph Generator (NGG) addresses these challenges by providing a "promptable" model. It can generate diverse graphs based on a vector of desired characteristics, offering a scalable and flexible solution for conditional graph generation.

Methodology

The NGG architecture adopts a two-stage approach, drawing inspiration from the success of latent diffusion in the image domain.

1. Graph Compression (VGAE)

The first stage involves training a Variational Graph Autoencoder (VGAE). An encoder, utilizing Graph Isomorphism Network (GIN) layers, compresses the input graph $G$ into a low-dimensional latent vector $\mathbf{z}$. A corresponding decoder learns to reconstruct the adjacency matrix from this latent representation.

2. Latent Diffusion and Conditioning

Instead of diffusing the high-dimensional graph structure, NGG performs the diffusion process within the latent space. The model learns to denoise a random vector into a valid latent representation $\mathbf{z}_T$.

The NGG architecture overview, showing the integration of VGAE for latent compression and a conditioned diffusion process.

The core innovation lies in the Feature Conditioning mechanism. The denoising model is conditioned on a vector of 15 graph properties, including the number of nodes, edges, diameter, and clustering coefficient. These properties are encoded and concatenated with the latent vector, guiding the diffusion process to produce a graph that matches the specified statistics.

Data and Benchmarking

To train and evaluate NGG, the authors introduced a massive synthetic dataset comprising 1 million graphs. This benchmark covers 17 distinct graph families, such as Barabási-Albert (scale-free), Watts-Strogatz (small-world), and stochastic block models. The dataset includes graphs with up to 100 nodes, providing a diverse "vocabulary" of structures that allows the model to learn underlying structural principles and generalize to unseen configurations.

Results and Analysis

Performance and Accuracy

NGG achieves significantly lower Mean Absolute Error (MAE) and Symmetric Mean Absolute Percentage Error (SMAPE) compared to standard VGAE baselines across all 15 conditioned properties. The model also demonstrates a robust ability to handle missing data; when only a subset of properties is provided, NGG infers the remaining characteristics to produce realistic graphs.

Efficiency and Comparison with LLMs

A key finding of this research is the comparison between NGG and Large Language Models like Llama 3 and GPT-3.5. While LLMs are powerful general-purpose tools, they struggle with the global structural constraints of graphs. NGG is approximately 1,000 times faster than LLMs at generating graphs and requires significantly less GPU memory.

Generalization

NGG exhibits remarkable extrapolation capabilities. When trained on graphs with up to 50 nodes, it can successfully generate reasonable graphs with more than 50 nodes, suggesting it learns fundamental structural rules rather than memorizing specific templates.

Conclusion

The Neural Graph Generator represents a significant step forward in conditional graph generation. By combining the efficiency of latent diffusion with a flexible conditioning mechanism, it provides a powerful tool for researchers. Future work will focus on improving local precision (e.g., exact triangle counts) and scaling the framework to handle real-world networks with thousands or millions of nodes.

Summary updated

BibTeX
@misc{evdaimon2024neural,
  author = {Iakovos Evdaimon and Giannis Nikolentzos and Michail Chatzianastasis and Hadi Abdine and Michalis Vazirgiannis},
  title = {{Neural Graph Generator: Feature-Conditioned Graph Generation using Latent Diffusion Models}},
  year = {2024},
  eprint = {2403.01535},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.01535},
}
Figure