Generalized Flow Matching for Transition Dynamics Modeling

Haibo Wang, Yuxuan Qiu, Yanze Wang, Rob Brekelmans, Yuanqi Du

TL;DR

Simulating rare transition events between metastable states (such as molecular conformational changes) usually requires millions to billions of expensive physical energy evaluations. This paper introduces Generalized Flow Matching (GFM), a framework that leverages inexpensive, short-run local molecular dynamics trajectories around metastable states to learn surrogate potentials and fit neural splines. By combining optimal transport with importance resampling, GFM generates plausible transition paths across high energy barriers with orders-of-magnitude fewer potential energy calculations than classical sampling techniques.

What Problem Does This Paper Address?

In dynamical systems and molecular chemistry, systems often get trapped in metastable states (local energy minima). Transitions between these states—such as protein folding or chemical reactions—are "rare events" governed by high energy barriers.

Simulating these transitions using standard Molecular Dynamics (MD) or Markov Chain Monte Carlo (MCMC) is computationally prohibitive because trajectories rarely cross these barriers organically. While methods like path integral control, shooting methods, or Doob’s $h$-transforms have been proposed, they either suffer from high variance or demand extensive, costly energy evaluations. Meanwhile, naive baselines like linear interpolation cross straight through unphysical, ultra-high-energy configurations (e.g., overlapping atoms). The authors seek a low-cost, data-driven way to warm-up and approximate transition path distributions using only short, local trajectories sampled near the endpoints.

Methods

The paper introduces a framework combining generative flow matching with physical action minimization:

  1. Local Dynamics Initialization: Short-run Langevin dynamics are executed strictly around the initial and terminal metastable states ($A$ and $B$) to produce endpoint marginal distributions ($\mu_0$ and $\mu_T$), bypassing equilibrium sampling.
  2. Surrogate Energy Learning: Rather than repeatedly querying true, expensive potential energy functions during optimization, the model learns a surrogate cost from local data via:
  3. Latent Space Interpolation: A VAE maps coordinates into a semantic latent space; deviations from latent-space paths penalize intermediate states.
  4. Metric Learning: A Riemannian metric tensor based on RBF kernels over clustered local data penalizes trajectories passing through low-density regions.
  5. Conditional Generalized Flow Matching (GFM): The transport problem minimizes kinetic energy plus potential energy along the path. The authors prove that optimizing an expected conditional objective over endpoint couplings upper-bounds the marginal generalized flow objective. They parameterize conditional paths using neural splines that enforce exact endpoint boundaries by construction and regress an unconditional marginal velocity field.
  6. Coupling & Importance Resampling: Endpoints are paired via Minibatch Optimal Transport or Rectified Flow. Generated paths are then evaluated against the true potential energy, assigned importance weights based on their dynamical action, and buffered in a replay cache to iteratively refine the neural spline.
       Local Trajectories (State A & B)
                     │
         ┌───────────┴───────────┐
         ▼                       ▼
  Endpoint Marginal       Surrogate Energy / Metric
     Coupling (OT)         (Latent VAE or RBF-Metric)
         │                       │
         └───────────┬───────────┘
                     ▼
       Neural Spline + Flow Matching
                     │
                     ▼
             Candidate Paths
                     │
                     ▼
         True Energy Reweighting
          & Replay Buffer Update

Datasets

The authors evaluated their method on two primary benchmarks:

  • Müller-Brown Potential: A standard 2D toy energy surface containing three local minima and two transition saddle points, simulated using first-order Langevin dynamics.
  • Alanine Dipeptide: A canonical 22-atom biomolecular system with two metastable conformational states ($C_{7\text{eq}}$ and $C_{7\text{ax}}$) characterized by backbone dihedral angles $(\phi, \psi)$. Local trajectories were collected from 1.2 ns conventional MD simulations in both Cartesian and internal coordinates.

Key Insights and Ideas

  • Local Data Contains Global Clues: Short-run simulations that fail to cross barriers still capture local geometry. Learning a surrogate density metric prevents path generators from cutting across prohibitive energy peaks.
  • Simulation-Free Neural Splines: Parameterizing trajectories via boundary-satisfying neural splines satisfies the continuity equation analytically, avoiding costly numerical ODE/SDE integration inside the core optimization loop.
  • Amortized Generation with Targeted Re-weighting: Decoupling path proposals (guided by surrogate potentials) from validation (importance weighting using true energies) drastically reduces evaluation costs without getting stuck in high-energy bottlenecks.

Key Results

  • Müller-Brown Benchmark:
  • GFM sampled valid transition paths passing close to the true saddle points ($d_1 \approx 0.12, d_2 \approx 0.13$) using only 4,000 to 20,000 simulation steps.
  • In contrast, Doob’s Lagrangian required 1.28 million steps and MCMC required 1.03 billion steps to explore transition pathways.
  • Alanine Dipeptide:
  • While linear interpolation produced absurdly high energy barriers (maximum energies exceeding $10^{15}$ to $10^{24}$), GFM paths remained physically plausible (mean maximum energies around $698$–$987$).
  • Latent interpolation was roughly $4\times$ to $6\times$ faster to train than metric learning (18–29 minutes vs. 100–112 minutes) while yielding competitive transition energy profiles.
  • Adding importance resampling lowered the maximum energy barrier (from ~987 down to ~841 in Cartesian coordinates), though benefits saturated after a single resampling round.

Limitations and Future Work

  • Approximation Gap: The sampled path distribution does not strictly match the true physical transition path distribution; some paths exhibit flipped dihedral angles.
  • Resampling Overhead: Computing true energy importance weights across dense trajectories is computationally heavy if iterated repeatedly.
  • Future Directions: The authors propose using the GFM path distribution as an informed proposal distribution for sampling-based algorithms (e.g., path integral control or transition path sampling) or as an initialization for exact transition state search methods.

Summary updated

BibTeX
@inproceedings{wang2024generalized,
  author = {Haibo Wang and Yuxuan Qiu and Yanze Wang and Rob Brekelmans and Yuanqi Du},
  title = {{Generalized Flow Matching for Transition Dynamics Modeling}},
  booktitle = {AIDrugX @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=zxyP6YXknv},
}
Figure