Exact and approximate inference in graphical models: variable elimination and beyond

Nathalie Peyrard, Marie-Josée Cros, Simon de Givry, Alain Franc, Stéphane Robin, Régis Sabbadin, Thomas Schiex, Matthieu VignesarXiv 2015

This tutorial paper, published by a team of researchers from INRA and Massey University, serves as a bridge between the worlds of computer science and statistics. It demystifies why some complex probabilistic graphical models (PGMs) are easy to solve exactly, while others require approximations, and shows how the same underlying principles—specifically variable elimination—power both approaches.

TL;DR

The complexity of inference in graphical models is determined not by the number of variables, but by a structural property called treewidth. By understanding this, researchers can exploit graph structure to perform exact inference when possible and derive efficient, deterministic approximations like Loopy Belief Propagation when it is not.

What Problem Does This Paper Address?

In fields ranging from bioinformatics to computer vision, we often model systems using PGMs to capture dependencies between random variables. The core challenge is inference: calculating marginal distributions, finding the most likely state (the mode), or computing the normalization constant (partition function).

For many real-world problems, these tasks are NP-hard. Statisticians frequently default to stochastic methods like Markov Chain Monte Carlo (MCMC). However, MCMC can be slow and difficult to assess for convergence. The authors argue that by looking at the graph's structure, we can often find more efficient, deterministic alternatives borrowed from optimization and computer science.

Methods

The paper centers on the concept of Variable Elimination (VE). The core "trick" is the clever use of the distributive law (e.g., $ab + ac = a(b+c)$) to minimize algebraic operations.

Key techniques discussed include:

  • Exact Variable Elimination: Successively "eliminating" variables by summing or maximizing them out. The order of elimination is crucial; a poor order creates a dense graph of "fill-in" edges, making the problem intractable.
  • Treewidth: This parameter characterizes the complexity of the best possible elimination order. If a graph has a low treewidth, exact inference is efficient, even if the total number of variables is huge.
  • Message Passing: An extension of VE (like the Sum-Product algorithm) that allows computing all marginals simultaneously in two passes (forward and backward).
  • Variational Approximations: When the treewidth is too high for exact methods, the authors show how to approximate the complex distribution with a simpler, "tractable" one (e.g., Mean Field or Bethe approximations).
Figure 1: From left to right: (a) Graphical representation of a directed graphical model where potential functions define the conditional probability of each variable given its parents values; (b) The corresponding factor graph where every potential function is represented as a factor (square vertex) connected to the variables that are involved in it; (c) Graphical representation of an undi- rected graphical model. It is impossible from this graph to distinguish between a graphical model defined by a unique potential function on vertices 3, 4 and 5 from a model defined by 3 pairwise potential functions over each pair (3, 4), (3, 5) and (4, 5); (d) The corresponding factor graph, which unambiguously defines the potential functions, here three pairwise potential functions.

Datasets

The authors evaluate these methods using several benchmarks:

  1. Combinatorial Optimization Benchmarks: Including ParityLearning (Constraint Satisfaction), Linkage (genetic analysis), and computer vision problems (GeomSurf, SceneDecomp).
  2. Coupled Hidden Markov Model (CHMM): A simulated model of pest propagation in a landscape of crop fields, used to compare exact methods against Gibbs sampling and variational approaches.

Key Insights and Ideas

  • Structure Over Size: The number of variables is rarely the limiting factor. A model with millions of variables but a tree-like structure (treewidth = 1) is easier to solve than a small, highly connected "loopy" graph.
  • The "Elimination Game": Eliminating a variable makes its neighbors a clique. This process is visualized through "fill-in" edges. The goal of a good elimination order is to minimize the size of the largest clique created during this process.
  • LBP is Optimization: The popular Loopy Belief Propagation (LBP) algorithm is not just a heuristic; it is a variational method that attempts to minimize the "Bethe free energy."
  • Deterministic vs. Stochastic: Deterministic approximations (like LBP or Mean Field) are often orders of magnitude faster than stochastic ones (like Gibbs sampling) while providing comparable accuracy for many tasks.

Key Results

The paper provides a quantitative comparison on the CHMM pest propagation model (where $I$ is the number of hidden variables):

  • Speed: For a problem with $I = 10,000$ variables, approximate methods based on variable elimination (LBP, Mean Field) took less than 4 minutes, whereas Gibbs sampling took significantly longer (nearly 8 hours for $n=200$).
  • Accuracy: Despite being much faster, LBP and Mean Field were highly accurate, with LBP showing a mean difference in marginals of only 0.003 compared to the ground truth.
  • Exact Methods: The BTD (Branch and Tree Decomposition) method was shown to be more robust than standard variable elimination (ELIM) on complex benchmarks, solving more instances within a fixed time and memory budget.

Limitations and Future Work

  • Treewidth Computation: Finding the optimal treewidth is itself an NP-hard problem. While good heuristics exist (like "minimum fill-in"), they don't guarantee the absolute best performance.
  • Convergence: LBP is not guaranteed to converge on graphs with many loops, and its error bounds are not theoretically well-established.
  • Software Gap: The authors note a lack of generic, easy-to-use software libraries for these techniques that integrate well with standard statistical tools like R or Python, which hinders their adoption among statisticians.
  • Continuous Variables: While the paper focuses on discrete variables, the authors point to emerging research in message passing for continuous state spaces using orthogonal series approximations.

Summary updated

BibTeX
@misc{peyrard2015exact,
  author = {Nathalie Peyrard and Marie-Josée Cros and Simon de Givry and Alain Franc and Stéphane Robin and Régis Sabbadin and Thomas Schiex and Matthieu Vignes},
  title = {{Exact and approximate inference in graphical models: variable elimination and beyond}},
  year = {2015},
  eprint = {1506.08544},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1506.08544},
}
Figure