Flow Annealed Importance Sampling Bootstrap

Laurence Illing Midgley, Vincent Stimper, Gregor N. C. Simm, Bernhard Schölkopf, José Miguel Hernández-Lobato

The Challenge of Sampling Complex Distributions

In fields like computational chemistry and physics, researchers often know the "energy function" of a system (the unnormalized density) but cannot easily draw samples from its equilibrium state, known as the Boltzmann distribution.

Normalizing flows—neural networks that transform simple distributions into complex ones—offer a promising solution. However, training them without pre-existing samples presents a "chicken and egg" problem:

  1. Mode-Seeking Behavior: If trained using the standard "reverse KL divergence" without ground-truth samples, the flow tends to collapse onto a single mode, ignoring other equally important regions of the distribution.
  2. Data Scarcity: To avoid mode-seeking, models usually require ground-truth samples. Generating these via Molecular Dynamics (MD) or Markov Chain Monte Carlo (MCMC) is prohibitively expensive and often yields highly correlated data.
  3. High Variance: Existing "mass-covering" objectives that do not require samples often suffer from extreme numerical instability and high-variance gradients during training.

The Solution: Flow AIS Bootstrap (FAB)

To overcome these limitations, researchers introduced Flow AIS Bootstrap (FAB), a novel method for training normalizing flows to approximate complex, multimodal distributions without needing pre-existing samples. FAB relies on three key pillars:

  • The $\alpha=2$ Divergence: Instead of the standard KL divergence, FAB minimizes the $\alpha$-divergence with $\alpha=2$. This specific choice is "mass-covering" (forcing the model to find all modes) and is mathematically equivalent to minimizing the variance of importance sampling weights. By targeting this divergence, FAB turns a common problem (importance weight variance) into the objective itself.
  • AIS as a Discovery Engine: To estimate the loss, FAB uses Annealed Importance Sampling (AIS) rather than just sampling from the flow. AIS starts with a sample from the flow and refines it through a series of intermediate steps toward the target. This allows the model to discover modes that the flow hasn't learned yet, providing a high-quality training signal.
  • Prioritized Replay Buffer: Because AIS is computationally expensive, FAB stores AIS samples in a buffer. It utilizes a prioritized scheme—inspired by reinforcement learning—to re-use these samples, reweighting them as the flow evolves so they remain valid training data.

Key Results

The researchers evaluated FAB on increasingly difficult benchmarks, demonstrating its ability to discover hidden modes and achieve state-of-the-art results with significantly fewer evaluations than traditional methods.

Discovering Hidden Modes

On a synthetic 2D Mixture of Gaussians target with 40 distinct modes, FAB was tested to see if it could find every "island" of density.

Comparison of FAB against baselines on a 40-mode 2D Gaussian mixture. FAB successfully discovers and covers all modes.

As shown above, FAB successfully found every single mode. In contrast, every other baseline (including SNF and CRAFT) exhibited mode-seeking behavior and missed significant portions of the distribution.

Scaling to Real-World Molecules

FAB was also tested on Alanine Dipeptide, a real-world 22-atom molecule that serves as a standard benchmark for "Boltzmann Generators." The goal is to map the 3D atomic coordinates to their energy states.

Ramachandran plots of Alanine Dipeptide dihedral angles. FAB closely matches the ground truth without requiring prior MD samples.

FAB is the first method to successfully learn the Boltzmann distribution of alanine dipeptide using only the unnormalized energy function, without any MD samples. Compared to training a flow on MD samples (the gold standard), FAB produced more accurate histograms of molecular dihedral angles while requiring 100x fewer evaluations of the target density.

Limitations and Future Work

While FAB represents a significant step forward, challenges remain. Scaling FAB to large proteins with thousands of atoms is difficult due to the increased complexity of the energy landscape. Additionally, the performance of the AIS step depends heavily on Hamiltonian Monte Carlo (HMC) hyperparameters, which require careful tuning.

Looking ahead, the authors suggest that the "AIS bootstrap" concept could potentially be adapted to improve the training of Diffusion Models, which currently face similar high-variance issues when trained on unnormalized densities.

Summary updated

BibTeX
@inproceedings{midgley2023flow,
  author = {Laurence Illing Midgley and Vincent Stimper and Gregor N. C. Simm and Bernhard Schölkopf and José Miguel Hernández-Lobato},
  title = {{Flow Annealed Importance Sampling Bootstrap}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=XCTVFJwS9LJ},
}
Figure