Leakage

Leakage is when information from the test set reaches the model during training, inflating reported performance that then collapses in real use. It hides in duplicate records, shared identifiers across splits, target-derived features, and preprocessing fit on the full dataset.

The split should satisfy an independence assumption:

The subscript means exact row overlap is not enough; near-duplicates, shared groups, and target-derived features can also transmit information.

Practical Checks

  • Split before any fitting — scalers, encoders, and imputers learn on train only.
  • Deduplicate and check for near-duplicates across train/val/test.
  • Ensure grouped entities (molecule, protein, patient) never span splits.
  • Audit features for any that encode the label or future information.
  • If a result looks too good, suspect leakage before celebrating.

Common Leakage Channels

  • Duplicate or near-duplicate examples across splits.
  • Shared scaffold, protein family, subject, source, or time period across splits.
  • Preprocessing fit on the full dataset before splitting.
  • Feature selection, imputation, normalization, or vocabulary building that sees test data.
  • Target-derived features, post-outcome metadata, or future information.
  • Test-set iteration during model selection.

Domain-Specific Channels

DomainLeakage unitExample
molecule propertyduplicate, salt form, tautomer, scaffold, close analogsame chemotype appears in train and test
protein modelingsequence identity cluster, domain, template, MSA databasehomolog or template crosses the boundary
protein-ligand taskprotein, ligand scaffold, pair, assay sourcetarget novelty confused with ligand interpolation
structure predictiontemplate, predicted structure source, database datebenchmark structure appears in retrieval context
LLM or agent taskprompt family, answer key, tool trace, benchmark discussionfinal task appears in pretraining or prompt examples
clinical or assay datasubject, lab, batch, time, sourcesource-specific artifacts predict labels

Leakage Test

For a split function and information unit , a basic grouped-leakage condition is:

This condition must be checked for every unit that could transmit target-relevant information.

Equivalently, no leakage-relevant group should appear in more than one split:

Audit Evidence

AuditEvidence to record
exact duplicate checkduplicate count before and after split
near-duplicate checksimilarity threshold and cross-split hits
grouped split auditnumber of groups per split and cross-split violations
preprocessing auditwhich statistics were fit on train only
label/source auditsource distribution and label distribution per split
test-iteration auditnumber of final-test inspections or submissions

An audit should report both the rule and the residual risk. “No leakage” is too broad unless the leakage unit is named.