GRAM: Scalable Generative Models for Graphs with Graph Attention Mechanism

Wataru Kawai, Yusuke Mukuta, Tatsuya HaradaarXiv 2019

Abstract

Graphs are ubiquitous real-world data structures, and generative models that approximate distributions over graphs and derive new samples from them have significant importance. Among the known challenges in graph generation tasks, scalability handling of large graphs and datasets is one of the most important for practical applications. Recently, an increasing number of graph generative models have been proposed and have demonstrated impressive results. However, scalability is still an unresolved problem due to the complex generation process or difficulty in training parallelization. In this paper, we first define scalability from three different perspectives: number of nodes, data, and node/edge labels. Then, we propose GRAM, a generative model for graphs that is scalable in all three contexts, especially in training. We aim to achieve scalability by employing a novel graph attention mechanism, formulating the likelihood of graphs in a simple and general manner. Also, we apply two techniques to reduce computational complexity. Furthermore, we construct a unified and non-domain-specific evaluation metric in node/edge-labeled graph generation tasks by combining a graph kernel and Maximum Mean Discrepancy. Our experiments on synthetic and real-world graphs demonstrated the scalability of our models and their superior performance compared with baseline methods.

Introduction: The Scalability Wall in Graph Generation

Generating realistic, large-scale graphs with node and edge labels has long been a computational challenge. While graph generative models are essential for applications ranging from drug discovery to social network simulation, they frequently encounter a "scalability wall." This research defines the challenge through three lenses:

  1. Graph Scalability: The ability to handle individual graphs with thousands of nodes.
  2. Data Scalability: Efficiency in training on massive datasets with millions of examples.
  3. Label Scalability: Managing complex graphs where nodes and edges possess diverse types or labels.

Previous state-of-the-art models like DeepGMG suffer from $O(n^3)$ complexity, making them prohibitively slow for large graphs. Others, such as GraphRNN, struggle to incorporate node/edge labels and rely on sequential Recurrent Neural Networks (RNNs), which limits training parallelization.

Methodology: The GRAM Architecture

The proposed model, GRAM (Graph Generative Model with Graph Attention Mechanism), addresses these limitations by replacing sequential RNNs with a novel graph attention mechanism inspired by the Transformer architecture.

The overall architecture of GRAM, featuring the Feature Extractor, Node Estimator, and Edge Estimator components.

Core Innovations

  • Graph Attention with Relative Positional Encoding: Since graphs lack a natural linear order, GRAM introduces bias terms based on the shortest path length between nodes. This allows the attention mechanism to capture the underlying geometry and structural context of the network.
  • Autoregressive Generation: GRAM constructs graphs one node at a time. For each new node $s$, it predicts the node's label $X_s$ and then determines the edges $A_{t,s}$ connecting it to existing nodes $t < s$.
  • Complexity Reduction Variants: To enhance speed, two variants were developed:
  • GRAM-B (BFS): Utilizes Breadth-First Search ordering to restrict edge predictions to a "frontier" of active nodes.
  • GRAM-A (Zeroing): Deterministically ignores nodes unlikely to connect based on early attention weights, pruning the computation graph.

Unified Evaluation (GK-MMD)

To evaluate both topology and labels, the authors introduced GK-MMD, a metric combining Graph Kernels with Maximum Mean Discrepancy. This provides a robust, non-domain-specific measure of how well the generated distribution matches the target data.

Experimental Results

GRAM was evaluated on synthetic benchmarks (Grid, Community, Barabási-Albert) and real-world datasets (ZINC molecular database, Ego social networks, and Protein structures).

Comprehensive performance comparison of GRAM variants against baseline models across synthetic and real-world datasets.

Key Findings

  • Unprecedented Speed: By shifting from $O(n)$ sequential operations to $O(1)$ during training via attention, GRAM achieves significant acceleration. On the Protein dataset, GRAM-B was approximately 5x faster than GraphRNN.
  • High Fidelity Generation: On the ZINC molecular dataset, GRAM achieved a 92.7% validity rate and 100% uniqueness, vastly outperforming the modified GraphRNN baseline (11.1% validity).
  • Superior Scalability: While DeepGMG failed to complete training on larger datasets within reasonable timeframes (estimated >90 hours), GRAM processed them efficiently.

Conclusion and Future Work

GRAM demonstrates that attention-based mechanisms can overcome the scalability bottlenecks of RNN-based graph generation. By parallelizing training and incorporating structural biases, it handles large, labeled graphs with high quality and speed. Future research may explore beam search to mitigate error cascading during inference and further optimize feature extraction for extremely dense graphs.

Reference: Kawai, W., Mukuta, Y., & Harada, T. (2020). Scalable Generative Models for Graphs with Graph Attention Mechanism. ICLR 2020.

Summary updated

BibTeX
@misc{kawai2019gram,
  author = {Wataru Kawai and Yusuke Mukuta and Tatsuya Harada},
  title = {{GRAM: Scalable Generative Models for Graphs with Graph Attention Mechanism}},
  year = {2019},
  eprint = {1906.01861},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1906.01861},
}
Figure