Benchmarking Compositional Generalisation for Machine Learning Interatomic Potentials

GMD: testing known parts in new molecules

Amir Masoud Nourollah
Irtaza Khalid
Stefano Leoni
Steven Schockaert

Overview

  1. Introduction: two fields, one question
  2. Background: how machines learn about molecules
  3. Motivation: where the data runs out
  4. GMD: a benchmark for known parts in new molecules
  5. Results: where and why models fail
  6. Takeaways and what comes next

How a chemist reads a molecule

G. Socrates, Infrared and Raman Characteristic Group Frequencies, 3rd ed., Wiley (2001); S. W. Benson, J. H. Buss, J. Chem. Phys. 29, 546 (1958).

This is called compositionality. Do machine learning models know what is compositionality?

Compositional generalisation

  • Learn the parts, then handle new combinations of them
  • A model that understands jump and twice can carry out jump twice, a command it never saw
  • Standard models often fail: SCAN, COGS in language; CLEVR-CoGenT in vision

Chemists do this every day. For ML it is still an open problem.

B. Lake, M. Baroni, ICML (2018); N. Kim, T. Linzen, EMNLP (2020); J. Johnson et al., CVPR (2017).

Before asking whether models can do this for molecules, we need to know where learning breaks down. First, how does a machine learn at all?

Teaching a computer from examples

  • We give the computer examples: inputs and the correct answers
  • It tunes a flexible formula until its predictions match those answers
  • “Learning” means finding the parameters with the smallest error

You already do this: fit a curve to two or three experimental points, then predict other amounts of reactant without running more experiments.

C. M. Bishop, Pattern Recognition and Machine Learning, Springer (2006), ch. 1.

Can we rely on what the model has learned, or are we missing something?

Inside the data versus outside it

  • Between known points the model interpolates, and is usually reliable
  • Beyond them it extrapolates, and nothing in the training checks it
  • Models that agree inside the data can disagree wildly outside it

A small training error says little about data the model has never seen.

C. M. Bishop, Pattern Recognition and Machine Learning, Springer (2006), §1.1, §3.2.

Let’s see how different our interpretation of a molecule is from a computer’s.

What does a molecule look like to a computer?

  • Input: each atom’s element and 3D position, exactly what an .xyz file holds
  • Output: the energy E, and the force on every atom
  • Many other representations: adjacency matrices, molecular graphs, SMILES, fingerprints

The model never sees a label like “carbonyl”: only elements and distances.

J. Behler, M. Parrinello, Phys. Rev. Lett. 98, 146401 (2007); I. Batatia et al., NeurIPS (2022).

Then does machine learning models read molecules the way a chemist does?

Does machine learning models read molecules this way?

  • The model learns from whole molecules, one geometry at a time
  • Nothing forces it to learn “parts” the way a chemist does
  • It might learn rules, or it might memorise the molecules it was shown

If every part of a new molecule is familiar, does the model find the whole familiar?

B. Lake, M. Baroni, ICML (2018).

Any method can supply the data and become a teacher

  • From CCSD(T) to GFN2-xTB, every method gives energies and forces for a geometry
  • So any of them can supply training data
  • Datasets range from ten small molecules (MD17) to over 100 million calculations (OMol25)

A model is at best as accurate as the method that produced its data.

S. Chmiela et al., Sci. Adv. 3, e1603015 (2017); C. Bannwarth, S. Ehlert, S. Grimme, J. Chem. Theory Comput. 15, 1652 (2019); D. S. Levine et al., arXiv (2025).

If these methods already give us energies and forces, why not just keep using them?

Why we invented semi-empirical methods

  • Cost grows steeply with size: roughly N4 for Hartree–Fock, N5 for MP2, N7 for CCSD(T)
  • Molecular dynamics needs energies and forces at millions of time steps
  • Semi-empirical methods replaced expensive integrals with fitted parameters

Every step down the ladder makes the same trade: accuracy for time and computer resources.

M. J. S. Dewar, W. Thiel, J. Am. Chem. Soc. 99, 4899 (1977); W. Thiel, WIREs Comput. Mol. Sci. 4, 145 (2014).

Machine learning makes a similar trade, by fitting to data. So what kind of method is it?

Enter machine-learning potentials

  • Learn from reference calculations once
  • Then predict energies and forces in milliseconds, close to the reference accuracy
  • Nanosecond MD at near-reference accuracy becomes routine

Is machine learning a numerical, a semi-empirical, or an empirical method?

J. Behler, Chem. Rev. 121, 10037 (2021).

If labels are this expensive, why not pay once, at scale, for all of chemistry? Is that possible to cover all the chemical space?

Foundation models for atoms

  • More DFT calculations, bigger datasets: MPtrj (materials), OMol25 (molecules, 100M+ calculations)
  • Pre-train once on millions of structures, then fine-tune or use zero-shot
  • Examples: MACE-MP-0, UMA, PET-MAD

The assumption: they learn chemistry itself. Or do they stay grounded in what they have seen?

I. Batatia et al., arXiv:2401.00096 (2023); D. S. Levine et al., arXiv (2025); A. Mazitov et al., arXiv (2025).

Even with 100M+ calculations, do these datasets cover all or enough of the chemical space?

What the data covers

  • A model is only checked where its training data are
  • Room-temperature MD samples the energy well densely, and the steep repulsive wall almost never
  • On the wall the model has to guess, and it guesses wrong

High-energy geometries: one kind of out-of-distribution.

J. Behler, Chem. Rev. 121, 10037 (2021); X. Fu et al., Trans. Mach. Learn. Res. (2023).

Now think of a reaction. Which point on the path does MD visit least?

Reactions: the rarest point matters most

  • MD spends almost all its time in the reactant and product wells
  • The transition state is visited rarely, so it is barely in the data
  • At 298 K, every 1.4 kcal/mol of barrier error is a factor of 10 in the rate

Rare events the data barely covers: a second kind of out-of-distribution.

H. Eyring, J. Chem. Phys. 3, 107 (1935).

Steep walls, rare events… what else counts as out-of-distribution?

Many ways to be out-of-distribution

Out-of-distribution: anything the training data does not represent, where the model has to go beyond its data rather than fill in between it.

  • High-energy geometries; rare events
  • Higher temperature than in training
  • Elements, charges or spin states never seen
  • Solvent or surfaces, when trained in vacuum
  • A new combination of known groups

S. Chmiela et al., Sci. Adv. 3, e1603015 (2017); X. Fu et al., Trans. Mach. Learn. Res. (2023).

Which of these do we actually test when we evaluate ML potentials today?

How ML potentials are evaluated today

Standard evaluations rarely test new combinations of known parts.

S. Chmiela et al., Sci. Adv. 3, e1603015 (2017); X. Fu et al., TMLR (2023); Z. Wu et al., Chem. Sci. 9, 513 (2018).

Shouldn’t these models handle new combinations anyway? After all, they are built from local parts.

Locality: where chemistry and ML agree

  • Chemistry: a property is roughly a sum of group contributions
  • ML potential: the energy is a sum of contributions from each atom’s neighbourhood
  • Both say the whole is built from local parts

So compositional generalisation should come for free. Does it?

S. W. Benson, J. H. Buss, J. Chem. Phys. 29, 546 (1958); J. Behler, M. Parrinello, Phys. Rev. Lett. 98, 146401 (2007).

Our choice: scaffold out-of-distribution

  • Fusion: –OH and C=O seen apart; tested together on one carbon, as –COOH
  • Duplication: one –COOH seen; tested with two

Every group is in training; only the molecule is new.

G. W. Bemis, M. A. Murcko, J. Med. Chem. 39, 2887 (1996); A. M. Nourollah et al., NeurIPS (2026); arXiv:2605.08988.

To run this test properly, we need a dataset built for it. That is GMD.

GMD: Generalisation for Molecular Dynamics

  • 140 molecules in 12 families, built from H, C, N and O
  • 300 K MD for each molecule, DFT energies and forces for every snapshot: about 280,000 configurations
  • Splits are by molecule, never by snapshot

Models are usually tested on new shapes of known molecules. GMD tests them on new molecules.

A. M. Nourollah, I. Khalid, S. Leoni, S. Schockaert, NeurIPS (2026), Evaluations & Datasets Track; arXiv:2605.08988.

Five ways to build a new molecule from known parts

A. M. Nourollah, I. Khalid, S. Leoni, S. Schockaert, NeurIPS (2026), Evaluations & Datasets Track; arXiv:2605.08988.

How big is each task?

The dataset in numbers

Task Training set Test set (new molecules)
Chain extension C2–C6 alkanes: ethane to hexane C7–C13 alkanes: heptane to tridecane
Fusion C4–C10 alcohols and aldehydes, C7–C11 diols; complex polyols and polycarbonyls C4–C10 carboxylic acids
Duplication C5–C10 carboxylic acids C5–C10 dicarboxylic acids
Combination C2–C9 diamines; C2–C9 dicarboxylic acids C2–C9 amino acids
Fission C5–C10 carboxylic acids C5–C10 alcohols; C5–C10 aldehydes

Fission reuses the training set of Duplication; only its test set is new · 140 molecules · about 280,000 DFT-labelled configurations

A. M. Nourollah, I. Khalid, S. Leoni, S. Schockaert, NeurIPS (2026), Evaluations & Datasets Track; arXiv:2605.08988.

But if a model fails, is it because it never saw enough, or because it cannot compose?

The augmented variants

Chain extension gets the missing coverage; fusion gets a worked example of composition.

A. M. Nourollah, I. Khalid, S. Leoni, S. Schockaert, NeurIPS (2026), Evaluations & Datasets Track; arXiv:2605.08988.

The models we test

Model Year Type
SchNet 2017 invariant, distances only
DimeNet++ 2020 invariant, adds angles
GemNet 2021 invariant, adds dihedrals
PaiNN 2021 equivariant, vector features
NequIP 2022 equivariant, tensor features
MACE 2022 equivariant, many-body messages
eSCN 2023 equivariant, efficient convolutions
MACE-MP-0 S / M / L 2023 foundation model, fine-tuned
EquiFormerV2 2024 equivariant transformer
UMA-Small 2025 foundation model, fine-tuned

A. M. Nourollah, I. Khalid, S. Leoni, S. Schockaert, NeurIPS (2026), Evaluations & Datasets Track; arXiv:2605.08988.

How do we compare them fairly?

Known molecules versus new molecules

A. M. Nourollah, I. Khalid, S. Leoni, S. Schockaert, NeurIPS (2026), Evaluations & Datasets Track; arXiv:2605.08988.

Where inside the molecule does the error appear?

Where the failure happens: inside the molecule

  • Hexanoic acid: new in the fusion task
  • Inner disc: error in force strength; ring: error in direction
  • Backbone fine; error on –COOH, mostly strength

Known: –OH and C=O. Not composed: –COOH.

A. M. Nourollah, I. Khalid, S. Leoni, S. Schockaert, NeurIPS (2026), Evaluations & Datasets Track; arXiv:2605.08988.

Combining parts fails badly. How does the simplest task, a longer chain, compare?

Chain extension: a smaller drop

  • Train on ethane to hexane; test on heptane to tridecane
  • Errors still rise with length, but far less than in the other four tasks
  • SchNet and DimeNet++ break down past the training lengths

Repeating a known part costs some accuracy. Combining parts in a new way costs far more.

A. M. Nourollah, I. Khalid, S. Leoni, S. Schockaert, NeurIPS (2026), Evaluations & Datasets Track; arXiv:2605.08988.

So is the problem coverage, or composition? The augmented variants answer that.

Coverage helps length, not composition

Augmented chain extension
Much easier for every model except SchNet: OOD/ID close to ×1, and DimeNet++ recovers

Coverage was part of the missing piece

Augmented fusion
The amide example does not help: errors on carboxylic acids stay as large as before

Composition is the missing piece

Consistent with models treating each group as a standalone token, not learning how groups combine.

A. M. Nourollah, I. Khalid, S. Leoni, S. Schockaert, NeurIPS (2026), Evaluations & Datasets Track; arXiv:2605.08988.

And if we run fusion backwards, can a model split a group it only saw whole?

Fission: the group is learned as one unit

  • Trained on carboxylic acids: –OH and C=O only ever appear together
  • Tested on alcohols and aldehydes: each part alone
  • The models cannot recover the parts

Consistent with –COOH being learned as one unit, not built up from its parts.

A. M. Nourollah, I. Khalid, S. Leoni, S. Schockaert, NeurIPS (2026), Evaluations & Datasets Track; arXiv:2605.08988.

Could bigger models, pre-training or a different level of theory close the gap?

Not a data, scale or label problem

Pre-training
Pre-trained foundation models do not consistently beat models trained from scratch

Scale
Larger MACE-MP-0 helps on some tasks; the gap stays

Labels
GFN2-xTB labels instead of DFT give the same pattern

Coverage
Helps chain extension, not fusion

Fine-tuning fixes the molecules the model was shown, not the ones it was not.

A. M. Nourollah, I. Khalid, S. Leoni, S. Schockaert, NeurIPS (2026), Evaluations & Datasets Track; arXiv:2605.08988.

What it means

For chemistry

  • Errors sit on the new functional group: wrong vibrations, conformers, barriers
  • They appear exactly where a molecule is new, which is where you would use a model

For machine learning

  • Scale, pre-training and fine-tuning do not give compositional generalisation
  • In-distribution accuracy does not reliably predict out-of-distribution accuracy

Before trusting a model on a new molecule, ask: has it seen this combination, or only these parts?

A. M. Nourollah, I. Khalid, S. Leoni, S. Schockaert, NeurIPS (2026), Evaluations & Datasets Track; arXiv:2605.08988.

Scope and next steps for the benchmark

What GMD covers
Small H/C/N/O molecules in vacuum, one DFT level (PBE/def2-TZVP+D3BJ)

Why that is enough
Every part of each test molecule is in training: failure under this minimal shift is a strong result

What it does not cover
Aromatic, charged, inorganic or transition-metal chemistry; condensed phases

Natural extensions
Richer fragment vocabularies: peptides for proteins, monomers for polymers

A. M. Nourollah, I. Khalid, S. Leoni, S. Schockaert, NeurIPS (2026), Evaluations & Datasets Track; arXiv:2605.08988.

Takeaways and future work

What we found

  • More of the same (longer chains or a duplicated functional group) costs some accuracy
  • Known parts in new combinations cost far more
  • Coverage, scale and pre-training do not fix composition
  • Models learn groups as units, not from their parts

What I am working on

  • A model whose learning is guided by chemical structure
  • Forcing it to see a molecule as a chemist does: functional groups and how they connect

A. M. Nourollah, I. Khalid, S. Leoni, S. Schockaert, NeurIPS (2026), Evaluations & Datasets Track; arXiv:2605.08988.

Thank you

Amir Masoud Nourollah

Paper: arXiv:2605.08988 (NeurIPS 2026)

Data: huggingface.co/datasets/AmirMasoud/GMD

Code: github.com/Nourollah/GOAL

Questions?