Neural Network Approximators for Marginal MAP in Probabilistic Circuits

Shivvrat Arya, Tahrima Rahman, Vibhav Gogate · DOI

Abstract

Solving Marginal Maximum-a-Posteriori (MMAP) inference in Probabilistic Circuits (PCs) is a notoriously difficult NP-hard problem. This paper introduces SSMP (Self-Supervised Marginal MAP), a novel neural network approach that learns to predict near-optimal MMAP solutions in linear time. By utilizing a continuous relaxation of query variables and a self-supervised loss function, SSMP bridges the gap between fast but inaccurate heuristics and slow, search-based exact methods. Experimental results demonstrate that SSMP significantly outperforms traditional linear-time approximations in both speed and accuracy across various benchmarks.

Introduction

Probabilistic Circuits (PCs) are a class of deep generative models prized for their tractability. They can compute marginal probabilities—the likelihood of some variables given others—in time that scales linearly with the size of the network. However, this tractability has limits. The task of finding the Marginal Maximum-a-Posteriori (MMAP) assignment—identifying the most likely values for a subset of variables while marginalizing out others—remains NP-hard.

In practice, researchers often rely on "polytime" approximations like the Max-product algorithm. While fast, these methods frequently yield solutions far from the global optimum. This research aims to provide the speed of a linear-time approximation with the high-quality results typically reserved for complex search-based methods.

Methodology: Self-Supervised Marginal MAP

The core of the proposed approach is SSMP, which trains a Neural Network (NN) to act as an efficient MMAP approximator. Unlike standard supervised learning, which requires computationally expensive ground-truth labels, SSMP uses a self-supervised objective.

Continuous Relaxation and the QPC

To enable gradient-based training, the authors introduce the Query-specific PC (QPC). In a QPC, the discrete query variables of the original circuit are replaced with continuous values output by the NN. By treating these assignments as continuous values in the range [0, 1], the probability of an assignment becomes a differentiable multilinear function.

Comparison between a standard Probabilistic Circuit (PC) and the proposed Query-specific PC (QPC) used for continuous relaxation during training.

Training Objective

The NN is trained to maximize the probability of its predicted assignments directly through the PC. The authors prove that the gradient of this loss function can be computed in linear time relative to the PC's size, allowing for standard backpropagation. To ensure the NN eventually outputs "sharp" binary assignments (0 or 1) rather than ambiguous probabilities, an entropy-based penalty is added to the loss function.

Experimental Setup

The researchers evaluated SSMP across a diverse set of benchmarks:

  • TPM Datasets: 22 standard binary datasets (e.g., NLTCS, MSNBC, KDD, Plants).
  • Image Datasets: Binarized versions of MNIST, EMNIST, and CIFAR-10.
  • Baselines: SSMP was compared against three common linear-time approximations: Max Approximation, Maximum Likelihood (ML) Approximation, and Sequential Estimation.

Key Results

SSMP demonstrated a clear advantage over traditional heuristics in both performance and efficiency:

  • Superior Accuracy: In contingency table evaluations across 154 test cases, SSMP outperformed the standard "Max" approximation in approximately two-thirds of the MPE and MMAP tasks.
  • Massive Speedups: At inference time, SSMP is nearly 1,000 times faster than the Max-product baseline, reducing computation time from milliseconds to microseconds.
  • Visual Coherence: In image completion tasks, SSMP produced significantly smoother and more visually coherent reconstructions compared to the Max method, which often resulted in disjointed or "broken" character outputs.
Performance comparison table showing the number of times each method (rows) outperformed others (columns) across 154 MPE and MMAP test cases.

Insights and Future Work

A key insight of this work is the decoupling of inference from model size. In traditional methods, inference time is strictly tied to the complexity of the PC. With SSMP, once the NN is trained, inference speed is determined solely by the NN's architecture. Furthermore, SSMP provides an excellent "warm start" for local search algorithms like Hill Climbing, leading to better final solutions than those initialized with traditional heuristics.

Future work includes generalizing the NN to handle arbitrary, "on-the-fly" query subsets without retraining and exploring more specialized architectures like Graph Neural Networks to further enhance performance. Additionally, incorporating hard logical constraints into the loss function could ensure that predictions always fall within a valid state space.

Summary updated

BibTeX
@inproceedings{arya2024neural,
  author = {Shivvrat Arya and Tahrima Rahman and Vibhav Gogate},
  title = {{Neural Network Approximators for Marginal MAP in Probabilistic Circuits}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i10.28966},
}
Figure