Neural Network Approximators for Marginal MAP in Probabilistic Circuits

Shivvrat Arya, Tahrima Rahman, Vibhav Giridhar Gogate

TL;DR

This paper introduces a novel self-supervised neural network approach (SSMP) to efficiently approximate the computationally hard Marginal Maximum-a-Posteriori (MMAP) inference task in Probabilistic Circuits (PCs). By learning a continuous approximation of the MMAP objective, SSMP achieves significantly faster inference times and comparable or better accuracy than existing methods, especially for complex queries.

What Problem Does This Paper Address?

Probabilistic Circuits (PCs), like Sum-Product Networks (SPNs), are powerful tools for representing complex probability distributions and excel at marginal inference (MAR) tasks, which can be solved efficiently in linear time. However, a more challenging inference problem, Marginal Maximum-a-Posteriori (MMAP), which combines marginalization and finding the most probable assignment for a subset of variables, remains NP-hard even for these expressive models. Existing approximate methods for MMAP are often slow or yield suboptimal solutions. This paper aims to bridge this gap by developing a fast and accurate approximate MMAP inference method for PCs using neural networks.

Methods

The core of the proposed method is a neural network (NN) that acts as an "optimizer" for MMAP queries. Given an assignment to evidence variables, the NN predicts an assignment for the query variables. The novelty lies in the self-supervised learning approach and the custom loss function.

Instead of relying on pre-computed optimal solutions (which are intractable to obtain), the authors propose a self-supervised loss function. This loss is derived from a modified Probabilistic Circuit called a Query-specific PC (QPC). In the QPC, the discrete leaf nodes corresponding to query variables are replaced with continuous outputs from the NN. The loss function is then constructed as the negative logarithm of the QPC's output, with an optional entropy-based penalty to encourage discrete-like solutions.

A key technical contribution is the demonstration that the gradient of this loss function can be computed efficiently in time linear to the size of the PC. This tractability allows for standard gradient-based optimization techniques to train the NN. The authors also propose an improvement to the loss function by incorporating an entropy-based penalty, controlled by a hyperparameter, to balance smoothness and accuracy.

Datasets

The paper evaluates its approach on a variety of datasets:

  • 22 widely used binary datasets from the tractable probabilistic models literature (referred to as TPM datasets).
  • Image datasets: binarized MNIST, EMNIST, and CIFAR-10.

For the image datasets, PCs were learned for each class, and then the top portion of the image was used as evidence, with the bottom portion as query variables.

Key Insights and Ideas

  • Learning to Optimize for MMAP: The paper successfully frames MMAP inference in PCs as an optimization problem that can be learned by neural networks, moving beyond traditional inference algorithms.
  • Self-Supervised Learning for Intractable Problems: By devising a self-supervised loss function derived from a modified PC (QPC), the method circumvents the need for ground truth optimal MMAP solutions, which are computationally infeasible to obtain.
  • Tractable Gradients for Continuous Approximations: The ability to compute gradients of the proposed loss function in linear time with respect to the PC size is crucial for enabling efficient NN training.
  • QPC as a Differentiable Surrogate: The Query-specific PC (QPC) acts as a differentiable surrogate for the MMAP objective, allowing gradient-based optimization.
  • SSMP as an Effective Initialization: The proposed method not only provides good standalone MMAP solutions but also serves as a strong initialization strategy for existing anytime local search algorithms, improving their performance.

Key Results

  • Superior Accuracy: SSMP consistently outperforms three baseline methods (Max, ML, Seq) in terms of log-likelihood scores across various datasets and query ratios, especially when the number of query variables is large.
  • Significant Speedup: SSMP achieves inference times in the order of 7-10 microseconds, making it approximately 1000 times faster than the Max approximation method, which takes 7 milliseconds. This speedup is independent of the PC size.
  • Effective Initialization: When used as an initial state for stochastic hill climbing, SSMP leads to better MMAP solutions compared to other baseline initializations.
  • Robustness: The method demonstrates strong performance across diverse datasets, including standard benchmarks and image completion tasks.

Limitations and Future Work

  • Fixed Query/Evidence Sets: The current approach assumes that the sets of evidence and query variables are known a priori and do not change. The authors suggest generalizing this to handle arbitrarily chosen query and evidence subsets as future work.
  • NN Architecture Independence: While the method is independent of the specific NN architecture, the performance might be further improved by tailoring the architecture to the specific PC.
  • Future Directions: The authors propose extending the approach to handle more complex queries involving constrained optimization, developing more sophisticated self-supervised loss functions, learning better NN architectures for given PCs, and generalizing to arbitrary query/evidence subsets.

Summary updated

BibTeX
@inproceedings{arya2024neural,
  author = {Shivvrat Arya and Tahrima Rahman and Vibhav Giridhar 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