Learning Hamiltonian Flow Maps

Mean Flow Consistency for Large-Timestep Molecular Dynamics

Winfried Ripken* 1,2 Michael Plainer* 3,4,1,2 Gregor Lied* 1 J. Thorben Frank* 1,2 Oliver T. Unke5 Stefan Chmiela1,2 Frank Noé3,6,7 Klaus-Robert Müller1,2,5,8,9

1Technical University Berlin   2BIFOLD Berlin   3Free University of Berlin   4Zuse School ELIZA   5Google DeepMind   6Rice University   7Microsoft Research AI4Science   8MPI for Informatics, Saarbrücken   9Department of Artificial Intelligence, Korea University

Paper arXiv
Code GitHub
Colab JAX PyTorch

Our learned Hamiltonian Flow Map enables stable simulations at significantly larger timesteps (right) than standard Velocity Verlet integration (left), which becomes inaccurate or unstable already at comparatively small step sizes. Consequently, our model explores conformational space more rapidly and identifies all relevant modes more efficiently than the baseline.

Abstract

Simulating the long-time evolution of Hamiltonian systems is limited by the small timesteps required for stable numerical integration. This is particularly costly for molecular dynamics simulations where force evaluations are computationally expensive (e.g., ab-initio MD).

We introduce a framework to learn Hamiltonian Flow Maps based on a novel Mean Flow consistency condition. This formulation allows training our model to predict the mean phase-space evolution directly, enabling stable rollouts far beyond classical limits and reducing the computational cost of long-time simulations.

Crucially, our method can be trained on standard trajectory-free MLFF datasets. We learn the cumulative dynamics directly from independent phase-space samples, without relying on expensive precomputed reference trajectories that are typically generated by simulating a teacher model with small timesteps.

Key Insights

  • 🚀
    Large-Timestep Integration: We predict the mean phase-space evolution to enable stable rollouts at timesteps significantly larger than the stability limits of classical integrators.
  • 🎲
    Training on Trajectory-Free Data: We learn the dynamics from uncorrelated snapshots using a Mean Flow consistency condition, eliminating the need for expensive reference trajectories.
  • ⏱️
    Unified Force & Flow: We learn a continuous-time model that supports inference with arbitrary timesteps, functioning as both a conventional force field and a large-step integrator.

Methodology

Standard ML potentials approximate the potential energy surface $V(x)$, compute the forces $F(x)=-\nabla_x V(x)$, and simulate dynamics by integrating Hamilton's equations of motion with numerical integrators such as Velocity Verlet. In contrast, we learn the Hamiltonian Flow Map $u_{\Delta t}$ that directly predicts the phase-space evolution $(x_t, p_t)\rightarrow (x_{t + \Delta t}, p_{t + \Delta t})$ over a finite time interval $\Delta t$.

1

Parameterization

We parameterize this map using a neural network $u^\theta$ that takes the current state $(x_t, p_t)$ and a time interval $\Delta t$ as input and outputs the mean velocity and force over that interval. The future state is then obtained by adding the mean displacement to the current state, $(x_t, p_t) + \Delta t u^\theta(x_t, p_t, \Delta t)$, allowing us to decouple the step size from the stability limit of numerical integrators.

2

Mean Flow Consistency

We utilize that the change in position and momentum must equal the time-integrated velocity and force. With this, we can formulate a Mean Flow consistency condition that penalizes deviations between the predicted change and the mean quantities acting along the predicted path, using only instantaneous force labels from independent phase-space samples as the training signal.

3

Arbitrary Timesteps

We train our model on a distribution of time intervals $\Delta t \sim q(\Delta t)$, which enables inference with arbitrary timesteps rather than a single, fixed timestep. For $\Delta t = 0$, the model directly predicts the instantaneous forces. For $\Delta t > 0$, the model learns the cumulative dynamics, enabling stable rollouts at timesteps significantly larger than the stability limits of classical integrators.

Comparison with existing approaches

Comparison with existing approaches. To learn large timesteps, existing approaches rely on trajectory data, typically generated using a teacher MLFF model through sequential simulation with small timesteps. This potentially introduces artifacts from the teacher, can be computationally expensive, and the model only supports a single, fixed timestep during inference. In contrast, our method learns continuous-time, large-timestep dynamics directly from decorrelated phase-space samples without requiring expensive reference trajectories. Our tailored loss function combines force matching with a consistency constraint that enforces agreement of the predicted flow across different time horizons.

Results: Paracetamol

We validate our method on the flexible drug molecule Paracetamol. Unlike standard generative models that are limited to reproducing the specific (often unconverged) distribution of training data, Hamiltonian Flow Maps (HFM) function like Machine Learning Force Fields (MLFF): they learn the underlying dynamics rather than just the data density.

Consequently, our goal is to match the "gold standard" accuracy of a conventional MLFF but with significantly larger timesteps. HFM accurately reproduces the complex conformational landscape and vibrational spectra while enabling stable simulation at large timesteps (e.g., $\Delta t = 9.0$ fs) beyond the stability limit of classical integrators.

Data efficiency for Paracetamol in NVT simulation (3 ns)

Data efficiency for Paracetamol in NVT simulation (3 ns). We compare models trained on $\approx$ 85k samples (top) and on only 256 samples (bottom). We show the Free Energy Surface (FES) projected onto the dihedral angles $\varphi, \psi$. Both the MLFF and the HFM recover the reference distribution despite the biased training distribution. Our learned HFM additionally yields accurate large-timestep dynamics, as indicated by a vibrational spectrum that closely matches the small-timestep MLFF.

Resources

Interactive Demo

Explore the core training logic for the harmonic oscillator directly in your browser.

Notebook preview
HFM Training = Force Matching + Consistency Loss Training Step def train_step (model, x, f, t_max): # 1. Sampling p = sample_maxwell_boltzmann(temperature) dt = sample_timestep(t_max) # 2. Apply Model (JVP) # Tangents: [v, f, -1] for flow consistency tangents = [p/m, f, -1.0] u, du = jvp(model, (x, p, dt), tangents) # 3. Compute Loss (Stop Gradient) target = [p/m, f] + dt * du return (u - target.stop_gradient())**2 [Output] Hamiltonian Dynamics Loss: Converging... [Results] Full evaluation plots and metrics are available in the notebook. Run in Colab to see results →
Models

Pretrained checkpoints for Paracetamol, Alanine Dipeptide, and other benchmark systems will be released soon and will be made available here.

Coming Soon

Citation

@article{ripken2026learning,
    title = {Learning Hamiltonian Flow Maps: Mean Flow Consistency for Large-Timestep Molecular Dynamics},
    author = {Ripken, Winfried and Plainer, Michael and Lied, Gregor and Frank, Thorben and Unke, Oliver T. and Chmiela, Stefan and No{\'e}, Frank and M{\"u}ller, Klaus Robert},
    year = {2026},
    journal={arXiv preprint arXiv:2601.22123},
}