Abstract
Generating graphs remains a significant challenge in machine learning due to the graph isomorphism problem—the lack of a canonical node ordering. The Discrete Graph Auto-Encoder (DGAE) introduces a novel two-stage generative framework that bridges the gap between permutation-invariant Graph Neural Networks (GNNs) and the powerful density-modeling capabilities of Transformers. By encoding graphs into sets of discrete, quantized node embeddings, DGAE transforms the complex graph generation task into a sequence modeling problem. This approach achieves state-of-the-art performance on molecular and synthetic benchmarks while delivering generation speeds up to 400 times faster than leading diffusion-based models.
Introduction
Graph generation is critical for applications ranging from drug discovery to social network analysis. However, a graph with $n$ nodes has $n!$ possible representations, making it difficult for models to learn a consistent structure. Existing methods typically choose between sequential models (like RNNs), which struggle with long-range dependencies, or permutation-invariant models (like GANs or Diffusion), which can be computationally expensive or fail to capture global distributions.
DGAE addresses these limitations by proposing a hybrid strategy: using GNNs for structural feature extraction and Transformers for global distribution modeling. The key innovation lies in converting a graph into a set of discrete tokens that can be easily ordered, bypassing the hardest aspects of the isomorphism problem.
The DGAE Framework
The DGAE architecture operates in two distinct stages: the discrete auto-encoder and the latent distribution model.
1. The Discrete Auto-Encoder
In the first stage, a Message Passing Neural Network (MPNN) serves as the encoder, converting the input graph $\mathcal{G}$ into a set of node embeddings. To overcome the inherent expressive limitations of standard MPNNs, the authors introduce $p$-path features—a feature augmentation technique that counts paths of length $p$ between nodes, allowing the encoder to perceive complex substructures.
Following encoding, the node embeddings undergo quantization. Inspired by VQ-VAEs, each embedding is partitioned into $C$ vectors and mapped to the nearest entry in a learned codebook. This process creates a discrete "bottleneck" that forces the model to focus on essential structural motifs. Finally, a decoder MPNN reconstructs the original graph's edges and attributes from these discrete tokens.
2. The Latent Distribution Model (The Prior)
Once the auto-encoder is trained, graphs are represented as sets of discrete indices. While sorting a graph is computationally difficult, sorting a set of vectors is trivial (e.g., by the value of the first codeword). This sorting step provides a unique sequence for each graph. A specialized 2D-Transformer is then trained to learn the distribution of these sequences auto-regressively, handling both the node dimension and the partition dimension of the latent data.
Experimental Results
The model was evaluated on several benchmarks, including synthetic graphs (Ego-Small, Community-Small), protein structures (Enzymes), and large molecular datasets (QM9 and Zinc250k).
Quality and Fidelity
DGAE demonstrates competitive performance against state-of-the-art (SOTA) models like DiGress and GDSS. On the Zinc250k dataset, it matched or exceeded SOTA metrics for structural integrity (NSPDK) and chemical validity (FCD), proving that the discrete latent space effectively captures the underlying distribution of complex graphs.
Generation Efficiency
The most striking result is the model's efficiency. Unlike diffusion models that require hundreds of iterative denoising steps, DGAE generates graphs in a single auto-regressive pass.
- QM9: DGAE generated 1,000 molecules in 0.33 seconds, compared to 54 seconds for DiGress.
- Zinc250k: DGAE achieved a 400x speedup, generating samples in 1.8 seconds versus 799 seconds for the diffusion baseline.
Conclusion and Future Work
DGAE represents a significant step forward in efficient graph generation. By leveraging quantization to simplify the graph isomorphism problem into a sequence modeling task, it achieves high-fidelity results with unprecedented speed. Future research directions include implementing conditional generation (e.g., targeting specific molecular properties) and optimizing the Transformer's attention mechanism to scale the model to even larger biological or social networks.
Summary updated