Margin-calibrated Classifier Guidance for Property-driven Synthesis Planning

Najwa Laabid, Vikas Garg · 2026

Read Margin-calibrated Classifier Guidance for Property-driven Synthesis Planning by Najwa Laabid, Vikas Garg (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-13101.txt.

Introduction

Laabid and Garg improve classifier guidance for property-driven synthesis planning, where a retrosynthesis model is repeatedly invoked to build reaction sequences toward a target molecule. Auxiliary classifiers trained with cross-entropy loss prove too weak to override unconditional token distributions from sparse reaction data. Their Sequence Completion Ranking calibrates the classifier with contrastive argumentation and a margin-based loss, opening more valid routes under guided beam search. On USPTO-190 it lifts multi-step solve rates from 16.8% unguided to 78.4% with reaction-type guidance and 95.3% with Tanimoto guidance.

Catalog record

CREATORNajwa Laabid, Vikas Garg
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE94719
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.13101

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Margin-calibrated Classifier Guidance for Property-driven Synthesis Planning Najwa Laabid, Vikas Garg Abstract Synthesis planning seeks an efficient sequence of chemical reactions that produce a target molecule. Typically, a pretrained single-step (autoregressive) retrosynthesis model is repeatedly invoked to generate such a sequence. Classifier guidance can, in principle, help steer the output of single-step model toward reactions that satisfy specific constraints or accommodate chemist’s preferences during inference without having to retrain the autoregressive generator. We expose the insufficiency of auxiliary classifiers trained with cross-entropy loss to override the unconditional token-level distributions learned from typical sparse single-disconnection reaction datasets. We overcome this issue with a novel method called Sequence Completion Ranking (SCR), which employs contrastive argumentation and a margin-based loss to calibrate the classifier so that it can meaningfully discriminate between continuations during decoding. We formally establish that margin-calibrated classifiers can expand the set of property-satisfying sequences reachable under guided beam search. Empirically, on USPTO-190, given chemist-specified guidance targets, SCR substantially improves multi-step solve rates from 16.8 % 16.8\% (unguided generator) to 78.4 % 78.4\% with reaction-type guidance and 95.3 % 95.3\% with Tanimoto guidance, unlocking valid routes for 33 targets ( 17.4 % 17.4\% ) previously unsolvable with baselines. Our method also effectively closes the long-standing diversity gap between template-free and template-based methods. 1 Introduction Retrosynthesis, the task of predicting which precursor molecules can produce a given target, is a cornerstone of synthetic chemistry and drug discovery. Data-driven single-step models have made remarkable progress ( Segler and Waller 2017 ; Segler et al. 2018 ; Schwaller et al. 2019 ; Sacha et al. 2021 ; Zhong et al. 2022 ; Chen and Jung 2021 ; Seidl et al. 2022 ) , yet chemists rarely seek any viable precursors: a medicinal chemist may favor robust C–C cross-couplings for late-stage diversification ( Brown and Boström 2016 ; Roughley and Jordan 2011 ) , an industrial chemist may require routes through specific, low-cost starting materials, and a process chemist may avoid reactions with hazardous intermediates or pyrophoric reagents ( Constable et al. 2007 ) . Current models are largely agnostic to such preferences. Existing approaches either retrain the generator per property (expensive and brittle to constraint changes), or filter post-hoc from a fixed sample pool, leaving sequences outside the base model’s beam unreachable. Classifier guidance ( Yang and Klein 2021 ; Meng et al. 2022 ) offers a lightweight alternative: steer at inference time using an auxiliary signal, leveraging the generative prior of an existing model. We study steerable single-step retrosynthesis : given a target molecule and a desired property (e.g. a reaction type or a starting material constraint), generate precursors satisfying the property while remaining chemically valid. Our approach applies classifier guidance to an autoregressive SMILES-based model: a token-level classifier predicts whether the completed reaction will satisfy the target property and reranks candidates during beam search ( Eq. 2 ), steering generation at inference time without retraining. For this guidance to work, the classifier must assign meaningfully different probabilities to token continuations leading toward versus away from the target property, a quantity we term token-level discriminability . We show that classifiers trained with cross-entropy cannot guarantee this on retrosynthesis data: the data regime needed for a CE estimator to clear the discriminability gap requires per-prefix coverage of rare token–class combinations that single-disconnection reaction corpora structurally lack ( Section 3.1 ). To overcome this, we propose Sequence Completion Ranking (SCR), combining contrastive augmentation (replacing the final token of partial sequences with random alternatives to force token-level sensitivity) with a margin-based ranking loss that directly enforces the discriminability gap required by guidance. We further prove that classifiers satisfying these per-step requirements provably expand the set of sequences reachable under beam search ( Proposition 1 ). We evaluate SCR on reaction type steering and starting material conditioning. On USPTO-190-Steps (640 products), SCR achieves the highest steering breadth among all baselines including template-based methods, recovers valid steered precursors for 231 of the 287 products on which the unguided generator fails entirely, and produces samples with only 39% Jaccard overlap with unguided generation. In multi-step search on USPTO-190 with chemist-specified targets per node, reaction-type guidance lifts the Retro* solve rate from 16.8% (unguided generator) to 78.4%, exceeding the best template-free baseline by 12.6 pp, and Tanimoto guidance reaches 95.3% with the highest route diversity overall. Across both signals, guidance unlocks valid routes for 33 targets (17.4%) that no baseline solves, and remains competitive with search-level steering when the two are combined. • We prove that cross-entropy training cannot deliver the token-level discriminability guidance requires on retrosynthesis data, where single-disconnection corpora structurally lack the rare-cell coverage the CE estimator needs ( Section 3.1 ). • We propose Sequence Completion Ranking (SCR), pairing contrastive augmentation with a margin-based ranking loss that calibrates classifiers to clear the discriminability gap by construction ( Section 3.2 ), and prove that SCR-trained classifiers expand the set of property-satisfying sequences reachable under guided beam search ( Proposition 1 ). • Empirically, on USPTO-190-Steps SCR achieves the highest steering breadth among all baselines (template-based and template-free); in multi-step search, reaction-type guidance lifts the Retro* solve rate by 4.7{\times} over the unguided generator and Tanimoto guidance reaches the highest solve rate and route diversity overall, jointly unlocking valid routes for 33 targets (17.4%) that no baseline solves. Our anonymized code release is available at https://anonymous.4open.science/r/scr-submission-FB82/ and the trained classifier checkpoints are archived at https://osf.io/nyazq/?view_only=0fb8e747409c4067ba2299124bcf7b46 . Figure 1 : Autoregressive generation under three configurations: unguided generator, generator + CE-trained classifier, and generator + SCR-trained classifier. CE-guided decoding produces the same outcome as the unguided generator ( Section 3.1 ), whereas SCR steers generation toward the target reaction type (C–C coupling). 2 Preliminaries 2.1 Single-step retrosynthesis Single-step retrosynthesis is the task of predicting plausible precursor molecules (reactants) for a given target product. Formally, we define \mathcal{M} as the space of all valid molecules and represent a reaction as a pair R=(\mathbf{r},p) , where \mathbf{r}\subset\mathcal{M} is the set of reactants and p\in\mathcal{M} is the product. A template-free single-step model parameterizes the conditional distribution p_{\theta}(\mathbf{r}\mid p) , generating reactant predictions directly without relying on predefined reaction templates. Following the protocol of Zhong et al. 2022 , we train our base generator with root-aligned SMILES, where products and reactants are aligned to minimize their edit distance so that the underlying autoregressive model focuses on learning local chemical transformations. Both products and reactants are represented as SMILES strings, and the generator emits the reactant string token by token, conditioned on the product. At inference we follow the augmentation protocol of Zhong et al. 2022 ; details in Section D.5 . Throughout the paper, we refer to this product-reactant-aligned autoregressive model simply as the generator . In many practical settings, chemists seek not just any valid set of precursors, but precursors satisfying additional constraints, such as proceeding via a specific reaction type or incorporating a particular starting material. We refer to this as steerable single-step retrosynthesis. Prior work on steerable synthesis planning operates primarily at the search level in multi-step settings, filtering single-step predictions ( Segler et al. 2018 ) or modifying value functions ( Armstrong et al. 2024 ) . At the single-step level, recent work steers retrosynthesis language models through disconnection prompts (

Read the complete text