Accelerated Sampling with Stacked Restricted Boltzmann Machines

Jorge Fernandez-de-Cossio-Diaz, Clément Roussel, Simona Cocco, Remi Monasson

TL;DR

Stacked Tempering (ST) is a novel sampling method that uses a hierarchy of Restricted Boltzmann Machines (RBMs) to navigate complex, multimodal probability distributions. By allowing different levels of the stack to exchange configurations, the algorithm uses "coarse-grained" representations in deeper layers to help the base model jump between distant modes, significantly outperforming standard Monte Carlo and Parallel Tempering methods.

What Problem Does This Paper Address?

Sampling from complex "energy landscapes"—distributions with many peaks (modes) separated by deep valleys (low-probability regions)—is a fundamental challenge in physics, chemistry, and machine learning. Standard Markov Chain Monte Carlo (MCMC) methods, like Gibbs sampling, often get "stuck" in a single mode for a long time because the probability of crossing a high-energy barrier is exponentially small.

While Parallel Tempering (PT) addresses this by running multiple chains at different "temperatures" (where higher temperatures smooth out the landscape), it can be computationally expensive and sometimes fails to bridge the gap between very distinct modes. The authors seek a more "data-driven" way to simplify these landscapes to accelerate sampling.

Methods

The authors introduce Stacked Tempering (ST). The core idea is to build a "ladder" of RBMs where each rung is a simplified version of the one below it:

  1. Sequential Training: First, a base RBM is trained on the raw data. Then, the hidden representations (features) of that RBM are used as the "training data" for a second, smaller RBM. This process repeats, creating a stack where deeper RBMs have fewer hidden units.
  2. Nested Architecture: The stack is designed so that the number of hidden units in RBM $n$ equals the number of visible units in RBM $n+1$. This "nested" structure allows for direct communication between layers.
  3. Replica Exchanges: During sampling, all RBMs run in parallel using Alternating Gibbs Sampling (AGS). Periodically, the algorithm proposes a "swap": the hidden configuration of RBM $n$ is exchanged with the visible configuration of RBM $n+1$.
  4. The "Aha" Mechanism: Because deeper RBMs are smaller and more regularized, they learn to cluster data. A deep RBM might represent "all versions of the digit 0" as a single point. If the deep RBM moves from the "0" cluster to the "1" cluster, a swap can instantly transport the bottom RBM from one mode to another, bypassing the energy barrier entirely.
RBM architecture, sampling, and datasets

Datasets

The researchers evaluated ST on three distinct types of data:

  • MNIST: The classic handwritten digits dataset (both the full set and a 0/1 subset).
  • In-silico Lattice Proteins: Synthetic protein models where sequences must fold into specific 3D structures ($S_A$ and $S_B$). This represents a high-dimensional, discrete physics problem.
  • 2D-Ising Model: A landmark model from statistical mechanics used to study phase transitions in magnetism.

Key Insights and Ideas

  • Representational Regimes: Through analytical modeling, the authors identify a phase transition between "pattern separation" (where the RBM keeps data points distinct) and "pattern completion/clustering" (where the RBM maps similar data to the same representation). ST works best when deeper layers reach the clustering regime.
  • Coarse-Graining vs. Temperature: Unlike Parallel Tempering, which uses a global temperature parameter to flatten the landscape, ST uses the RBM's own architecture to perform "feature-based" smoothing.
  • Symmetry Breaking: In the 2D-Ising model, ST is particularly effective at flipping the global magnetization sign—a move that standard local MCMC struggles with—because the deeper RBMs learn to represent the global state of the system.

Key Results

  • Faster Mixing: In MNIST 0/1 sampling, ST achieved significantly more transitions between the "0" and "1" modes compared to standard AGS and Parallel Tempering (PT) within the same number of steps.
  • Global Transitions: For the full MNIST dataset, ST was able to jump between dissimilar digits (like 0 and 7) much faster than AGS, which often takes long, indirect paths through similar-looking digits.
  • Protein Folding: In the Lattice Protein dataset, ST successfully sampled sequences for both target structures ($S_A$ and $S_B$), whereas standard methods often remained trapped in one sequence subspace for the duration of the simulation.
  • Theoretical Validation: The authors provided a mathematical proof for a simplified case ($K=2$ data points), showing that ST offers an exponential speedup in mixing time compared to standard Gibbs sampling.

Limitations and Future Work

  • Training Cost: ST requires training a stack of multiple RBMs. While the authors note that deeper RBMs are smaller and train faster, this is still an additional overhead compared to a single model.
  • Hyperparameter Tuning: Choosing the right number of layers, hidden units, and regularization strengths for each level of the stack remains an empirical challenge.
  • Scaling to Large $K$: The current theoretical analysis focuses on a regime with few data points. Extending this theory to datasets with millions of points is a goal for future research.
  • Integration with DBNs: The authors suggest that ST could be used to improve the training of Deep Belief Networks (DBNs) by providing better-mixed samples during the learning phase.

Summary updated

BibTeX
@inproceedings{fernandezdecossiodiaz2024accelerated,
  author = {Jorge Fernandez-de-Cossio-Diaz and Clément Roussel and Simona Cocco and Remi Monasson},
  title = {{Accelerated Sampling with Stacked Restricted Boltzmann Machines}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=kXNJ48Hvw1},
}
Figure