Abstract
Machine learning interatomic potentials (MLIPs) enable more efficient molecular dynamics (MD) simulations with ab initio accuracy, which have been used in various domains of physical science. However, distribution shift between training and test data causes deterioration of the test performance of MLIPs, and even leads to collapse of MD simulations. In this work, we propose an online Test-time Adaptation Interatomic Potential (TAIP) framework to improve the generalization on test data. Specifically, we design a dual-level self-supervised learning approach that leverages global structure and atomic local environment information to align the model with the test data. Extensive experiments demonstrate TAIP's capability to bridge the domain gap between training and test dataset without additional data. TAIP enhances the test performance on various benchmarks, from small molecule datasets to complex periodic molecular systems with various types of elements. Remarkably, it also enables stable MD simulations where the corresponding baseline models collapse.
Introduction
Molecular Dynamics (MD) simulations serve as critical "microscopes" in computational chemistry, providing a window into atomic-scale interactions. While traditional ab initio methods offer high accuracy, their computational cost is prohibitive for large-scale systems. Machine Learning Interatomic Potentials (MLIPs) have emerged as a powerful alternative, learning to predict potential energy surfaces from data.
However, MLIPs face a significant challenge: distribution shift. When a simulation encounters atomic configurations outside its training distribution—such as rare chemical reactions or phase transitions—model predictions become unreliable. This often results in "simulation collapse," where atoms behave unphysically, rendering the simulation useless. Traditionally, addressing this requires expensive active learning cycles to collect new labeled data. This paper introduces TAIP, a framework that allows models to adapt to new data on-the-fly during inference using self-supervised learning, effectively preventing collapse without additional labels.
The TAIP Framework
TAIP (Test-time Adaptation Interatomic Potential) shifts the paradigm from static models to adaptive ones. Instead of freezing the model after training, TAIP enables continuous refinement during the testing (inference) phase.
The core of TAIP is a dual-level self-supervised learning (SSL) scheme that utilizes the internal geometry of atomic structures as a training signal. The model is optimized using three auxiliary tasks:
- Noise Intensity Prediction (Global): The model predicts the level of perturbation applied to a molecule, learning robust global structural features.
- Atom Feature Recovery (Local): By masking specific atoms and predicting their types from neighbors, the model learns to understand local chemical environments.
- Pseudo Force Recovery (Local): The model reconstructs "pseudo forces" from masked features to capture intricate inter-atomic relationships.
During the adaptation phase, when a new test sample is encountered, the model performs a single gradient update on its encoder to minimize these SSL losses. This "feature alignment" pulls the test data embeddings closer to the training distribution, bridging the domain gap before final energy and force predictions are made.
Experimental Evaluation and Results
The researchers evaluated TAIP across diverse benchmarks, including small organic molecules (MD17), isomers (ISO17), and complex periodic systems like liquid water, ice, and electrolyte solutions.
Key Findings:
- Significant Accuracy Gains: TAIP reduced prediction errors by an average of 30% across all datasets compared to standard models like SchNet and PaiNN. In the ISO17 isomer dataset, error reduction reached 40%.
- Simulation Stability: In electrolyte simulations, baseline models typically collapsed within 0.1 ps. In contrast, TAIP-enabled models maintained stability for over 500 ps, demonstrating its robustness in handling complex ionic environments.
- Cross-Phase Generalization: When trained on liquid water and tested on ice, TAIP significantly outperformed static baselines, proving its ability to adapt to different physical states of the same substance.
Conclusion
TAIP represents a major step forward in making MLIPs more reliable for real-world scientific discovery. By leveraging self-supervision to adapt at test-time, it mitigates the risks of distribution shift and simulation collapse. While the current implementation introduces a modest computational overhead due to the per-sample gradient update, the gains in stability and accuracy provide a compelling trade-off for complex molecular simulations. Future research may focus on more dynamic adaptation strategies to further optimize the balance between computational efficiency and model robustness.
Summary updated