← All workCompetition

PolyPred

Predicting polymer properties from a single monomer SMILES string with an equivariant GNN on cheap, guessed 3D geometry. It matched a strong tabular baseline, and beat it on free volume.

Role
Kaggle competition, team of two
Year
2025
Stack
Equivariant GNNs, 3D conformers, RDKit, Kaggle
Five overlaid 3D conformers of one polymer trimer, rendered as glowing ball-and-stick outlines on a dark background

In 2025, a friend and I entered the NeurIPS Open Polymer Prediction challenge on Kaggle. The task was simple enough: given a short string of text describing one (tiny) building block of a plastic, predict five properties of the plastic itself. The time-proven and sensible entry for almost any Kaggle competition is some kind of gradient-boosted ensemble, in this case on hand-made chemical features. We wanted to see how far a 3D equivariant network could get instead, mostly because it sounded like much more fun than running endless hyperparameter tuning experiments.

What can you predict from a string?

The string is a SMILES: a molecule written as a line of text. Letters are atoms, brackets are side branches, digits close rings, and hydrogens are left out because they can be inferred. So, it’s a kind of code-language. The odd one out is the *. It is not an atom, and is instead a polymer specific thing. It marks where this unit (“monomer”) bonds to the next one when thousands of copies link up into a polymer chain.

*CC(*)c1ccccc1C(=O)OCCCCCC

**OOOOOOOO
The first monomer in the competition's training set, read the way a SMILES parser reads it. The chain is the same unit stitched three times at its * points by PolyPred's trimer builder, with the loose ends capped by hydrogen; the pink bonds are where the * were. Both drawings laid out by RDKit.

The five targets are glass transition temperature, fractional free volume, thermal conductivity, density and radius of gyration. The organisers computed them by simulating the bulk polymer with molecular dynamics. There are about 8,000 monomers to learn from, and the labels are sparse: free volume has 7,030 of them, the other four between 511 and 737 each.

7,030 of 7,973 monomers have a fractional free volume label

Every square is one monomer in the training set. 7,266 of them have a single label, and none has all five.

All five properties come from molecular dynamics simulations of the bulk polymer, run by the organisers. Grid in dataset order, from the competition's training file.

Into 3D

An equivariant network like PaiNN (more on it in my bachelor’s thesis) reads atoms and their positions in space. A SMILES string has no positions, so they have to be made up. The cheap way, and the one PolyPred ends up using: let RDKit embed a first 3D guess, then let a force field relax it into something chemically plausible. RDKit can’t place a *, so for the embedding each one stands in as a hydrogen.

Loading
PolyPred's simplest route to 3D, run on the same monomer with the settings used for the dataset: each *becomes a hydrogen, RDKit's ETKDG v3 makes a first 3D guess, and the MMFF force field relaxes it. That takes 176 iterations here, and the energy readout follows the real optimiser path from 59.6 to 34.4 kcal/mol. Then the hydrogens go back to being *. The jump from the flat drawing to the first guess is drawn as a straight morph, since the embedding has no in-between steps.

That is one guess. A flexible molecule has many valid shapes, called conformers, and in isolation nothing says which one it takes inside a polymer. So every molecule gets up to five, the network predicts on each, and the median is the answer.

So what is a *?

To the network, every atom is a type and a position. A polymerisation point is neither a real atom nor nothing, so it needs an answer of its own. We could keep pretending it is a hydrogen, but then the network can’t tell a chain continuing from a dead end. We could drop it, and lose where the chain goes. We gave it a type of its own, and let the network learn what it means.

  1. *0
  2. H1
  3. Li3
  4. B5
  5. C6
  6. N7
  7. O8
  8. F9
  9. Na11
  10. Si14
  11. P15
  12. S16
  13. Cl17
  14. K19
  15. Ca20
  16. Zn30
  17. Ge32
  18. Se34
  19. Br35
  20. Cd48
  21. Sn50
  22. Te52
  23. I53
  24. Pb82
Every atom type PolyPred's PaiNN can tell apart: 23 elements (the 18 in the training monomers, plus a few spares) and the *, as atomic number 0. Each type is a row in a learned embedding table, so the network works out for itself what a polymerisation point means.

That still leaves where in space to put it. PolyPred has four answers. Hydrogen and carbon stand-ins are quick and know nothing about the neighbours. The more informed route builds a chain of three units, relaxes the whole thing, and cuts the middle one back out, so each * sits where the neighbouring atom actually ended up. Or skip the question and give the network the whole trimer.

Loading conformers
Conformer
Molecule1 of 3
Polymerisation point *HydrogenCarbonNitrogenOxygen
Real output of PolyPred's generators for three monomers from the training set, two of them the ones the report uses. Up to five conformers per molecule (ETKDG v3, seed 42, MMFF relaxed). The generator gives separate guesses, not a path between them, so the folding from one conformer to the next is drawn as a straight morph. Near duplicates are pruned, so a stiff molecule can end up with a single conformer. In the trimer the outer units are dimmed.

Count the leaps. A string becomes a graph. The graph gets a guessed shape from a force field. One unit, in one of several shapes, stands in for a chain, and the chain for a bulk material whose properties came out of a molecular dynamics simulation. Each step is a guess, and none of them can be checked quickly. In hindsight, it is a lot to ask of a network whose whole point is taking geometry seriously. But it was for the fun of it.

How it did

We compared PaiNN against AutoGluon, an automatically tuned ensemble of tabular models on standard chemical descriptors: same molecules, same splits, 10-fold cross-validation.

PaiNNAutoGluon, and its interval as a bandNo overlap with AutoGluon
 
  • PaiNN per property
  • PaiNN, all five at once
  • PaiNN per property, descriptors
  • PaiNN all at once, descriptors
  • AutoGluon
Free volumeMAE, ×10⁻³, 7,030 labels
4.14.75.3
DensityMAE, ×10⁻³, 613 labels
192531
Radius of gyrationMAE, 614 labels
1.361.521.69
Glass transitionMAE, 511 labels
495662
Thermal conductivityMAE, ×10⁻³, 737 labels
23.426.128.9
 
  • Hydrogen stand-in
  • AutoGluon
  • Whole trimer
  • AutoGluon
  • Borrowed from neighbours
  • AutoGluon
Free volumeMAE, ×10⁻³, 7,030 labels
4.35.36.3
DensityMAE, ×10⁻³, 613 labels
203039
Radius of gyrationMAE, 614 labels
1.451.671.89
Glass transitionMAE, 511 labels
505765
Thermal conductivityMAE, ×10⁻³, 737 labels
212630

Lower is better. Hover a row for its numbers.

The numbers as a table
Tuned models, hydrogen stand-in, all molecules
ModelFree volume (×10⁻³)Density (×10⁻³)Radius of gyrationGlass transitionThermal conductivity (×10⁻³)
PaiNN per property4.2 ± 0.225.2 ± 4.61.49 ± 0.1353.4 ± 3.925.0 ± 2.0
PaiNN, all five at once4.4 ± 0.323.3 ± 3.81.49 ± 0.1458.8 ± 4.426.9 ± 2.4
PaiNN per property, descriptors4.2 ± 0.223.8 ± 3.41.47 ± 0.1352.6 ± 4.026.0 ± 2.0
PaiNN all at once, descriptors4.3 ± 0.222.4 ± 3.81.56 ± 0.1557.1 ± 4.626.0 ± 2.0
AutoGluon5.2 ± 0.228.2 ± 3.41.57 ± 0.1452.2 ± 3.926.1 ± 2.0
Default PaiNN on each geometry, with AutoGluon as reported
ModelFree volume (×10⁻³)Density (×10⁻³)Radius of gyrationGlass transitionThermal conductivity (×10⁻³)
Hydrogen stand-in4.4 ± 0.323.1 ± 4.01.53 ± 0.1156.6 ± 4.227.8 ± 2.4
AutoGluon6.2 ± 0.333.3 ± 5.01.73 ± 0.1953.4 ± 4.424.6 ± 2.6
Whole trimer4.8 ± 0.331.5 ± 5.81.66 ± 0.1960.3 ± 5.524.7 ± 3.5
AutoGluon6.1 ± 0.335.0 ± 5.21.71 ± 0.1854.0 ± 4.523.8 ± 2.4
Borrowed from neighbours4.9 ± 0.332.0 ± 5.91.66 ± 0.1859.7 ± 5.424.4 ± 3.6
AutoGluon6.2 ± 0.333.3 ± 5.01.73 ± 0.1953.4 ± 4.424.6 ± 2.6
Mean absolute error on held-out folds with 95% intervals from 10-fold cross-validation, as reported in the project report. In the tuned comparison, every model saw exactly the same molecules and splits. In "Which geometry", PaiNN runs with default settings and the hydrogen stand-in set is cut to about 72% so all three have roughly as much data. AutoGluon's numbers there are as reported; its rows for the hydrogen stand-in and borrowed-neighbour sets are identical, most likely because both were trained on the molecules that survived the trimer pipeline, with the same descriptors.

Nothing earth-shattering. PaiNN matched the tuned ensemble on four properties and beat it on free volume, the one property with plenty of labels. Given all the guessing it took to get a 3D molecule in the first place, it held up better than I expected. And of all the geometries, the simplest one, the hydrogen stand-in, did best.

The package

PolyPred itself is a pip-installable Python package, built as a wheel so it would install inside Kaggle’s offline notebooks. It holds the 3D pipelines, parallelised and seeded so a cluster rebuilds the same dataset every time; PaiNN with the * type, optional descriptor injection, and single or multi-target heads with a loss that skips missing labels; conformer pooling; and grouped cross-validation with the confidence intervals of Bayle et al. (2020), shared with the baseline so the comparison is fair. The code is on GitHub.

About that leaderboard

Partway through the competition, the test set leaked, and the hosts made a new one. Our cross-validation scores were far better than anything the leaderboard showed, and we were not the only ones. The winning write-up calls its “key trick” a single line of post-processing: add 0.56 standard deviations to every glass transition prediction. It was found by probing the leaderboard rather than through any chemistry, and it would have lifted pretty much anyone’s score. We took the hint and trusted the cross-validation.

Next projectHours →