Learning chemistry before the labels
Lab assays tell whether a compound triggers a toxicity pathway, but they cost time and money, so models try to predict them. The hard case is a compound from a chemical family the model has never seen.
Born from the forecast
This forecast comes from the view without generative AI: Singularity predicted that contrastive learning — teaching a model to recognise two altered views of the same example — would enter the subfield of health, toxicology and mutagenesis, where no work used it up to 2025. We tested it on the standard Tox21 assays.
What we found
A simple version already helps. Pretraining on the training compounds alone, by hiding random bits of their fingerprints, made the same network better at ranking active compounds from new chemical families.
How we tested it
Compounds were grouped by chemical scaffold, so every test family was new to the model. The models, the two splits and the metric were fixed before the runs.
Why it matters
The gain comes from the training objective, not from more data, so larger unlabelled libraries and chemistry-aware alterations are a clear direction to push further.
The paper
Contrastive pretraining on fingerprints improves Tox21 assay ranking for unseen chemical scaffolds
· November 2026 · preprint
Abstract
We test whether contrastive pretraining on molecular fingerprints helps predict Tox21 in-vitro assay labels for compounds whose chemical scaffolds were absent from training. Two scaffold-grouped splits were fixed in advance, each with 615 held-out scaffolds. A fingerprint network pretrained to match two randomly masked views of the same molecule, then fine-tuned on the 12 assays, reached a mean macro average precision of 0.407 in the first split, against 0.384 for the same network trained from scratch and 0.321 for per-assay logistic regression. Averaging three initialisations, the contrastive model gained 0.031 over the supervised one (paired scaffold bootstrap 95% interval 0.008 to 0.052). The second split reproduced the gain: 0.028 (interval 0.012 to 0.040). In both splits the contrastive ensemble was better on all 12 assays. The cost is about 38 seconds of training instead of 4, and no data beyond the training compounds is needed.

Limitations
One dataset and two scaffold splits; Tox21 labels are in-vitro assay outcomes. The models, splits and metric were fixed in advance, but not a numerical success threshold. Graph-based and large pretrained models were not compared.