Introduction
Energy-based models (EBMs) provide a flexible framework for modeling complex probability distributions. However, their utility is often constrained by the computational intractability of the partition function and the slow mixing of traditional Markov Chain Monte Carlo (MCMC) samplers. Researchers from Vicarious AI have introduced Perturb-and-max-product (PMP), a parallelizable method that leverages message-passing to overcome these hurdles, offering significant speedups and improved sampling quality in discrete EBMs.
The Challenge of Discrete EBMs
The primary difficulty in training EBMs lies in estimating the gradient of the log-likelihood, which requires calculating the partition function—a normalization constant that is computationally intractable for most interesting models. Traditional approaches rely on MCMC methods like Gibbs sampling. While widely used, MCMC is inherently sequential and often fails to "mix" between different modes of a distribution, leading to biased estimates and slow convergence.
An alternative framework, Perturb-and-MAP, suggests sampling by adding random noise to the energy function and finding the configuration that maximizes the resulting "perturbed" probability. While theoretically sound, finding the Maximum A Posteriori (MAP) configuration is itself computationally expensive. Previous attempts using Linear Programming (LP) relaxations often failed to capture the sharp peaks of the distribution, resulting in poor sampling quality.
The Perturb-and-max-product (PMP) Approach
PMP addresses these issues by using max-product belief propagation to solve the MAP problem within the Perturb-and-MAP framework. Unlike sequential MCMC, max-product updates all messages in a graph simultaneously, making it highly suitable for modern GPU architectures.
Key innovations of PMP include:
- Gumbel Perturbations: Unary terms are perturbed with Gumbel noise, aligning the process with the Gibbs distribution for simple models.
- Damped Message Passing: A damping factor is employed to ensure convergence in graphs with loops.
- Learning for the Sampler: Instead of forcing the model to fit a theoretical Gibbs distribution, PMP learns parameters that, when used with the PMP sampler, best reconstruct the target data distribution. This "inexact" approach allows the model to compensate for any biases inherent in the approximate sampler.
Experimental Results
The authors evaluated PMP against state-of-the-art methods like Gibbs-with-Gradients (GWG) across various benchmarks, including structured 2D lattices, Erdös-Renyi graphs, and Restricted Boltzmann Machines (RBMs).
Efficiency and Accuracy
On Ising models and 2D lattices, PMP achieved orders-of-magnitude speedups over Gibbs and GWG. As shown in comparative analyses, PMP consistently reaches lower error rates (measured by RMSE and Maximum Mean Discrepancy) in fewer sampling steps, particularly on complex graph topologies where traditional MCMC struggles to mix.
Scaling to Complex Models
PMP's ability to handle multimodality was further demonstrated in a 2D blind deconvolution task involving over 40,000 binary variables. In this highly entangled model, where standard MCMC failed to explore the state space effectively, PMP successfully recovered the posterior distribution and generated diverse, high-quality samples. Furthermore, this work marks the first successful application of a Perturb-and-MAP method to training RBMs on MNIST, producing clear, recognizable digits.
Conclusion
Perturb-and-max-product represents a significant advancement in the training and sampling of discrete EBMs. By replacing sequential MCMC with a parallelizable message-passing approach, PMP breaks the "mixing" barrier and offers a scalable solution for high-dimensional, multimodal distributions. While currently limited to max-marginalizable factors, PMP opens new avenues for efficient probabilistic modeling in complex discrete domains.
Summary updated