Energy-Weighted Flow Matching: Unlocking Continuous Normalizing Flows for Efficient and Scalable Boltzmann Sampling

Niclas Dern, Lennart Redl, Sebastian Pfister, Marcel Kollovieh, David Lüdke, Stephan Günnemann

TL;DR

Continuous Normalizing Flows (CNFs) trained via Flow Matching generate high-quality molecular conformations, but traditionally require ground-truth data from the target distribution to train. This paper introduces Energy-Weighted Flow Matching (EWFM), a simulation-free objective that trains CNFs to sample from unnormalized Boltzmann distributions using only energy evaluations via importance sampling. On challenging benchmarks up to 55-particle Lennard-Jones clusters, EWFM achieves state-of-the-art sample quality while requiring up to three orders of magnitude fewer energy evaluations than competing methods.

What Problem Does This Paper Address?

In computational chemistry and biophysics, predicting equilibrium states of molecular systems requires sampling from a Boltzmann distribution $\mu_{\text{target}}(x) \propto \exp(-E(x)/T)$, where $E(x)$ is the potential energy and $T$ is temperature. The normalizing constant (partition function $Z$) is intractable, and traditional trajectory-based approaches (like Molecular Dynamics or MCMC) get trapped in metastable local minima separated by high energy barriers.

Deep generative models called Boltzmann generators can produce independent samples directly in one pass. However:

  1. Standard Flow Matching requires samples from the target distribution—the exact thing researchers need to generate.
  2. Existing energy-only generative approaches (e.g., FAB, iDEM) either do not scale well to high dimensions or rely on nested Monte Carlo estimators of score/vector fields, demanding millions or billions of expensive energy function evaluations.

Methods

The authors introduce an importance-sampling reformulation of Conditional Flow Matching (CFM), enabling simulation-free regression training directly on samples from an arbitrary proposal distribution $\mu_{\text{prop}}$:

  • Energy-Weighted Flow Matching (EWFM) Objective: By rewriting the expectation over the target $\mu_{\text{target}}$ as an expectation over $\mu_{\text{prop}}$, the loss is reweighted by self-normalized importance weights: $$w(x_1) = \frac{\exp(-E(x_1)/T)}{\mu_{\text{prop}}(x_1)}$$ High-weight paths along the vector field are amplified, while low-weight paths are suppressed. Unlike methods that approximate marginal vector fields via nested Monte Carlo loops (e.g., iDEM or iEFM), EWFM regresses directly to exact conditional vector fields, requiring only a single energy evaluation per trajectory.

  • Iterative EWFM (iEWFM): If $\mu_{\text{prop}}$ deviates significantly from $\mu_{\text{target}}$, importance weights suffer from extreme variance. The authors prove that the optimal proposal minimizing gradient variance is approximately $\mu_{\text{target}}$. Thus, iEWFM iteratively reuses the current model $q_\theta$ as the proposal distribution for subsequent training epochs.

  • Sample Buffering & Weight Clipping: Because evaluating CNF density requires solving a reverse ODE and divergence trace estimation, the authors cache samples, energies, and densities into a reusable replay buffer. To prevent training instability from sharp energy barriers, log-importance weights are clipped at upper percentiles (e.g., 97.5%–99.9%).
  • Annealed EWFM (aEWFM): For rugged energy landscapes where random initialization yields negligible target overlap, aEWFM begins training at an elevated temperature ($T_0 = 10.0$) with flatter energy wells and gradually cools along a geometric schedule to the target temperature ($T = 1.0$).

Datasets

The authors evaluated the method on four established synthetic and physical benchmark systems:

  • GMM-40: A 2D Gaussian Mixture Model with 40 components arranged in a grid.
  • DW-4: Four particles in 2D space (8D total) interacting via a double-well potential. Ground truth provided via MCMC from prior literature.
  • LJ-13: A 13-particle Lennard-Jones cluster in 3D (39D total) with harmonic confinement.
  • LJ-55: A 55-particle Lennard-Jones cluster in 3D (165D total), representing a high-dimensional, complex multimodal landscape.

No new benchmarks were created; all ground truth data and comparison baselines (FAB and iDEM) were taken from existing literature (Klein et al., 2023; Akhound-Sadegh et al., 2024).

Key Insights and Ideas

  • Importance sampling directly on the objective vs. score estimation: Prior methods like iDEM approximate intractable marginal score fields via an inner Monte Carlo sampling loop per step. EWFM instead shifts importance weighting to the outer expectation of the conditional objective. This reduces the energy query burden from a costly inner loop down to a single energy calculation per generated endpoint.
  • Iterative boot-strapping grounded in variance reduction: By showing that the variance-minimizing proposal for self-normalized importance sampling gradients is roughly proportional to $\mu_{\text{target}}$, the paper provides theoretical justification for iteratively plugging the learned model back in as the training proposal.
  • Annealing unlocks hard initialization: While un-annealed EWFM fails to converge on complex landscapes like LJ-13 and LJ-55, starting from a high temperature provides the proposal sufficient overlap with high-probability modes to bootstrap learning.

Key Results

  • Dramatic Energy Efficiency: On LJ-13, EWFM requires only $1 \times 10^7$ energy evaluations compared to $5 \times 10^{10}$ evaluations for iDEM—a 5,000-fold reduction. Across all benchmarks, EWFM requires 1 to 3 orders of magnitude fewer energy evaluations than iDEM while remaining competitive with or better than FAB.
  • Competitive Sample Quality on Complex Systems:
  • On LJ-55 (165D), aEWFM achieves a test Negative Log-Likelihood (NLL) of 100.89 ± 1.46, substantially outperforming iDEM (125.86 ± 18.03) and FAB (200.32 ± 62.30), while matching iDEM on 2-Wasserstein distance ($W_2 = 16.13$).
  • On GMM-40, non-iterative EWFM achieves superior 2-Wasserstein distance ($W_2 = 3.88$) compared to FAB ($12.00$) and iDEM ($7.42$).
  • On DW-4, baseline methods achieved slightly better NLL ($7.17$ for iDEM vs. $7.65$ for iEWFM), indicating room for improvement on intermediate-scale systems.

Limitations and Future Work

  • Wall-Clock Computational Overhead: While energy function calls are drastically reduced, calculating exact or Hutchinson-estimated CNF densities via ODE integration is computationally heavy. Training took 25–27 hours on an H100 for LJ-55 and 30–31 hours on an A100 for LJ-13. The wall-clock trade-off only favors EWFM when target energy evaluations are relatively expensive.
  • Intermediate System Sub-optimality: On the 8D DW-4 system, both iEWFM and aEWFM underperformed iDEM/FAB in NLL, possibly caused by subtle gradient estimation biases when drawing proposals from early intermediate model checkpoints.
  • Future Directions: Incorporating faster proposal densities (e.g., Gaussian mixtures via Kernel Density Estimation), scaling to explicit biomolecular systems (such as small peptides), and experimenting with separate model retraining rather than continuous fine-tuning during annealing.

Summary updated

BibTeX
@inproceedings{dern2026energy,
  author = {Niclas Dern and Lennart Redl and Sebastian Pfister and Marcel Kollovieh and David Lüdke and Stephan Günnemann},
  title = {{Energy-Weighted Flow Matching: Unlocking Continuous Normalizing Flows for Efficient and Scalable Boltzmann Sampling}},
  booktitle = {DeLTa @ ICLR},
  year = {2026},
  url = {https://openreview.net/forum?id=JYP1FWXqxO},
}
Figure