Stability-Aware Training of Machine Learning Force Fields with Differentiable Boltzmann Estimators

Sanjeev Raja, Ishan Amin, Fabian Pedregosa, Aditi S. Krishnapriyan

TL;DR

StABlE Training is a novel framework that significantly improves the stability of Machine Learning Force Fields (MLFFs) in long molecular dynamics simulations. By using a differentiable "Boltzmann Estimator," the method allows models to learn directly from macroscopic system observables (like bond length distributions) to correct unphysical behaviors without requiring any additional expensive quantum mechanical calculations.

What Problem Does This Paper Address?

Molecular Dynamics (MD) simulations are essential for studying everything from protein folding to battery materials. While traditional quantum mechanical (QM) methods are accurate, they are too slow for large systems. Machine Learning Force Fields (MLFFs) act as fast surrogates, but they have a major "stability" problem: they often drift into unphysical regions of the potential energy surface that weren't covered in their training data.

When this happens, simulations "collapse"—atoms might fly apart or overlap unnaturally, as shown in the failure modes in Figure 1.

Figure 1: Machine learning force field (MLFF) failure modes. (a) Illustrative examples of true and learned potential energy surfaces (PES) and resulting dynamics for unstable MLFFs. MLFFs can be accurate in approximat- ing much of the PES, but contain regions where energy and forces estimates deviate significantly from the true PES, leading to sampling of highly unphysical regimes. As a result, observables computed from MD simulation may be biased by the oversampling of unphysical states, or have high statistical error in the extreme case of unrecoverable simulation collapse. (b) Examples of stable versus unstable configurations sampled by MLFFs during molecular dy- namics simulation of systems considered in this work. (c) Selected states from an unstable MD trajectory of aspirin.

Standard solutions like active learning require running more expensive QM calculations to fill these gaps. The authors sought a way to fix these instabilities using only the data already available and macroscopic "observables" that describe how the system should behave on average.

Methods

The authors introduce StABlE (Stability-Aware Boltzmann Estimator) Training. The procedure alternates between two phases:

  1. Simulation Phase: The model runs many MD simulations in parallel to actively seek out regions where it becomes unstable.
  2. Learning Phase: Once instabilities are found, the model is updated to match reference system observables (like the distribution of interatomic distances).

The core innovation is the Boltzmann Estimator. Differentiating through a long MD simulation is notoriously difficult; it’s memory-intensive and numerically unstable. The authors treat the MD simulation as a way to sample from a Boltzmann distribution. By doing so, they can use implicit differentiation to compute gradients of macroscopic observables with respect to the model parameters without backpropagating through the entire simulation trajectory.

For large systems like liquid water, they also developed a Localized Boltzmann Estimator to target specific "pockets" of instability (like two molecules colliding) that might get washed out in global averages.

Figure 2: Schematic of Stability-Aware Boltzmann Estimator (StABlE) Training procedure. Our proposed StABlE Training procedure begins with conventional pre-training on a small reference dataset of QM calculations. This dataset remains fixed throughout the procedure, and is never expanded with new calculations. Upon convergence of pre-training, StABlE alternates between two main phases, simulation and learning. In the simulation phase, we perform many molecular dynamics simulations in parallel with the MLFF and find regions of instability. When a sufficient fraction of simulations become unstable, we enter the learning phase, where the MLFF is further trained to match known system observables from ab-initio simulation or experiment. Gradients are computed efficiently through the MD simulation via our Boltzmann Estimator. After a sufficient reduction in the portion of unstable trajectories, we re-enter the simulation phase, and repeat the training cycle until a predetermined computational budget is reached.

Datasets

The researchers evaluated StABlE across three distinct systems using different state-of-the-art MLFF architectures:

  • Aspirin (MD17 dataset): A small organic molecule, using the SchNet architecture.
  • Ac-Ala3-NHMe (MD22 dataset): A larger, flexible tetrapeptide, using the NequIP architecture.
  • Liquid Water: A condensed-phase system of 64 water molecules, using the GemNet-T architecture.

Key Insights and Ideas

  • Observables as a "Sanity Check": While forces tell a model how to move locally, macroscopic observables (like radial distribution functions) provide a global constraint that prevents the model from wandering into unphysical "holes" in the energy landscape.
  • Stability $\neq$ Accuracy: A model can have very low error on a static test set of forces but still be completely unstable in a live simulation. StABlE addresses this misalignment directly.
  • Data Efficiency: StABlE-trained models can outperform models trained on 50x more QM data. This suggests that "seeing" a simulation fail and correcting it with a simple physical constraint is more valuable than just adding more random data points.
  • Larger Timesteps: Interestingly, the authors found that simulation instability isn't just a result of large timesteps. StABlE-trained models remain stable even when the simulation timestep is doubled, effectively speeding up research.

Key Results

  • Massive Stability Gains: For aspirin, the median stable simulation time increased from 42 ps to 602 ps. Even when trained on only 1,000 QM structures, StABlE outperformed models trained conventionally on 50,000 structures.
  • Temperature Generalization: Models trained at 500K remained significantly more stable when tested at 350K and 700K compared to baseline models, as seen in Figure 4.
  • Accurate Transport Properties: In water simulations, StABlE-trained models provided much more accurate estimates of the diffusivity coefficient, a key property for materials science.
Figure 4: Testing temperature generalization for aspirin. (a, b) Fraction of unstable replicas as a function of simulation time for SchNet MLFFs at 350K and 700K. Applying StABlE Training yields significantly more stable simulations than a baseline SchNet model. (c, d) Distribution of interatomic distances (h(r)) from SchNet MLFFs. The StABlE-trained SchNet model more accurately recovers the true h(r) at both 350K and 700K (the inset shows difference between the predicted and reference h(r)). The AIMD reference h(r) is computed by Boltzmann-reweighting of independent samples from the 500K training dataset.

Limitations and Future Work

  • Under-constrained Objectives: Matching a sparse set of observables doesn't guarantee a unique potential energy surface. The authors mitigate this by regularizing with the original QM data.
  • Dynamical Observables: The current Boltzmann Estimator relies on equilibrium samples. It cannot yet be used to train directly on time-dependent properties like velocity autocorrelation functions (though it does improve them as a side effect).
  • Trade-offs: The authors noted a slight increase in force error on static test sets when stability is prioritized, suggesting a Pareto frontier between local force accuracy and global simulation stability.

Overall, StABlE Training offers a powerful, self-contained framework for researchers to build robust ML models for molecular science without the bottleneck of endless high-level quantum calculations.

Summary updated

BibTeX
@article{raja2025stability,
  author = {Sanjeev Raja and Ishan Amin and Fabian Pedregosa and Aditi S. Krishnapriyan},
  title = {{Stability-Aware Training of Machine Learning Force Fields with Differentiable Boltzmann Estimators}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2025},
}
Figure