In drug repurposing, data leakage occurs when a model inadvertently gains access to information during training that would not be available in a real-world prospective validation. A classic example is splitting a dataset of drug-disease associations randomly, where different molecular entries of the same drug scaffold appear in both the training and test sets. The model memorizes the shared chemical substructure rather than learning generalizable pharmacological principles, leading to inflated accuracy metrics that collapse during experimental validation.
Glossary
Data Leakage

What is Data Leakage?
Data leakage is a critical methodological flaw in machine learning where information from outside the training dataset, typically from the test set or future data points, is used to create the model, resulting in deceptively optimistic and non-generalizable performance estimates.
Preventing leakage requires rigorous temporal or scaffold-based splitting strategies that isolate all data points related to a specific drug or disease into a single partition. Techniques like cold-start simulation, where entire drugs are held out, provide a true measure of a model's ability to generalize to novel compounds. Without this discipline, computational repurposing pipelines risk advancing false candidates into costly preclinical studies, undermining the credibility of AI-driven drug discovery.
Key Characteristics of Data Leakage
Data leakage is a critical validation error where information from the test set inadvertently influences the training process, producing over-optimistic performance estimates that fail in real-world deployment. In drug repurposing, this often manifests through shared molecular scaffolds or overlapping biological targets between training and test splits.
Target-Based Leakage
Occurs when drugs sharing the same protein target are split across training and test sets. The model memorizes target-specific features rather than learning generalizable drug-target interaction patterns.
- Example: Splitting kinase inhibitors randomly rather than by kinase subfamily
- Consequence: Model appears to predict novel kinase-drug interactions but has simply learned kinase family fingerprints
- Mitigation: Cluster drugs by target class before splitting; use target-stratified cross-validation
Scaffold-Based Leakage
Arises when molecules with identical core chemical scaffolds appear in both training and test partitions. The model exploits structural similarity rather than learning true pharmacological relationships.
- Detection: Compute Tanimoto similarity between all training and test molecules; flag pairs above 0.85 threshold
- Standard practice: Use scaffold split where molecules sharing the same Bemis-Murcko scaffold are assigned to the same partition
- Impact: Without scaffold splitting, reported AUC values can be inflated by 10-30%
Temporal Leakage
Occurs when future information contaminates training data in time-series predictions. In drug repurposing, this happens when clinical trial outcomes or post-market surveillance data predate the model's supposed knowledge cutoff.
- Example: Training on adverse event reports from 2023 to predict drug safety in a 2020 validation set
- Real-world failure: Models predicting drug-disease associations using literature published after the hypothetical discovery date
- Solution: Implement time-aware splitting where all training data predates test data by a defined temporal gap
Aggregation Leakage
Results from computing dataset-level statistics before splitting, allowing test set properties to influence training normalization or feature selection.
- Common mistake: Applying global feature scaling or principal component analysis to the entire dataset before train-test split
- Example: Normalizing gene expression values using mean and standard deviation computed from combined training and test samples
- Best practice: Fit all preprocessing transformations exclusively on training data, then apply to test set
Duplicate Record Leakage
Occurs when identical or near-identical data points exist in both training and test sets, often due to data curation errors or multiple database entries for the same entity.
- Source: Merging DrugBank and ChEMBL entries without deduplication can create duplicate drug-target pairs
- Detection: Perform exact and fuzzy matching on SMILES strings and target sequences before splitting
- Severity: Even a 1% duplicate rate can artificially boost test accuracy by 5-15% in imbalanced datasets
Feature Leakage from Metadata
Arises when proxy variables in the feature set encode information about the test labels. These features act as shortcuts that bypass genuine learning.
- Example: Including 'number of publications' as a feature when predicting drug-disease associations, which correlates with well-studied indications
- Red flag: Features with unusually high feature importance scores that lack mechanistic plausibility
- Audit: Review top SHAP value features for each prediction; question any feature that directly encodes the outcome variable
Data Leakage vs. Overfitting vs. Data Drift
Distinguishing three distinct failure modes that degrade model generalization in drug repurposing pipelines, each with different root causes and remediation strategies.
| Feature | Data Leakage | Overfitting | Data Drift |
|---|---|---|---|
Root cause | Test information contaminates training data during preprocessing or splitting | Model memorizes noise and spurious patterns in training data rather than learning generalizable signals | Statistical properties of production data diverge from training distribution over time |
Detection method | Ablation studies on split integrity; scaffold-based split validation; temporal split auditing | Large gap between training and validation performance; learning curve analysis; cross-validation variance | Population stability index (PSI) monitoring; feature distribution drift tests; performance degradation alerts |
Primary symptom | Over-optimistic validation metrics that fail to replicate in external validation | Excellent training performance but poor generalization to held-out test set | Gradual or sudden decline in production model performance without retraining |
Temporal relationship to deployment | Occurs before model training during data preparation and experimental design | Occurs during model training and hyperparameter selection | Occurs after deployment when model encounters new data distributions |
Impact on drug repurposing | False positive drug-disease associations due to shared chemical scaffolds leaking between splits | Model learns assay-specific artifacts instead of true pharmacological signals | Model trained on pre-pandemic data fails on post-pandemic clinical trial populations |
Remediation strategy | Strict scaffold-based splitting; temporal splitting by approval date; blinding target information | Regularization (L1/L2); dropout; early stopping; reducing model capacity; increasing training data | Continuous monitoring; periodic retraining; domain adaptation; feature recalibration |
Example in practice | Splitting DrugBank entries randomly causes same drug's salts to appear in both train and test sets | A GNN memorizes atom counts instead of learning pharmacophore patterns relevant to binding | COVID-19 pandemic shifts patient demographics and comorbidity distributions in EHR data |
Prevention approach | Data split auditing pipelines; metadata-aware cross-validation; independent holdout sets | Nested cross-validation; rigorous hyperparameter tuning on validation set only; model simplicity bias | Automated drift detection dashboards; scheduled model refresh cycles; robust feature engineering |
Frequently Asked Questions
Data leakage is one of the most insidious and consequential validation errors in machine learning for drug discovery. It occurs when information from the test set inadvertently contaminates the training process, producing performance metrics that look exceptional in silico but collapse entirely in prospective experimental validation. Below are the most critical questions research leaders and CTOs ask about detecting and preventing this failure mode.
Data leakage in drug repurposing is a validation error where information that should be strictly held out during model training—such as overlapping chemical scaffolds, shared protein targets, or duplicate bioassay measurements—unintentionally influences the learning process. This produces over-optimistic performance estimates that cannot be reproduced in real-world experimental settings. The catastrophe is twofold: first, it wastes millions in downstream wet-lab validation on false-positive repurposing candidates; second, it erodes institutional trust in computational methods. A landmark 2020 analysis of 21 drug-target interaction models found that performance dropped by 30-60% when rigorous time-split or scaffold-split validation replaced random splitting, exposing widespread leakage in published benchmarks. For CTOs and heads of translational medicine, leakage represents not just a technical flaw but a governance and capital allocation failure.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Understanding data leakage requires familiarity with the validation frameworks and evaluation pitfalls that define rigorous machine learning in drug discovery.
Train/Test Split Contamination
The most common source of leakage occurs when training and test sets are not properly separated before preprocessing. In drug repurposing, this happens when molecules sharing the same scaffold or Murcko framework are randomly split, placing nearly identical compounds in both sets. The model memorizes the scaffold rather than learning generalizable pharmacological properties.
- Scaffold split is the mandatory alternative to random splitting
- Leakage inflates AUC-ROC by 10-30% in published benchmarks
- Always split at the drug level, not the interaction level
Temporal Leakage
A subtle form of leakage where future information inadvertently informs the training process. In drug repurposing, this occurs when a model is trained on drug-disease associations discovered after the test set's cutoff date. The model appears to 'predict' a known association, but it has simply memorized post-hoc literature.
- Use time-stratified splits based on publication or approval dates
- Critical for Real-World Evidence (RWE) mining from EHRs
- Simulates true prospective validation
Target Information Leakage
Occurs when protein target features derived from the test set's drug-target interactions are used during training. For example, computing protein embeddings or network propagation scores on the full interactome before splitting contaminates the training data with test-set binding information.
- Compute all network features exclusively on the training partition
- Recompute embeddings for each cross-validation fold
- Particularly dangerous in Knowledge Graph Embedding models
Negative Sampling Bias
In drug repurposing, negative examples (non-interactions) are rarely verified experimentally. Randomly sampling 'negatives' from unlabeled pairs can introduce leakage if the sampling strategy inadvertently selects true but undiscovered interactions. This creates label noise that artificially deflates performance estimates.
- Use PU learning (Positive-Unlabeled) frameworks
- Validate negatives against DrugBank or ChEMBL
- Consider calibrated negative sampling from dissimilar pairs
Benchmark Integrity
Many published drug repurposing benchmarks suffer from systemic leakage due to redundant molecular representations. When ECFP4 fingerprints or pre-trained BERT for SMILES embeddings are generated on the full dataset before splitting, the model gains indirect access to test-set structural information through the featurization process.
- Always featurize after splitting, not before
- Audit benchmarks using scaffold similarity heatmaps
- Reproduce baselines with corrected splits to measure true leakage impact

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us