Manuscript Offprint

arXiv:2610.38835

What to randomize matters: a controlled study of volume, axis and representation in low-data molecular generation

Neerav Kaushal, Alisa Teige, Ajay MNV Penmatsa

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Chemical language models can struggle to generate new molecules when trained on small datasets, where a model may reproduce training examples rather than learn a useful generative distribution. Randomized SMILES augmentation varies atom traversal, whereas Sequential Attachment-based Fragment Embedding (SAFE) also allows the order of fragment blocks to vary. How these distinct sources of representational variation affect low-data molecular generation has not been clearly studied. Here, using 1,000 seed molecules to train an autoregressive sequence model, we compare canonical SAFE with randomized SAFE at increasing corpus sizes, isolate atom-order and fragment-order axes of SAFE randomization, and compare fully randomized SAFE with randomized SMILES at molecule-by-molecule matched training corpora. Three findings emerge. First, randomization of SAFE alone raises the genuine yield of novel molecules more than 450-fold, turning a model that merely reproduces its training set into a practical molecular generator. Second, the two axes of randomization act jointly rather than additively: atom order alone reaches a tenth, and fragment order alone a seventh, of the genuine yield obtained when both vary, which is four times their combined contribution. Third, at matched corpus size and compute, randomized SAFE delivers 2.8 times the genuine yield of randomized SMILES. Welch tests with Games-Howell post-hoc comparisons resolve every difference on the primary outcomes. In the low-data regime, thus, what one randomizes rather than only how much determines whether augmentation produces new molecules or merely new spellings of the training set.

Scientific Contribution: This study compares string augmentation strategies in the low-data regime, where randomization has been reported to offer limited benefit at benchmark scale, using matched corpora and compute to separate SAFE's two randomization axes and to compare randomized SAFE with randomized SMILES. The main findings are that randomization turns a memorizing model into a practical generator, that the two axes of randomization act jointly rather than additively, and that randomized SAFE exceeds randomized SMILES in performance at matched corpus size. This work contributes the first augmentation axis-resolved analysis showing that augmentation design, and not augmentation volume alone, determines molecular-generation outcomes in data-poor settings.

Keywords: de novo generation, molecular AI, molecular representations, transformers, chemical language modeling, low-data, data augmentation

1 Introduction

In the last decade, deep learning-based generative models have become central to de novo molecular design [1–7] and among the most widely used ones are autoregressive language models trained on string representations of molecules [8–11]. These benchmark models are mostly trained on vast swaths of data ranging from millions to billions. Yet the settings in which generation would be most valuable are often the most data-poor. A medicinal chemistry campaign may have only tens to a few hundred molecules of interest around a chemotype or disease target. Learning a useful generative distribution from the low-data regime of around 1,000 molecules or fewer is therefore a recurring, practical, and important challenge in the field of molecular generation and drug discovery.

Most molecular language models operate on Simplified Molecular Input Line Entry System (SMILES) [12], a string built by traversing a molecule atom by atom. A single molecule can be represented by many valid SMILES strings and this redundancy has been exploited as data augmentation [10, 13–15]. Enumerating multiple non-canonical or randomized SMILES per molecule was shown by Arús-Pous et al. [14] to improve the validity, novelty, and distributional coverage of SMILES-based generative models. SMILES randomization exposes the model to many spellings of the same molecule, discouraging memorization of a single canonical form and increasing learning robustness. More recent work extends this idea with SMILES-level operations such as token deletion, atom masking, and bioisosteric substitution for low-data generation [16, 17]. All of these operate on the SMILES grammar, whose only source of randomization is the order in which atoms are traversed.

Sequential Attachment-based Fragment Embedding (SAFE) [18] representation is an alternative, information-equivalent linearization organized by molecular fragments rather than atoms. It preserves fragment composition, connectivity, and scaffold context. A molecule is first decomposed into fragments by a slicing scheme—obtained by BRICS [19] decomposition in our work—which cuts retrosynthetically accessible bonds, resulting in each fragment being written as a SMILES-like block. Fragments are concatenated into a single string, separated by • (dot), and the bonds that originally joined them are preserved as matching ring-bond digits shared across blocks, which act as attachment points. For example, acetanilide becomes c13cccc1.CC2=0.N23, constituting a phenyl block, an acetyl block, and a nitrogen block, with the shared digits 2 and 3 encoding the N—C(=O)C and N—phenyl bonds respectively. This is shown in Figure 1.

Figure

Fig. 1: The SAFE representation. The same molecule (acetanilide) is shown three ways: as a SMILES string (top), a 2D structure (middle), and a SAFE string (bottom). SMILES encodes a molecule by an atom-by-atom traversal. SAFE instead decomposes the molecule into fragments, here cleaved by the BRICS algorithm into a phenyl ring (blue), the central nitrogen (orange), and an acetyl group (green), with dashed lines marking the cleaved bonds. Each fragment gets written as a SMILES-like block. The blocks are concatenated with a • separator, and the bonds that originally joined the fragments are preserved as matching ring-bond attachment digits shared across blocks (e.g. the shared 2 and 3). Colors link each fragment to its corresponding block.

Like SMILES, a SAFE string is a valid, invertible encoding that a language model can generate token by token and that can decode back to a unique molecule. Unlike SMILES though, its fragment structure is explicit in the string. This makes SAFE natural for fragment-constrained generation tasks as shown by Zhu and Noutahi [20], and it introduces a second source of string variation that SMILES does not possess: the order of the fragment blocks themselves, which is central to this work. Critically, randomizing a SAFE string can be done by varying two orthogonal axes: the order of fragments and the atom ordering within the fragments, whereas SMILES randomization varies only the atom ordering. This is shown in Figure 2 and discussed in detail in Sec 2.1.

Whether augmenting data by SAFE randomization benefits molecular generation at all, and if so, whether that benefit arises from the fragment-order axis, the atom-order axis, or their combination, is unestablished. Indeed, at benchmark scale (MOSES [21], 104−10610^{4}-10^{6} molecules), Mesbahi and Noutahi [22] reported that SAFE randomization yields limited benefit, attributing what benefit there is largely to extended training and reduced overfitting rather than to improved generalization.

Figure

Canonicalc13cccccc1.CC2=O,N23Fixed, deterministic, canonical SAFE representation
Dot-randomized (fragment-order)CC2=O.c13cccccc1.N23Fragment order permuted but fragment spelling unchanged
Atom-randomized (atom-order)C3(C)=O.N32.c12cccccc1Atom traversal rewritten within fragments and block order fixed by deterministic sort
Full-randomized (dot + atom)C2(C)=O.N23.c1cccc3c1Both fragment order permuted and fragment spelling rewritten

Fig. 2: The axes of randomization of a SAFE string. All four SAFE strings encode the same molecule, acetanilide (top) and decode back to it. Colors mark the three BRICS fragments (phenyl:blue, acetyl:green, and nitrogen:orange). Canonical: the single deterministic SAFE string. Dot-randomized (fragment-order): the fragment blocks are permuted while each block's internal spelling is unchanged, meaning the atom traversal within a fragment follows the same order as in the canonical representation. Atom-randomized (atom-order): the atom traversal within each fragment is rewritten, and the resulting blocks are then arranged in deterministic sorted order rather than a random one, so that randomness enters only through the spelling of each fragment and not through their sequence. Full-randomized (dot + atom): both axes vary jointly, the default for SAFE randomizer. Because a molecule's fragments can be reordered and each fragment respelled independently, SAFE exposes two orthogonal randomization axes. SMILES randomization varies only the atom-order axis, making the fragment-order axis unique to SAFE.

These observations leave three questions open, each bearing directly on when and why representation-level randomization helps:

  1. Does SAFE randomization help in a strictly low-data regime (∼103\sim 10^3 molecules), as SMILES randomization does, or is its benefit as limited there as at benchmark scale?

  2. SAFE randomization couples two axes: fragment order and atom order. Which, if either, or both, is responsible for any benefit?

  3. If there is indeed a benefit, is it due to the SAFE representation itself or to augmentation in general? Since only SAFE has the fragment-order axis, a controlled comparison against baseline SMILES randomization at matched data and compute can tell the two apart.

To our knowledge, none of these questions has been addressed directly. We approach them with a controlled study built around 1,000 seed molecules and a small decoder-only transformer (OPT) trained from scratch. Across all comparisons we hold the architecture, tokenization scheme, and optimizer-step budget fixed. For the axis ablation and the SAFE-SMILES comparison we additionally match the molecular composition of the training corpora molecule by molecule, so that those arms differ only in the randomization applied. Each arm is trained five times from independent initializations and evaluated on validity, uniqueness, novelty, yield, genuine yield, seed recovery, internal diversity, and physicochemical property distributions. Three results follow:

  1. In this low-data setting, SAFE randomization changes the character of the model's output rather than merely improving it. Genuine yield rises from 15 to 7,079 novel molecules per 10,000 samples, so a model that largely reproduces its training set becomes a working molecular generator. This contrasts with the limited benefit reported for SAFE randomization at benchmark scale [22].

  2. Neither randomization axis alone approaches their combination. At matched composition, varying both axes of randomization together reaches 6,977 genuine-yield molecules per 10,000 samples, against 712 for atom-order and 1,026 for fragment-order randomization. The two axes thus interact, rather than add.

  3. Under identical training and evaluation conditions, fully randomized SAFE produces 7,067 genuine-yield molecules per 10,000 samples against 2,562 for randomized SMILES, a gap that widens relative to the plain novelty count because SMILES randomization diversifies spellings more than the molecules.

Taken together, these comparisons indicate that an augmentation scheme is better characterized by the transformations it introduces than by the number of strings it produces. In other words, in the low-data regime, what one randomizes matters. The fragment-order axis afforded by SAFE's fragment grammar, and absent from SMILES, appears to be what converts string augmentation into molecular novelty.

References (31)