NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Approximating the Bethe partition function

Adrian Weller, Tony JebaraarXiv 2014

Approximating the Bethe Partition Function via Discrete MAP Inference

Abstract

Computing the partition function $Z$ is a fundamental challenge in graphical models, essential for normalizing scores into probabilities. While the Bethe approximation ($Z_B$) is a popular heuristic, standard optimization via Belief Propagation (BP) often fails to converge or settles in local optima. This paper introduces a robust discretization strategy that transforms the continuous minimization of Bethe free energy into a discrete multi-label Maximum A Posteriori (MAP) inference task. By utilizing first-derivative bounds to construct an adaptive mesh, the authors provide the first Fully Polynomial-Time Approximation Scheme (FPTAS) for attractive binary pairwise models on arbitrary graphs. Empirical results on a power network dataset demonstrate that this method succeeds where BP fails, providing guaranteed accuracy with significantly improved efficiency over previous theoretical bounds.

Introduction

In machine learning and statistical physics, undirected graphical models like Markov Random Fields are indispensable for capturing complex dependencies. However, calculating the partition function $Z$—the normalization constant—is #P-hard. The Bethe approximation is a common surrogate, typically solved using Loopy Belief Propagation (LBP). Despite its popularity, LBP is a heuristic with no convergence guarantees on loopy graphs and can be highly sensitive to initialization. This paper addresses these shortcomings by proposing a "discretize and optimize" framework that guarantees an $\epsilon$-approximation of the global minimum of the Bethe free energy.

Methodology

The core of the proposed approach is the reduction of a continuous marginalization problem to a discrete optimization problem through several key steps:

Mesh Construction and First Derivatives

The authors innovate by using first derivatives of the Bethe free energy to determine the required mesh density. By bounding these derivatives, they can ensure that the global minimum of the discrete mesh is within $\epsilon$ of the true continuous global minimum. This is a significant improvement over previous work that relied on second derivatives, which often resulted in prohibitively dense meshes.

Upper and lower bounds on the partial derivative of the Bethe free energy, used to determine mesh density.

Reduction to MAP

Once the mesh is constructed, finding the optimal point is shown to be equivalent to a discrete multi-label MAP inference problem. This conceptual shift allows researchers to leverage decades of progress in MAP solvers, such as graph cuts or dual decomposition, to solve partition function problems that were previously treated as counting tasks.

Adaptive Meshing

To enhance efficiency, the authors introduce adaptive methods that vary mesh density based on the energy function's behavior. In regions where the energy changes slowly, a coarse mesh suffices, while rapidly changing regions receive a finer mesh. This "minsum" approach makes the algorithm practical for real-world applications, often reducing the mesh size by eight orders of magnitude compared to non-adaptive theoretical bounds.

Handling General Models

While the FPTAS guarantee applies to attractive models (where variables tend toward similar values), the framework extends to general models through variable flipping techniques. Although the resulting MAP problem for non-attractive models remains NP-hard, the reduction provides a structured way to approach these complex cases with a "stop" button and a guaranteed accuracy bound.

Results and Evaluation

The algorithm was tested on a synthetic urban power network dataset consisting of 55 connected transformers. This dataset is particularly challenging because its topology and parameters cause standard LBP to fail to converge, making it a critical test case for the new algorithm.

  • FPTAS Achievement: For attractive models, the algorithm is a Fully Polynomial-Time Approximation Scheme. Its runtime scales polynomially with both the graph size and the inverse of the desired accuracy ($1/\epsilon$), regardless of the graph's degree.
  • Success where BP Fails: The proposed method successfully computed the partition function with a mean $\ell_1$ error of only 0.003 for single marginals, as verified against the exact Junction Tree algorithm, in scenarios where BP oscillated or failed to converge.

Conclusion

By bridging the gap between marginalization and optimization, this work provides a powerful new tool for statistical inference. The reduction to discrete MAP inference not only offers theoretical guarantees that BP lacks but also leverages existing high-performance optimization algorithms. Future work includes integrating this method into dual decomposition frameworks to further refine marginal polytope relaxations and optimizing mesh selection for even greater computational efficiency.

Summary updated

BibTeX
@misc{weller2014approximating,
  author = {Adrian Weller and Tony Jebara},
  title = {{Approximating the Bethe partition function}},
  year = {2014},
  eprint = {1401.0044},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1401.0044},
}
Figure