Tractable Mode-Finding in Sum-Product Networks with Gaussian Leaves

Tiago Madeira, Denis Deratani Mauá2022 · DOI

Abstract

In this work, we leverage the relation between Sum-Product Networks (SPNs) and Gaussian mixtures to propose an algorithm that adapts the Expectation-Maximization method to efficiently find the modes of SPNs with Gaussian leaves. We discuss how the algorithm can be used to perform Maximum-A-Posteriori inference in SPNs learned from continuous data with theoretical advantages over the existing methods in the literature, and how it can be used to shrink the size of learned models. As an additional example of the use of the algorithm, we perform an SPN-based hierarchical clustering of digit images. Thus, our proposed algorithm can be used for model analysis, model compression, and exploratory data analysis.

Introduction

Sum-Product Networks (SPNs) have emerged as a powerful class of deep probabilistic models. Their primary appeal lies in their ability to perform exact marginal and conditional inference in linear time relative to the size of the network. However, one fundamental task remains computationally difficult: finding the mode, or the single most likely point in the distribution.

In practical applications such as image completion, signal denoising, or classification, we often require the "best guess" for missing or latent variables, a process known as Maximum-A-Posteriori (MAP) inference. Unfortunately, finding the global mode in a general SPN is NP-hard. While greedy approximations like the "Max-Product" algorithm exist, they frequently fail to find even local maxima of the actual joint density. This research introduces a mathematically principled and efficient method to navigate the complex probability landscapes of Gaussian SPNs (GSPNs) to locate these peaks.

The Exponential GMM Perspective

A key insight of this work is the structural relationship between SPNs and Gaussian Mixture Models (GMMs). Any GSPN with univariate Gaussian leaves is mathematically equivalent to a GMM. However, unlike a standard GMM which might contain a few dozen components, an SPN represents a mixture with a number of components that grows exponentially with the height of the network.

Decomposition of an SPN into a weighted sum of induced trees, illustrating its equivalence to a large Gaussian Mixture Model.

As shown in the figure above, the SPN can be decomposed into a weighted sum of "induced trees." Each tree represents a product of leaf distributions, effectively acting as a single component in a massive mixture. The challenge lies in performing inference over this astronomical number of components without explicitly enumerating them.

Methods: Modal EM for GSPNs

To find the modes of these complex distributions, the authors adapt the Modal EM algorithm. While standard EM is typically used for parameter estimation, Modal EM is designed to find the local maxima (modes) of a fixed, known distribution.

For GSPNs, the authors demonstrate that both the E-step and M-step of Modal EM can be computed efficiently in a single bottom-up pass through the network graph. The algorithm propagates two specific values ($N$ and $D$) for each random variable at every node. Upon reaching the root, it calculates a new point $x^{(r+1)}$ that is guaranteed to have a higher probability density than the previous point $x^{(r)}$. This process is repeated until convergence to a local maximum.

A Gaussian Sum-Product Network (a, b) and its resulting multi-modal probability density surface (c).

The figure above illustrates how a simple SPN structure (a, b) generates a complex, multi-modal probability density surface (c). The proposed algorithm allows for efficient "hill-climbing" on this surface to find the peaks ($x_1, x_2$) that represent the most likely states of the system.

Key Insights and Efficiency

  • Linear Time Complexity: Despite the underlying exponential complexity of the mixture, each iteration of the Modal EM algorithm takes only $\Theta(n|S|)$ time, where $n$ is the number of variables and $|S|$ is the number of nodes in the network.
  • Stationary Point Guarantee: Unlike greedy search methods (e.g., Max-Product), Modal EM provides a guarantee of converging to a stationary point, ensuring more reliable MAP inference.
  • Model Compression: The algorithm enables a novel form of model compression. By identifying the unique modes of a large, complex SPN and then training a new, smaller SPN on just those modes, researchers can create a compact model that retains the essential "diversity" of the original data.

Experimental Results: MNIST Clustering

The algorithm was evaluated using the MNIST database, specifically focusing on the digit "0". The researchers first learned a large GSPN (74,556 nodes) from nearly 6,000 images. By running Modal EM starting from every data point, they identified 201 unique modes.

In a second iteration, they trained a new SPN using only these 201 modes as training data. This resulted in a significantly smaller network (7,851 nodes)—roughly 10% of the original size—which eventually converged to 10 final modes. These final modes represent clear, diverse "prototypes" of the digit zero, demonstrating the algorithm's effectiveness in summarizing complex datasets into their most representative peaks.

Conclusion and Future Work

This work provides a tractable solution for mode-finding in continuous SPNs, offering significant advantages for model analysis and compression. While the current approach is specialized for Gaussian leaves, future research may extend these principles to discrete data (e.g., Bernoulli leaves) or address the "density bias" observed during compression, where high-density regions can sometimes be underrepresented. Finding the global maximum in these complex landscapes remains an open and challenging problem for the field.

Summary updated

Abstract

In this work, we leverage the relation between Sum-Product Networks (SPNs) and Gaussian mixtures to propose an algorithm that adapts the Expectation-Maximization method to efficiently find the modes of SPNs with Gaussian leaves. We discuss how the algorithm can be used to perform Maximum-A-Posteriori inference in SPNs learned from continuous data with theoretical advantages over the existing methods in the literature, and how it can be used to shrink the size of learned models. As an additional example of the use of the algorithm, we perform an SPN-based hierarchical clustering of digit images. Thus, our proposed algorithm can be used for model analysis, model compression, and exploratory data analysis.
BibTeX
@misc{madeira2022tractable,
  author = {Tiago Madeira and Denis Deratani Mauá},
  title = {{Tractable Mode-Finding in Sum-Product Networks with Gaussian Leaves}},
  year = {2022},
  doi = {10.5753/eniac.2022.227582},
}
Figure