Abstract
Estimating the partition function ($Z$) of energy-based models like Restricted Boltzmann Machines (RBMs) is a fundamental challenge in machine learning, as $Z$ is required to compute exact log-likelihoods. This paper introduces a unifying theoretical framework based on a generalized version of Crooks’ equality that links Annealed Importance Sampling (AIS) and Bennett’s Acceptance Ratio (BAR). We show that BAR is the maximum-likelihood estimator for the ratio of partition functions and, when combined with Parallel Tempering (PT), significantly outperforms the standard AIS. Our results on MNIST-trained RBMs demonstrate that BAR achieves higher accuracy with fewer intermediate distributions and enables real-time "online" monitoring of model performance during training.
Introduction: The Normalization Challenge
In energy-based models, the probability of a state is defined by an energy function. To normalize this into a valid probability distribution, we must divide by the partition function $Z = \sum_x \exp(-E(x))$. For models like RBMs, this sum involves an exponential number of terms, making exact calculation intractable.
Without an accurate estimate of $Z$, researchers cannot calculate the actual likelihood of data, hindering model comparison and the monitoring of training progress. While Annealed Importance Sampling (AIS) is the industry-standard tool, it often suffers from high variance and a systematic tendency to underestimate the true value unless a massive number of intermediate "bridging" distributions are used.
Methodology: A Unified Framework
The authors propose a unification of estimation methods through a generalized version of Crooks’ equality, which relates the expectations of samples generated by a "forward" transition operator to those generated by a "reversed" operator. Under this framework:
- AIS is shown to be a specific case where the estimator function is set to a constant.
- BAR represents the optimal version that uses a function designed to minimize the variance of the estimate.
A key practical innovation is the integration with Parallel Tempering (PT). PT maintains several "replicas" of the model at different temperatures. The authors demonstrate that samples already being generated during PT training can be "recycled" for BAR estimation at almost no additional computational cost.
Efficiency and the Power of the Base-Rate
A critical factor in the performance of these algorithms is the choice of the reference distribution ($p_{ref}$). Traditionally, a simple uniform distribution is used. However, the authors show that using a "base-rate" distribution—one that matches the pixel-wise marginals of the training data—drastically improves accuracy for both AIS and BAR.
As illustrated in the experimental results, BAR is significantly more efficient than AIS when the number of intermediate distributions is small. While AIS requires a high density of bridges to converge to low error, BAR provides reliable estimates even with an order of magnitude fewer distributions. Furthermore, the transition from a uniform reference to a base-rate reference reduces the error for both methods by several orders of magnitude.
Online Monitoring and Empirical Results
The framework's efficiency allows for "Online-BAR," where the partition function is estimated continuously during training. This provides a real-time view of the model's log-likelihood, a capability that traditional "offline" AIS lacks due to its high computational overhead.
In experiments on MNIST, Online-BAR successfully tracked the mean negative log-likelihood throughout 20,000 iterations. The estimates were consistent with expensive offline benchmarks, confirming that BAR can provide high-fidelity monitoring without slowing down the training process. The results also confirmed that AIS tends to exhibit a "visible skew," systematically underestimating $Z$, whereas BAR estimates are more robustly centered around the ground truth.
Conclusion and Limitations
By framing partition function estimation as a maximum-likelihood problem via BAR, this work provides a more robust and efficient alternative to AIS. The ability to recycle samples from Parallel Tempering makes it particularly attractive for modern generative modeling workflows, allowing for real-time performance tracking.
However, some limitations remain. BAR's performance is sensitive to the "burn-in" time of the Markov chains; if the chains have not reached stationarity, the estimates will be biased. Additionally, while PT is powerful, it carries its own setup costs if not already utilized for training. Future work will explore extending this framework to other generative architectures, such as GANs.
Summary updated