Manuscript Offprint

arXiv:2610.32103

ReMedI: Inference-Time Refinement and Self-Distillation for Controllable Molecular Optimization

Jia Yi Zhang, Shivanshu Shekhar, Allison McLevige, Tong Zhang

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

ABSTRACT

In drug development, lead optimization must improve competing properties, such as increasing permeability and reducing toxicity, while limiting scaffold changes that could compromise the lead's potency. RL-based post-training, such as C-MORAL, addresses this problem by fine-tuning molecular language models to directly optimize molecular leads for objectives of interest, which relies on expensive task-specific datasets and faces challenges in achieving multi-objective optimization (MOO). We argue a pretrained model may already contain useful molecular edits that zero-shot generation cannot efficiently reach. Motivated by the limited search capabilities of zero-shot generation, we develop an efficient Metropolis–Hastings search strategy to better explore the proposal distribution. We propose ReMedI, which uses the molecular language model as a base proposer for inference-time alignment. Given a lead and a set of multi-objective tasks, the model proposes edits conditioned on the current molecule, while Metropolis–Hastings refinement guides sequential edits under an objective for property improvement, preservation, and lead similarity. On both C-MuMOInstruct and SMDD benchmarks, refinement improves frozen base models across three backbones, reaching significantly higher multi-objective optimization success rates compared to baselines. These search traces can then distilled into the base model which improves zero-shot generation and subsequent search using ≈7.8×\approx 7.8\times less training molecular leads than that of C-MORAL. ReMedI achieves ≈2.8×\approx 2.8\times the strict-success coverage of RL baseline C-MORAL, including on out-of-distribution tasks, with matched lead-relative similarity.

1 INTRODUCTION

Chemical language models (CLMs) have increasingly become popular for text-guided molecular generation (Edwards et al., 2022), multi-property optimization (Dey et al., 2025b;a), and the design of functional, makeable molecules (Edwards et al., 2026). A central application of CLMs is lead optimization, which starts with a promising molecule (lead) and seeks local edits that improve deficient properties, such as permeability or toxicity, while preserving satisfactory properties and maintaining lead-relative similarity. However, current CLMs do not reliably produce molecules that meet all property targets without drifting off-scaffold. RL post-training and reference-guided policy optimization methods try to align CLMs to property rewards to satisfy MOO (Gao et al., 2026; Li et al., 2026). For instance, C-MORAL combines group-based policy optimization with property-specific score transformations and nonlinear reward aggregation to improve selective molecular editing (Gao et al., 2026). This approach relies on task-specific RL adapters and editing data, which are costly to develop and can limit transfer to new combinations of objectives. Since chemists often optimize several properties together, the challenge therefore is to meet every property requirement and maintaining acceptable lead-relative similarity without adapting a separate model for each task.

Inference-time alignment offers an alternative by guiding generation while holding the model weights fixed. Existing approaches include similarity-guided decoding (Navratil et al., 2025) and iterative editing (Edwards et al., 2026). For instance, GP-MoLFormer-Sim guides decoding through

∗^{*}Equal contribution

Figure

Figure 1: ReMedI separates the molecular edit proposal from the inference-time objective. Refinement discovers successful trajectories; lead- and state-conditioned examples from those trajectories train a shared proposal for later generation and search.

reference similarity and uses an outer genetic algorithm for property optimization (Navratil et al., 2025), but its decoding guidance does not directly encode which properties should improve or remain unchanged. MARS demonstrates that multi-property molecular optimization can benefit from iterative search over intermediate molecular states (Xie et al., 2021). We build on this principle in ReMedI by using an instruction-conditioned language model to propose successive edits with a search algorithm which determines which states to retain.

We introduce ReMedI, which uses a pretrained molecular language model to propose local edits and Metropolis–Hastings (MH) refinement to guide the search. Its lead-relative objective balances property improvement, preservation, and similarity to the lead. Because the proposal remains frozen during refinement, the improvement–similarity trade-off can be adjusted at inference time without task-specific RL adapters. Thus our method allows chemists to explore pharmacological spaces that are hard to reach via zero-shot prompting. On C-MuMOInstruct and SMDD, refinement improves success across GeLLMO-Llama, GeLLMO-Mistral, and mCLM-4B, and ReMedI achieves higher strict-success coverage than C-MORAL on matched GeLLMO-Mistral leads, including on combinations of properties held out during training.

We show that in ReMedI a single shared proposal adapter trained from only 500 lead–task instances achieves performance comparable to C-MORAL, which relies on five task-specific policies trained from 3,883 lead–task prompts. Our traces contain successful endpoints and intermediate states, so training does not require a separate specialized editing dataset. Search improves candidates at inference time and supplies examples that strengthen later generation and refinement.

References (33)