AnyLearn
All lessons
Scienceadvanced

Machine-Learned Interatomic Potentials: Standing In for DFT

How machine-learned interatomic potentials learn the energy surface that density functional theory computes, why locality and built-in symmetry make them fast and data-efficient, how universal potentials are trained, and where they quietly fail, such as the systematic softening that lowers phonon frequencies and migration barriers.

Updated · AI-authored, review-gated · how lessons are made

Progress1 / 10

The one function every simulation needs

Almost every computational question about a solid, from "is this crystal stable?" to "how fast do lithium ions move through it?", reduces to one function: the potential energy surface. Give it the positions of every atom, R=(r1,…,rN)\mathbf{R} = (\mathbf{r}_1, \dots, \mathbf{r}_N), and it returns the total energy E(R)E(\mathbf{R}). Forces are its slope:

Fi=−∂E∂ri\mathbf{F}_i = -\frac{\partial E}{\partial \mathbf{r}_i}

With energy and forces you can relax a structure to its nearest minimum, run molecular dynamics at a temperature, compute vibrations from the curvature, and compare competing crystal structures.

The gold-standard way to evaluate E(R)E(\mathbf{R}) for materials is density functional theory (DFT), which solves an approximate quantum-mechanical problem for the electrons at every new set of positions. A machine-learned interatomic potential (MLIP) is a model trained to reproduce DFT's energies and forces directly from positions, skipping the electrons entirely.

Sign in free to save your progress and earn certificates.

Full lesson text

All 10 steps on one page, for reading, reference, and search.

Show

1. The one function every simulation needs

Almost every computational question about a solid, from "is this crystal stable?" to "how fast do lithium ions move through it?", reduces to one function: the potential energy surface. Give it the positions of every atom, R=(r1,…,rN)\mathbf{R} = (\mathbf{r}_1, \dots, \mathbf{r}_N), and it returns the total energy E(R)E(\mathbf{R}). Forces are its slope:

Fi=−∂E∂ri\mathbf{F}_i = -\frac{\partial E}{\partial \mathbf{r}_i}

With energy and forces you can relax a structure to its nearest minimum, run molecular dynamics at a temperature, compute vibrations from the curvature, and compare competing crystal structures.

The gold-standard way to evaluate E(R)E(\mathbf{R}) for materials is density functional theory (DFT), which solves an approximate quantum-mechanical problem for the electrons at every new set of positions. A machine-learned interatomic potential (MLIP) is a model trained to reproduce DFT's energies and forces directly from positions, skipping the electrons entirely.

2. Why DFT is the bottleneck

DFT is accurate enough to be trusted for many inorganic solids, but its cost grows fast. Fiedler and colleagues (npj Computational Materials, 2023) summarise the standard algorithm as scaling with the cube of system size, which limits routine calculations to a few hundred atoms.

That ceiling collides with what materials questions actually demand:

  • Molecular dynamics needs energies and forces at every femtosecond-scale time step, for many thousands of steps, to see diffusion or melting.
  • Defects, surfaces and grain boundaries need large simulation cells so the feature does not interact with its own periodic copy.
  • Screening needs a relaxation for every one of thousands to millions of candidate structures.

Each workload multiplies an already expensive single calculation. An MLIP changes the economics: you pay for DFT once to build a training set, then evaluate the fitted model at a small fraction of the cost, with cost growing only linearly in the number of atoms for the reason explained next.

3. The locality trick

Every practical MLIP rests on one modelling assumption: the total energy is a sum of atomic contributions, and each contribution depends only on the atoms within a cutoff radius rcr_c around that atom.

E(R)=∑i=1Nε({rj−ri:∣rj−ri∣<rc})E(\mathbf{R}) = \sum_{i=1}^{N} \varepsilon\big(\{\mathbf{r}_j - \mathbf{r}_i : |\mathbf{r}_j - \mathbf{r}_i| < r_c\}\big)

The physical justification is the nearsightedness of electronic matter: in most solids, perturbing an atom far away barely changes the local electronic structure. The computational payoff is large. Because each atom only looks at a fixed-size neighbourhood, doubling the cell doubles the work, and the same model trained on small cells transfers to cells of any size.

Gotcha: Locality is an approximation, not a law. Long-range electrostatics in ionic solids, charge transfer, and metallic screening can reach past the cutoff. Some models add explicit long-range terms or, like CHGNet, extra information such as magnetic moments as a proxy for charge state. Know which effects your model can physically see.

4. Symmetry built in, not learned

Physics constrains the function ε\varepsilon before any data arrives. Translating or rotating the whole crystal must leave the energy unchanged, and swapping two identical atoms must too. Forces must rotate with the structure, a property called equivariance. Model families differ in how they guarantee this (the group theory behind it is covered in the lesson Symmetry Groups: Crystals, Conservation Laws, and Neural Networks).

FamilyHow symmetry is handledExamples
Descriptor + regressorHand-built invariant features of each neighbourhood, fed to a neural net or kernel modelBehler-Parrinello networks, GAP
Invariant graph networkAtoms are nodes, bonds are edges; messages use only distances and anglesM3GNet, CHGNet
Equivariant graph networkMessages carry vectors and higher-order tensors that rotate correctlyNequIP, MACE

Equivariance pays off in data. Batzner and colleagues (Nature Communications, 2022) reported that NequIP, an E(3)-equivariant network, outperformed existing models with up to three orders of magnitude fewer training data. Note the "up to": a best case across their benchmarks, not a constant factor.

5. What the model is trained on

An MLIP is fitted by regression on DFT labels. Each training structure contributes its energy, the force on every atom, and the stress on the cell, combined in a weighted loss:

L=wE(E^−E)2+wF3N∑i=1N∥F^i−Fi∥2+wσ∥σ^−σ∥2\mathcal{L} = w_E \big(\hat{E} - E\big)^2 + \frac{w_F}{3N} \sum_{i=1}^{N} \big\| \hat{\mathbf{F}}_i - \mathbf{F}_i \big\|^2 + w_\sigma \big\| \hat{\sigma} - \sigma \big\|^2

Forces dominate the information budget: one structure yields one energy but 3N3N force components. The MPtrj dataset released with CHGNet (Deng et al., Nature Machine Intelligence, 2023) shows the ratio at scale: 1,580,395 structures carrying 49,295,660 force labels, drawn from Materials Project relaxation trajectories.

Because the predicted forces are computed as the exact gradient of the predicted energy, the model is conservative by construction: molecular dynamics run with it conserves energy, which a model that predicts forces as a separate output cannot promise.

Key idea: An MLIP can only be as right as its labels. It learns the DFT functional's answer, including that functional's systematic errors, not the true physics.

6. Building and using a potential

The workflow is a loop, not a one-shot fit. Simulations driven by the model visit configurations the training set never contained, such as hot liquids, strained bonds or a migrating ion at its saddle point. A good workflow detects those, usually by the disagreement within an ensemble of models, sends them back to DFT, and refits. This active-learning loop is how a bespoke potential for one system becomes trustworthy, and it is the same idea GNoME used at the scale of a whole database.

flowchart LR
A["Reference DFT calculations"] --> B["Dataset of energies, forces, stresses"]
B --> C["Fit the MLIP"]
C --> D["Validate on held-out DFT"]
D --> E["Run relaxations or molecular dynamics"]
E --> F["Flag configurations the model is unsure about"]
F --> A

7. Universal potentials and fine-tuning

Classic MLIPs are bespoke: fitted to one chemical system for one study. Large DFT databases made a second kind possible, the universal potential, trained across most of the periodic table so it can be used on a new compound with no fitting at all.

  • CHGNet (Deng et al., 2023) was trained on MPtrj and also predicts magnetic moments, which helps it track charge states in battery materials such as lithium manganese oxides.
  • MACE-MP-0 (Batatia et al.) trains the equivariant MACE architecture on MPtrj and is reported to run stable molecular dynamics across a wide range of materials.
  • GNoME (Merchant et al., Nature, 2023) used relaxation data from its discovery campaign to pretrain a NequIP potential.
ApproachData costTypical role
BespokeHundreds to thousands of new DFT runsProduction accuracy on one system
Universal, zero-shotNoneFast first pass, screening, initial structures
Universal, fine-tunedA small set of system-specific DFT runsClose to bespoke accuracy for a fraction of the data

8. Code: relaxing a crystal with a universal potential

Universal potentials plug into the Atomic Simulation Environment (ASE) as a calculator, so the same optimisers and dynamics drivers work whether energies come from DFT or a model. This relaxes both atomic positions and the unit cell of silicon, starting from a deliberately stretched lattice:

from ase.build import bulk
from ase.filters import FrechetCellFilter
from ase.optimize import FIRE
from mace.calculators import mace_mp

atoms = bulk("Si", "diamond", a=5.60)          # stretched start
atoms.calc = mace_mp(model="medium", default_dtype="float64")

opt = FIRE(FrechetCellFilter(atoms))           # relax cell + positions
opt.run(fmax=0.01)                             # stop when forces < 0.01 eV/Å

print(f"{atoms.get_potential_energy() / len(atoms):.3f} eV/atom")
print(atoms.cell.cellpar()[:3])                # relaxed lattice lengths

Swap mace_mp for a DFT calculator and the script is unchanged, only far slower.

In practice: In a screening pipeline the MLIP relaxation is a pre-filter. The structures that survive are re-relaxed with DFT before anyone quotes an energy, because the decision that follows (the next lesson of this path) hinges on differences of a few tens of meV per atom.

9. The softening problem

Universal potentials share a characteristic bias. Deng and colleagues (npj Computational Materials, 2025) tested M3GNet, CHGNet and MACE-MP-0 and found a consistent softening of the potential energy surface: the models systematically underpredict energies and forces away from equilibrium. They traced it to underpredicted curvature, and the curvature error to training data dominated by near-equilibrium structures, which is what relaxation trajectories mostly contain.

The affected properties are exactly the ones that live away from the minimum: surface and defect energies, solid-solution energetics, phonon modes, and ion migration barriers.

Predict first

A softened potential underestimates the curvature of the energy well. Will its predicted phonon frequencies come out too high or too low, and what happens to a predicted ion migration barrier?

Because the error is largely systematic, it is cheap to correct: the preprint version of the study reports that fine-tuning on as little as a single additional data point fixes much of it.

10. When to trust a potential

An MLIP is an interpolator over its training distribution. Treat every result as a claim that needs a check proportional to how far it sits from that distribution.

  1. Chemistry coverage. Are your elements and bonding types well represented in the training data? A model trained mostly on oxides may be weak on, say, intermetallic hydrides.
  2. Configuration coverage. Equilibrium crystals are easy. Melts, surfaces, high pressure and transition states are where softening and extrapolation errors live.
  3. Spot-check against DFT. Recompute a handful of energies and forces for representative configurations from your own simulation, not from a benchmark.
  4. Uncertainty. Train or download an ensemble; large disagreement between members flags configurations to send back to DFT.
  5. The inherited ceiling. Agreement with DFT is the best case. If the DFT functional misdescribes your material, for example strongly correlated electrons, the potential faithfully copies that error.

The output of this machinery is a fast, approximate energy for any arrangement of atoms. The next lesson uses those energies to decide which hypothetical crystals deserve a synthesis attempt at all.

Check your understanding

The lesson ends with a 5-question quiz. Take it in the player above to see your score.

  1. Why does a machine-learned interatomic potential's cost grow only linearly with the number of atoms?
    • It solves the Kohn-Sham equations with a faster eigensolver
    • It ignores forces and predicts only the total energy
    • Each atom's energy contribution depends only on neighbours within a fixed cutoff radius
    • It is evaluated only on the primitive cell, never on supercells
  2. Computing forces as the exact negative gradient of the predicted energy guarantees which property?
    • Molecular dynamics with the model conserves energy
    • The model matches experiment better than DFT does
    • The model needs no stress labels during training
    • The model becomes equivariant to rotations automatically
  3. Deng and colleagues found universal potentials systematically 'soften' the energy surface. What did they identify as the root cause?
    • Too small a cutoff radius in all three architectures
    • Single-precision arithmetic during inference
    • Using equivariant rather than invariant message passing
    • Training data dominated by near-equilibrium structures, leading to underpredicted curvature
  4. A team uses a universal potential, zero-shot, to compute a lithium migration barrier and gets a value well below their later DFT check. Which explanation fits the softening result best?
    • The potential overestimated the curvature at the minimum
    • The potential underpredicted the energy of the high-energy saddle point configuration
    • Migration barriers cannot be computed with any interatomic potential
    • DFT systematically overestimates all barriers by a factor of two
  5. What is the best-case accuracy target for an MLIP trained only on data from one DFT functional?
    • Matching experiment, since machine learning corrects functional errors
    • Exceeding DFT, because forces carry more information than energies
    • Reproducing that functional's answers, including its systematic errors
    • Matching higher-level quantum chemistry methods automatically

Related lessons

Science
intermediate

Predicted, Made, Proven: Judging a Materials Discovery Claim

How to tell a predicted crystal from a validated new material. Builds an evidence ladder from predicted stable to useful, explains why zero-kelvin calculations invent atomic order that real samples lack, and applies the ladder to three documented cases: a large prediction database, an autonomous lab, and a generative model.

10 steps·~15 min
Science
intermediate

Closed-Loop Autonomous Labs for Inorganic Synthesis

How a self-driving lab turns predicted crystals into real powders: choosing targets, borrowing first recipes from the literature, reading products with machine-learned XRD analysis, and using reaction driving forces to decide the next experiment after a failure, with the A-Lab as the worked example of what automation speeds up and what it cannot settle.

10 steps·~15 min
AI
advanced

Measuring Continual Learning: Scenarios, Transfer Metrics, and Honest Baselines

The same method can score 99% or 21% on one benchmark depending on what the model is told at test time. Learn the task-, domain- and class-incremental scenarios, the accuracy matrix with backward and forward transfer, and the protocol choices and baselines that make a continual learning result trustworthy.

9 steps·~14 min
AI
advanced

Fixing Forgetting: Replay, Regularisation, and Parameter Isolation

The three families of continual learning methods, taken apart: experience and generative replay, gradient projection with GEM, weight penalties from EWC and synaptic intelligence, distillation, and per-task adapters. Includes a runnable PyTorch comparison of EWC and replay, and a table for choosing among them.

9 steps·~14 min