Merging Strategies for Sum-Product Networks: From Trees to Graphs

Tahrima Rahman, Vibhav GogateUAI 2016

Abstract

Sum-Product Networks (SPNs) provide a framework for exact probabilistic inference in linear time. However, most learning algorithms produce tree-structured models that are often redundant and suffer from high parameter variance. This paper introduces a greedy, bottom-up algorithm to transform tree SPNs into more efficient graph-structured ones by merging similar sub-structures. By sharing components, the resulting graph SPNs achieve state-of-the-art accuracy on several benchmarks while significantly reducing computational complexity and model size.

Introduction

Probabilistic graphical models like Bayesian or Markov networks are powerful tools for modeling complex distributions, but they often face a "tractability trap" where exact inference is NP-hard. Sum-Product Networks (SPNs) were designed to solve this, offering exact inference in time linear to the size of the network.

Despite this advantage, most existing algorithms for learning SPNs from data produce tree-structured models. While easy to learn, tree SPNs are often redundant and inefficient. They can grow exponentially large to represent complex distributions that a directed acyclic graph (DAG) could represent much more compactly. Furthermore, because tree nodes only "see" a small subset of the training data, their parameter estimates often have high variance, leading to poor generalization on new data.

The Merging Methodology

The authors propose a post-processing approach to convert learned tree SPNs into graph SPNs. Their core contribution is a two-step strategy focused on structural sharing.

Identifying Similar Sub-structures

To decide which parts of the tree to merge, the authors need a distance metric. Since calculating the exact distance (like KL divergence) between two graph structures is computationally expensive, they propose a mean-field style approximation. This method averages the distances between single-variable marginal distributions, which can be computed in linear time.

Greedy Bottom-Up Merging

The algorithm starts at the leaves and moves toward the root. It partitions sub-SPNs by their "scope" (the set of variables they cover). Within each partition, it merges sub-SPNs if the distance between them is below a certain threshold or if merging improves accuracy on a validation set.

Algorithm 2: The greedy bottom-up merging process for SPNs.

As shown in Algorithm 2, the process iteratively identifies candidates for merging based on scope and distance. This transformation effectively turns the tree into a Directed Acyclic Graph (DAG).

Visual representation of transforming a tree SPN (a) into graph-structured SPNs (b, c) through sub-structure merging.

Figure 1 illustrates this transition. In (a), the tree contains redundant sub-structures. By merging these components, as seen in (b) and (c), the network becomes more compact while maintaining or improving its representational power.

Key Insights and Results

The researchers evaluated their approach on 20 real-world benchmark datasets, ranging from low-dimensional sets like NLTCS to high-dimensional ones like Ad (1556 variables).

  • The Variance-Bias Trade-off: Merging sub-structures acts as a form of regularization. By combining two similar sub-trees, the resulting node is trained on more data points. This reduces the variance of the parameter estimates, which usually leads to better generalization.
  • Structural Compression: Merging doesn't just make the model more accurate; it makes it smaller. The authors report a "Compression Ratio" (CR), showing that graph SPNs can represent the same distribution with significantly fewer parameters than their tree counterparts. For example, on the WebKB dataset, the graph version was over 5 times smaller than the tree version.
  • Accuracy Boost: Merging improved the test-set log-likelihood on the majority of the 20 datasets. In many cases, the merged graph SPNs achieved the best-known results to date.

Conclusion

This work demonstrates that tree-structured SPNs can be significantly improved through a greedy merging process. By transitioning from trees to graphs, the models become more accurate, more compact, and better at generalizing to unseen data. Future research could look into "direct induction"—building the graph structure from scratch during the initial learning phase rather than starting with a tree—and extending these strategies to continuous and relational domains.

Summary updated

BibTeX
@inproceedings{rahman2016merging,
  author = {Tahrima Rahman and Vibhav Gogate},
  title = {{Merging Strategies for Sum-Product Networks: From Trees to Graphs}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2016},
}
Figure