Pretraining Strategy for Neural Potentials

Zehua Zhang, Zijie Li, Amir Barati FarimaniarXiv 2024 · DOI

Introduction

Molecular Dynamics (MD) simulations are essential for drug discovery and materials science, yet they often face a trade-off between computational speed and accuracy. While ab initio methods like Density Functional Theory (DFT) provide high accuracy, they are computationally expensive. Machine Learning (ML) potentials, particularly Graph Neural Networks (GNNs), have emerged as a promising middle ground. However, these models are data-intensive, and high-quality training data is costly to produce. This paper explores a masked pretraining strategy for GNNs, inspired by successes in Natural Language Processing, to improve the accuracy and efficiency of neural potentials.

Methodology

The proposed approach utilizes a Masked Pretraining Strategy to help GNNs learn deep structural priors from molecular data. The workflow is divided into three primary stages: data preparation, pretraining on a pretext task, and finetuning on target properties.

Overview of the masked pretraining and finetuning workflow for neural potentials.

The Pretext Task

In the pretraining stage, the model is presented with molecular systems where the spatial information of specific atoms—typically hydrogen—is "masked" or removed. The GNN is then tasked with predicting the displacement of these hidden atoms relative to the rest of the molecular structure.

A key innovation in this method is the use of Cosine Similarity Loss instead of standard Euclidean distance (L1/L2) loss. This choice ensures scale invariance, allowing the model to focus on the relative geometry of the system, which remains consistent across varying external conditions such as temperature or pressure.

Transfer Learning

Once the GNN has been pretrained to reconstruct molecular geometry, its weights are transferred to a downstream task. In this Finetuning Stage, the model is trained to predict actual potential energy surfaces (PES) and atomic-level forces. This strategy is model-agnostic and has been successfully applied to both energy-centric models (e.g., EGNN) and force-centric models (e.g., ForceNet).

Experimental Setup

The strategy was evaluated across three benchmarks:

  1. Water RPBE: A high-accuracy DFT dataset with 7,241 structures.
  2. Water Tip3p: A larger dataset (10,000 structures) featuring 258 water molecules per sample to evaluate scalability in bulk systems.
  3. Revised MD17: A refined benchmark containing trajectories for 10 small organic molecules (e.g., Aspirin, Ethanol) at DFT accuracy.

Results and Discussion

The masked pretraining strategy yielded significant improvements across all tested models and datasets.

Performance Gains

On the RPBE water dataset, the EGNN model achieved a 58.9% improvement in force prediction accuracy and a 42.2% improvement in energy prediction. Similarly, on the Revised MD17 dataset, the method reduced the Mean Absolute Error (MAE) by approximately 30% for both force and energy across various organic molecules.

Stability and Efficiency

Beyond accuracy, pretraining provided substantial benefits for training stability. Models like ForceNet, which are often prone to gradient explosions when trained from scratch, converged smoothly when initialized with pretrained weights. Furthermore, pretrained models reached lower error rates more quickly than models trained for longer durations from scratch, demonstrating superior data efficiency.

The Role of Hydrogen

The researchers identified Hydrogen as the optimal atom for masking. Masking heavier atoms like Oxygen led to training instability, whereas Hydrogen's ubiquity and lighter mass provided a "just right" signal for learning molecular geometry without overwhelming the model.

Conclusion

The masked pretraining strategy represents a significant step forward in developing robust neural potentials. By leveraging structural priors through a BERT-like masking task, GNNs can achieve higher accuracy and better generalization with less labeled data. While currently focused on hydrogen-containing systems, future research may extend this approach to a broader range of chemical species and even larger foundation models for chemistry.

Summary updated

BibTeX
@misc{zhang2024pretraining,
  author = {Zehua Zhang and Zijie Li and Amir Barati Farimani},
  title = {{Pretraining Strategy for Neural Potentials}},
  year = {2024},
  eprint = {2402.15921},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.15921},
}
Figure