Knowing the parts, missing the whole: does machine learning understand new molecules built from what it already knows?

Knowing the parts, missing the whole

Amir Masoud Nourollah
Stefano Leoni
Steven Schockaert

Overview

  1. Introduction: how machine learning learns, and what it learns from
  2. Motivation: how chemists read molecules, and where models go wrong
  3. GMD: the benchmark: familiar parts, new molecules
  4. Results: where today’s models break
  5. Takeaways and what comes next

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” just means finding the parameters with the smallest error

You already do this: fitting a calibration curve or a rate law is the same idea, with three parameters instead of millions.

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

The curve passes close to every point. But is that really what we want?

Fitting well is not generalising well

  • Two kinds of points: the model learns a border between them
  • A straight line misses a few training points, but gets new points right
  • A wiggly border gets every training point right, and new points wrong

We want a model that works on data it has never seen, not one that remembers its training data. That is generalisation.

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

And what about points that lie outside everything the model has seen?

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
  • A very flexible model can pass every training point and still go wild just outside

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

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

So a model is only as good as its data. For molecules, what does that data look like?

What does a molecule look like to a computer?

  • Input: each atom’s element and its 3D position, exactly what an .xyz file holds
  • Output: the energy E, and the force on every atom, F = −∂E/∂r
  • Each atom looks at its neighbours within a few ångström; the total energy is built from these atomic contributions

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

J. Behler, M. Parrinello, Phys. Rev. Lett. 98, 146401 (2007).

Where can we get this data, and how much of it is available?

Any method can be the 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 N⁴ for Hartree–Fock, N⁵ for MP2, N⁷ for CCSD(T)
  • Molecular dynamics needs energies and forces at millions of time steps
  • Semi-empirical methods replaced expensive integrals with fitted parameters, trading some accuracy for speed

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 accuracy of the reference
  • Nanosecond MD at near-reference accuracy becomes routine

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

J. Behler, M. Parrinello, Phys. Rev. Lett. 98, 146401 (2007); J. Behler, Chem. Rev. 121, 10037 (2021).

Whatever it is, it can learn from huge datasets. What if one model learned all of chemistry?

Universal models

  • Train once on millions of DFT calculations across chemistry
  • One model for many molecules, with no new DFT for each system
  • Examples: MACE-OFF, MACE-MP-0, PET-MAD, models trained on SPICE and OMol25

The promise: download a model and simulate your molecule. But what has the model actually learned about chemistry?

I. Batatia et al., NeurIPS (2022); D. P. Kovács et al., J. Am. Chem. Soc. (2025); P. Eastman et al., Sci. Data 10, 11 (2023); A. Mazitov et al., arXiv (2025).

To answer that, let’s first ask how we, as chemists, understand a molecule.

How a chemist reads a molecule

  • We see a molecule as parts: functional groups, rings, chains
  • Parts carry their behaviour with them: an ester behaves like an ester
  • Many properties are close to additive, which is why group-additivity schemes work

Shown a molecule you have never met, built from groups you know, you can still predict a lot about it.

S. W. Benson, J. H. Buss, J. Chem. Phys. 29, 546 (1958).

Is this only a habit on paper, or does experiment read molecules the same way?

Even a spectrum is read in parts

  • In IR, peaks belong to groups, not to whole molecules
  • C=O stretch near 1700 cm⁻¹, broad O–H near 3300 cm⁻¹, C–H just below 3000 cm⁻¹
  • Specific combinations of atoms leave their own signatures in the fingerprint region

Chemistry is compositional: we understand the whole by knowing the parts and how they connect.

G. Socrates, Infrared and Raman Characteristic Group Frequencies, 3rd ed., Wiley (2001).

We read molecules in parts. Do machine-learning models?

Does machine learning 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, Proc. ICML (2018).

So where exactly do models go wrong? Let’s go back to our scatter plot.

Molecules are not dots on a plane

  • A molecule has 3N coordinates, so we cannot draw it as a dot on a plane
  • But errors still gather at the borders, where the answer changes fast and data are thin
  • For energies, a border is a steep slope: the wall when atoms are pushed together, which MD rarely visits

A model is weakest where the energy changes fastest and the data are thinnest.

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 training data
  • A model can get the barrier wrong, and the rate with it: at 298 K, every 1.4 kcal/mol of barrier error is a factor of 10 in k

The chemistry we care about most often sits where the data are thinnest.

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

Steep walls, rare transition states… in how many ways can data be “new” to a model?

Many ways to be out-of-distribution

Out-of-distribution means unlike the training data, and there are many ways to be unlike:

  • High-energy geometries: the steep walls
  • Rare events: transition states
  • High temperature, unseen elements, other properties

All of these change the conditions. Few tests ask about new combinations of familiar parts.

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

So what would a test of new combinations look like, and why should a chemist care?

Our choice: scaffold out-of-distribution

  • Train on molecules with fragments A, B and C; test on the same fragments joined in a new way
  • Every local environment is familiar; only the whole molecule is new
  • This is how new chemistry is made: known groups in a new arrangement

It asks whether a model understands molecules the way we do: from their parts.

G. W. Bemis, M. A. Murcko, J. Med. Chem. 39, 2887 (1996); Z. Wu et al., Chem. Sci. 9, 513 (2018).

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

GMD: Generalisation for Molecular Dynamics

  • Carbon chains carrying –OH, –CHO, –COOH or –NH2
  • MD for each molecule, DFT energies and forces for every snapshot
  • Training and test sets contain different molecules, not just different snapshots

Usually models are 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. F. Bigi et al., arXiv:2505.19350 (2025); F. Neese, WIREs Comput. Mol. Sci. 2, 73 (2012).

So which new molecules do we test them on?

Five ways to build a new molecule from known parts

Every part of a test molecule is in the training data; only how the parts are joined is new.

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

Why build all of this from such small, simple molecules?

Why small molecules?

  • Control: each task changes exactly one thing, so a failure has one cause
  • Nothing hidden: every part of a test molecule is in the training data
  • Checkable: chemists can see what a sensible answer looks like
  • A strong test: if a model fails at the smallest possible step, bigger molecules will not be easier

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

So how do today’s models do?

New molecules: errors often ten times larger

  • Each row is a model; each bar runs from its error on known molecules (|) to its error on new ones
  • Fusion and duplication give the longest bars
  • Chain extension (◆) gives the shortest
  • Right: how many times larger the error gets, on average

Error = mean absolute error of the forces against DFT.

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

But where inside the molecule do these errors actually 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

–OH and C=O are known. –COOH is not.

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 on longer chains, but far less than in the other four tasks
  • A longer chain adds more CH2, nothing chemically new

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.

Maybe the models were just too small, or saw too little data?

Not a data or model-size problem

More data

Foundation models pre-trained on millions of structures (MACE-MP-0, UMA) do not consistently beat MACE trained from scratch on GMD.

Bigger models

A larger MACE-MP-0 helps on some tasks, but the gap stays.

More training coverage

Adding related molecules to the training set does not close the gap for fusion.

Another level of theory

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

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

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

So where does this leave us, and why should a chemist care?

Why a chemist should care

  • Wrong force strengths on a functional group mean wrong vibrations, wrong conformers, wrong barriers
  • The errors appear exactly where a molecule is new, which is where you would use a model
  • A good score on known molecules says little about your molecule

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.

Takeaways and future work

What we found

  • More of the same (longer chains) costs some accuracy
  • Known parts in new combinations cost far more
  • More data, bigger models and pre-training do not fix it
  • Accuracy on known molecules does not predict accuracy on new ones

What I am working on

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

Goal: a model that understands a new molecule from its parts.

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

Thank you

Amir Masoud Nourollah

Stefano Leoni · Steven Schockaert

Paper: arXiv:2605.08988 (NeurIPS 2026)

Data: huggingface.co/datasets/AmirMasoud/GMD

Code: github.com/Nourollah/GOAL

Questions?