arXiv:2610.12694cs.LGOct 2026

Manuscript Offprint

arXiv:2610.12694

Critical Mass: Structure-Disjoint Splits Drift With the Libraries They Are Built On

Tomo Oga, Devesh Shah, Cailum M. K. Stienstra, Gabriel Asher, Antonio H. de O. Fonseca, Niall O'Connor, Michael Widrich

Abstract

Molecular machine learning evaluates out-of-distribution performance with structure disjoint splits, a construction rule fixed once at the scale its library happened to have: threshold a pairwise distance, then assign whole connected components to folds. For predicting structures from mass spectra, the field has converged on single-linkage clustering under the myopic Maximum Common Edge Subgraph (MCES) distance at a threshold of 10. This convention was set on 29,000 molecules but public libraries now hold 227,690 molecules. MCES is NP-hard per pair over a quadratically growing set, and so the criterion has never been evaluated at that scale. We propose an optimized version of this criterion, allowing for computationally feasible application on the public libraries: Admissible bounds and a union-find skip reduce 2.6×10102.6 \times 10^{10} molecular pairs to only 1.15×1071.15 \times 10^{7} integer programs, a 2,259×2,259 \times saving, while provably producing the lossless partition. We find that at this scale the graph percolates. A single component holds 95.5% of the library, capping any test set at 4.5%. What remains is not merely smaller, but systematically different: a held-out compound outweighs a training compound 88.1% of the time, because a fixed absolute budget is a tighter relative tolerance on a larger molecule. Large library benchmarks using this splitting rule naively therefore conflate structural novelty with extrapolation to larger, more complex chemistry.

1 Introduction

Shared benchmarks have driven much of the progress in machine learning, though how well a reported result transfers depends on the split it was built on [1, 2]. The problem is acute in molecular machine learning, where random partitions place near-identical structures in different splits and reward recall of the training data over generalization [3]. Structure-disjoint evaluation has therefore become central to establishing whether a model generalizes beyond known chemical neighborhoods [4, 5]. Such splits compute pairwise distances between molecules, retain only the edges below a threshold T, and assign each connected component to a single fold. Which distance should define near, however, remains an open question [4, 6–8].

In MS/MS structure elucidation, deep learning based methods have been developed to translate spectra to structure de novo or retrieve them from candidate sets [9–13], and are evaluated out-of-distribution on MassSpecGym [4]. This benchmark adopts the myopic Maximum Common Edge Subgraph (MCES) distance, an absolute edit distance on the molecular graph, and requires every test compound to lie at distance > 10 (MCES-10) from every training compound, enforced by single-linkage clustering of the near graph, arguing that MCES is more interpretable and reflects biochemical modification more faithfully than faster alternatives such as fingerprint Tanimoto.

*Corresponding author: tomo@matterworks.ai

40th Conference on Neural Information Processing Systems (NeurIPS 2026). Workshop: AI Data Readiness for Scientific Discovery.

Figure

(b)

(c)

Figure 1: The union-find skip turns a quadratic problem into a near-linear one. (a) Integer programs solved against library size NN: all pairs and myopic-MCES both scale as N2N^2, ours as N0.93N^{0.93}, a 70×70\times gap at the full union. (b) The union-skip is the only stage that improves substantially with NN. (c) One 24-structure cluster: of the 276 pairs among its members, 30 were solved near, 23 merging components, and 7 closing cycles, 11 were solved and returned far, and 235 never reached the solver. Myopic-MCES counts in (a) are calculated with 5×1065 \times 10^6-pair samples per rung (Appendix C).

However, fixed-threshold single-linkage partitions are sensitive to sampling density, so the same rule applied to a grown library may define a fundamentally different benchmark. Each molecule can form edges that can bridge previously separate regions, until percolation yields a single giant component [14, 15]. The effect is documented in chemical similarity networks [16] and sequence-identity benchmarks [17], where larger datasets yield fewer separable clusters. Percolation can occur for single-linkage splits under any distance; what an absolute threshold determines is which compounds survive it, since a fixed budget of T edits perturbs a small molecule far more than a large one. This is no longer a hypothetical concern. Public ML libraries for MS/MS have since grown from ~29,000 structures to 227,690 unique structures, following the release of SpectraVerse [18] and Enveda-180 [19], contributing 44,240 and 183,476 respectively. At this scale MCES-10 is also computationally intractable: MCES is NP-hard, and molecular pairs grow quadratically with library size [8].

Contributions. We show that MCES-10 partitioning defines a benchmark that is not invariant to library size. Its separation guarantee holds at every scale, but the holdout it permits collapses. Moreover, the compounds that remain are systematically heavier, because an absolute threshold is a size-dependent relative one. To measure this, we introduce an optimized MCES that makes splitting feasible at modern library sizes, reducing 2.6×10102.6 \times 10^{10} pairs to 1.15×1071.15 \times 10^{7} integer programs while preserving the exact partition.

References (21)