Introduction
Sampling from discrete probability distributions is a fundamental challenge in machine learning, essential for tasks ranging from training Restricted Boltzmann Machines to performing Bayesian inference. Traditional approaches generally fall into two categories: exact sampling (e.g., rejection sampling), which often fails to scale due to the #P-hard nature of computing partition functions, and approximate sampling (e.g., MCMC), which lacks convergence guarantees and can take exponentially long to mix.
This paper introduces GumbelMIP, a novel algorithm that bridges this gap. By reframing exact sampling as a combinatorial optimization problem, GumbelMIP leverages the power of Integer Linear Programming (ILP) to scale to complex, high-treewidth models previously considered inaccessible to exact methods.
Methodology: The Gumbel-Max Trick Meets ILP
The foundation of GumbelMIP is the Gumbel-max trick: adding independent Gumbel-distributed noise to the log-probabilities of all possible states and selecting the state that maximizes this perturbed value yields an exact sample. However, for a system with $n$ binary variables, the state space of $2^n$ makes direct application impossible.
GumbelMIP overcomes this through three primary innovations:
- Lazy Instantiation: Noise is generated "on the fly" during search tree exploration, utilizing the property that the maximum of a set of Gumbel variables is itself Gumbel-distributed.
- ILP and LP Relaxations: The search for the maximum perturbed state is treated as an ILP problem. Linear Programming (LP) relaxations provide upper bounds to prune branches of the search tree that cannot contain the optimal state.
- Advanced Solver Integration: By integrating with the CPLEX ILP solver via callbacks, GumbelMIP benefits from industrial-grade heuristics and multi-threaded parallel search capabilities.
Experimental Evaluation
The authors evaluated GumbelMIP across several benchmarks:
- Ising Models: Testing both "attractive cliques" and "mixed interactions" to assess performance on classic physics-inspired models.
- Graphical Models: Grid and tree structures were used to compare estimated marginals against ground truth.
- MNIST/RBM: A Restricted Boltzmann Machine trained on MNIST digits served as a high-dimensional real-world test case for a "Blocked Gibbs" implementation.
Key Results and Insights
Scalability and Efficiency
GumbelMIP demonstrates significantly better scalability than existing exact methods. On "attractive clique" models, it successfully provided exact samples for up to $n=60$ variables, whereas standard rejection sampling failed beyond $n=35$. Unlike traditional exact inference, GumbelMIP's performance is largely independent of treewidth, depending instead on the tightness of the underlying LP relaxation.
Any-time Performance and Bounding
A unique advantage of GumbelMIP is its "any-time" nature. Because the algorithm maintains upper and lower bounds during its branch-and-bound search, it can provide stochastic bounds on the partition function $Z$. This capability is often considered a "holy grail" in probabilistic inference, as $Z$ is notoriously difficult to estimate.
In practical tests, even when stopped early, GumbelMIP produced marginal probabilities closer to ground truth than standard Gibbs samplers. Furthermore, using GumbelMIP as a "block" sampler within a Gibbs chain significantly accelerated the mixing of Markov chains on high-dimensional data like MNIST.
Conclusion and Future Work
GumbelMIP represents a significant step forward by showing that optimization techniques can be repurposed for exact sampling. While the algorithm remains subject to NP-hard complexity in the worst case—particularly for "frustrated" systems with loose LP relaxations—it offers a powerful alternative for many practical models. Future work includes extending the framework to continuous spaces and exploring integration with other combinatorial solvers like weighted CSP solvers.
Summary updated