Lesson 7.2 · 18 min

Machine-learning potentials

Machine-learning interatomic potentials (MLIPs) learn the energy and forces of a quantum-mechanical method such as DFT and reproduce them at a tiny fraction of the cost. They write the energy as a sum of atomic contributions that depend on each atom's neighbourhood, are fitted to energies and forces, and must be trained on data that cover every configuration the simulation will visit.

The idea

DFT gives accurate energies and forces, but its cost grows roughly as N³ and a single MD step for a few hundred atoms can take minutes. Classical force fields are fast but have a fixed functional form that often misses many-body effects (polarization, bond breaking, unusual coordination). Machine-learning interatomic potentials (MLIPs) aim for both: train a flexible model on DFT data, then run MD with the model.

Atomic energies. Almost all MLIPs write the total energy as a sum over atoms, E = Σi εi, where εi depends only on the positions of neighbours within a cutoff (typically 5–6 Å). This makes the cost linear in N, like a classical force field, and lets a model trained on small cells be used for large ones.

Descriptors and symmetry. The model must give the same energy if the system is translated, rotated or if identical atoms are swapped. Early models (Behler–Parrinello neural networks, GAP/SOAP, SNAP, ACE) feed each atom's neighbourhood through hand-built invariant descriptors (radial and angular functions) into a neural network or a linear/kernel model. Modern equivariant message-passing networks (NequIP, Allegro, MACE) learn the descriptors themselves, passing geometric information between neighbouring atoms with built-in rotational symmetry; they are among the most accurate and data-efficient.

Fitting to forces. Forces are the negative gradient of the model energy, so they come for free and are energy-conserving. Each configuration gives one energy but 3N force components, so training on forces is far more informative (code tab, Part 1: a linear model with angular descriptors fits a three-body reference 4× better than a pair potential).

Extrapolation is the main danger. An MLIP has no physics outside its training data. In unseen configurations (higher temperature, compression, a new chemical environment) errors can grow by an order of magnitude (Part 2), and a simulation can wander into unphysical "holes" where the model predicts a low energy. Two defences: training data that cover what MD will visit, and an uncertainty estimate (committee spread, Gaussian-process variance, or MACE/NequIP ensembles). Active learning runs MD with the current model, picks the configurations where it is least certain, computes DFT there, and retrains (Part 3 and the widget).

Foundation models (for example MACE-MP-0 and similar models trained on large materials databases) work out of the box for many systems and are a good starting point for fine-tuning on your own DFT data.

Key idea. E = Σ atomic energies of local environments, learned from DFT energies and forces. Validate on unseen data, watch the uncertainty, and grow the training set where the model is unsure.

The algorithm

1. initial data : DFT on a few hundred diverse configurations (AIMD snippets, distorted cells, different T/ρ)
2. train        : minimize  Σ (E_model - E_DFT)²/N² · w_E  +  Σ |F_model - F_DFT|² · w_F   (+ stress)
3. validate     : held-out test set; parity plots for E, F; also physical tests (g(r), density, D, phonons)
4. explore      : run MD with the model at the conditions you care about
5. select       : configurations with high uncertainty (committee spread / model std)
6. label        : DFT on the selected configurations; add to the training set; go to 2
7. production   : long MD with the final model; monitor the uncertainty during the run
  1. DFT settings (functional, dispersion correction, basis, k-points) define what the model learns; keep them identical for all data.
  2. Training codes: mace, nequip/allegro, pacemaker (ACE), FitSNAP, DeePMD-kit. Active-learning helpers: FLARE and committee scripts.
  3. Running: LAMMPS (pair_style mace, pair_style allegro, ML-PACE, ML-SNAP), ASE calculators, OpenMM-ML, and GROMACS through its neural-network potential interface.
  4. Watch for long-range physics: plain local models miss electrostatics beyond the cutoff; for ionic systems consider models with explicit long-range terms or charges.