Analyzing Atomic Interactions in Molecules as Learned by Neural Networks

Malte Esders, Thomas Schnake, Jonas Lederer, Adil Kabylda, Grégoire Montavon, Alexandre Tkatchenko, K. Müller

TL;DR

This paper introduces a novel framework using Explainable AI (XAI) to analyze how well machine learning models (specifically neural networks like SchNet and PaiNN) learn fundamental chemical principles. The key takeaway is that high prediction accuracy doesn't guarantee stable molecular simulations; models that violate basic chemical physics principles, even with good accuracy, can lead to unstable dynamics.

What Problem Does This Paper Address?

Machine learning (ML) models, particularly neural networks, have achieved remarkable accuracy in predicting molecular properties like energies and forces. However, this accuracy on a test set doesn't automatically mean the models have truly "learned" the underlying physics. A common issue is that these models can fail to extrapolate beyond their training data, leading to unstable simulations, especially in molecular dynamics (MD). This paper addresses the critical question: how can we ensure that ML models used in chemistry are not just accurate but also chemically plausible and robust? The authors aim to bridge the gap between high predictive accuracy and reliable chemical modeling by analyzing the "learned representations" of ML models.

Methods

The core of this work is a novel framework built upon Explainable AI (XAI) techniques, specifically an extension of Layer-wise Relevance Propagation (LRP) called GNN-LRP. This framework allows the researchers to:

  • Quantify Interaction Strength: Develop measures to assess how strongly different atom pairs interact as perceived by the ML model.
  • Determine Interaction Range: Define the distance up to which a model considers interactions significant.
  • Measure Many-Bodyness: Quantify how much the interaction between two atoms is influenced by the presence of other atoms in their chemical neighborhood.

These XAI tools are then used to systematically evaluate ML models against four fundamental chemical principles.

Datasets

  • QM9 Dataset: Used for training and evaluating models on properties like atomization energy, dipole moment, HOMO, and LUMO energies.
  • MD22 Dataset: Specifically, the Ac-Ala3-NHMe molecule from this dataset was used for training and evaluating models on energies and forces, particularly for MD stability tests.

Key Insights and Ideas

  • Accuracy Isn't Everything: High prediction accuracy on a test set is insufficient to guarantee stable molecular dynamics. Models can achieve low errors by exploiting data artifacts (the "Clever Hans effect") rather than truly learning physical principles.
  • Chemical Principles as a Diagnostic Tool: By evaluating ML models against fundamental chemical principles (atom-type dependence, intensive vs. extensive properties, power-law decay, and many-bodyness), researchers can gain deeper insights into their learned representations.
  • Interaction Range Matters for Property Type: Intensive properties (like dipole moment, HOMO/LUMO) require models to learn longer interaction ranges than extensive properties (like atomization energy).
  • Power-Law Decay is Crucial: Many physical interactions decay with distance following a power law. ML models that fail to learn this decay (e.g., exhibiting exponential decay or plateauing) lead to unstable MD trajectories.
  • Many-Bodyness is Key to Stability: Models that better capture the "many-bodyness" of interactions (i.e., how the neighborhood influences atom-pair interactions) tend to be more stable in MD simulations.
  • Architectural Choices Impact Learning: The number of layers and cutoff distances in GNNs significantly influence their ability to learn chemical principles and, consequently, their MD stability.

Key Results

  • SchNet and PaiNN Models: The study applied the XAI framework to SchNet and PaiNN, two popular graph neural network architectures for molecular modeling.
  • Atom-Type and Property Dependence: Both SchNet and PaiNN models captured the atom-type and property dependence of interaction strengths, as visualized in heatmaps.
  • Interaction Range Differences: Models trained on intensive properties (dipole moment, HOMO, LUMO) showed longer interaction ranges than those trained on extensive properties (atomization energy), aligning with theoretical expectations.
  • Violation of Power-Law Decay: A significant finding was that ML models, particularly when using common cutoff distances, tend to learn an exponential decay of interaction strength rather than the expected power-law decay. This was particularly evident in models with fewer layers or inappropriate cutoffs.
  • MD Instability Linked to Chemical Implausibility: Models that deviated from chemical principles (e.g., incorrect interaction decay, excessive many-bodyness) exhibited significantly higher rates of MD instability, even when their test errors were comparable to stable models. For instance, a 1-layer PaiNN model showed a high rate of MD failures (22/30), while a 3-layer model was mostly stable (0/30).
  • Many-Bodyness Correlation: The study found that many-bodyness generally increased with distance in well-behaved models (3-5 layers), but excessively high many-bodyness in some models correlated with instability.

Limitations and Future Work

  • Architectural Constraints: The paper suggests that current GNN architectures might implicitly enforce an exponential decay due to their message-passing mechanisms and cutoff functions, hindering the learning of true power-law decay. Future work could focus on designing architectures that better accommodate power-law interactions.
  • Model Design Guidance: The authors propose that their XAI framework can guide the development of more robust and transferable MLFFs by identifying models that learn chemically plausible representations.
  • Beyond Validation Accuracy: The study strongly advocates for moving beyond simple validation accuracy metrics to include analyses based on chemical principles and MD stability for a more comprehensive model evaluation.
  • Transferability: While not explicitly a limitation of the XAI method itself, the paper implies that improving the learned representations could lead to better transferability of MLFFs to new chemical spaces.

Summary updated

BibTeX
@article{esders2025analyzing,
  author = {Malte Esders and Thomas Schnake and Jonas Lederer and Adil Kabylda and Grégoire Montavon and Alexandre Tkatchenko and K. Müller},
  title = {{Analyzing Atomic Interactions in Molecules as Learned by Neural Networks}},
  journal = {Journal of Chemical Theory and Computation},
  year = {2025},
  doi = {10.1021/acs.jctc.4c01424},
}
Figure