Improved sampling via learned diffusions

Lorenz Richter, Julius Berner

TL;DR

This paper introduces a unifying framework for sampling from unnormalized probability densities by treating the problem as a divergence minimization between path-space measures. To overcome the limitations of existing approaches, the authors propose a novel log-variance loss. This new objective prevents the "mode collapse" common in KL-divergence-based methods, eliminates the need to differentiate through SDE solvers, and significantly improves sampling accuracy across complex, multi-modal benchmarks.

The Challenge of Unnormalized Densities

In fields like Bayesian statistics and computational physics, researchers frequently need to draw samples from a distribution where only the "unnormalized" density is known—meaning the shape of the probability curve is defined, but the total area underneath it is not calculated.

Recently, "diffusion-based" samplers have emerged as a powerful alternative to traditional Markov Chain Monte Carlo (MCMC) methods. These models learn to "push" a simple prior distribution (like standard Gaussian noise) into the complex target distribution using a Stochastic Differential Equation (SDE). However, existing diffusion samplers suffer from two major headaches:

  1. Mode Collapse: Most current methods use the reverse Kullback-Leibler (KL) divergence as a loss function. Reverse KL is notoriously "mode-seeking"—it tends to focus all its energy on one peak of a distribution and ignore the others, failing to capture the full diversity of the data.
  2. Computational Cost: Training these models usually requires differentiating through the SDE solver (backpropagating through time). This process is memory-intensive, numerically unstable, and slow.

A Unifying Framework and the Log-Variance Loss

The authors provide a theoretical bridge that connects several popular sampling methods—including Schrödinger Bridges (SB), Path Integral Samplers (PIS), and Denoising Diffusion Samplers (DDS)—into a single variational framework based on path space measures.

The standout contribution is the introduction of the log-variance loss ($L_{LV}$). Instead of using the standard KL objective, the authors minimize the variance of the log-ratio of the path measures. This approach yields three key technical advantages:

  • "Sticking-the-landing": The gradients of this loss have zero variance at the optimal solution. As the model gets closer to the target, training becomes increasingly stable, avoiding the noisy gradient updates that plague KL-based methods.
Training stability comparison between KL-based and log-variance loss.
  • Derivative-Free w.r.t. the Process: You no longer need to backpropagate through the SDE solver. The solver can be treated as a "black box," saving massive amounts of computational memory and time.
  • Partial Trajectory Optimization: Because the loss is based on path ratios, the model can be trained on random sub-segments of the diffusion path rather than the entire trajectory at once. This encourages much better exploration of the state space.

Datasets and Key Insights

The authors evaluated their method on several challenging synthetic benchmarks designed to trip up standard samplers:

  • Gaussian Mixture Model (GMM): 2D distributions with 9 and 40 well-separated modes to explicitly test for mode collapse.
  • Funnel Distribution (10D): A classic "sharp" distribution that is notoriously difficult for MCMC algorithms to navigate.
  • Double Well (DW): A physics-inspired potential with high energy barriers between modes, tested in dimensions ranging from 5D up to 1000D.
  • Labrador Target: A 2D density shaped like an image of a dog to visually assess sample quality.

By looking at the divergence between entire trajectories rather than just the final samples, the authors found a more robust way to enforce the "time-reversal" property that makes diffusion models work. The paper confirms that the standard KL loss is a primary culprit for mode collapse: if the model finds one mode, the KL loss "settles." In contrast, the log-variance loss continues to penalize the model until it covers the entire distribution.

Key Results

The empirical results demonstrate that the log-variance loss provides a massive upgrade over existing baselines:

  • Superior Mode Coverage: In the GMM tasks, the log-variance loss successfully captured all modes. Meanwhile, the KL-based versions collapsed to just a few isolated peaks.
Comparison of mode coverage on a 2D Gaussian Mixture Model. KL-based methods suffer from mode collapse, while the proposed LV methods capture all modes.
  • Massive Efficiency Gains: In a 2D GMM, the Effective Sample Size (ESS)—a standard measure of sampling quality—jumped from a dismal 0.0051 (KL) to an impressive 0.9093 (Log-Variance).
  • High-Dimensional Scaling: The method remained stable and accurate even in 1000-dimensional double-well problems, significantly outperforming previous state-of-the-art diffusion samplers.
  • Faster Training: By avoiding differentiation through the SDE solver, the average time per gradient step was drastically reduced.

Limitations and Future Work

While highly effective, the authors note a few areas for future exploration:

  • General Bridge Complexity: The framework unifies "General Bridges" (where two controls are learned), but this specific setup can still be numerically unstable compared to simpler versions like DIS or PIS.
  • Hyperparameter Sensitivity: The authors used the same hyperparameters for both KL and Log-Variance to ensure a fair comparison. However, they suggest that the Log-Variance loss likely has its own optimal "sweet spot" for learning rates and schedulers that hasn't been fully mapped out yet.
  • Black-Box Densities: While the method can work without gradients of the target density ($\nabla \log \rho$), the experiments mostly focused on cases where those gradients are available. Further testing on truly "black-box" densities remains a promising next step.

Summary updated

BibTeX
@inproceedings{richter2024improved,
  author = {Lorenz Richter and Julius Berner},
  title = {{Improved sampling via learned diffusions}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=h4pNROsO06},
}
Figure