Serving MPE Queries on Tensor Networks by Computing Derivatives

Maurice Wenig, Hanno Barschel, Joachim Giesen, Andreas Goral, Mark BlacherPGM 2024

TL;DR

This paper introduces a novel method for efficiently answering "Most Probable Explanation" (MPE) queries on graphical models represented as tensor networks. By leveraging derivatives within the tropical semiring, they bypass the need for a second pass typically required for MPE queries, offering a more unified approach.

What Problem Does This Paper Address?

Inference in graphical models, such as Bayesian networks and Markov Random Fields, often involves answering queries about probabilities or finding the most likely configuration of variables. While "Probability of Evidence" (PoE) queries can be directly mapped to weighted model counting, "Most Probable Explanation" (MPE) queries, which seek the specific variable assignments that maximize the joint probability, are more challenging. Existing methods for MPE often rely on a two-pass approach: first, finding the maximum probability value, and then performing a second pass to identify the assignments that achieve this maximum. This paper aims to bridge this gap by showing how MPE queries can be answered directly by computing derivatives of tensor network contractions.

Methods

The core of this paper lies in extending the concept of derivatives to tensor networks operating within the tropical semiring (max-plus algebra).

  • Tensor Networks for Graphical Models: The paper first establishes how graphical models can be represented as tensor networks, where factors of the model correspond to tensors and variables correspond to axes.
  • Tropical Semiring Contraction: For MPE queries, the standard sum-product semiring used for PoE queries is replaced by the tropical semiring (using max for aggregation and + for combination). This allows for the computation of the maximum probability value.
  • Extended Derivatives: Standard derivatives are not well-defined for the max operation when inputs are equal. The authors introduce an "extended derivative" for the maximum operation, assigning a value of 1 when an input contributes to the maximum, even at points of non-differentiability.
  • Jacobian Tensor: They generalize the concept of a Jacobian matrix to tensors, defining a "Jacobian tensor" that captures the derivatives of tensor operations.
  • Chain Rule for Tensors: The paper applies the chain rule to tensor operations, allowing them to compute the derivative of a complete tensor network contraction.
  • Algorithm for MPE: Theorem 13 outlines the algorithm: augment the tensor network with zero-vectors for each axis, compute the derivative of the contraction with respect to these augmented axes, and the non-zero entry in the resulting derivative vector directly indicates the maximizing index for that axis. This derivative computation can be efficiently handled by automatic differentiation.

Datasets

Not discussed in the paper. The authors mention using randomly generated graphical models in the form of tensor trains for their implementation and testing.

Key Insights and Ideas

  • Derivatives as MPE Solvers: The most significant insight is that derivatives of tensor network contractions over the tropical semiring directly reveal the maximizing states for MPE queries. This elegantly unifies the computation of maximum probability values and the identification of the corresponding states.
  • Unified Framework: By extending derivative concepts to tensor networks and the tropical semiring, the paper provides a single, coherent framework for both PoE (via contraction) and MPE (via derivatives of contraction) queries.
  • Connection to Log Partition Function: The paper draws a parallel between the derivatives of a graphical model's log partition function over the standard semiring (yielding expected sufficient statistics) and the derivatives over the tropical semiring (yielding maximum probability states), as illustrated in Figure 2.
  • Efficiency of Automatic Differentiation: The authors highlight that reverse-mode automatic differentiation can compute these derivatives with a computational overhead comparable to computing the contraction itself, making the approach practical.

Key Results

The paper presents a theoretical framework and an algorithm for serving MPE queries on tensor networks. While specific quantitative results on benchmark datasets are not detailed, the implementation section shows runtime plots (Figure 4) demonstrating the scalability of their approach on randomly generated tensor train graphical models. The plots indicate that the runtime increases with the total number of variables and the number of conditional variables, but the overall trend suggests a manageable complexity.

Limitations and Future Work

  • Multiple Maxima: The paper acknowledges that in practice, there might be multiple states yielding the maximum probability. They propose a strategy of selecting the smallest maximizing index as the unique non-zero entry in the derivative to handle this, but note that this choice can lead to different maximizing states depending on the contraction path. Future work could explore more robust ways to handle multiple maxima.
  • Implementation Improvements: The authors suggest several avenues for improving their proof-of-concept implementation:
  • Using better contraction paths.
  • Leveraging GPUs for parallel processing of tropical batch-matrix-multiplications.
  • Employing a conditional slicing variant that mimics branch-and-bound algorithms to avoid contracting over all elements.
  • Space Complexity: While computational complexity is comparable to log partition function computation, the space complexity can be larger due to the storage of intermediate tensors for derivatives.

Summary updated

BibTeX
@inproceedings{wenig2024serving,
  author = {Maurice Wenig and Hanno Barschel and Joachim Giesen and Andreas Goral and Mark Blacher},
  title = {{Serving MPE Queries on Tensor Networks by Computing Derivatives}},
  booktitle = {PGM},
  year = {2024},
}
Figure