Growing Better Graphs With Latent-Variable Probabilistic Graph Grammars

Xinyi Wang, Salvador Aguiñaga, Tim Weninger, David ChiangarXiv 2018

Abstract

Recent work in graph models has found that probabilistic hyperedge replacement grammars (HRGs) can be extracted from graphs and used to generate new random graphs with graph properties and substructures close to the original. In this paper, we show how to add latent variables to the model, trained using Expectation-Maximization, to generate still better graphs, that is, ones that generalize better to the test data. We evaluate the new method by separating training and test graphs, building the model on the former and measuring the likelihood of the latter, as a more stringent test of how well the model can generalize to new graphs. On this metric, we find that our latent-variable HRGs consistently outperform several existing graph models and provide interesting insights into the building blocks of real world networks.

Introduction

Generating realistic graphs—such as social networks, citation webs, or internet topologies—is a fundamental challenge in data science. While many generative models exist, they often struggle with two critical aspects: structural context and generalization.

Standard grammar-based models, like Probabilistic Hyperedge Replacement Grammars (HRGs), extract rules from a graph's tree decomposition. However, during generation, these rules are often applied without awareness of their global position (e.g., top vs. bottom of the tree), leading to structures that are "grammatically correct" but structurally unrealistic. Furthermore, evaluation typically focuses on how well a model mimics the training graph's properties (like degree distribution), which rewards memorization rather than true learning. This paper introduces laHRG, a model that addresses these issues by incorporating latent variables to capture deeper structural context.

Methodology: Latent-Variable Graph Grammars

The core of the proposed approach is the enhancement of HRGs through latent variables, a technique inspired by advancements in Natural Language Processing for string grammars.

Rule Extraction and Tree Decomposition

The process begins by converting a graph into a tree decomposition. Each node in this tree (a "bag") contains a subset of the graph's vertices. Rules are then extracted by identifying how one bag relates to its children.

A graph and its corresponding tree decomposition, which serves as the basis for extracting grammar rules.
Extraction of a hyperedge replacement rule from a specific node in the tree decomposition.

Nonterminal Splitting and EM Training

To provide context, the authors implement nonterminal splitting. Every nonterminal symbol in the grammar is split into $n$ "subsymbols" or latent variables. This effectively expands the state space, allowing the grammar to encode more context about where a rule is being applied, similar to how a higher-order Markov chain expands its state space.

To learn the probabilities of these refined rules, the Inside-Outside algorithm (a form of Expectation-Maximization) is employed. This dynamic programming approach calculates the probability of all possible derivations for a given graph, iteratively optimizing the rule weights.

Experimental Setup and Evaluation

The authors argue for a shift from heuristic metrics to log-likelihood on held-out test data. A superior model should assign a higher probability to a new, unseen graph of the same type. To handle structural "rules" in the test set never seen during training, a smoothing technique assigns a minimal probability ($\epsilon$) to unknown rules, preventing the total likelihood from dropping to zero.

The model was tested on various datasets, including synthetic models (Barabasi-Albert, Watts-Strogatz) and real-world networks such as citation networks (HepPh), internet topology (as-topo), and Amazon co-purchasing data.

Key Results and Insights

  • Superior Generalization: laHRG consistently achieved higher log-likelihood on test graphs compared to standard HRGs ($n=1$), Kronecker graphs, and Chung-Lu models.
  • Structural Accuracy: Using metrics like Graphlet Correlation Distance (GCD), laHRG outperformed or matched state-of-the-art baselines, demonstrating its ability to capture the fundamental "building blocks" of networks.
  • The Complexity Trade-off: Increasing the number of latent splits ($n$) improves performance up to a point. On real-world data, performance typically peaks at $n=2$ or $3$. Beyond this, the model begins to overfit the training data, leading to decreased performance on test sets.

Conclusion

By adding latent variables to HRGs, the laHRG model successfully captures the structural context necessary for generating realistic graphs that generalize well to unseen data. While the model introduces some computational complexity—the grammar size grows cubically with the number of splits—its ability to outperform traditional models on rigorous likelihood-based metrics marks a significant step forward in graph generation research. Future work may focus on pruning low-probability rules to create more efficient models.

Summary updated

BibTeX
@misc{wang2018growing,
  author = {Xinyi Wang and Salvador Aguiñaga and Tim Weninger and David Chiang},
  title = {{Growing Better Graphs With Latent-Variable Probabilistic Graph Grammars}},
  year = {2018},
  eprint = {1806.07955},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1806.07955},
}
Figure