arXiv:2610.19123cs.LGOct 2026

Manuscript Offprint

arXiv:2610.19123

PairIT: Autoregressive Transformers for Low-Data Molecule Optimization

Hannah Lawrence, Bodhi P. Vani, Ji Won Park, Natasa Tagasovska, Samuel Don Stanton, Andrew Martin Watkins, Michael Maser, Ewa M. Nowara

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

Abstract

Generating novel molecules with desired properties is a central challenge in drug discovery. Although foundational work focused on de novo generation, practical use cases require a more complex setting: conditioning on an initial seed molecule, optimizing multiple properties, and operating in data-sparse regimes. We introduce PairIT, a flexible training framework for autoregressive transformers over SMILES sequences that enables seeded generation by learning from pairs of structurally similar molecules. By leveraging matched pairs, the model learns to generate local, chemically meaningful edits that improve a property of the seed molecule. Prompt tokens extend this framework by specifying the target property, desired direction, and approximate magnitude of change. Multiple prompt tokens can be concatenated to enable multi-property optimization at inference time. For properties where pair supervision alone is insufficient, reinforcement learning post-training can further improve optimization, providing a tunable trade-off between proximity to the seed and the optimization objective. PairIT naturally supports pretraining on a large dataset and fine-tuning on a smaller dataset, which is critical for performance in data-sparse regimes. Surprisingly, we observe diminishing returns to the scale of the pretraining dataset. We demonstrate empirically on MoleculeNet and Therapeutics Data Commons datasets that, with appropriate paired-data curation, a standard transformer model of modest size (68M parameters) can achieve robust seeded molecular optimization in low-data regimes.

1 Introduction

Generative models enable efficient exploration of chemical space, making them increasingly important tools for molecular discovery [Bohacek et al., 1996]. In practical drug discovery, an important task is molecular optimization. The goal is to propose small, local modifications to a known seed molecule that improve one or more (bio)chemical properties. Maintaining structural similarity to a seed molecule increases the likelihood of preserving biological function [Bender and Glen, 2004]. However,

Generative AI tools were used to assist with manuscript editing and formatting, and with code development and debugging. All AI-assisted outputs were reviewed and verified by the authors.

Code is available at https://github.com/prescient-design/pairit.

Figure

Figure 1: Overview of PairIT. We (1) construct training pairs of structurally similar molecules with differing property values and (2) train an autoregressive transformer to predict the target SMILES given the seed SMILES and structured property-control prompt tokens. (3) At inference time, the model generates property-improved candidates from a new seed and prompt. Multiple prompt blocks can be concatenated for multi-property control.

structure–function response surfaces are notoriously jagged [Aldeghi et al., 2022]; molecules differing by even a single atom may have drastically different properties, making optimization challenging. In practice, computational and medicinal chemists often approach this problem through local molecular edits informed by cheminformatics tools and domain expertise [Kramer et al., 2014]. A full discovery campaign has an “outer loop” in which candidates are synthesized and experimentally measured and an “inner loop” in which candidates are proposed and scored against a surrogate model. We focus on seeded generation 0^{0} in this “inner loop”, in the scarce-label regime common in early-stage discovery, where experimental measurements are expensive and datasets often contain only hundreds to thousands of labeled molecules [Wu et al., 2018].

While substantial prior literature exists on molecular optimization, the small-dataset regime remains under-addressed, with few works evaluating seeded optimization on biological properties. Many recent models are developed and evaluated either in de novo settings, where there is no seed molecule [Pinheiro et al., 2023, Joshi et al., 2025, Xu et al., 2023], or with far more labeled data than is typically available in early-stage discovery [Dey et al., 2025, Lee et al., 2025, Jin et al., 2020]. In contrast, we focus on seeded optimization in the low-data regime. Generated molecules must remain close enough to the seed to preserve relevant structure while introducing enough novelty to improve the desired property. Moreover, constraining generation to a local search space is restrictive, by definition: the model must introduce enough novelty to improve the requested properties while still remaining close to the seed, and such conditioning can collapse toward near-reconstruction rather than diverse one-to-many outputs [Kumar et al., 2024]. In small labeled datasets, limited examples further increase the risk of overfitting and memorized edits [Wu et al., 2018]. Yet even small datasets can contain useful local structure–property relationships, motivating training objectives that expose these transformations directly.

One way to expose such local transformations directly is to match structurally similar molecules from a dataset and train the model to “translate” from one molecule to the other. If the pairs are directed so that the target molecule has an improved value for a property of interest, the model learns local, property-improving edits. For example, Damani et al. [2019] apply this sequence-to-sequence approach to small-molecule optimization, while Tagasovska et al. [2024], Pinheiro et al. [2025], Chen et al. [2025] use related pair-based approaches for protein sequence optimization. Recent work also applies pair-based training to large language models for controllable molecular optimization [Dey et al., 2025].

We propose PairIT (Figure 1), a decoder-only autoregressive transformer over SMILES 1^{1} trained on matched seed–target pairs of structurally similar molecules with differing properties. The base model learns to generate local, property-improving edits directly from pair supervision. To extend optimization beyond the property changes learned in a single generation step, we also consider iterative re-seeding, in which high-scoring generations are fed back to the model as new seeds for further optimization. We refer to this variant as PairIT-Beam. For properties that remain difficult to optimize from pair supervision alone, we further explore reinforcement learning (RL) post-training

0^{0}In this work, we use the terms molecular optimization and seeded generation interchangeably, and likewise for seed molecule and input molecule.

1^{1}SMILES strings are text representations of molecular structure [Weininger, 1988].

with a property-model reward when a reliable property predictor is available, which we refer to as PairIT-RL.

However, pair-only approaches tie the optimization objective to the constructed pair set. Changing the target property or direction, or composing multiple objectives, can require constructing new pairs and retraining. This becomes increasingly restrictive in small datasets, where suitable pairs for specific combinations of property changes may be sparse or absent. To provide finer control over how much a seed property is changed, we additionally introduce structured control tokens specifying the property, direction, and approximate magnitude of change. This also extends naturally to multi-property optimization, where constructing similar pairs that improve several properties simultaneously can be especially difficult in very small datasets. Multiple property prompts can instead be composed at inference time without constructing a separate pair set and retraining for each combination.

Because the downstream pair sets are very small, we first pretrain PairIT on ZINC-250K [Irwin et al., 2012] before fine-tuning on each target dataset. This raises two practical questions, whether the gains come simply from molecular pretraining or specifically from pretraining on directed pairs, and how much paired pretraining is needed in terms of pair diversity and training duration. We therefore compare no pretraining, single-molecule pretraining, and directed-pair pretraining, vary the amount and diversity of paired data, and track validation and downstream performance over the course of training. We find that directed-pair pretraining outperforms pretraining on individual molecules, but that its benefits emerge surprisingly early, with the best validation checkpoint reached before one full epoch over the pair dataset. We study this behavior with training-dynamics and data-scale ablations, finding that repeated molecular coverage across many pairs helps explain the early saturation and that additional pair data yield diminishing returns.

PairIT deliberately combines existing components in a way tailored to low-data seeded molecular optimization, rather than introducing a new architecture or dataset. Rather than relying on a large general-purpose language model, we use a compact 68M-parameter transformer with molecule-specific tokenization, matched-pair construction, and the training and inference strategies described above. We evaluate this setting on MoleculeNet, where, to our knowledge, seeded generation has not previously been studied systematically. We formulate the task, define metrics that capture property improvement, novelty, and fidelity to the seed, and compare to diverse baseline methods under the same limited-data setting.

Our main contributions are (i) a compact 68M-parameter matched-pair autoregressive model for low-data seeded molecular optimization that is competitive with substantially larger or more elaborate baselines; (ii) iterative re-seeding and optional RL post-training that can further improve property optimization when additional inference compute or a reliable property predictor is available; (iii) structured property-control tokens that provide control over the direction and magnitude of property change and support multi-property optimization without retraining for each objective combination; and (iv) an analysis of paired-pretraining dynamics showing that pair structure provides benefits beyond exposure to the same molecules individually, and characterizing why useful pretraining can emerge before a full pass over the pair dataset.

References (58)