Molecular Featurization Contract

A molecular featurization contract defines how a standardized molecule becomes a model input. It prevents train, evaluation, and inference from using subtly different molecule definitions.

A featurizer is a versioned function:

where is the standardized molecule, is the featurizer with versioned parameters , and is a fingerprint, graph, descriptor vector, conformer, or learned representation.

Contract Fields

FieldRecord
Input identitystandardized molecule hash and standardization protocol
Chemical statetautomer, protonation, charge, salt/counterion, stereochemistry
Representation typeSMILES, graph, fingerprint, descriptor, conformer, 3D pose, or learned embedding
Feature definitionatom features, bond features, fingerprint radius/size, descriptor list, conformer protocol
Software versiontoolkit, model, featurizer code, and random seed when applicable
Failure policyparse failure, sanitization failure, missing stereo, invalid valence, conformer failure
Cache keyinput hash plus featurizer version

Cache Identity

Feature cache keys should include both molecule identity and featurizer identity:

If either or changes, cached features are invalid.

Representation Types

RepresentationGood ForMain Caveat
canonical SMILESsequence models, exact string pipelinestokenization and canonicalization policy can change the input
randomized SMILESaugmentation and sequence robustnesstrain/test augmentation policy must be fixed
molecular graphGNNs and atom/bond inductive biasaromaticity, bond order, charge, stereo, and hydrogens must be explicit
fingerprintfast baselines, similarity, retrievalradius, bit length, collision, and count/binary choice matter
descriptorssmall data baselines, interpretabilitydescriptor list and missing-value policy can leak preprocessing choices
conformer or coordinatesgeometry, docking, 3D generationconformer source and deployment availability define the claim
learned embeddingretrieval or downstream predictionfrozen vs trainable encoder changes evaluation meaning

RDKit Features

Many molecular ML baselines and preprocessing pipelines use RDKit. The featurization contract should make RDKit choices explicit rather than treating them as library defaults.

FeatureParameters to Record
Morgan fingerprintradius, bit length, count/binary, chirality flag
descriptor vectordescriptor names, NaN policy, scaling
molecular graphatom features, bond features, aromaticity, explicit hydrogens, stereo
conformerconformer count, seed, force field, minimization, failure policy
scaffoldstandardization state and scaffold extraction policy

Leakage Risks

Featurization can leak information even when labels are not directly used:

when conformers, filters, standardization statistics, vocabulary, or embedding models are fit using test data or deployment-unavailable context.

Common risks:

  • conformer or pose generated with knowledge of the bound ligand or target when inference will not have it;
  • descriptors normalized using full-dataset statistics before the split;
  • duplicate handling after featurization rather than before the split;
  • fingerprint or embedding cache reused after changing standardization;
  • invalid molecules silently dropped differently across train and test;
  • scaffold split computed on a different molecular identity than the model input.

Checks

  • Is the same featurizer used at train, validation, test, and inference time?
  • Are invalid molecules logged rather than silently dropped?
  • Are stereochemistry and protonation handled consistently with the task?
  • Does featurization distinguish molecules that the label distinguishes?
  • Does graph batching keep molecules isolated?
  • Does a simple fingerprint baseline already explain the benchmark?
  • Is the split computed on the same standardized identity used by the featurizer?
  • Are conformer and coordinate features available under the intended inference setting?