A Tunable Model for Graph Generation Using LSTM and Conditional VAE

Shohei Nakazawa, Yoshiki Sato, Kenji Nakagawa, Sho Tsugawa, Kohei Watabe

Introduction

Graph generation is a vital task for applications ranging from simulating communication networks to designing new molecules. Historically, researchers have relied on two main approaches: statistical models and machine learning (ML) models. While statistical models are highly "tunable" (e.g., setting a specific scale-free parameter), they often fail to capture the multi-faceted complexity of real-world data. Conversely, ML models excel at learning complex patterns but typically operate as "black boxes," offering little control over specific structural properties.

This paper introduces the GraphGen-based CVAE, a model that bridges this gap by learning the general structure of a dataset while providing "knobs" (conditional vectors) to control specific graph properties like clustering or degree distribution.

Methodology

The proposed approach transforms graph topology into a controllable sequence generation problem using three core components:

  1. DFS Code Encoding: To handle the non-linear nature of graphs, the model uses "DFS code" to flatten a graph into a sequence of 5-tuples representing timestamps, labels, and edges.
  2. Conditional Variational Autoencoder (CVAE): Unlike standard VAEs, the CVAE is conditioned on an external feature vector containing specific graph metrics, such as the scaling exponent of the degree distribution.
  3. LSTM Architecture: Long Short-Term Memory (LSTM) networks serve as both the encoder and decoder. The encoder compresses the graph sequence into a latent "fingerprint," while the decoder reconstructs a new graph sequence based on this fingerprint and the desired conditional inputs.
Architecture of the LSTM-based Conditional Variational Autoencoder (CVAE) for graph generation.

Experimental Setup

The model was evaluated using a synthetic dataset generated by the Connecting Nearest Neighbor model, providing a ground truth with known structural features. The dataset consisted of 1,200 graphs (25 nodes each), divided into three groups of 400. Each group targeted different values for the scaling exponent (degree distribution) and the clustering coefficient.

Key Results and Discussion

The experiments demonstrated that the model is highly responsive to its conditional inputs. By treating graph generation as a sequence task, the model uses NLP-style logic to predict edges that respect global features.

Comparison of scaling exponents between training and generated data across different conditional vectors.

As shown in Figure 3, when the model was tasked with generating graphs with specific scaling exponents (-1.1, -0.8, and -0.5), the resulting outputs clustered tightly around these targets. This confirms that the conditional vector effectively guides the model during both training and generation. Furthermore, the generated data closely mirrored the distribution of the training data, indicating that the model respects specific conditional inputs rather than merely averaging features.

Conclusion and Future Work

While the results are promising, several challenges remain. The current evaluation relied on synthetic data; future work must verify performance on complex, real-world datasets like social or biological networks. Additionally, scaling sequence-based models to graphs with thousands or millions of nodes presents significant computational hurdles. Future research will focus on expanding the variety of controllable features and improving scalability for larger network structures.

Summary updated

BibTeX
@inproceedings{nakazawa2021tunable,
  author = {Shohei Nakazawa and Yoshiki Sato and Kenji Nakagawa and Sho Tsugawa and Kohei Watabe},
  title = {{A Tunable Model for Graph Generation Using LSTM and Conditional VAE}},
  booktitle = {ICDCS},
  year = {2021},
  doi = {10.1109/icdcs51616.2021.00119},
}
Figure