Adversarial Attacks on Uncertainty Enable Active Learning for Neural Network Potentials

Daniel Schwalbe-Koda, Aik Rui Tan, Rafael Gómez-BombarelliarXiv 2021

Abstract

Neural network interatomic potentials (NNPs) offer a computationally efficient alternative to first-principles methods but often suffer from poor extrapolation in unseen regions of the potential energy surface (PES). We present an active learning framework that utilizes adversarial attacks to identify high-uncertainty molecular configurations. By maximizing model disagreement through gradient-based optimization of atomic coordinates, we can efficiently sample informative geometries that improve model robustness and accuracy. Our approach demonstrates significant improvements in stability and predictive power across systems ranging from toy models to complex molecular inversions and peptide conformations.

Introduction

The development of neural network interatomic potentials has significantly accelerated computational chemistry by providing ab initio accuracy at a fraction of the cost. However, these models are inherently "brittle," often failing catastrophically when encountering molecular geometries outside their training distribution. This is particularly problematic during long-duration molecular dynamics (MD) simulations or when modeling rare events like chemical reactions.

Traditional active learning (AL) strategies attempt to mitigate this by identifying uncertain configurations during simulations and labeling them with expensive quantum mechanical calculations (e.g., Density Functional Theory). However, standard MD simulations primarily sample low-energy, well-known regions of the PES, making the discovery of critical "edge cases"—such as transition states or high-energy distortions—a slow and inefficient process.

Methodology: Adversarial Active Learning

To overcome the limitations of standard sampling, we propose an "inverse sampling" strategy inspired by adversarial attacks in computer vision. Instead of waiting for a simulation to stumble upon an uncertain state, we actively "push" the molecule toward configurations that maximize the model's uncertainty.

Overview of the adversarial attack framework and the active learning cycle.

The framework relies on several key components:

  1. Neural Network Committees: An ensemble of models is used to estimate epistemic uncertainty. High variance in the predictions of the committee members indicates regions where the model is poorly constrained.
  2. Differentiable Uncertainty: Since NNPs are differentiable, we can compute the gradient of the uncertainty metric (e.g., force variance) with respect to atomic positions. This allows for efficient exploration of the PES via gradient ascent.
  3. Likelihood Weighting: To ensure that the adversarial attacks generate physically plausible configurations rather than unphysical "explosions," the adversarial loss is weighted with a Boltzmann factor.
  4. Collective Variables (CVs): For complex systems, attacks can be directed toward specific degrees of freedom, such as dihedral angles, to ensure the model learns critical structural transitions.

Experimental Evaluation

The method was validated on three distinct systems:

  • 2D Double Well Potential: A mathematical toy model used to demonstrate the algorithm's ability to "discover" hidden energy basins.
  • Ammonia ($NH_3$) Inversion: A classic chemical benchmark requiring the model to learn the energy barrier of the nitrogen atom passing through the hydrogen plane.
  • Alanine Dipeptide: A standard benchmark for molecular simulation used to test the method's scalability to complex conformational changes.

Results and Discussion

Our results indicate that maximizing force uncertainty is a superior signal for active learning compared to energy uncertainty, as force-matching is the primary driver of NNP training.

Results for the ammonia inversion system, comparing adversarial attacks to random sampling and showing the improved accuracy of the reaction barrier.

In the ammonia inversion case, the adversarially-trained model predicted the inversion barrier within 0.25 kcal/mol of the DFT ground truth by the second generation. In contrast, models trained on random distortions consistently overestimated this barrier. Furthermore, the adversarial approach significantly improved the stability of MD trajectories. For alanine dipeptide, models trained with adversarial samples achieved 83% trajectory stability, compared to only 63% for those using random sampling.

The adversarial strategy effectively bypasses the "curse of dimensionality" that plagues random sampling. As the number of atoms increases, the volume of the configuration space grows exponentially, making random exploration increasingly futile. Adversarial attacks provide a guided search that scales more effectively to larger molecular systems.

Conclusion and Future Work

Adversarial active learning provides a robust framework for building reliable neural network potentials with minimal ground-truth data. By intentionally seeking out and learning from the model's own weaknesses, we can create potentials that are both accurate and stable across a wide range of physical conditions.

Future work will focus on automating the selection of collective variables for very large systems and refining the "physicality" constraints of the attacks to prevent the inclusion of extremely high-energy configurations that might degrade training. This framework paves the way for automated transition state discovery and more trustworthy long-term molecular simulations.

Summary updated

BibTeX
@misc{schwalbekoda2021adversarial,
  author = {Daniel Schwalbe-Koda and Aik Rui Tan and Rafael Gómez-Bombarelli},
  title = {{Adversarial Attacks on Uncertainty Enable Active Learning for Neural Network Potentials}},
  year = {2021},
  eprint = {2101.11588},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2101.11588},
}
Figure