When Random Splits Test the Wrong Generalization

A random test split can be clean yet answer the wrong deployment question. DataSAIL shows how similarity-aware splits expose a different generalization target in biomolecular ML.

A comparison of random splitting that scatters related data points across folds and entity-aware splitting that keeps related points together.

A test set can be untouched and still give the wrong reassurance. The key question is not only whether the model saw the exact test row during training. It is whether the test rows resemble the cases the model will face after deployment.

Suppose a model will be used on new protein families, compounds, hospitals, or customers. A random row split may place close relatives in both training and test folds. The evaluation is then testing prediction among familiar neighborhoods, not necessarily performance on the intended new entities. This is a mismatch between the split and the deployment question; it need not mean that anyone accidentally copied test labels into training.

Reported — DataSAIL. The 2025 Nature Communications paper “Data splitting to avoid information leakage with DataSAIL” focuses on this harder case: evaluation on in-distribution data when deployment requires out-of-distribution generalization. It describes DataSAIL, a framework that uses a similarity or distance measure to construct folds. The method formulates splitting as a constrained optimization problem and uses clustering plus integer linear programming heuristics. The paper reports reduced train–test leakage for models on one- and two-dimensional biomolecular datasets.

The scope matters. The paper’s empirical examples are biomolecular, where dependencies such as protein similarity can make random splits misleading. The authors describe the framework as applicable when a suitable similarity or distance measure exists, but that does not establish that one split strategy or similarity threshold is right for every domain. Choosing the measure is itself a modeling decision.

A practical split-design workflow starts with the prediction you intend to make. Write down what must be new at inference time: a new sample from known entities, a new entity, a new pair of entities, or a later time period. Then identify relationships that could make train and test examples unusually alike—such as repeated entities, near-duplicates, or similarity under a domain-specific representation. Choose a split that holds out the relevant unit, and document any examples that cannot be assigned without crossing the boundary.

Keep a random split as a useful baseline, not as the only score by default. Run the same modeling and tuning procedure under the deployment-matched split, and report both results with their different interpretations. A drop under the stricter split is evidence that the task changes when related examples are withheld; by itself it does not prove a particular model exploited leakage or predict the exact production score. Check class balance and sample counts too, since stricter grouping can make folds smaller or less balanced.

Hypothesis — proposed exercise, not run. On a suitable public dataset with entity identifiers and a defensible similarity measure, compare a random split with an entity- or similarity-aware split while holding the model and tuning budget fixed. Record cross-fold entity/similarity overlap, fold sizes, class balance, and the metric under each design. The hypothesis is that scores may diverge when the random split places related examples on both sides. No local experiment or measurement was produced for this article.

The decision rule is simple: choose the evaluation boundary from the deployment boundary, not from convenience. If the deployment target is unknown, show how conclusions change across plausible split designs and keep that uncertainty visible. For more on separating measurement from decision risk, see our note on sequential A/B testing. Read the Chinese companion for the same scope and caveats.

Evidence notes

  • Reported — DataSAIL, Nature Communications (2025), “Data splitting to avoid information leakage with DataSAIL”: https://www.nature.com/articles/s41467-025-58606-8 . First-party methods and results support similarity-aware splitting and the biomolecular evaluation examples summarized above. The framework’s transfer to another domain depends on the relevance of its similarity/distance measure and a deployment-matched split design.
  • Source not used — Information and Software Technology (2026), “Understanding how data leakage manifests in real-world ML notebooks”: https://www.sciencedirect.com/science/article/pii/S0950584926003253 . Publisher endpoint returned HTTP 403; exact-title/identifier search did not locate an accessible author copy. No notebook-corpus counts or detailed findings from this study are asserted here.
  • Hypothesis: Random and entity-aware splits may produce different scores on a dataset with related entities. The proposed comparison has not been run; no result is claimed.