Flow Sampling: Learning to Sample from Unnormalized Densities via Denoising Conditional Processes

Aaron Havens, Brian Karrer, Neta Shaul

TL;DR

Flow Sampling is a novel framework that adapts diffusion models and flow matching to sample from unnormalized probability densities without requiring existing data samples. By conditioning the training process on noise rather than data, it derives a closed-form regression target that reuses energy gradients via a replay buffer, yielding a 4×–8× training speedup. Furthermore, it naturally extends to non-Euclidean geometries, providing the first diffusion-based sampler for constant-curvature Riemannian manifolds.

What Problem Does This Paper Address?

In fields like computational chemistry, physics, and reinforcement learning, we often need to sample from high-dimensional probability distributions where we only know the unnormalized density—typically expressed as $q(x) \propto \exp(r(x))$, where $r(x)$ is a reward or negative energy function.

Traditional methods like Markov chain Monte Carlo (MCMC) converge asymptotically but are slow and inherently sequential, making them impractical for tasks requiring rapid, repeated sampling (e.g., molecular design). Recently, "amortized" samplers based on diffusion models have emerged to learn fast, generative approximations. However, existing diffusion samplers suffer from a major bottleneck: they require massive numbers of expensive energy function and gradient evaluations during training, or they rely on complex auxiliary networks to enforce optimal control paths.

Comparison of conditional probability paths between Flow Matching and Flow Sampling.

Methods

The authors introduce Flow Sampling, which flips the standard flow matching paradigm on its head to operate in a data-free setting:

  1. Noise-Conditioned Denoising: Standard diffusion models condition on a data sample ($t=1$) and learn a noising drift. Flow Sampling instead conditions on a noise sample ($t=0$) and learns a denoising drift.
  2. Endpoint Gradient Reuse: The authors prove that for any sample along the interpolant path, the target conditional drift only requires evaluating the energy gradient $\nabla r(x)$ at the final generated endpoint ($X_1$). This allows them to implement an efficient replay buffer that stores generated samples and their corresponding energy gradients, completely eliminating the need to re-evaluate the energy function at intermediate timesteps during the optimization phase.
  3. Fixed-Point Iteration: Because true target samples are unavailable, training proceeds as a fixed-point algorithm. The model uses its current "detached" state to explore and generate endpoints, evaluates their gradients once, stores them in the buffer, and then optimizes the network over multiple inner loops.
  4. Riemannian Manifold Extension: By swapping the standard linear interpolant with a geodesic interpolant, the authors extend Flow Sampling to curved spaces. They derive a closed-form formula for the conditional denoising drift on constant-curvature Riemannian manifolds, such as hyperspheres ($\mathbb{S}^d$) and hyperbolic spaces.

Datasets

The framework was evaluated across a diverse suite of synthetic and real-world benchmarks:

  • Synthetic Energy Functions: 2D Double-Well potential (DW-4), 3D 13-particle Lennard-Jones system (LJ-13), and a 55-particle Lennard-Jones system (LJ-55).
  • Peptide Conformers: 22-atom Alanine Dipeptide (Ala2) and 42-atom Alanine Tetrapeptide (Ala4), simulated in full-atom Cartesian coordinates using the OpenMM library.
  • Amortized Molecular Conformer Generation: Trained on 24,775 molecular topologies from the SPICE dataset; evaluated on 80 held-out SPICE molecules and 80 molecules from the GEOM-DRUGS dataset for generalization.
  • Manifold Benchmark: A multimodal mixture of von Mises-Fisher (vMF) distributions on a two-dimensional unit sphere ($\mathbb{S}^2$).

Key Insights and Ideas

  • The Power of Reversing Conditioning: Shifting the conditioning from the target data distribution to the source noise distribution makes the conditional path a simple scale-and-shift of the target distribution. This structural change is what unlocks the closed-form drift expression.
  • Simulation-Free Training via Replay Buffers: In previous methods, reducing the Number of Function Evaluations (NFE) during training severely degraded sample quality because gradients had to be computed on-the-fly along the paths. Flow Sampling decouples path generation from gradient evaluation, allowing researchers to drastically lower training NFE without sacrificing accuracy.
  • Intrinsic Geometric Sampling: Rather than using extrinsic coordinate projections or complex reparameterizations to sample on manifolds, Flow Sampling computes the drift intrinsically using parallel transport and Jacobi fields, preserving the underlying geometry naturally.
Figure 1. Flow Sampling is the first diffusion sampler able to perform sampling from an unnormalized density on Riemannian manifolds. The figure depicts a learned diffusion process using iterative Flow Sampling from a mixture of spherical von Mises–Fisher distributions.

Key Results

  • 4× to 8× Speedup: On the large-scale SPICE and GEOM-DRUGS conformer generation benchmarks, Flow Sampling maintained robust performance even when training NFE was reduced from 512 down to 64, cutting simulation training costs significantly compared to baselines like Adjoint Sampling (AS).
  • State-of-the-Art Accuracy: Flow Sampling outperformed prior methods (iDEM, PIS, DDS, ASBS) on synthetic particle benchmarks, achieving the lowest Wasserstein-2 ($W_2$) distances relative to ground-truth MCMC samples.
  • Superior Mode Coverage: For the complex Ala4 peptide, Flow Sampling successfully captured all 8 distinct metastable torsional modes, demonstrating tighter and more accurate sample concentration than competing bridge-based samplers.
Ramachandran plots for Ala2 showing excellent agreement with molecular dynamics (MD) ground truth.

Limitations and Future Work

  • Lack of Global Convergence Guarantees: Because the target distribution is iteratively approximated using the model's own detached state, the training relies on fixed-point dynamics. While highly effective empirically, the paper does not provide a formal proof of global convergence for this replay-buffer mechanism.
  • Geometry Constraints: The closed-form formulations derived for Riemannian manifolds are currently restricted to spaces with constant curvature (like spheres and hyperbolic spaces). Extending this efficiency to more general, arbitrarily constrained manifolds or complex topological spaces remains an open challenge.

Summary updated

BibTeX
@inproceedings{havens2026flow,
  author = {Aaron Havens and Brian Karrer and Neta Shaul},
  title = {{Flow Sampling: Learning to Sample from Unnormalized Densities via Denoising Conditional Processes}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=YlcyOMTPNl},
}
Figure