Source-linked AI summary
On the role of gradients for machine learning of molecular energies and forces
Anders S. Christensen, O. Anatole von Lilienfeld
TL;DR
The paper asks how energy and force labels should be selected to train accurate molecular machine-learning potentials efficiently. It compares function-, derivative-, and combined-label training across generic and molecular datasets, finding that the value of force labels depends on the dataset, predicted property, acquisition cost, and model size. The results support dataset-design choices tailored to whether the goal is energy prediction, force prediction, or both.
Problem
The paper addresses uncertainty about when force labels improve machine-learning potentials relative to energy labels under a limited computational budget.
Method
The study compares models trained and evaluated with functions, derivatives, or both across Himmelblau’s function and molecular datasets.
Results
Force labels improve force prediction across the studied molecular settings, but they do not improve energy prediction for diverse organic molecules, whereas single-surface datasets benefit from including forces alongside energies.
Takeaways & Limitations
Training-label choices should reflect the application, target property, acquisition cost, desired model compactness, and execution requirements.
Takeaways & Limitations
Models trained on force labels can be substantially more expensive to train and execute than models trained on the same number of energy labels.
Abstract
from arXiv · showhide
The accuracy of any machine learning potential can only be as good as the data used in the fitting process. The most efficient model therefore selects the training data that will yield the highest accuracy compared to the cost of obtaining the training data. We investigate the convergence of prediction errors of quantum machine learning models for organic molecules trained on energy and force labels, two common data types in molecular simulations. When training and predicting on different geometries corresponding to the same single molecule, we find that the inclusion of atomic forces in the training data increases the accuracy of the predicted energies and forces 7-fold, compared to models trained on energy only. Surprisingly, for models trained on sets of organic molecules of varying size and composition in non-equilibrium conformations, inclusion of forces in the training does not improve the predicted energies of unseen molecules in new conformations. Predicted forces, however, also improve about 7-fold. For the systems studied, we find that force labels and energy labels contribute equally per label to the convergence of the prediction errors. Choosing to include derivatives such as atomic forces in the training set or not should thus depend on, not only on the computational cost of acquiring the force labels for training, but also on the application domain, the property of interest, and the desirable size of the machine learning model. Based on our observations we describe key considerations for the creation of datasets for potential energy surfaces of molecules which maximize the efficiency of the resulting machine learning models.
1. Introduction
Machine-learning potentials depend on carefully selected training data, but the value of adding force labels relative to energy labels remains unclear across molecular applications. This paper compares function, derivative, and combined training and evaluation choices across generic and chemical use cases.
- Adequate training data is essential for accurate machine-learning approximations of molecular potential energy surfaces.
- The relative benefit of force labels remains unresolved, with prior studies reporting strong results from force-only or energy-only training.
- The paper evaluates how including atomic force vectors alongside energies affects predictive accuracy under a fixed computational-data budget.
- The study compares nine combinations of function, derivative, and combined choices in training loss functions and prediction-error measures.
- Learning-curve behavior is examined first on Himmelblau’s function and then for single-molecule and cross-molecule chemical applications.
- The cross-molecule use case tests whether force-inclusive training helps models generalize from known molecules to unseen molecules and conformations.
2. Theory
The theory compares energy-only, combined energy-and-force, and force-only kernel regressors, using shared representations and closed-form regression where possible. It also specifies how energies and forces are represented, predicted, and constrained across single- and multiple-surface settings.
- Regressor families: The regressors use the same kernel functions and representations, while loss functions place basis kernels and kernel derivatives on training data.This design enables fair comparisons and closed-form solutions.
- Regressor families: Three regressors train on energies only, energies plus forces, or forces only, yielding nine combinations of training and testing loss functions.The models are formulated within kernel ridge regression or Gaussian process regression notation.
- Energy-only training: Energy-only kernel ridge regression expands query energies over training molecules, with coefficients obtained by minimizing regularized squared errors.The kernel matrix contains pairwise similarities between training and prediction molecules, and regularization controls the coefficient penalty.
- Combined energy-and-force training: Combined training augments the basis with kernel derivatives so the model can simultaneously match reference energies and forces.Additional basis functions are needed because each energy label is accompanied by multiple force labels.
- Force-only training: Force-only training uses derivative kernels and predicts energies by integrating the learned force field, leaving energies determined up to an integration constant.The constant is usually unimportant for one surface but complicates energy prediction across molecules with varying size and composition.
- Test systems and representations: The study benchmarks these regressors on Himmelblau’s function and molecular energetics, using FCHL19 to represent atomic environments and a localized kernel summing environment similarities.Different kernel and representation choices are used for the analytical function and molecular systems.
3. Results
The results show that force labels substantially improve learning for a single molecular surface, but their benefit depends on whether the model must generalize across chemical compositions. For unseen molecules, forces improve force predictions while adding little or no energy-prediction benefit.
- 3.1. Toy system: Learning Himmelblau’s Function: 7.0-fold and 7.2-fold reductions in the learning-curve offset were obtained for function-value prediction using derivatives alone or derivatives plus function values, respectively.Adding function values to derivative training provided little additional benefit.
- 3.1. Toy system: Learning Himmelblau’s Function: 7.9-fold and 7.0-fold reductions in the learning-curve offset were obtained for gradient prediction using gradients alone or gradients plus function values, respectively.The improvement was measured relative to training on function values only.
- 3.1. Toy system: Learning Himmelblau’s Function: The two models including gradients had mostly overlapping 95% confidence intervals, and their difference was not statistically significant.The learning curves were also consistent with expected power-law behavior across the tested ranges.
- 3.2. Use case 1: Learning the PES for a one molecule: About 7-fold lower energy and force MAEs were obtained on the revised MD17 molecules when forces were included, while adding energies to force training made little difference.At N=1000, the largest differences from adding energies were 0.001 kcal/mol for energy MAE and 0.002 kcal/mol/Å for force-component MAE.
- 3.3. Use case 2: Training models across chemical composition: For 1,595 chemically distinct molecules, force inclusion hardly changed energy learning, with the largest deviation between energy-learning curves being 3% of the average MAE.The authors attribute this to forces determining each potential surface only up to an integration constant, while energy labels determine differences between molecular compositions.
- 3.3. Use case 2: Training models across chemical composition: 51 times fewer labels were required by the energy-only model to reach the same energy accuracy, whereas including forces reduced force-component MAE by 3.5-fold.The additional force labels therefore did not aid energy prediction for unseen molecules but improved prediction of each molecule’s relative energy landscape.
4. Methodology
The methodology combines molecular datasets, kernel-based models, nested cross-validation, and learning-curve analysis to compare training on energies, forces, or both.
- Cross-validation: Nested cross-validation randomized datasets, used 100 folds for Himmelblau’s function, and used five folds for molecular datasets.Grid-search cross-validation within each training fold selected model settings.
- Hyperparameters: The molecular learning-curve analysis used kernel-width and regularization grids spanning σ=0.25–32.0 and λ=10^-12–10^-6.These hyperparameter ranges were used for the molecular datasets.
- Data characterization: Figures characterize molecular-size, atomization-energy, and force distributions, while models were implemented with QML and plotted using Matplotlib and Seaborn.Scikit-Learn supplied linear fits to the learning curves.
- Datasets: The molecular datasets comprise revised MD17 structures and non-equilibrium conformers of 1,595 small organic molecules.The revised MD17 data covers 10 molecules with force and energy evaluations, while the diverse dataset contains molecules with up to 7 CNO atoms.
- Datasets: The small-organic-molecule dataset provides atomization energies and corresponding forces computed at the ωB97xD/6-31G(d) level.Its structures were generated using normal-mode sampling.
5. Conclusion and Outlook
The conclusions distinguish single-surface learning from learning across chemically diverse molecules. Force labels improve force prediction broadly, but their value for energy prediction and dataset design depends on the task, label cost, and model complexity.
- Learning-curve behavior: Power-law learning behavior was confirmed for two molecular dataset types and Himmelblau’s function across 6 orders of magnitude.The result applies to machines trained on function derivatives as well as scalar values.
- Single-surface datasets: For single surfaces, adding force labels improves predictive error at fixed training-point counts, while force-only and combined models differ negligibly.When counted by total labels, force and energy prediction errors are close to identical across energy-only, force-only, and combined training.
- Diverse molecular datasets: For chemically diverse molecules, force labels do not improve energy prediction but greatly improve atomic-force prediction.Energy-only training reaches comparable energy accuracy with about 20× fewer labels than combined training in this setting.
- Dataset design: For MD17-type use cases, force labels are beneficial when their acquisition costs less than 3N independent single-point energy calculations.The recommendation is especially favorable for DFT datasets, whereas costlier gradients make inclusion less favorable.
- Dataset design: For chemical-space energy prediction, compact models may favor compositionally diverse energy-only data, whereas force modeling favors adding force labels when acquisition is cheaper.Force-trained models can require substantially more expensive training and execution than models trained on the same number of energy labels.
- Scope: The conclusions are presented as applicable to machine learning tasks that learn multidimensional, differentiable function surfaces.This extends the paper’s dataset-design perspective beyond molecular potential-energy surfaces.
Supplementary Material
The supplementary material provides learning-curve comparisons across loss functions and tabulated force and energy errors for the revised MD17 dataset.
- Learning curves: Figure S1 compares test learning curves for function-value-only, gradient-only, and combined loss functions.The corresponding machines are shown as green, red, and blue curves, respectively.
- Learning curves: Figure S2 presents force and energy learning curves for the revised MD17 dataset using multiple training-data types.It also includes results for the original, noisier DFT data.