Representation Contract

A representation contract records how a raw object becomes the model input used for training and evaluation. It is the bridge between entity, modality, architecture, loss, metric, and leakage checks.

The core map is:

where is the raw object, is preprocessing or featurization, is the model-ready representation, and is the model output.

Contract Fields

FieldQuestion
Raw objectWhat is the entity before preprocessing: text, image, molecule, protein, pocket, complex, graph, or sequence?
RepresentationWhat does the model see: tokens, tensor, graph, fingerprint, conformer, coordinate set, embedding, or fused view?
UnitWhat is one token, node, edge, residue, atom, frame, candidate, or example?
Shape and axesWhat are the batch, token, node, edge, coordinate, channel, head, or candidate axes?
FeaturizerIs deterministic, learned, stochastic, cached, versioned, or data-dependent?
InvarianceShould the representation preserve order, permutation, translation, rotation, time, units, or metadata?
MissingnessWhat happens when fields, modalities, coordinates, labels, or alignments are missing?
OutputWhat output space does this representation support?
Loss and metricWhich loss trains the model, and which metric evaluates the output?
SplitWhich unit must be held out to support the generalization claim?
LeakageDoes use labels, target poses, future information, test statistics, or deployment-unavailable context?

AI Use

For AI architecture notes, the representation contract explains why an architecture is appropriate.

RepresentationLikely Architecture BiasCheck
Token sequenceTransformer, RNN, state-space modeltokenization, context length, positional encoding
Image patches or feature mapsCNN, ViT, U-Netlocality, resolution, augmentation policy
GraphGNN, Graph Transformernode/edge definition, graph construction leakage
SetDeep Sets, Set Transformer, Perceiverpermutation behavior and pooling
Coordinatesgeometric GNN, equivariant model, diffusion/flowtransformation group and coordinate-frame leakage
EmbeddingMLP, retrieval model, linear probefrozen vs trainable encoder and evaluator capacity

Molecular Modeling Use

ObjectRepresentation Questions
MoleculeSMILES, graph, fingerprint, descriptors, conformer, tautomer/protonation/stereo policy
Proteinsequence tokens, MSA, residue embedding, residue graph, coordinates, pocket representation
Ligand poseconformer source, coordinate frame, atom mapping, symmetry handling
Protein-ligand complexpocket definition, ligand state, interaction graph, distance features, pose availability
Assay recordtarget, assay, endpoint, unit, threshold, censoring, source

Formula View

If the representation is stochastic or learned, write:

where is context such as pH, assay, target, crop, alignment, retrieval corpus, or conformer protocol. If is unavailable at inference, evaluation may be invalid.

Checks

  • Is the raw object separate from the model input?
  • Are tensor shapes and axis meanings explicit?
  • Is the representation identical across train, validation, test, and inference where it should be?
  • Are featurizer versions, random seeds, caches, and failure policies recorded?
  • Does the representation preserve the information required by the task?
  • Does the representation include information unavailable at deployment time?
  • Is the split defined before or after representation caching?
  • Does the loss and metric match the output space implied by the representation?
  • Does the architecture match the representation structure rather than only the paper’s keyword?