Inference in Probabilistic Graphical Models by Graph Neural Networks

KiJung Yoon, Renjie Liao, Yuwen Xiong, Lisa Zhang, Ethan Fetaya, Raquel Urtasun, Richard S. Zemel, Xaq Pitkow · DOI

Introduction

Probabilistic Graphical Models (PGMs) are essential for representing complex dependencies between variables in machine learning. A central challenge in PGMs is "inference"—calculating marginal probabilities or identifying the most likely state (MAP inference). While exact inference is feasible for tree-structured graphs, most real-world applications involve "loopy" graphs with cycles, where inference is NP-hard.

Traditionally, researchers rely on approximate methods like Belief Propagation (BP). Although elegant, BP is designed for trees and often fails to converge or provides poor estimates on loopy graphs due to "echo chamber" effects. This research explores whether Graph Neural Networks (GNNs) can learn superior message-passing rules that naturally handle these complexities.

Methods: GNNs as Learned Message Passing

The authors utilize Gated Graph Neural Networks (GG-NNs) to perform inference. The iterative message-passing architecture of a GNN is viewed as a functional generalization of the BP algorithm. Instead of hand-crafted mathematical updates, GNNs use flexible, non-linear multi-layer perceptrons (MLPs) to transform messages, allowing the model to compensate for graph loops.

Two primary mapping strategies from PGMs to GNNs are explored:

  1. msg-GNN (Message-based): Each GNN node represents a message between variables in the original PGM, closely mimicking traditional BP.
  2. node-GNN (Variable-based): Each GNN node represents a variable in the PGM. This approach is more computationally efficient by avoiding explicit message representation.
Mapping a Factor Graph to GNN architectures: (b) message-based (msg-GNN) and (c) variable-based (node-GNN).

The models are trained via supervised learning on small PGMs (Ising models) where exact ground truth is calculable. The objective is to minimize the cross-entropy loss between GNN predictions and true marginals.

Experimental Setup and Datasets

The study evaluates performance on synthetic Binary Markov Random Fields across various topologies:

  • Structured Graphs: 13 classic topologies, including stars, grids, ladders, and complete graphs.
  • Random Graphs: Erdos-Renyi graphs with edge probabilities ($q$) ranging from 0.1 to 0.9.
  • Generalization: Models trained on 9-node graphs are evaluated on both 9-node (within-set) and 16-node (out-of-set) graphs to test structural generalization.

Key Results

The GNN approach demonstrates significant advantages over traditional algorithms like BP, Mean Field (MF), and Tree-reweighted BP (TRBP).

Performance comparison of GNNs against traditional inference algorithms across various graph structures (b) and edge probabilities (e).
  • Superior Accuracy: On loopy and dense graphs, GNNs often achieve an order of magnitude higher accuracy in terms of Kullback-Leibler (KL) divergence compared to BP.
  • Structural Generalization: Remarkably, GNNs trained on 9-node graphs successfully perform inference on 16-node graphs with different topologies, suggesting they learn fundamental local rules of probabilistic message passing.
  • Representation Efficiency: The simpler node-GNN performs comparably to the msg-GNN, indicating that explicit message representation is not strictly necessary to capture statistical dependencies.
  • Convergence and Robustness: Unlike BP, which may oscillate on loopy graphs, GNNs exhibit stable convergence. Furthermore, GNN performance degrades gracefully as graph density increases, whereas BP's accuracy drops sharply.

Limitations and Future Directions

While promising, the current approach faces scalability challenges due to its reliance on supervised learning with NP-hard ground truth labels. Future research could investigate unsupervised or reinforcement learning objectives to enable training on larger graphs. Additionally, extending these methods from binary Ising models to continuous or high-cardinality categorical variables remains an important area for development.

Summary updated

BibTeX
@inproceedings{yoon2018inference,
  author = {KiJung Yoon and Renjie Liao and Yuwen Xiong and Lisa Zhang and Ethan Fetaya and Raquel Urtasun and Richard S. Zemel and Xaq Pitkow},
  title = {{Inference in Probabilistic Graphical Models by Graph Neural Networks}},
  booktitle = {ACSSC},
  year = {2018},
  doi = {10.1109/ieeeconf44664.2019.9048920},
}
Figure