betaFeedback

WorksComputer Science

ReTRACE: Feedback-Guided LLM Agent in a Chemistry Harness for Retrosynthesis Planning

Abstract

Computer-aided retrosynthesis has progressed through single-step prediction, tree search and route scoring, yet complex targets still require route-level judgement where stereochemistry, functional-group compatibility, cost and greenness interact. Here we present \textbf{\mbox{ReTRACE}} (REtrosynthesis with Tool-orchestrated Reasoning And Context-aware Evidence), an agent that places a large language model (LLM) inside a deterministic chemistry harness integrating molecular tools, heterogeneous single-step prediction engines, purchasable building-block libraries, an external route memory and a multi-criterion evaluator. To assess chemical validity beyond stock termination, we introduce Audit@k, a two-stage metric combining programmatic structural checks with adversarial LLM review that closely tracks expert judgement. ReTRACE learns from harness feedback on two timescales: within a run, it diagnoses weak sub-scores and backtracks to revise disconnections; across runs, trajectories and audit verdicts are distilled through a three-stage post-training pipeline into an open-weight coordinator, ReTRACE-27B, which completes routes for all 40 evaluation targets and raises Audit@1 from 11/40 (27.5%) to 23/40 (57.5%). Across Retro*-190, JMC2025 and FDA30, ReTRACE with GPT-6.2 Astra achieves Audit@1 of 97.9%, 99.3% and 96.7%, and Audit@10 of 99.5%, 100.0% and 100.0%, respectively. Two prospective wet-lab syntheses demonstrate that ReTRACE proposals translate into executable procedures after expert revision.

Introduction

Retrosynthetic analysis is one of the central tasks of organic synthesis. Since Corey formalized the logic of working backwards from a target molecule to simpler precursors,[1, 2, 3] route design has been treated as a strategic activity that depends on chemical judgement about which bonds to break, in what order and under what conditions. This judgement matters increasingly in drug discovery, where complex candidates often contain several heterocycles, stereocentres and sensitive functional groups. For such targets, an early retrosynthetic choice propagates through the whole route and affects selectivity, protecting-group burden, cost, safety and sustainability.

Computer-aided synthesis planning (CASP) has progressed substantially since early expert systems encoded reaction rules and retrosynthetic templates as searchable chemical knowledge.[1, 2, 4, 5] Modern data-driven systems couple purchasable-compound libraries and tree search with single-step retrosynthesis models that fall into two broad families. Template-based models apply reaction rules extracted from known reactions and so remain chemically traceable,[6, 7] whereas template-free models learn the product-to-precursor mapping directly from reaction data and can propose transformations outside any template library.[8, 9, 10, 11, 12, 13] Combining models with different inductive biases improves single-step prediction further.[14] These advances are essential, but a single-step model judges one disconnection at a time and cannot by itself tell whether that disconnection serves the route as a whole.

Search algorithms then assemble these single-step predictions into multistep routes, including the modular ASKCOS platform,[15, 16] Monte Carlo tree search guided by a neural template policy[6, 7] and AND–OR graph search with a learned value function in Retro*[17], and hybrid platforms that incorporate enzymatic steps.[18] Because plausible single-step disconnections are often plentiful, the harder decision is which precursor to expand for a given target. Chemists make this decision by weighing mechanism, functional-group compatibility, precedent, availability and cost together, and these signals rarely reduce to a single number. A highly ranked Suzuki–Miyaura disconnection, for example, may be unattractive if the required organoboron partner is unstable or expensive. Existing search controllers can explore very large trees, but they usually compress this judgement into model probabilities, value estimates or a scalar route score.[6, 7, 17, 19, 20] This makes search fast, but it is difficult to enforce route-wide constraints, diagnose why a branch is weak or execute targeted revisions. Moreover, evaluating planners mainly by whether routes terminate in purchasable building blocks obscures a substantial gap between formal connectivity and laboratory feasibility.

Large language models (LLMs) offer another way to make these decisions. Recent systems use them to guide route search,[21] to coordinate single-step tools through reinforcement learning,[22] to check route constraints during search[23] and to evaluate synthetic strategy in natural language.[24] These systems build on chemistry agents in which the LLM selects and interprets expert tools while deterministic software supplies verifiable observations.[25, 26] Their results suggest that LLMs are most useful for strategy assessment, constraint reasoning and tool coordination, and that specialized single-step models remain necessary for proposing precursors.

Recent gains in LLM capability create new opportunities for coordinating heterogeneous chemistry tools over long-horizon route planning. In software engineering, LLM agents now call tools over many rounds and revise their actions from execution feedback,[27] and the length of tasks they can complete has grown rapidly.[28] Chemistry poses an additional problem. A general-purpose LLM can discuss functional groups and synthetic strategy, but on its own it is unreliable at precise molecular operations such as writing valid SMILES, conserving atoms or computing quantitative scores. For long-horizon route planning, the environment built around the model, which we call its harness, therefore matters alongside the model itself. The harness determines which tools the model can call, what it remembers and what feedback it receives.

Here we present ReTRACE (REtrosynthesis with Tool-orchestrated Reasoning And Context-aware Evidence), an agent that embeds an LLM coordinator inside a deterministic chemistry harness for multistep retrosynthesis (Figure 1a). The harness integrates three core components: heterogeneous chemistry tools (RDKit molecular operations, template-based and template-free single-step engines, purchasability lookup and route scoring) guarded by deterministic code gates, an external route memory, and a multi-criterion route evaluator. Within this harness, the agent learns from feedback on two timescales. Within a run, sub-score feedback enables the coordinator to diagnose bottlenecks, backtrack to specific branch points or switch disconnection strategies (Figure 1c), steadily improving route quality and audit pass rates as candidate routes accumulate (Figure 1d). Across runs, recorded trajectories, scores and audit verdicts are converted into training supervision to distill harness feedback into an open-weight coordinator deployed back into the same environment.

We evaluate this co-designed system across four complementary dimensions. First, a large-scale audit of ten single-step engines on USPTO-50K confirms strong candidate complementarity, motivating a harness that retains heterogeneous evidence for route-level adjudication rather than committing to one predictor. Second, to measure chemical validity beyond stock termination, we introduce Audit@k, a frozen two-stage metric pairing programmatic structural checks with stepwise and adversarial LLM review whose verdicts closely agree with a synthetic chemist, and benchmark ReTRACE against classical and LLM controllers on Retro*-190, JMC2025 and FDA30. Third, we dissect how the agent uses harness feedback through decision trajectories, tool-group ablations and a post-training pipeline that turns Qwen3.8-27B into ReTRACE-27B-latest, deployed behind a web interface that supports natural-language preference steering, human-in-the-loop continuation, modular enzymatic tools and continual learning. Finally, two prospective wet-lab syntheses demonstrate that ReTRACE route proposals can be translated into executable laboratory procedures after expert revision.

Figure 1. ReTRACE harness, two decision instances from real search trajectories and the response to score feedback within a run. a, An LLM coordinator works inside a harness of heterogeneous chemistry tools, deterministic gates that check every tool call, tool result and a route memory. Within a run, route scores return to the coordinator as feedback. When the coordinator judges a route score satisfactory, it submits the route for ranking and audit. Selected routes go on to chemist review and wet-lab synthesis; experimental outcomes are not used for post-training. Across runs, run trajectories and Audit@k verdicts become training data for three-stage post-training of Qwen3.8-27B, and the resulting ReTRACE-27B is deployed back into the same harness as the coordinator. b, Adjudicating conflicting single-step suggestions. The coordinator keeps both a late-stage nitro reduction and a glycidyl N-alkylation open, checks whether the electrophile can be purchased and expands the shared lactam core with both engine classes before choosing. c, Diagnosis and backtracking. Route B scores 0.75 against 0.80 for the best route. The coordinator attributes the gap to lower cost and feasibility from the added steps, saves route B as an alternative and backtracks to shorten the linear sequence. Monologues in b and c are verbatim excerpts from run trajectories. d, Score feedback within a run in 670 completed Retro*-190 runs. Mean score of the best route so far (dark green) and of the j-th scored route (light green; left axis), and percentage of runs in which at least one of the first j scored routes passed the audit (grey, dashed; right axis).

Results

Heterogeneous single-step tools provide complementary but imperfect candidate evidence

Figure 2 compares ten single-step retrosynthesis engines on the 50,000 USPTO-50K reactions we recorded: GraphFP, RXNGraphormer, ChemBART, Reaxys template relevance, Ringbreaker, Pistachio, Reaxys biocatalysis, BKMS, MHNreact[29] and LocalRetro[30]. For each engine we asked four questions: whether it returned output, whether its rank-1 prediction passed RDKit structural screening, whether that prediction passed an adversarial LLM audit, and whether its predictions reproduced the reference precursors recorded in the dataset, ignoring stereochemistry. Most targets admit several valid disconnections, so exact match is a conservative measure of coverage and says little about chemical feasibility. The measures diverge for every engine (Figure 2a): rank-1 predictions pass the audit far more often than they reproduce the reference, and a single top-k accuracy is therefore a poor summary of an engine’s value for route planning.

The engines are strongly complementary. The top-10 union of all ten engines recovers the reference precursors for 98.6% of reactions. Even the misses of the strongest engines are mostly recovered elsewhere: 69.8% of the top-10 misses of MHNreact, 79.6% of those of GraphFP and 80.9% of those of LocalRetro are recovered by at least one other engine. An engine’s contribution to the pool does not follow its own ranking. ChemBART is fourth on top-10 recovery, yet it accounts for most of the reactions that no other engine hits (Figure 2b) and recovers the largest share of the misses of MHNreact (Figure 2c). These observations agree with the ensembling results of RetroChimera at the single-step level[14] and motivate our design choice for the agent system, which retains heterogeneous candidates and lets the coordinator select and backtrack in the context of the full route, rather than fixing one single-step predictor before search begins.

Agreement between engines also carries information during multistep planning. We traced each step of the audited top-10 routes in the four Retro*-190 runs (Table 1) back to the candidates that the five runtime engines had returned in the same run, matching molecules without stereochemistry and excluding steps that no engine had proposed. Steps proposed by two or more engines almost always passed the audit (98.2% with two engines and 99.8% with three or more), whereas 28.6% of steps proposed by a single engine failed (Figure 2d). Agreement between engines is therefore a useful signal of step reliability when the coordinator weighs candidates.

Controller / baselineRun success (%)Audit@k (%) k=1k=1k=3k=3k=5k=5k=10k=10Rank-1 route length vs reference (%) ShorterEqualLongerNone
Retro*-190 (N=190N=190)
GPT-6.2 Astra standard100.097.999.599.599.566.817.415.80.0
Claude Opus 4.8 standard97.970.078.483.787.465.815.818.40.0
GPT-5.6 Sol fast100.064.276.878.480.064.216.319.50.0
GPT-5.6 Sol standard100.065.875.379.582.664.711.623.70.0
GPT-5.6 Sol thorough100.063.772.679.582.160.015.824.20.0
Qwen3.6-35B-A3B91.623.733.233.734.774.712.18.44.7
Retro*85.873.7N/AN/AN/A42.621.620.515.3
Codex98.932.1N/AN/AN/A57.924.716.31.1
w/o single-step prediction98.442.357.768.877.867.712.220.10.0
w/o route scoring99.552.176.381.686.865.314.720.00.0
w/o molecular-perception tools100.060.573.276.884.268.415.316.30.0
JMC2025 (N=141N=141)
GPT-6.2 Astra standard100.099.3100.0100.0100.069.512.817.70.0
Claude Opus 4.8 standard99.382.387.990.195.063.814.921.30.0
GPT-5.6 Sol fast100.075.285.888.789.460.312.827.00.0
GPT-5.6 Sol standard100.075.985.888.792.266.713.519.90.0
GPT-5.6 Sol thorough100.075.285.185.888.762.412.824.80.0
Qwen3.6-35B-A3B92.224.839.742.643.368.17.819.15.0
Retro*95.080.9N/AN/AN/A44.715.634.85.0
Codex100.040.4N/AN/AN/A58.212.827.71.4
FDA30 (N=30N=30)
GPT-6.2 Astra standard100.096.7100.0100.0100.076.720.03.30.0
Claude Opus 4.893.370.080.083.386.773.313.310.03.3
GPT-5.6 Sol fast96.770.080.083.386.773.320.06.70.0
GPT-5.6 Sol standard100.076.783.386.790.080.013.36.70.0
GPT-5.6 Sol thorough100.066.776.776.783.376.710.013.30.0
Qwen3.6-35B-A3B100.030.053.360.063.383.313.33.30.0
Retro*86.753.3N/AN/AN/A36.716.713.333.3
Codex100.030.0N/AN/AN/A66.710.020.03.3

Table 1. Route-planning performance of coordinating models and unified audit baselines across three datasets, with Claude Opus 4.8 tool-group ablations on Retro*-190.

Validity, reference recovery and complementarity of ten single-step engines, and engine agreement in planned routes

Figure 2. Validity, reference recovery and complementarity of ten single-step engines, and engine agreement in planned routes. a–c, 50,000 USPTO-50K reactions, with engines ordered by top-10 recovery and reference matching. a, Fraction of reactions with output, with a rank-1 prediction that passes RDKit screening, with a rank-1 prediction that passes the LLM audit (95% Wilson interval), and with an exact top-1 reference match. b, Reactions recovered within the top 10 by that engine alone. c, Percentage of the top-10 misses of the row engine that the column engine recovers within its top 10, and the right column gives the top-10 miss rate of each engine. d, Route steps in the Retro*-190 runs that passed or failed the audit, by the number of runtime engines that proposed the step.

The error modes of the engines also differ. Among returned rank-1 predictions, the two generative engines, ChemBART and RXNGraphormer, had the lowest structural pass rates, and their failures were more often unparsable structures, atom or valence anomalies and mechanistically untenable precursor combinations. All engines were run with their released or historical checkpoints, and the recorded corpus overlaps their training data, so Figure 2 describes retrospective performance and does not rank the engines on held-out data. ReTRACE therefore does not adopt the raw ranking of any engine. It canonicalizes, deduplicates and screens candidates before exposing them to the LLM.

Route-level performance and controller comparison

ReTRACE converts single-step candidates into complete multistep synthesis plans. With the LLM coordinators, run success, that is, the fraction of targets for which a run completes and returns at least one route, was 93.3–100% across the three datasets (Table 1). Run success, however, does not imply chemical validity: many of these routes contain steps that would not work in the laboratory, partly because single-step models can return false-positive precursors. Route-level metrics widely used in related work, such as solve rates based on reaching purchasable leaves, are therefore not sufficient to assess our system. We instead propose a new metric, Audit@kk, which applies the same frozen two-stage audit to every method and records whether at least one of the top-kk ranked routes passes the audit, with all targets in the dataset as the denominator. On Retro*-190, Audit@1/3/5/10 reached 97.9%/99.5%/99.5%/99.5% for GPT-6.2 Astra standard, 70.0%/78.4%/83.7%/87.4% for Claude Opus 4.8 standard and 65.8%/75.3%/79.5%/82.6% for GPT-5.6 Sol standard. On JMC2025 and FDA30, GPT-6.2 Astra standard achieved Audit@1 of 99.3% and 96.7% and reached 100.0% from Audit@3 through Audit@10 on both benchmarks, while Claude Opus 4.8 standard and GPT-5.6 Sol standard also maintained high multi-candidate coverage (Table 1).

The coordinating model and its search preset affect route-planning outcomes. ReTRACE provides several reasoning and search budgets to suit different users, but larger reasoning and search budgets did not yield monotonic gains. For GPT-5.6 Sol fast, standard and thorough, Audit@10 was 80.0%, 82.6% and 82.1% on Retro*-190, 89.4%, 92.2% and 88.7% on JMC2025, and 86.7%, 90.0% and 83.3% on FDA30. The standard preset gave the highest Audit@1 and Audit@10 of the three presets on every dataset. The thorough preset, which has the largest reasoning effort, query budget and route capacity, never exceeded it and was at or below the fast preset in five of the six comparisons. More reasoning and search on a target therefore did not translate into proportionally better routes.

For comparison, the classical Retro* search baseline achieved Audit@1 of 73.7%, 80.9% and 53.3% on the three datasets, and the general-purpose agent baseline Codex with GPT-5.6 Sol standard, which generates routes directly, achieved 32.1%, 40.4% and 30.0%. These external baselines share the target sets, the stock-termination criterion and the frozen audit, but keep their native controllers and budgets, so the comparison is outcome-level rather than compute-matched. With GPT-6.2 Astra standard, ReTRACE surpassed Retro* substantially even at Audit@1 across all three benchmarks (97.9% versus 73.7% on Retro*-190, 99.3% versus 80.9% on JMC2025 and 96.7% versus 53.3% on FDA30) and reached 99.5% to 100.0% Audit@10. Earlier-generation coordinators (Claude Opus 4.8 standard and GPT-5.6 Sol standard) trailed Retro* on first-route coverage on Retro*-190, but because Retro* returns only one route per target, ReTRACE's multi-candidate sets increased coverage as kk grew and exceeded Retro* at Audit@10 on all three datasets.

To test the agreement of this audit endpoint with human chemical judgement, a researcher with a background in synthetic chemistry reviewed 59 candidate routes returned for the first six Retro*-190 targets, including all 24 rank-1 routes under four coordinator conditions and selected lower-ranked candidates, comprising 274 reaction steps. Under the same audit-pass/audit-fail criterion used for Audit@kk, route-level agreement between the automatic audit and the chemist was 96.6% (57/59; Cohen’s κ\kappa = 0.93), rank-1 agreement was 95.8% (23/24; κ\kappa = 0.91) and step-level agreement was 97.4% (267/274; κ\kappa = 0.89). Only two route-level judgements disagreed, one in each direction.

The run trajectories show how the coordinator uses this feedback within a run (Figure 1d). We analysed the 670 completed Retro*-190 runs (Claude Opus 4.8 and GPT-5.6 Sol fast, standard and thorough) in which every scored route was audited. As a run submits more scored routes, the best score so far and the percentage of runs with at least one passed route both rise and level off after about eight routes. The score of the jj-th route is more informative. Runs submit 3–10 scored routes, so this curve averages fewer runs at larger jj (670 runs for j≤3j \le3 and 282 for j=10j=10).

Route-level chemical judgement in a representative decision trajectory

Quantitative Audit@k only shows whether a candidate set contains an audit-passing route; it does not show how the coordinator handles conflicting single-step evidence. To make this decision process inspectable, we follow one real execution trajectory, presenting the target, tool returns, coordinator diagnosis, next tool call and final route, and compare rejected branches with the reference or literature route in the same chemical context.

fig:3a contrasts two kinds of search control. Conventional MCTS or Retro* controllers expand a search tree within the candidate space defined by single-step models and update node priorities from value estimates or rollout outcomes. ReTRACE keeps the same specialist single-step tools but places branch selection at route-level context: the LLM can compare different reaction strategies, diagnose the current route from purchasability and multi-criterion scores, and backtrack when evidence is insufficient or a local step is unreliable. The difference is a change in how search is controlled, not a substitute for single-step model capability. Figure 3b shows a real execution trajectory. The LLM first identified three purchasable strategic anchors, methoxypropanol, 4-bromobenzyl bromide and a β\beta-keto ester, and assembled convergent Route 1 from them. The two single-step engine classes then gave support scores of 0.96, 1.0 and 0.98 for the Williamson etherification, Grignard addition and ester reduction, respectively, and Route 1 received a total score of 0.80. The route passed structural and single-step checks, but the route evaluator identified cost as its main weakness. The LLM therefore kept Route 1 while testing whether changing the reaction order would improve the route.

Routes 2 and 3, obtained only by reordering steps, scored 0.74 and 0.62, indicating that the problem lay not in the step order but in the shared C–C disconnection strategy. The LLM then switched to a different disconnection class: Route 4 used a Boc-last assembly and scored 0.70, and Route 5 switched to a Suzuki/oxa-Michael route. When the BPin–aryl ether leaf in Route 5 turned out not to be purchasable, the LLM disconnected it further into 4-BPin-benzyl bromide and methoxypropanol and, after re-checking, obtained the highest-scoring route with a total score of 0.83 and a feasibility score of 0.90. The case shows that route-level feedback can trigger a directed search that moves from local reordering to a change of disconnection strategy.

Conventional tree-search control and ReTRACE route-level control, with one real decision trajectory

Figure 3. Conventional tree-search control and ReTRACE route-level control, with one real decision trajectory. a, Conventional MCTS or Retro* controllers repeatedly select, expand, evaluate and backpropagate within a fixed candidate space. ReTRACE instead runs an agent loop that diagnoses weak steps, introduces alternative precursors and restructures a route before saving it. b, The common target is shown once above the five saved routes; each row begins at its first disconnection and gives the total route score. Routes 2 and 3 only reorder the steps of Route 1, Route 4 uses a Boc-last assembly, and Route 5 changes the disconnection class and reaches the highest score (0.83) after its unpurchasable BPin–aryl ether leaf is disconnected further.

Tool-group ablation

We further examined three functionally distinct tool groups: single-step prediction supplies data-driven disconnection candidates, the route scorer feeds back the feasibility, cost and greenness of the full route, and molecular-perception tools provide deterministic structural operations and molecular properties. Each ablated system was run once on Retro*-190 with Claude Opus 4.8 and compared, target by target, with the full system (Table 1). Removing single-step prediction caused the largest and most consistent decrease. This arm was evaluated on 189 targets because one run transcript was misattributed and excluded. On these 189 targets the full system reached Audit@1 of 70.4% and Audit@10 of 87.8%, slightly above the 70.0% and 87.4% it reached on all 190 targets (Table 1). Without single-step prediction, Audit@1 fell to 42.3% and Audit@10 to 77.8% (differences −28.0 and −10.1 percentage points, paired bootstrap 95% CI −37.0 to −19.0 and −16.9 to −3.2, exact McNemar P=2.9×10−8P = 2.9 \times10^{-8} and 0.005), and the decrease was significant at all four values of kk. This result is consistent with the candidate complementarity in Figure 2. Without data-driven single-step suggestions, the coordinator struggles to maintain candidate coverage through general chemical reasoning alone. This supports using the LLM to weigh and combine the outputs of specialized models rather than replacing them with LLM generation.

Removing route scoring lowered Audit@1 by 17.9 percentage points (95% CI −26.8 to −8.9, P=2.7×10−4P = 2.7 \times10^{-4}), but the difference was −2.1 points at k=3k = 3 and k=5k = 5 and −0.5 points at k=10k = 10 (95% CI −6.3 to 5.3), and no interval at k≥3k \ge3 excluded zero. Without route-score feedback, the system found an acceptable route within its top ten candidates about as often but placed it first less often, which is consistent with the role of the scorer in ranking routes. Removing molecular-perception tools lowered Audit@k by 3.2 to 9.5 points, and no difference was significant (P≥0.057P \ge0.057). This does not show that molecular perception is unnecessary. With 190 targets, the comparison has limited power for differences of a few percentage points.

Prospective wet-lab validation by synthetic chemists

A computational audit can exclude detectable structural and mechanistic contradictions, but it cannot replace optimization of experimental conditions, nor can it show that a route can be executed as proposed. The prospective validation therefore tests whether route proposals generated by ReTRACE can be translated into executable procedures after review and any necessary revision by synthetic chemists.

Figure 4a shows that, for target compound C1, ReTRACE provided the core retrosynthetic framework and an initial plan that was chemically reasonable overall. Chemist review identified two limitations of the predicted route. First, in the phosphorylation step, the free carboxyl group can compete with the phenolic hydroxyl group in side reactions, lowering selectivity. Second, the Suzuki coupling was placed late in the synthesis, where the sterically hindered substrate would lower the coupling yield and the intramolecular phosphate ester bond would risk cleavage.

Figure 4. Prospective wet-lab validation of ReTRACE-assisted route design. a, Compound C1. b, Compound C2. In each panel, the initial ReTRACE prediction is shown above the route revised by chemists and executed experimentally. C1 required a revised protection strategy and an earlier Suzuki coupling, whereas C2 retained the core sequence with localized substrate and condition changes.

To address these issues, the chemists modified the predicted route in two respects, protecting-group strategy and reaction order. To avoid competing side reactions of the carboxyl group during phosphorylation, compound 18, in which the carboxyl group is protected as a tert-butyl ester, was used as the starting substrate. The synthetic order was also changed so that the Suzuki coupling became the first step: cross-coupling of compounds 17 and 18 gave intermediate 19 in 52% yield, avoiding the efficiency loss of coupling a hindered substrate. Compound 19 then underwent K2_2CO3_3-mediated nucleophilic substitution with 3-bromopropyne (compound 20) to give intermediate 21 in 57% yield. Following the reaction design proposed by ReTRACE, compound 21 was condensed with compound 3 under piperidine catalysis with concomitant removal of the methoxybenzoate protecting group, giving intermediate 22 in 64% yield. Intermediate 22 was phosphorylated with phosphoryl chloride 10 in the presence of triethylamine to give intermediate 23 (73%), and removal of the tert-butyl group with trifluoroacetic acid gave the key intermediate 11 in 89% yield. The final amide coupling and

CuAAC click reaction retained the reaction types of the ReTRACE route, with the coupling reagent changed from TBTU to HATU: intermediate 11 was coupled with doxorubicin using HATU/DIPEA to give intermediate 13 (69%), and intermediate 13 was then clicked with the separately prepared intermediate 16 under copper sulfate/sodium ascorbate catalysis to give C1 in 67% yield. The main linear sequence therefore comprises seven isolated transformations; compound 16 was prepared in a separate branch (81%).

As shown in Figure 4b, for target compound C2 the reaction logic, core reaction types and overall synthetic order proposed by ReTRACE were largely retained in the route finally used, with modifications mainly to substrate choice and experimental details.

The first step in both routes builds the biaryl scaffold by Suzuki cross-coupling with 4-hydroxyphenylboronic acid (compound 25), giving intermediate 32 in 83% yield; in the experiment, the starting material was changed to the Boc-protected amine 31 to avoid amine side reactions during glycosylation and to improve availability. The reaction type and transformation logic of the second step, glycosylation, were also retained; on the basis of practical experience, the chemists used compound 33 as the glycosyl donor and grafted it by caesium carbonate-mediated nucleophilic substitution, giving intermediate 34 in 71% yield. Removal of the tert-butyl-based protecting group with trifluoroacetic acid (96%), followed by a three-step sequence of triphosgene-mediated coupling with dasatinib and removal of the acetyl protecting groups with sodium methoxide, gave C2 (51% over three steps). The core bond-forming logic of the experimental route thus followed the model proposal, with the changes listed above.

In both cases, ReTRACE rapidly produced a workable route skeleton that guided synthesis design, and the targets were obtained after chemistry-informed revisions of varying extent. These two expert-revised demonstrations indicate practical utility; they are not an estimate of the rate of autonomous synthesis success.

Failure modes and evidence boundaries

The frozen two-stage audit reveals important limits behind the route-level metrics. Of the 1,250 candidate routes returned by GPT-5.6 Sol standard on Retro*-190, 753 (60.2%) passed the audit and 497 (39.8%; 95% target-bootstrap CI 33.8–45.8%) failed.

Failed routes were not dominated by formatting or parsing problems; they concentrated on chemical contradictions within the route. The audit records a defect code for every fatal step, and a route can contain several fatal steps of different kinds, so the original codes overlap at the route level. We therefore grouped the codes into four operational families and assigned each route to the first family it contains in a fixed order, from the most directly checkable evidence to the most interpretive: (A) skeletal carbons appear or vanish with no reagent to supply or remove them, (B) the drawn product has the wrong connectivity, regiochemistry or ring size, (C) the stated or implied reagent cannot effect the drawn change, and (D) no known mechanism links the drawn reactants to the drawn product. Of the 497 failed routes, 22.9% (95% CI 15.4–30.9%) were assigned to A, 34.8% (26.7–43.3%) to B, 9.5% (5.7–14.1%) to C and 32.8% (25.4–40.6%) to D. Eighty-one routes contain fatal steps from more than one family. Figure 5 places this distribution alongside three real audit cases, one each from families A, B and D. Such errors can be confined to one step or propagate to later steps, so that a structurally closed route can still fail chemically.

Chemical failure modes identified by the route-level adversarial audit

Figure 5. Chemical failure modes identified by the route-level adversarial audit. a, Operational grouping of the 497 audit-failed routes of GPT-5.6 Sol (standard) on Retro*-190. Each route is assigned the first family A–D that occurs among its fatal steps (filled bars); hatched extensions add routes that also contain that family but were assigned an earlier one. b, a Knoevenagel condensation should keep all 19 reactant carbons; the drawn product has no counterpart of carbon 2 and contains 18. c, an intramolecular oxa-Michael addition should join alcohol oxygen 3 to β\beta-carbon 1 and close a seven-membered ring; the drawn product joins it to α\alpha-carbon 2 and turns carbon 1 into a methyl group, giving a six-membered ring. d, a one-step construction of a δ\delta-carboline (pyrido[3 2-b]indole) from a phenylenediamine and a dibromopyridine ester forms new C–N and C–C bonds while the nitrogen count falls from five to four, with no nitrogen-containing leaving group.

Preference steering, chemo-enzymatic planning

Changing the route weights can change which synthesis is shown to a chemist without generating a new candidate. For target 100 on Retro*-190, increasing the weight on cost promoted a six-step route from eighth to first in the same audited pool. Its cost sub-score was 0.035 higher than that of the eight-step default route, but its feasibility sub-score was 0.029 lower. The six-step candidate uses a different Suzuki coupling partner and avoids borylating the aryl bromide (Extended Data Figure 2).

Extended Data Figure 2 showing route selection, chemo-enzymatic planning and chemist-guided route revision

Extended Data Figure 2. Route selection, chemo-enzymatic planning and chemist-guided route revision. a, Shared intermediates align vertically; shaded intermediates are unique to the default route. One amide-forming step per route is omitted. Under cost-priority weights the six- and eight-step routes scored 0.6974 and 0.6967. b, The literature row follows Sankaranarayanan and Jensen [31], Fig. 4D (ref. 31). The mixed-arm route recovers the PAC intermediate but gives a different final stereoisomer from the reference. The top organic-only route instead reduces an amino ketone. Template retrieval is not experimental validation. c, Initial proposal and executed C2 route from Figure 4b. Only the lower row reports yields from this study; 51% covers the last three operations.

Adding enzyme-template retrieval allowed the coordinator to retain a RetroBioCat carboligation rule[38] in a saved route via phenylacetylcarbinol (PAC). This candidate followed the reaction sequence in Figure 4D of Sankaranarayanan and Jensen[31] but used a different carbon donor and encoded a different final stereoisomer. It ranked sixth of ten; the strict organic-only control did not recover the sequence (Extended Data Figure 2). In the prospective C2 study, chemists retained the proposed Suzuki coupling and O-glycosylation but changed the phenothiazine substrate, protected its nitrogen and used purchased dasatinib in the final assembly (Figure 4b and Extended Data Figure 2).

Harness-model co-design

In ReTRACE, the chemistry harness and the coordinating LLM are co-designed rather than treated as independent layers. The structured feedback generated by the harness operates across two complementary time scales. At test time, it guides the coordinator to diagnose weak steps, backtrack and iteratively refine submitted routes within a single search. At training time, the same verifiable records serve as high-signal supervision for updating the model’s weights, closing a harness–model co-design loop in which the environment not only scaffolds inference but also improves the coordinator deployed within it (Figure 1a). We therefore investigated how to internalize harness-derived signals into an open-weight coordinator, Qwen3.8-27B, operating inside the same harness. Because standard single-stage and online post-training baselines struggle with noisy trajectories and costly long-horizon rollouts, we developed a three-stage post-training curriculum (yielding ReTRACE-27B) and benchmarked it against baseline post-training methods. We trained all three stages on four NVIDIA A800 GPUs using bfloat16 LoRA updates with DeepSpeed ZeRO-3.

On the 40-target evaluation set, the Qwen3.8-27B base controller completed routes to purchasable stock for 35 targets, yet only 11 rank-1 routes passed the two-stage chemical audit. Stage 1 therefore trained the model to critique single-step precursor candidates. However, exploratory traces showed that flagging a flawed reaction in text did not prevent the planner from committing it to the final route. To supervise multi-step tool use and route revision, stage 2 trained on 167 GPT-6 Astra trajectories, combined with a turn-level loss mask that zeroed loss on risky or redundant intermediate moves while retaining them as conditioning context. The resulting stage 2 checkpoint raised Audit@1 to 17 of 40 targets, but route completion fell to 30 of 40 (Extended Data Table 1). Stage 3 restored completion without sacrificing selectivity via a single offline round of student self-refinement on 26 completed, high-quality trajectories filtered from 418 stage 2 rollouts. We used offline filtering because environment interaction dominates compute: collecting just the first 260 student rollouts required 29.79 h before auditing, whereas all gradient updates across the three stages took 7.31 allocated GPU-hours (Extended Data Table 2).

MetricBase modelStage 1Stage 2ReTRACE-27 Bteacher SFTOPSD
Route completion to stock (targets / 40)353830403738
Primary pass: Audit@1, passed (targets / 40)1181723149
Audit@1 pass rate (%) [95% bootstrap CI]27.5 [15.0–42.5]20.0 [7.5–32.5]42.5 [27.5–57.5]57.5 [42.5–72.5]35.0 [20.0–50.0]22.5 [10.0–35.0]
Audited routes (n) and mean rejected steps per audited route40 (1.65)40 (1.60)37 (1.19)40 (0.72)40 (1.43)40 (1.63)
Pooled rejected steps: chemically impossible / skeletal fabrication27 / 1423 / 1820 / 117 / 1227 / 2131 / 13
Mean tool-result error returns per target1.572.650.880.652.351.57
Explicit SMILES validation failures / total calls52 / 1,283102 / 1,13415 / 1,08020 / 96871 / 1,31850 / 1,232
Targets with ≥1 retry-exhausted empty turn013000
Mean exact repeated tool calls per target10.5310.2510.289.659.709.25
Elapsed time per target, median / mean (h)0.90 / 1.111.08 / 1.441.19 / 1.690.82 / 1.071.45 / 1.691.36 / 1.46

Extended Data Table 1. Route quality, chemical defect breakdown and controller behaviour across the 40 evaluation targets.

Pipeline stage or activityAdmitted dataset / workload scaleOptimizer stepsTrainer runtime (s)Allocated trainer GPU-hours
Stage 1 (chemical critique)819 responses (804 questions)2041,158.881.29
Stage 2 (teacher trajectories)167 trajectories (71 targets; 2,488,244 supervised tokens)424,803.715.34
Stage 3 (student self-refinement)26 trajectories (22 targets; 49,040 supervised tokens)7618.990.69
Three-stage curriculum totalHeterogeneous stages (not summed)2536,581.577.31
Direct teacher-SFT baseline167 trajectories (71 targets)424,787.475.32
OPSD (on-policy self-distillation, from base)128 targets; 8 steps × 16 targets × 1 fresh student rollout83,870.884.30

Extended Data Table 2. Training supervision scale, gradient-update compute and unbundled data-preparation workload.

ReTRACE-27B completed routes for all 40 targets and 23/40 (57.5%) passed Audit@1, compared with 11/40 for the base model and 14/40 for direct teacher SFT. The ReTRACE-27B trajectories averaged 0.65 tool-result errors per target, compared with 1.57 for the base model. Across the 40 audited routes, the audit flagged 7 chemically impossible steps and 12 fabricated skeletal changes for ReTRACE-27B, compared with 27 and 14, respectively, for the base model (Extended Data Table 1).

We compared online post-training with the curriculum using the same base model and the same 40 evaluation targets. OPSD completed routes to stock for 38 of 40 targets. Of the 40 rank-1 routes audited, nine passed Audit@1 and 31 failed.

To put this harness–model co-design loop into practice, we deployed ReTRACE-27B-latest behind an accessible web interface for organic chemists (Extended Data Figure 1). Through this interface, chemists can submit target molecules, inspect route scores and tool provenance, and steer planning interactively inside the chemistry harness. Planning trajectories and audit outcomes generated from real-world usage are periodically curated and fed back into the post-training pipeline described above, enabling continual learning and iterative updates of the deployed model version.

ReTRACE web interface for organic chemists

Extended Data Figure 1. ReTRACE web interface for organic chemists. The interface is shown with a completed ReTRACE-27B-latest plan. A chemist enters the target as SMILES or draws it in the embedded structure editor and sets the search effort before planning. The left panel ranks the 11 returned routes by route score, with their feasibility, cost and greenness components. The right panel shows the highest-ranked route as a forward scheme from a purchasable starting material to the target. Each step card gives the step feasibility, the single-step engines that support the step and the automated audit verdict with its rationale. The header reports the 40 planning iterations and 74 tool calls of the run, and the field at the bottom sends chemist feedback back to the planner for a continued search.

Discussion

ReTRACE demonstrates that reliable long-horizon retrosynthesis planning emerges from the co-design of a domain-specific chemistry harness and a language-model coordinator, rather than from scaling a standalone generative model. Our large-scale audit of ten single-step engines on USPTO-50K confirms that no single predictor dominates across reaction space, yet their top-10 union recovers 98.6% of reference precursors and steps supported by two or more engines pass chemical auditing in over 98% of cases. Tool-group ablations reinforce this division of labour: removing single-step predictors causes the steepest drop in route validity, whereas removing route scoring selectively degrades first-route ranking. By placing an LLM inside a deterministic harness equipped with heterogeneous predictors, external route memory and multi-criterion scoring, ReTRACE uses the model where it adds the most value (weighing conflicting chemical evidence, enforcing route-wide constraints and revising strategy) while offloading exact molecular operations to verifiable software. Crucially, the same harness signals operate across two timescales, guiding within-run backtracking at inference time and providing verifiable supervision for post-training an open-weight coordinator (ReTRACE-27B) across runs.

This architecture directly addresses two long-standing limitations of conventional computer-aided synthesis planning. Classical tree-search controllers such as Monte Carlo tree search and Retro* expand synthesis trees from local single-step probabilities and compress complex chemical trade-offs into scalar value estimates. As a result, they struggle to balance competing route-level constraints, such as functional-group compatibility, cost and greenness, and lack a mechanism for semantically diagnosing why a branch is weak or executing targeted strategic revisions. Equally important, the field's reliance on stock-termination solve rates has obscured a substantial gap between formal connectivity and chemical feasibility. Evaluating all controllers under our frozen two-stage Audit@k metric exposes this gap starkly: on the structurally complex FDA30 benchmark, Retro* achieves 86.7% run success but only 53.3% Audit@1. By contrast, ReTRACE's route-level semantic control enables the coordinator to diagnose weak sub-scores, moving from local step reordering to fundamentally new disconnection classes (Fig. 3b), and to retain diverse, audited alternatives in external memory. This design also scales directly with coordinator capability: paired with GPT-6.2 Astra standard, ReTRACE raises Audit@1 to 97.9% on Retro*-190, 99.3% on JMC2025 and 96.7% on FDA30, reaching 99.5% to 100.0% Audit@10 across all three benchmarks. Notably, increasing reasoning effort and search budgets from the standard to the thorough preset did not yield monotonic gains for GPT-5.6 Sol. This indicates that long-horizon synthesis planning is bottlenecked less by raw search depth or test-time compute than by the quality of intermediate diagnostic feedback.

The two prospective wet-lab syntheses clarify the practical role of ReTRACE in medicinal and synthetic chemistry. For both C1 and C2, the agent rapidly proposed workable convergent skeletons and core bond-forming logic that guided experimental design. However, translating these proposals into executable bench procedures still required expert intervention, to resolve protecting-group orthogonality (introducing a tert-butyl ester in C1 and a Boc-protected amine in C2), reorder sterically demanding couplings (moving the Suzuki cross-coupling to the first step in C1) and optimize reagents and reaction conditions. These demonstrations underscore that ReTRACE is best positioned as an auditable co-pilot rather than an autonomous replacement for synthetic chemists. Features such as natural-language preference steering, persisted route memory for human-in-the-loop continuation and the deployed web interface are designed specifically to support this collaborative workflow.

Several limitations point to concrete directions for improvement. First, step-level error analysis reveals an asymmetry in what language-level post-training can fix: ReTRACE-27B routes contained seven chemically impossible steps, compared with 27 for the base model, but fabricated skeletal changes remained common (12 versus 14). Eliminating subtle atom-conservation and connectivity hallucinations will likely require tighter deterministic guardrails inside the harness, such as automated atom-mapping and stoichiometric conservation checks before route admission. Second, although Audit@k showed high agreement with a synthetic chemist (96.6%, κ=0.93\kappa= 0.93), the automatic verdict relies on a single frozen LLM judge and the human review was targeted and non-blind over six targets; broader blind multi-chemist evaluations and cross-family judge verification remain important for benchmarking. Third, long-horizon agentic search incurs substantial wall-clock latency (typically ∼1\sim1 h per target for ReTRACE-27B), making environment rollouts the dominant bottleneck in post-training. Runtime profiling shows that the primary bottleneck shifts with coordinator deployment: whereas the unified single-step retrosynthesis tool accounts for roughly one-third of total wall-clock time under cloud API coordinators, 91.8% of wall-clock time for local ReTRACE-27B is spent with coordinator requests in flight (Appendix § 10).

Because the ReTRACE harness is modular, its capabilities can expand as specialist chemistry tools mature. Integrating forward reaction-condition, yield and selectivity predictors, alongside broader biocatalytic and chemo-enzymatic template libraries, will allow the coordinator to reason over experimental executability earlier in planning. Coupled with the deployed web interface, curated trajectories and chemist feedback from real-world use can feed back into the post-training pipeline to iteratively update ReTRACE-27B-latest, moving computer-aided synthesis planning from static single-pass predictors toward auditable, continually improving collaborators for synthetic chemistry.

Methods

Task formulation and system overview

We formulate multistep retrosynthetic planning as a tool-augmented sequential decision problem. Given the SMILES of a target molecule, a library of commercially purchasable starting materials and a set of single-step expansion tools, an LLM coordinator recursively selects disconnections until all leaves of the synthesis tree fall within the purchasable library. The search state is a triple consisting of the current synthesis tree, the external route memory and the remaining budget; each action is one tool call; and a planning task terminates in one of three cases: all leaves are purchasable, the budget is exhausted, or the route memory has accumulated the maximum number of structurally distinct candidate routes.

Figure 1a gives the overall architecture of ReTRACE. The chemistry tool layer is organized into four classes according to the type of evidence they provide to the LLM: molecular operations (RDKit-based structural validity checks and template application), single-step retrosynthesis (template-based and template-free engines), starting-material purchasability lookup and three-dimensional route scoring (feasibility, cost and greenness). The coordinator is an LLM that works in rounds. In each round it selects the molecule to disconnect and writes a chemical rationale, calls the selected tools, and then inspects the returned precursors and scores to decide whether to continue disconnecting, switch branches or backtrack. The route memory sits outside the loop; it stores constructed partial routes, previous disconnection decisions and abandoned branches, and is injected as prior context into the next round of reasoning, so that maintaining the search state does not depend on the model’s finite context window.

An LLM is a probabilistic language model, and its outputs carry no inherent structural reliability. Every interaction between the model and the tools, and between the model and the memory, therefore passes through deterministic guarantee gates, which are enforced by system code. The action gate rejects illegal operations and unparsable SMILES before a request reaches a tool. The result gate performs preliminary screening and fingerprint-based ensemble deduplication before candidate precursors are returned to the LLM, and the admission gate ensures that only fully scored routes can be written to route memory.

For every accepted or rejected disconnection, ReTRACE records (i) which tool class proposed the candidate precursors and what they were; (ii) the route-level evaluation feedback actually visible to the LLM when it made the decision; and (iii) the reason the LLM stated for accepting, modifying or abandoning the branch. These records ensure decision provenance and replayability. Figure 1b,c excerpts two decision instances from real search trajectories, adjudication of conflicting single-step suggestions and diagnosis and backtracking after an unfavourable score, which show these three kinds of records at single decision points.

Operation tools: molecular operations, single-step expansion and purchasability lookup

A basic difficulty in automated retrosynthesis is that no single single-step model covers the entire space of reaction types. Template-based methods are precise for common transformations within the training distribution but fail on novel scaffolds, whereas template-free neural methods generalize better but sometimes produce mechanistically problematic products. The tool layer of ReTRACE is therefore deliberately heterogeneous and complementary rather than built around a single best engine. This complementarity assumption is tested quantitatively on the 50,000 reactions of USPTO-50K (Figure 2).

The operation tools fall into three groups, organized by the type of evidence they provide to the LLM.

Deterministic molecular operations. A set of RDKit-based deterministic tools performs SMILES canonicalization, structural validity checks, disconnection analysis and template application.[33] These tools provide structure-level chemical guardrails, so that the validity of SMILES does not depend on the internal representations of the language model.

Single-step expansion engines. Single-step expansion is offered through a unified single-step retrosynthesis tool that queries five heterogeneous engines in parallel: GraphFP, a fingerprint-based graph neural model trained on USPTO-Full; RXNGraphormer, a sequence/graph model trained on USPTO-Full; ChemBART, a pretrained Transformer (BART architecture) pretrained with a reaction-level mask-infilling objective on USPTO-Full and USPTO-MIT; a template-relevance model based on the Reaxys template library; and the ring-opening template specialist Ringbreaker. Each ensemble engine emits up to 50 candidate precursors. After cross-engine canonicalization, de-duplication and diversity filtering, about 15 diverse candidates are returned to the LLM, each annotated with a cross-engine agreement (support) field. The LLM is instructed to query this single-step retrosynthesis tool for every non-leaf molecule rather than selecting a disconnection from its chemical intuition alone. Runtime usage statistics for this unified interface, together with serving-layer optimizations are detailed in Appendix § 10.

Purchasability lookup. Route termination is determined by two canonicalized stock libraries consistent with ChemEnzyRetroPlanner: BioNav (103,530 canonicalized molecules) and ZINC (10,320,667 canonicalized molecules).

The LLM can combine these tools through programmatic tool calling in the harness. Unlike conventional tool calling in agents, the LLM can compose multiple tools more flexibly in code, for example calling several single-step retrosynthesis tools at once and keeping only the purchasable part of their results. Intermediate tool states (here, the full result returned by each single-step tool) then do not need to enter the LLM context window, which saves tokens and shortens response time.

Scoring tools: multi-criterion route evaluation and closed-loop feedback

A single feasibility score cannot distinguish a route that is chemically feasible but long and dependent on regulated reagents from a route that is short and uses only green reagents, and scoring after the fact cannot influence the search itself. The route evaluator of ReTRACE is therefore multi-criterion and runs inside the search loop: it is used both to evaluate routes and to guide search.

The route evaluator outputs a weighted total score composed of three dimensions: feasibility, cost and greenness. Users can adjust the three weights to suit different project goals; all main experiments in this work use the default 0.70/0.15/0.15, which prioritizes feasibility while giving equal weight to cost and greenness. The weights change only candidate comparison during search and the final ranking. They do not change the independent audit’s pass/fail verdict on a route.

Feasibility is scored for each step by a pretrained discriminative reaction classifier.[18] Feasibility is not a simple average of the step scores: the mean is shifted towards the worst step of the route to penalize routes containing an individual severe defect. It is complemented by a penalty for fabricated carbon skeletons (applied when the product contains more carbons than the reactants combined) and by flags for stereochemical anomalies. In practice we found that the pretrained reaction classifier can assign very low scores to steps that lie outside its training distribution but are chemically sound (for example, near-zero feasibility for a textbook Boc deprotection or for displacement of a primary sulfonate by a secondary amine). The system therefore includes an LLM review safety net that is triggered only when the feasibility score of a step or a whole route falls below a threshold, can only raise sub-threshold scores and is bounded by a cap (threshold and cap values in Appendix B). The review keeps the original score by default and outputs a corrected score only when it judges the classifier to have produced a clear false negative. In a paired three-arm ablation, score changes were confined to steps with classifier confidence below the trigger threshold and affected 23.1% of all steps on JMC2025 and 10.7% on an FDA set. Among rank-1 routes, audit reportability was similar with and without a review-lifted step (70.3% versus 74.5%; Fisher two-sided PP = 0.687); this selected-route check does not establish that every upward correction recovers a genuine false negative.

Cost combines three signals: a step-efficiency term defined to decrease monotonically with the number of synthetic steps; leaf purchasability and price signals; and the reduction in synthetic complexity along the route, measured as the drop in SCScore of Coley et al.[20] from product to precursors.

Greenness combines three terms: atom economy (Trost[34]), solvent classification based on the CHEM21 solvent selection guide[35] and a SMARTS scan for hazardous reagents.

Closed-loop feedback. Candidate ranking during search and final route scoring share the same weights; the former is used when choosing disconnections and the latter when evaluating routes. As a direct consequence of this loop, the evaluator becomes search feedback rather than a post hoc score: the LLM backtracks in a targeted way from the lowest-scoring dimension, rather than resampling blindly, and adjusts its planning strategy in real time from the scorer’s feedback.

LLM coordinator, route memory and context compaction

The context window of a language model is finite, and the model keeps no persistent state between calls; a multistep search spanning dozens of rounds of tool interaction cannot keep the synthesis tree, the record of failed branches and the ranking of candidate routes in the model’s internal representation. ReTRACE therefore externalizes the entire search state as an explicit route memory and runs an agent loop on top of it.

Route memory. The route memory offers the LLM three operations: submitting a candidate route (de-duplicated by route fingerprint, which rejects trivial variants of saved routes), retrieving saved candidates by total score, and recording the reason and lowest sub-score of a branch before it is abandoned. Every saved record carries the route label, total score, reaction steps, dimension sub-scores, starting materials and free-text notes; the system also records an internal provenance tag for each route that is not visible to the LLM and is used only for post hoc analysis. The route memory keeps evaluated branches and exposes them to the LLM in later decisions.

Termination and budget. Search terminates when every leaf of the current tree is purchasable, when the single-step expansion query budget is exhausted, or when the number of saved, structurally distinct routes reaches the preset capacity. The maximum search depth is 12. Only queries to the single-step retrosynthesis tool consume budget. The main results use the heterogeneous presets frozen in the run-level configurations: GPT-5.6 Sol fast, standard and thorough use medium/high/xhigh reasoning efforts, 50/100/200 queries, route capacities of 10/10/20 and wall-clock limits of 4/6/10 h. Each model keeps the same preset on Retro*-190, JMC2025 and FDA30.

Context compaction and trajectory logging. Because the finite context window of an LLM cannot hold tasks that may run for hours, we introduced a context-compaction mechanism. Compaction trims only the LLM’s active context, namely the operating instructions, the target molecule and a snapshot of the route memory, to free the window for new exploration. The complete search trajectory, including raw tool outputs, evaluator feedback and backtracking rationales, is persisted to disk together with timestamped markers of compaction events. Compaction deletes no audit evidence: it moves large amounts of information that may no longer be relevant out of the LLM context window and replaces it with links to the corresponding disk locations, which the LLM can retrieve at any time through a memory tool.

Benchmarks, baselines and two-stage audit protocol

A failure mode specific to LLM agents is the generation of routes that look plausible and conserve atoms yet are mechanistically impossible, errors that conventional top-k exact matching cannot capture. The evaluation protocol must therefore be independent of the system’s internal evaluator. We first describe this structural separation and then the benchmark construction, the comparison systems and the two-stage audit.

Benchmark datasets. We use three complementary benchmarks. Retro*-190 (n=190n = 190) is a set of difficult target molecules selected from the Retro* test set and serves as the standard benchmark. JMC2025 (n=141n = 141) is drawn from medicinal-chemistry literature published in the Journal of Medicinal Chemistry in 2025. FDA30 (n=30n = 30) consists of small-molecule drugs approved by the FDA between 2020 and 2024.

Baselines. External comparisons include classical Retro* search, ReTRACE coordinated by the open-weight LLM Qwen3.6-35B-A3B, and direct generation by Codex, one of the strongest general-purpose agents. All comparisons use the same target sets, frozen stock-termination criterion, route canonicalization and two-stage audit, but keep their native controllers and budgets: Retro* returns at most one official search route per target; Codex performs one isolated call per target with a 90 min wall-clock limit.

Two-stage audit protocol. Route-level evaluation uses a two-stage audit applied with the same model and the same prompt templates to all backbones, baselines and datasets.

The audit first applies deterministic RDKit gating: products and precursors are parsed and canonicalized step by step, the check verifies that the target is produced by some step of the route, and changes in skeletal carbon count and ring size are recorded. Routes that cannot be parsed or do not produce the target are recorded as audit failures directly. Carbon-count or ring changes are passed to the subsequent review as structured hints. The remaining routes are read step by step, in independent calls, by a fixed single LLM judge (Claude Opus 5, temperature = 0.2, max_tokens = 32,000), which judges each step as passed or failed and gives a defect rationale. A route with any failed step provisionally fails, and all other routes pass. Only provisionally failed routes trigger a second, adversarial defence: in a fresh context and with the opposite objective, the same judge reads the route together with its failed steps and their rationales, and argues as strongly as possible whether these steps could be realized by real chemistry. It does not read the rest of the first-stage output. If the defence fails, the route fails the audit. If it succeeds, the route passes.

Our main metric, Audit@k, is defined as follows. For a target molecule, candidate routes are sorted from high to low by evaluator score; the target passes at depth kk if at least one of the top kk routes passes the two-stage audit. If none of the top kk routes passes, the target is recorded as a failure. The denominator is always the full number of targets in the dataset, and targets whose runs failed or returned no route also count as failures. Sampling uncertainty is estimated on the per-target binary success vector of the full dataset by percentile bootstrap resampling, giving 95% confidence intervals (B = 10,000; seed = 42). The complete interval matrix is given in Appendix C.

Chemist review. To test the agreement of the automatic audit with human chemical judgement, a researcher with a background in synthetic chemistry reviewed 59 candidate routes from the first six Retro*-190 targets, including all 24 rank-1 routes under four coordinator conditions and selected lower-ranked candidates, and judged 274 reaction steps. The reviewer could see the automatic verdict and rationale, so the review was targeted and non-blind. The primary analysis uses the same binary audit-pass/audit-fail endpoint as Audit@k and reports observed agreement and Cohen’s κ\kappa.

Wet-lab validation

Prospective design. To test experimental executability beyond the computational audit, we carried out prospective wet-lab validation on two target molecules, C1 and C2, that were not part of any benchmark set (n=2n = 2). These two were all the targets that entered experimental validation in this study; no other target was excluded after route generation because of prediction quality or experimental outcome. For each target, ReTRACE generated candidate routes before wet-lab work began.

Route review and experimental translation. Synthetic chemists then reviewed the candidate routes provided by ReTRACE for functional-group compatibility, protecting-group strategy, substrate availability, steric effects and reaction order, and translated them into executable procedures. They were allowed, on grounds of chemical rationale and practical operation, to substitute substrates with appropriate protecting groups or better availability, to change the reaction order and to optimize reagents and operating conditions; every change was recorded, with its chemical rationale, relative to the frozen route record. The validation therefore tests whether the core retrosynthetic framework and key bond-forming logic proposed by ReTRACE can lead to the target product after necessary chemist adaptation, not whether the experiment follows the model’s suggestion verbatim.

Execution, characterization and evaluation. Syntheses were carried out step by step according to the reviewed procedures; reaction progress was monitored by thin-layer chromatography, products were isolated by conventional work-up and silica-gel column chromatography, and the isolated yield of each step was recorded. Key intermediates were characterized by 1H NMR, and the structures of the final products C1 and C2 were confirmed by 1H NMR, 13C NMR and high-resolution mass spectrometry (HRMS). The evaluation record includes whether the target product was isolated and structurally confirmed, the extent to which the key disconnection and bond-forming logic proposed by the model was retained in the experimental route, the types of chemist revision and the yield of each step. Experimental validation was recorded as successful only when the target product was isolated and its structure was confirmed by these analyses. Complete experimental procedures, compound characterization data and spectra are given in Appendix D.

Post-training on harness signals

Dataset partitioning and checkpoint lineage. Qwen3.8-27B served as the base controller. The Retro*-190 benchmark was partitioned by canonical target SMILES into 130 training, 20 development and 40 evaluation targets. Stage-2 teacher collection and stage-3 student collection used the 130-target training split. Stage 1 used a separate pool of single-step precursor-selection questions developed from USPTO-50K.

Stage 1: Reference-guided chemical critique. Each stage-1 prompt specified a target product and candidate precursor sets. The model was trained to retain or reject candidates and explain defects such as unsupported skeletal changes, incompatible functional-group transformations and connectivity errors. To generate supervision in the student’s native format, the base model produced reasoning while consulting a reference explanation that was omitted from the training prompt seen by the student. Candidate responses were screened against reliance on the hidden reference, checked for label consistency and tested for the parseability of newly introduced SMILES strings. A separate chemical review admitted responses graded as pass or minor issue, retaining at most two responses per question. The final dataset comprised 819 responses across 804 questions (788 from reference-conditioned self-distillation[32] and 31 from rejection sampling).

Stage 2: Route admission and turn-level loss masking. GPT-6 Astra generated three planning trajectories per training target (390 runs) under the planning harness. Deduplicating the 389 runs that produced a final route yielded 286 unique target–route pairs for the two-stage chemical audit. Only trajectories passing the audit were admitted, yielding 167 trajectories over 71 targets.

To separate final route validity from intermediate decision quality, an offline selector using GPT-6 Astra evaluated each assistant turn twice using the recorded interaction and final route outcome. A turn was supervised only if its mean overall value across the two evaluations was at least 7 of 10 and neither evaluation assigned a risk score at or above the veto threshold of 3. The loss mask applied effective supervision only to the visible text, tool calls and end-of-message token of selected assistant turns. System and user messages, tool responses, reasoning prefixes and excluded assistant turns received zero direct loss while remaining in the sequence as conditioning context. Hidden teacher reasoning was not supervised. In the pre-conversion audit, 5,537 of 6,513 assistant turns (2,482,593 of 2,902,114 assistant tokens; 85.5%) were retained, corresponding to 2,488,244 supervised tokens in the final serialized training format.

Stage 3: Offline student self-refinement. The stage-2 model generated 418 trajectories on the training split. Admission required completion to purchasable stock, clean infrastructure execution, turn-level action screening and a route audit. The resulting 26 trajectories across 22 targets (1,094,003 context tokens and 49,040 supervised tokens) were used to train the stage-3 adapter from the stage-2 checkpoint with a fresh optimizer. Training optimized supervised likelihood on selected visible assistant actions and tool calls, with zero direct loss on reasoning tokens.

Online comparison: OPSD. OPSD started from the Qwen3.8-27B base with a fresh LoRA adapter of the same configuration as the curriculum stages; the comparison uses the same evaluation protocol and frozen audit. OPSD used the 128 of 130 stage-2 training targets with at least one route passing the audit. At each of eight optimizer steps, the current student generated one fresh trajectory for each of 16 targets in the native harness (temperature 0.7). A frozen copy of the base model, given the same context plus a privileged block containing the audited route and its per-step audit reasons, served as teacher. Training minimized a generalized Jensen–Shannon divergence (β=0.5\beta=0.5, temperature 1.0, top-64 teacher logits) on visible assistant tokens and tool calls, excluding reasoning tokens, using the Megatron-SWIFT GKD trainer (4-way tensor and sequence parallelism, AdamW, constant learning rate 2×10−52 \times10^{-5}, global batch 16).

Optimization and resource accounting. All stages used LoRA[36] (rank 8, α=16\alpha=16, dropout 0.05) on attention, linear-attention and MLP projections in bf16 with ms-swift[37] and DeepSpeed ZeRO-3 across four A800 GPUs (constant learning rate 2×10−52 \times10^{-5}, no warm-up, one epoch, global batch size 4, seed 42; maximum sequence length 16,384 for stage 1 and 131,072 with 4-way sequence parallelism for stages 2 and 3). Stages 1, 2 and 3 completed 204, 42 and 7 optimizer steps, respectively. A direct teacher-SFT baseline was trained from the base model on the same 167 stage-2 trajectories (42 steps). Trainer runtimes from terminal logs were multiplied by four GPUs to compute allocated GPU-hours (Extended Data Table 2).

Evaluation and diagnostic metrics. Evaluations on the 40 targets used temperature 0.7, a generation cap of 32,768 tokens per request, a 131,072-token context window, a 40-round limit and a 14,400-s wall-clock budget per target. Route completion required a saved route reaching purchasable stock, whereas Audit@1 required the top-ranked route to pass our audit pipeline. Behavioural metrics counted tool results with a non-empty error field, invalid inputs to explicit SMILES validation calls, exact repetitions of a tool name and serialized arguments within a target, and turns yielding neither visible text nor tool calls after exhausting internal retries. Paired binary outcomes were compared via exact two-sided McNemar tests, with single-arm 95% confidence intervals computed via target-level percentile bootstrap (10,000 replicates, seed 42) or exact Clopper–Pearson bounds at 40/40 completion.

Web deployment and continual-learning updates. To support interactive use by organic chemists, the latest checkpoint (ReTRACE-27B-latest) is deployed behind a web interface connected to the ReTRACE chemistry harness (Extended Data Figure 1). Through this interface, chemists can submit target molecules, inspect route scores and tool provenance, and steer planning interactively inside the harness. Planning trajectories and audit outcomes generated from real-world usage are periodically curated and fed back into the post-training pipeline described above to produce iterative updates of the deployed model version.

Data and model availability

The post-training data are publicly available on Hugging Face at https://huggingface.co/datasets/jxtse/ReTRACE-train-data for non-commercial research use. The trained ReTRACE-27B adapter evaluated in this study is publicly available on Hugging Face at https://huggingface.co/jxtse/ReTRACE-27B-latest under the Apache-2.0 licence.

Code availability

The ReTRACE agent and post-training code are publicly available at https://github.com/jxtse/retrace under the MIT licence. Running the agent requires an OpenAI-compatible model endpoint and an external single-step retrosynthesis service.

Extended Data

Appendix

Preference steering, human feedback and enzymatic tools

These three case studies probe interfaces beyond the core benchmark. They are case-based and are not estimates of average improvement across targets.

Preference steering. Under the default and cost-priority weightings, both top routes for target 100 passed the audit. With weights of 0.70/0.15/0.15 on feasibility/cost/greenness, the eight-step route ranked first. With weights of 0.50/0.40/0.10, the original rank-8 route scored 0.6974 versus 0.6967 for the original rank-1 route. This example had the largest increase in the cost sub-score among eligible switches between routes with VALID verdicts. The six-step record combines olefination and ring closure in one entry and uses a boronic-acid coupling partner in place of a separate borylation on the main scaffold. The changes in cost, greenness and feasibility sub-scores were +0.035, +0.010 and −0.029, respectively (Extended Data Figure 2). These scores are evaluator outputs, not measured process costs or environmental impacts.

Chemist feedback on C2. Chemists identified routes 6 and 7 as closest to the adopted sequence. The proposal shown in Figure 4b starts with 2-bromophenothiazine (24): Suzuki coupling with 25 gives phenol 26, O-glycosylation with donor 27 gives 28, and attachment of dasatinib (29) followed by deacetylation gives C2 via 30. The written review flagged competing reaction of the free phenothiazine N–H, preferred the more readily sourced chloro substrate, and recommended buying dasatinib rather than rebuilding it. In the executed route, N-Boc-2-chlorophenothiazine (31) and 25 gave 32 (83%); glycosyl bromide 33 replaced donor 27, giving 34 (71%). Boc removal yielded the common intermediate 28 (96%). Activation, coupling to purchased 29 and deacetylation then gave C2 in 51% yield over those three operations. The collaboration retained the written feedback and experimental route, but not the feedback-conditioned model transcript.

Chemo-enzymatic extension. In the ephedrine benchmark (ref. 31, Figure 4D), the literature sequence joins a pyruvate-derived carbon unit to benzaldehyde to give (R)-PAC, followed by amination to (−)-ephedrine. The mixed-arm record instead lists acetaldehyde and benzaldehyde, with RetroBioCat TDL Carboligation (Ar Acceptor) retrieved at rank 1. The chemical step uses methylamine. The archive encodes (1R,2R)-pseudoephedrine rather than (1R,2S)-(−)-ephedrine: only the sequence of transformations matches, not the complete precursor set or stereochemical endpoint. All three stored starting materials were in stock. The candidate ranked 6/10 (0.73). With the same coordinator and a limit of 18 retro-search calls, the strict organic-only arm returned 70/70 organic template suggestions and saved ten routes. Its three highest-ranked routes used ketone reduction, epoxide opening and direct reductive amination, respectively; none of its saved routes contained the reference sequence. No yield or enzyme activity was measured. Other cases were mixed: rasagiline retained a sourced imine-formation/reduction route but not the literature transaminase–N-propargylation order; for a fluoropyridinyl tryptoline a sourced Pictet–Spengler step was retrieved without the halogenase–Suzuki–cyclization strategy; and for o-chloromandelic acid the aldehyde–cyanohydrin–acid topology and a RetroBioCat hydrocyanation source were recovered, but the chemical hydrolysis of the reference route was treated as enzymatic nitrile hydrolysis.

LLM review safety net: trigger and caps

  • Trigger. Review is invoked only when the feasibility score of a step, or the aggregated feasibility of a route, is below 0.4. Scores at or above 0.4 are never reviewed.

  • Uphold by default. The review first decides whether the low classifier score is justified. If it is, the original score is kept unchanged; a corrected score is emitted only for a clear false negative.

  • Caps. A corrected score is capped at 0.85 for a step and at 0.7 for a route, and the final score is the maximum of the original and the capped corrected score, so review can only raise a score and cannot lift a step to a perfect score.

  • Fail-closed. If the review output cannot be parsed, times out or the service is unavailable, the original classifier score is kept.

Audit@ confidence intervals

Controller / baselinek=1k=1k=3k=3k=5k=5k=10k=10
Retro*-190 (N = 190)
GPT-6.2 Astra standard97.9 [95.8, 99.5]99.5 [98.4, 100.0]99.5 [98.4, 100.0]99.5 [98.4, 100.0]
Claude Opus 4.870.0 [63.2, 76.3]78.4 [72.1, 84.2]83.7 [78.4, 88.9]87.4 [82.6, 91.6]
GPT-5.6 Sol fast64.2 [57.4, 71.1]76.8 [70.5, 82.6]78.4 [72.6, 84.2]80.0 [74.2, 85.8]
GPT-5.6 Sol standard65.8 [58.9, 72.6]75.3 [68.9, 81.1]79.5 [73.7, 85.3]82.6 [76.8, 87.9]
GPT-5.6 Sol thorough63.7 [56.8, 70.5]72.6 [66.3, 78.9]79.5 [73.7, 85.3]82.1 [76.3, 87.4]
Qwen3.6-35B-A3B23.7 [17.9, 30.0]33.2 [26.3, 40.0]33.7 [26.8, 40.5]34.7 [27.9, 41.6]
Retro*73.7 [67.4, 80.0]73.7 [67.4, 80.0]73.7 [67.4, 80.0]73.7 [67.4, 80.0]
Codex32.1 [25.8, 38.9]32.1 [25.8, 38.9]32.1 [25.8, 38.9]32.1 [25.8, 38.9]
w/o single-step prediction142.3 [35.4, 49.2]57.7 [50.3, 64.6]68.8 [61.9, 75.7]77.8 [72.0, 83.6]
w/o route scoring52.1 [45.3, 59.5]76.3 [70.0, 82.1]81.6 [75.8, 86.8]86.8 [81.6, 91.6]
w/o molecular-perception tools60.5 [53.7, 67.4]73.2 [66.3, 78.9]76.8 [70.5, 82.6]84.2 [78.9, 88.9]
JMC2025 (N = 141)
GPT-6.2 Astra standard99.3 [97.9, 100.0]100.0 [100.0, 100.0]100.0 [100.0, 100.0]100.0 [100.0, 100.0]
Claude Opus 4.882.3 [75.9, 87.9]87.9 [82.3, 92.9]90.1 [85.1, 95.0]95.0 [91.5, 98.6]
GPT-5.6 Sol fast75.2 [68.1, 82.3]85.8 [80.1, 91.5]88.7 [83.0, 93.6]89.4 [84.4, 94.3]
GPT-5.6 Sol standard75.9 [68.8, 83.0]85.8 [80.1, 91.5]88.7 [83.0, 93.6]92.2 [87.2, 96.5]
GPT-5.6 Sol thorough75.2 [68.1, 82.3]85.1 [78.7, 90.8]85.8 [80.1, 91.5]88.7 [83.0, 93.6]
Qwen3.6-35B-A3B24.8 [17.7, 31.9]39.7 [31.9, 48.2]42.6 [34.8, 50.4]43.3 [35.5, 51.8]
Retro*80.9 [74.5, 87.2]80.9 [74.5, 87.2]80.9 [74.5, 87.2]80.9 [74.5, 87.2]
Codex40.4 [32.6, 48.2]40.4 [32.6, 48.2]40.4 [32.6, 48.2]40.4 [32.6, 48.2]
FDA30 (N = 30)
GPT-6.2 Astra standard96.7 [90.0, 100.0]100.0 [100.0, 100.0]100.0 [100.0, 100.0]100.0 [100.0, 100.0]
Claude Opus 4.870.0 [53.3, 86.7]80.0 [63.3, 93.3]83.3 [70.0, 96.7]86.7 [73.3, 96.7]
GPT-5.6 Sol fast70.0 [53.3, 86.7]80.0 [63.3, 93.3]83.3 [70.0, 96.7]86.7 [73.3, 96.7]
GPT-5.6 Sol standard76.7 [60.0, 90.0]83.3 [70.0, 96.7]86.7 [73.3, 96.7]90.0 [76.7, 100.0]
GPT-5.6 Sol thorough66.7 [50.0, 83.3]76.7 [60.0, 90.0]76.7 [60.0, 90.0]83.3 [70.0, 96.7]
Qwen3.6-35B-A3B30.0 [13.3, 46.7]53.3 [33.3, 70.0]60.0 [43.3, 76.7]63.3 [46.7, 80.0]
Retro*53.3 [36.7, 70.0]53.3 [36.7, 70.0]53.3 [36.7, 70.0]53.3 [36.7, 70.0]
Codex30.0 [13.3, 46.7]30.0 [13.3, 46.7]30.0 [13.3, 46.7]30.0 [13.3, 46.7]

Table A1. Table A1. Audit@kk (%) with 95% confidence intervals for all controllers, baselines and Retro*-190 ablations in Table 1. Intervals are percentile bootstrap over targets (B = 10,000; seed = 42). Retro* and Codex return at most one route, so their values are constant in kk.

Wet-lab procedures, characterization data and spectra

The initial ReTRACE routes and the chemist-modified experimental routes are shown in Figure 4; compound numbers below follow that figure. Each step of the experimental route is given with its procedure and characterization data. Yields are isolated yields unless stated as crude. Spectra are shown in Figures A1 and A2.

Compound C1

Reaction scheme from compounds 17 and 18 to compound 19

Figure 6.

To a side-arm ground-glass Schlenk flask, compound 17 (1.89 g, 7.62 mmol), compound 18 (2.20 g, 5.08 mmol), Pd(dppf)Cl2_2 (0.18 g, 0.25 mmol), and Cs2_2CO3_3 (3.31 g, 10.15 mmol) were added sequentially. 1,4-Dioxane (Diox, 15 mL) was added as the reaction solvent. The reaction system was evacuated and backfilled with nitrogen three times via a Schlenk manifold, and the mixture was then stirred at 90 °C for 16 h. Upon completion of the reaction, the mixture was filtered through a Celite pad. The filtrate was concentrated under reduced pressure, and the crude product was purified by silica gel column chromatography to afford compound 19 as a pale yellow solid (1.01 g, 52% yield). 1^{1}H NMR (500 MHz, Chloroform-d) δ 10.03 (s, 1H), 8.25 – 8.19 (m, 2H), 7.88 – 7.77 (m, 4H), 7.62 (dd, J = 8.4, 2.3 Hz, 1H), 7.35 (d, J = 8.4 Hz, 1H), 7.16 – 7.10 (m, 1H), 7.06 – 7.01 (m, 2H), 6.51 (d, J = 16.0 Hz, 1H), 3.94 (s, 3H), 1.50 (s, 9H).

Reaction scheme from compound 19 and compound 20 to compound 21

Figure 7.

Compound 19 (0.96 g, 2.02 mmol) was dissolved in acetonitrile (ACN, 12 mL), and K2_2CO3_3 (0.56 g, 4.05 mmol) was added. After stirring for 30 min, 3-bromopropyne (compound 20, 0.23 mL, 3.03 mmol) was added dropwise. The reaction mixture was heated to 82 °C and stirred under a nitrogen atmosphere for 6 h. After completion of the reaction was confirmed by thin-layer chromatography (TLC) monitoring, the mixture was filtered through a Celite pad. The filtrate was concentrated under reduced pressure, and the crude product was purified by silica gel column chromatography to afford compound 21 as a pale yellow solid (0.59 g, 57% yield). 1^{1}H NMR (500 MHz, Chloroform-d) δ 10.56 (s, 1H), 8.24 – 8.20 (m, 2H), 8.13 (d, J = 2.5 Hz, 1H), 7.88 (d, J = 2.3 Hz, 1H), 7.85 – 7.78 (m, 2H), 7.64 (dd, J = 8.4, 2.3 Hz, 1H), 7.33 (d, J = 8.5 Hz, 1H), 7.25 (d, J = 8.7 Hz, 1H), 7.05 – 7.01 (m, 2H), 6.51 (d, J = 16.0 Hz, 1H), 4.92 (d, J = 2.4 Hz, 2H), 3.93 (s, 3H), 2.64 (t, J = 2.4 Hz, 1H), 1.50 (d, J = 10.3 Hz, 9H).

Reaction scheme from compound 21 and compound 3 to compound 22

Figure 8.

Compound 21 (0.59 g, 1.15 mmol) and compound 3 (0.24 g, 1.15 mmol) were dissolved in ACN (10 mL). After stirring until a homogeneous solution was formed, piperidine (0.17 mL, 1.73 mmol) was added dropwise slowly. The reaction mixture was then heated to 82 °C and stirred for 4 h under a nitrogen atmosphere. The reaction progress was monitored by TLC. Upon complete consumption of the starting materials, the mixture was concentrated under reduced pressure to remove the solvent. The resulting crude product was purified by silica gel column chromatography to afford compound 22 as an orange solid (0.52 g, 64% yield). 1H^{1}\mathrm{H} NMR (500 MHz, DMSO-d₆) δ 10.37 (s, 1H), 8.74 (dd, J = 8.4, 1.5 Hz, 1H), 8.12 (d, J = 2.3 Hz, 1H), 7.96 – 7.92 (m, 2H), 7.85 (d, J = 16.1 Hz, 1H), 7.81 (dd, J = 8.4, 1.3 Hz, 1H), 7.76 (dd, J = 8.7, 2.4 Hz, 1H), 7.64 – 7.61 (m, 2H), 7.35 – 7.30 (m, 1H), 7.25 (d, J = 8.7 Hz, 1H), 7.04 (s, 1H), 7.01 (d, J = 8.5 Hz, 1H), 6.99 – 6.95 (m, 1H), 6.71 (d, J = 16.1 Hz, 1H), 5.03 (d, J = 2.5 Hz, 2H), 3.67 (t, J = 2.3 Hz, 1H), 1.50 (s, 9H).

Chemical reaction scheme showing compound 22 converted to compound 23 using compound 10, TEA and DCM at 0°C for 73% yield

Figure 1 (PDF p. 33).

Compound 22 (0.50 g, 0.88 mmol) was dissolved in dichloromethane (DCM, 10 mL). The reaction system was cooled to 0 °C in an ice bath, and TEA (0.23 mL, 1.32 mmol) was added dropwise slowly. After stirring for 10 min, compound 10 (0.24 g, 1.06 mmol) was added dropwise to the mixture. The reaction progress was monitored by TLC. Upon completion, the reaction was quenched by the slow addition of dilute hydrochloric acid. The organic phase was separated, and the aqueous phase was extracted with DCM three times. The combined organic phases were washed sequentially with deionized water and saturated aqueous sodium chloride solution three times each. The organic phase was concentrated under reduced pressure to remove the solvent, and the crude product was purified by silica gel column chromatography to afford compound 23 as an orange solid (0.49 g, 73% yield). 1H^{1}\mathrm{H} NMR (500 MHz, Chloroform-d) δ 8.93 (dd, J = 8.4, 1.4 Hz, 1H), 8.05 – 7.86 (m, 6H), 7.76 (ddd, J = 8.5, 7.1, 1.4 Hz, 1H), 7.70 (dd, J = 4.7, 2.3 Hz, 2H), 7.66 – 7.56 (m, 4H), 7.55 – 7.42 (m, 7H), 7.17 (d, J = 8.6 Hz, 1H), 7.06 (d, J = 16.1 Hz, 1H), 6.91 (s, 1H), 6.40 (d, J = 16.1 Hz, 1H), 4.92 (d, J = 2.4 Hz, 2H), 2.64 (t, J = 2.4 Hz, 1H), 1.56 (s, 9H).

Chemical reaction scheme showing compound 23 converted to compound 11 using TFA and DCM at 0°C for 89% yield

Figure 2 (PDF p. 33).

Compound 23 (0.46 g, 0.60 mmol) was dissolved in DCM (8 mL) and cooled to 0 °C in an ice bath. TFA (2 mL) was added dropwise slowly with stirring. The reaction progress was monitored by TLC. Upon complete consumption of the starting material, the reaction mixture was concentrated under reduced pressure to remove volatile solvents, affording crude compound 11 as an orange solid (0.38 g, 89% yield).

Chemical reaction scheme showing compound 11 and compound 12 converted to compound 13 using HATU, DIPEA and DMF at 25°C for 69% yield

Figure 3 (PDF p. 33).

Compound 11 (0.35 g, 0.49 mmol) and doxorubicin (compound 12, 0.32 g, 0.59 mmol) were dissolved in N,N-dimethylformamide (DMF, 10 mL), and the reaction system was cooled in an ice bath. N,N-Diisopropylethylamine (DIPEA, 0.17 mL, 0.98 mmol) was added dropwise slowly with stirring. After stirring for 10 min, 2-(7-aza-1H-benzotriazol-1-yl)-1,1,3,3-tetramethyluronium hexafluorophosphate (HATU, 0.56 g, 1.47 mmol) was added slowly in portions. The reaction was allowed to proceed at 25 °C for another 20 min. After completion, the reaction was quenched by slow dropwise addition of deionized water. After full precipitation of the solid, the mixture was filtered under reduced pressure, and the filter cake was collected as the crude product. Purification by silica gel column chromatography afforded compound 13 as a dark red solid (0.42 g, 69% yield). 1H{}^{1}\mathrm{H} NMR (500 MHz, DMSO-d6_6) δ 14.00 (s, 1H), 13.23 (s, 1H), 8.66 (dd, J = 8.3, 1.4 Hz, 1H), 8.02 (d, J = 2.2 Hz, 1H), 7.91 – 7.84 (m, 5H), 7.84 – 7.76 (m, 6H), 7.73 – 7.69 (m, 1H), 7.66 – 7.58 (m, 3H), 7.57 – 7.49 (m, 8H), 7.39 – 7.33 (m, 1H), 7.25 (d, J = 8.8 Hz, 1H), 6.99 – 6.89 (m, 2H), 5.46 (s, 1H), 5.26 (s, 1H), 5.03 (d, J = 2.2 Hz, 2H), 4.97 – 4.85 (m, 3H), 4.62 (d, J = 6.2 Hz, 2H), 4.24 (d, J = 6.5 Hz, 1H), 4.18 (s, 1H), 3.91 (s, 3H), 3.68 (t, J = 2.3 Hz, 1H), 3.51 – 3.48 (m, 1H), 2.99 (d, J = 17.9 Hz, 1H), 2.90 (d, J = 12.3 Hz, 1H), 2.24 (d, J = 13.9 Hz, 1H), 2.10 (d, J = 10.0 Hz, 1H), 1.91 (d, J = 22.4 Hz, 1H), 1.58 (d, J = 8.2 Hz, 1H), 1.17 (d, J = 6.4 Hz, 3H).

Chemical reaction scheme from compounds 14 and 15 to compound 16

Figure 14–16.

Compound 14 (0.37 g, 0.79 mmol) and compound 15 (0.10 g, 1.02 mmol) were dissolved in DMF (10 mL), and the reaction system was cooled in an ice bath. DIPEA (0.41 mL, 2.36 mmol) was added dropwise slowly with stirring. After stirring for 10 min, HATU (0.60 g, 1.57 mmol) was added slowly in portions. The reaction was allowed to proceed at 25 °C for another 20 min. After completion, the reaction was quenched by slow dropwise addition of deionized water. After full precipitation of the solid, the mixture was filtered under reduced pressure, and the filter cake was collected as the crude product. Purification by silica gel column chromatography afforded compound 16 as a white solid (0.35 g, 81% yield). 1H{}^{1}\mathrm{H} NMR (500 MHz, DMSO-d6_6) δ 7.66 (t, J = 5.7 Hz, 1H), 5.49 (s, 1H), 4.31 (s, 1H), 3.94 (s, 1H), 3.62 (t, J = 6.6 Hz, 2H), 3.23 (dq, J = 12.7, 6.4 Hz, 1H), 3.19 – 3.13 (m, 1H), 3.02 (dd, J = 11.6, 4.5 Hz, 1H), 2.59 (dt, J = 13.3, 3.4 Hz, 1H), 2.31 (s, 1H), 2.08 (td, J = 13.6, 4.6 Hz, 1H), 2.04 – 2.01 (m, 1H), 1.92 – 1.85 (m, 3H), 1.81 (dt, J = 13.7, 3.6 Hz, 1H), 1.74 (dt, J = 13.7, 4.7 Hz, 1H), 1.66 – 1.59 (m, 2H), 1.52 (ddd, J = 11.7, 8.7, 5.4 Hz, 2H), 1.41 (dt, J = 12.6, 3.6 Hz, 1H), 1.38 – 1.36 (m, 1H), 1.35 (s, 3H), 1.32 (dd, J = 11.4, 3.5 Hz, 1H), 1.29 – 1.25 (m, 2H), 1.20 – 1.10 (m, 2H), 1.03 (s, 6H), 1.02 (s, 3H), 0.95 (dt, J = 13.6, 4.1 Hz, 2H), 0.91 (s, 3H), 0.73 (s, 3H), 0.69 (s, 3H).

Chemical reaction scheme from compounds 13 and 16 to compound C1

Figure 13–C1.

Compound 13 (0.40 g, 0.32 mmol) and compound 16 (0.21 g, 0.39 mmol) were dissolved in tetrahydrofuran (THF, 8 mL) and stirred until homogeneous for further use. Separately, copper sulfate (CuSO4_4, 0.05 g, 0.25 mmol) and sodium ascorbate (VcNa, 0.03 g, 0.19 mmol) were fully dissolved in deionized water (2 mL) to prepare an aqueous catalyst solution. The aqueous catalyst solution was added to the above reaction mixture in portions. After purging the system with nitrogen to displace air, the reaction was stirred at 25 °C under a nitrogen atmosphere for 3 h. Upon complete consumption of starting materials as monitored by TLC, the mixture was concentrated under reduced pressure to remove the organic solvent, and the precipitated crude solid was collected. The crude product was purified by silica gel column chromatography to afford compound C1 as a dark red solid (0.39 g, 67% yield). 1^{1}H NMR (500 MHz, DMSO-d6_6) δ\delta 14.02 (s, 1H), 13.24 (s, 1H), 8.66 (d, JJ = 8.3 Hz, 1H), 8.35 (s, 1H), 8.04 (s, 1H), 7.96–7.83 (m, 9H), 7.82–7.78 (m, 2H), 7.71–7.55 (m, 8H), 7.55–7.50 (m, 5H), 7.37 (dd, JJ = 16.9, 8.7 Hz, 2H), 6.94 (d, JJ = 15.7 Hz, 1H), 6.88 (s, 1H), 5.46 (s, 1H), 5.38 (d, JJ = 8.6 Hz, 3H), 5.27 (s, 1H), 4.96–4.86 (m, 3H), 4.62 (s, 2H), 4.40 (t, JJ = 7.0 Hz, 2H), 4.29 (s, 1H), 4.26–4.21 (m, 1H), 4.18 (dt, JJ = 10.9, 5.7 Hz, 1H), 3.93 (d, JJ = 10.0 Hz, 4H), 3.50 (s, 1H), 3.13 (q, JJ = 6.6 Hz, 2H), 2.97 (t, JJ = 20.0 Hz, 3H), 2.23 (s, 2H), 2.11 (d, JJ = 9.0 Hz, 1H), 2.03–1.96 (m, 4H), 1.94–1.83 (m, 2H), 1.76 (d, JJ = 13.0 Hz, 1H), 1.67–1.36 (m, 8H), 1.27 (s, 5H), 1.23 (d, JJ = 6.0 Hz, 3H), 1.17 (dd, JJ = 5.1, 3.2 Hz, 3H), 0.99 (s, 3H), 0.96 (s, 3H), 0.92 (s, 3H), 0.87 (s, 5H), 0.65 (d, JJ = 9.5 Hz, 6H). 13^{13}C NMR (126 MHz, DMSO-d6_6) δ\delta 214.30, 212.55, 199.44, 186.84, 186.55, 175.91, 170.02, 164.38, 162.80, 161.15, 158.65, 156.66, 155.00, 153.09, 152.26, 148.74, 145.78, 142.92, 142.31, 141.87, 139.86, 139.42, 139.08, 137.77, 136.73, 135.88, 134.94, 134.48, 133.43, 132.98, 132.52, 131.73, 131.35, 131.29, 130.38, 129.55, 129.46, 127.88, 127.33, 127.17, 126.63, 126.52, 126.41, 125.52, 125.42, 124.95, 124.42, 124.16, 123.29, 122.04, 121.20, 120.50, 120.28, 119.31, 118.68, 117.46, 116.24, 115.14, 111.17, 110.97, 107.13, 100.82, 77.06, 76.81, 75.45, 74.01, 68.65, 66.60, 64.23, 63.88, 61.58, 60.71, 56.90, 54.54, 48.11, 47.91, 45.14, 43.34, 43.23, 39.18, 38.97, 37.79, 37.03, 36.39, 36.26, 32.51, 31.75, 31.24, 30.72, 30.29, 29.49, 29.10, 28.79, 28.54, 27.37, 26.32, 25.41, 23.37, 18.67, 17.51, 16.53, 16.39. HRMS: m/z [M+2H]2+^{2+} calcd 897.8809, found 897.8825.

Compound C2

Reaction scheme for the synthesis of compound 32

Figure 1 (PDF p. 35).

Compound 31 (0.47 g, 1.41 mmol), compound 25 (0.29 g, 2.11 mmol), Pd(dppf)Cl2_2 (0.05 g, 0.07 mmol), and K3_3PO4_4 (0.60 g, 2.82 mmol) were sequentially charged into a side-arm ground-glass Schlenk flask. Diox (8 mL) and deionized water (2 mL) were added as the mixed reaction solvent. The system was evacuated and backfilled with nitrogen three times via a Schlenk manifold, and the reaction mixture was stirred at 90 °C for 16 h. Upon completion, the mixture was filtered through a Celite pad to remove insoluble residues. The filtrate was concentrated under reduced pressure, and the crude product was purified by silica gel column chromatography to afford compound 32 as a white solid (0.46 g, 83% yield). 1^{1}H NMR (500 MHz, Chloroform-d) δ\delta 7.74 (d, JJ = 1.9 Hz, 1H), 7.55 (dd, JJ = 8.1, 1.3 Hz, 1H), 7.44–7.37 (m, 4H), 7.35 (dd, JJ = 8.1, 1.9 Hz, 1H), 7.32–7.28 (m, 1H), 7.19 (td, JJ = 7.6, 1.3 Hz, 1H), 6.91–6.85 (m, 2H), 1.53 (s, 9H).

Reaction scheme for the synthesis of compound 34

Figure 2 (PDF p. 35).

Compound 32 (0.41 g, 1.05 mmol) was dissolved in acetonitrile (ACN, 10 mL). After stirring until complete dissolution, Cs2_2CO3_3 (0.68 g, 2.09 mmol) was added, and the mixture was stirred at 25 °C (room temperature) for 10 min. Compound 33 (0.43 g, 1.05 mmol) was then added to the reaction system, and the mixture was stirred at a constant temperature of 25 °C for 3 h. Upon complete consumption of the starting material as monitored by thin-layer chromatography (TLC), the reaction mixture was filtered through a Celite pad to remove insoluble inorganic salts. The filtrate was concentrated under reduced pressure to remove the solvent, and the crude product was purified by silica gel column chromatography to afford compound 34 as a white viscous syrup (0.54 g, 71% yield). {sup}1`H NMR (500 MHz, Chloroform-d) δ\delta 7.73 (d, J = 1.9 Hz, 1H), 7.54 (dd, J = 8.2, 1.3 Hz, 1H), 7.53 – 7.51 (m, 2H), 7.40 (dd, J = 8.1, 1.6 Hz, 1H), 7.37 (dt, J = 7.8, 1.6 Hz, 1H), 7.34 (ddd, J = 8.1, 2.0, 0.8 Hz, 1H), 7.29 (ddd, J = 8.1, 5.9, 1.4 Hz, 1H), 7.17 (tt, J = 7.5, 1.5 Hz, 1H), 7.10 – 7.07 (m, 2H), 5.54 (dd, J = 10.5, 7.9 Hz, 1H), 5.49 (dd, J = 3.5, 1.1 Hz, 1H), 5.16 (ddd, J = 10.3, 3.4, 1.0 Hz, 1H), 5.12 (dd, J = 8.0, 1.1 Hz, 1H), 4.27 (dd, J = 11.3, 6.9 Hz, 1H), 4.20 (dd, J = 11.4, 6.3 Hz, 1H), 4.12 (td, J = 6.7, 1.2 Hz, 1H), 2.21 (d, J = 1.2 Hz, 3H), 2.11 (s, 3H), 2.08 (d, J = 1.0 Hz, 3H), 2.04 (s, 3H), 1.52 (s, 9H).

Chemical structure of compound 34 converted to compound 28

Figure 9 (PDF p. 36).

Compound 34 (0.46 g, 0.64 mmol) was dissolved in DCM (8 mL) and cooled to 0 °C in an ice bath. TFA (2 mL) was added dropwise with stirring. The reaction progress was monitored by TLC. Upon complete consumption of the starting material, the mixture was concentrated under reduced pressure to remove volatile components, yielding crude compound 28 as a white syrup (0.38 g, 96% yield). {sup}1H NMR (500 MHz, DMSO-d{sub}6`) δ\delta 8.67 (s, 1H), 7.57 – 7.50 (m, 2H), 7.10 – 7.05 (m, 2H), 7.03 – 6.96 (m, 3H), 6.95 – 6.90 (m, 2H), 6.77 (td, J = 7.5, 1.3 Hz, 1H), 6.70 (dd, J = 8.0, 1.3 Hz, 1H), 5.52 (d, J = 7.8 Hz, 1H), 5.36 (dd, J = 3.4, 1.0 Hz, 1H), 5.31 (dd, J = 10.4, 3.5 Hz, 1H), 5.24 (dd, J = 10.3, 7.8 Hz, 1H), 4.49 – 4.43 (m, 1H), 4.15 – 4.09 (m, 2H), 2.17 (s, 3H), 2.05 (d, J = 14.2 Hz, 6H), 1.96 (s, 3H).

Three-step synthesis of compound C2

Figure 10 (PDF p. 36).

Compound 28 (0.31 g, 0.50 mmol) was dissolved in DCM (6 mL) and cooled to 0 °C in an ice bath. Pyridine (Py, 0.12 mL, 0.15 mmol) was added dropwise, and the mixture was stirred at this temperature for 10 min. Then, a solution of BTC (0.15 g, 0.50 mmol) in DCM (2 mL) was added slowly dropwise, and the reaction was maintained at 0 °C for 2 h. Subsequently, a solution of dasatinib (compound 29, 0.24 g, 0.50 mmol) in DCM (2 mL) was added dropwise to the mixture. After thorough mixing, N,N-diisopropylethylamine (DIPEA, 0.17 mL, 1.00 mmol) was added dropwise, and the reaction was stirred at 0 °C for another 2 h. Upon completion as monitored by TLC, 3 mL of 4 M sodium methoxide in methanol (NaOMe-MeOH) was added, and the mixture was stirred at 0 °C for 1 h to remove the acetyl protecting groups on the glycosyl moiety. After the reaction, an appropriate amount of cation exchange resin was added, and the mixture was stirred for 10 min until the solution became clear to neutralize excess base. The mixture was filtered through a Celite pad. The filtrate was concentrated under reduced pressure, and the crude product was purified by silica gel column chromatography to afford the target product C2 as a white solid (0.25 g, 51% yield). {sup}1H NMR (500 MHz, DMSO-d{sub}6) $\delta$ 10.20 (s, 1H), 8.73 (s, 1H), 7.58 (s, 1H), 7.52 – 7.38 (m, 6H), 7.31 (dt, J = 15.5, 7.4 Hz, 3H), 7.05 (d, J = 8.3 Hz, 2H), 6.16 (s, 1H), 5.20 (dd, J = 8.2, 5.2 Hz, 1H), 4.89 – 4.82 (m, 2H), 4.66 (dt, J = 20.7, 5.0 Hz, 1H), 4.53 (d, J = 4.7 Hz, 1H), 4.48 (t, J = 5.3 Hz, 1H), 3.74 (dt, J = 5.2, 1.9 Hz, 1H), 3.61 – 3.55 (m, 8H), 3.51 (t, J = 6.0 Hz, 1H), 3.43 (dt, J = 6.0, 2.2 Hz, 1H), 2.46 (t, J = 6.3 Hz, 2H), 2.36 – 2.21 (m, 6H). {sup}13C NMR (126 MHz, MeOD) δ\delta 176.35, 166.97, 163.45, 162.13, 157.69, 155.65, 154.86, 146.62, 145.27, 144.49, 143.34, 140.33, 138.80, 137.40, 136.83, 135.83, 135.08, 133.24, 132.64, 130.48, 128.88, 128.41, 127.63, 127.01, 125.64, 122.59, 121.97, 119.19, 118.19, 116.76, 101.33, 92.70, 75.50, 73.46, 70.86, 68.74, 60.90, 58.98, 56.47, 51.98, 42.11, 33.52, 24.31. HRMS: m/zm/z [M+H]+[\mathrm{M}+\mathrm{H}]^{+} calcd 967.2669, found 967.2656.

NMR and HRMS spectra of compound C1 and its intermediates

Figure A1. NMR and HRMS spectra of compound C1 and its intermediates. Compound numbers follow Figure 4, spectra are reproduced as recorded.

NMR spectrum of compound 22

(a) c, compound 22, 1H^{1}\mathrm{H} NMR (500 MHz, DMSO-d6d_6)

NMR spectrum of compound 23

(b) d, compound 23, 1H^{1}\mathrm{H} NMR (500 MHz, CDCl3_3)

Figure A1 (continued). NMR and HRMS spectra of compound C1 and its intermediates.

NMR spectra of compound 13 and compound 16; panel e, compound 13, {sup}1`H NMR (500 MHz, DMSO-d{sub}6`); panel f, compound 16, {sup}1`H NMR (500 MHz, DMSO-d{sub}6`)

Figure A1 (continued, PDF p. 40). NMR and HRMS spectra of compound C1 and its intermediates.

NMR and HRMS spectra of compound C1 and its intermediates, including panels g and h

Figure A1 (PDF p. 41). g, C1, 1H^{1}\mathrm{H} NMR (500 MHz, DMSO-d6d_6); h, C1, 13C^{13}\mathrm{C} NMR (126 MHz, DMSO-d6d_6). Continued. NMR and HRMS spectra of compound C1 and its intermediates.

NMR and HRMS spectrum of compound C1 and its intermediates

Figure A1 (continued, PDF p. 42). NMR and HRMS spectra of compound C1 and its intermediates.

NMR spectra of compounds 32 and 34

Figure A2. NMR and HRMS spectra of compound C2 and its intermediates. Compound numbers follow Figure 4, spectra are reproduced as recorded.

NMR spectra of compound 28 and C2

Figure A2 (continued). NMR and HRMS spectra of compound C2 and its intermediates.

C2 carbon-13 NMR spectrum

(a) e, C2, 13C^{13}\mathrm{C} NMR (126 MHz, CD3OD\mathrm{CD_3OD})

C2 high-resolution mass spectrum

(b) f, C2, HRMS

Figure A2 (continued, PDF p. 45). NMR and HRMS spectra of compound C2 and its intermediates.

Agent runtime profiling, unified single-step interface and serving infrastructure

This appendix documents end-to-end planning latency, runtime usage of the unified single-step retrosynthesis tool and serving-layer optimizations for heterogeneous chemistry predictors. Underlying single-step models are provided by their respective original authors.

End-to-end runtime profiling and bottleneck shift

To characterize where wall-clock time is spent during multistep planning, we profiled the Retro*-190 benchmark runs across four API-hosted coordinators (760 runs in total) alongside the 40 evaluation runs of the locally hosted ReTRACE-27B controller (Table A2). Under GPT-5.6 Sol standard, planning a single target required a median of 15.5 min (interquartile range (IQR) 11.9–20.7 min; 72 LLM calls and 117 tool calls). By contrast, locally served ReTRACE-27B required a median of 53.0 min (IQR 38.9–85.7 min; 40 LLM calls and 77.5 tool calls).

Coordinator / settingNMedian runtime, min (IQR)Max, minMedian LLM callsMedian tool calls
GPT-5.6 Sol fast19017.4 (12.7–21.1)101.272119.5
GPT-5.6 Sol standard19015.5 (11.9–20.7)87.972117
GPT-5.6 Sol thorough19022.2 (16.3–30.9)97.779129
Claude Opus 4.819019.7 (15.5–25.0)43.95165
ReTRACE-27B / Test404053.0 (38.9–85.7)302.84077.5

Table A2. Table A2. Per-target wall-clock runtime and call counts across coordinator configurations.

Mutually exclusive wall-clock attribution (Table A3) reveals a pronounced bottleneck shift across deployment regimes. For API-hosted coordinators, coordinator requests in flight accounted for 53.6–57.1% of total wall-clock time, while the unified single-step retrosynthesis tool accounted for 31.9–36.6% (for example, 57.1% and 31.9% under GPT-5.6 Sol standard). For locally served ReTRACE-27B, 91.8% of total wall-clock time was spent with coordinator requests in flight and only 6.2% in single-step retrosynthesis. Optimizing single-step chemistry services therefore yields substantial end-to-end gains under fast API coordinators, whereas local open-weight deployments are dominated by coordinator inference throughput and queuing.

SettingLLM in flightSingle-step retrosynthesisRoute scoringOther toolsUnattributed
GPT-5.6 Sol fast53.633.45.10.17.7
GPT-5.6 Sol standard57.131.93.4<0.17.6
GPT-5.6 Sol thorough54.536.62.3<0.16.7
Claude Opus 4.855.531.93.9<0.18.6
ReTRACE-27B / Test4091.86.20.6<0.11.4

Table A3. Table A3. Mutually exclusive attribution of total wall-clock time (%).

Unified single-step retrosynthesis tool

Exposing heterogeneous single-step predictors (including template-based retrieval and template-free neural models) as separate tools forces the coordinating LLM to decide which engine to query first, reconcile incompatible score scales, de-duplicate identical precursor sets and track provenance inside its context window. ReTRACE instead exposes a single-step retrosynthesis tool that accepts either the default five-engine ensemble (GraphFP, RXNGraphormer, ChemBART, Reaxys template relevance and Ringbreaker) or an explicitly named engine. The harness dispatches requests to engine adapters and performs client-side score normalization, canonicalization, de-duplication and candidate grouping, returning a bounded list of precursors annotated with their supporting engines, while the serving backend handles execution, caching and scheduling. This design decouples replica counts and device placement from the agent tool protocol and allows cache sharing across concurrent workers.

Across the four Retro*-190 API runs, coordinators overwhelmingly used the default ensemble (94.5–97.1% of all single-step retrosynthesis calls; Table A4a). Under GPT-5.6 Sol standard, 94.6% of calls used the default ensemble, compressing an average of 99.2 raw proposals per call to 85.9 unique candidates and 11.6 returned candidates, of which 24.0% were supported by at least two engines.

a, Unified interface usage on Retro*-190Default ensemble / total callsMean raw → unique → returnedReturned with ≥2 engines
GPT-5.6 Sol fast2,835 / 2,977 (95.2%)99.9 → 86.3 → 11.524.3%
GPT-5.6 Sol standard2,824 / 2,986 (94.6%)99.2 → 85.9 → 11.624.0%
GPT-5.6 Sol thorough3,200 / 3,385 (94.5%)99.1 → 85.7 → 11.523.8%
Claude Opus 4.82,089 / 2,151 (97.1%)101.3 → 87.7 → 13.822.3%
b, Controlled ChemBART top-50 benchmarksSuccess / reqP95 latencyThroughputModel workload
Baseline, same-key concurrency 44 / 446.991 s0.0819 req/s4 serial passes (~12–49 s each)
Post-opt, cold same-key concurrency 44 / 412.996 s0.3077 req/s1 compute + 3 waiters
Post-opt, cold same-key concurrency 88 / 8~12.6 s0.6366 req/s1 compute + 7 waiters
Post-opt, warm same-key (×10 repeat)10 / 102.80 ms—10 cache hits, 0 computes

Table A4. Runtime usage of the unified single-step retrosynthesis tool (a) and controlled ChemBART top-50 serving benchmarks (b).

Serving optimizations by request geometry

Single-step traffic during agentic search exhibits two distinct request geometries that require separate serving primitives:

Concurrent identical keys (in-flight coalescing / singleflight). Under the baseline service, per-model locks serialized concurrent identical requests. Introducing singleflight coalescing executes one forward pass per full request key while concurrent callers wait for the shared result, eliminating duplicate compute without altering single-GPU inference latency on unseen molecules. In controlled ChemBART top-50 benchmarks at concurrency 4, P95 latency dropped by 72.3% (from 46.991 s to 12.996 s) and throughput increased 3.76-fold (from 0.0819 to 0.3077 req/s; Table A4b). Fixed-input verification confirmed identical canonical JSON digests before and after optimization across 50 ChemBART and 31 DMPNN outputs.

Sequential identical keys (two-tier caching and stochasticity boundaries). A two-tier (in-memory plus persistent) cache keyed by target SMILES, engine set, top-k, model version and post-processing version reuses completed deterministic results. In controlled acceptance tests, a cold ChemBART top-13 request dropped from 2.203 s to 2.19 ms upon immediate replay (~1,005× on a single key pair), and an 8-request suite showed 8/8 cold misses, 8/8 in-memory hits before restart and 8/8 persistent hits after restart with identical response digests. Failures are never cached and empty results use short TTLs. Crucially, not all scientific predictors are cacheable: RXNGraphormer produced 10 distinct digests across 10 identical calls and therefore explicitly bypasses the cache to avoid freezing stochastic outputs into a single pseudo-deterministic answer.

References

  1. [1]Corey, E. J. & Wipke, W. T. Computer-Assisted Design of Complex Organic Syntheses. Science 166, 178–192 (1969).pubmed.ncbi.nlm.nih.gov/17731475
  2. [2]Corey, E. J., Cramer, R. D. & Howe, W. J. Computer-assisted synthetic analysis for complex molecules. Methods and procedures for machine generation of synthetic intermediates. J. Am. Chem. Soc. 94, 440–459 (1972).DOI
  3. [3]Corey, E. J. & Cheng, X.-M. The Logic of Chemical Synthesis (Wiley, 1989).
  4. [4]Grzybowski, B. A. et al. Chemica: A Story of Computer Code That Started to Think like a Chemist. Chem 4, 390–398 (2018).DOI
  5. [5]Mikulak-Klucznik, B. et al. Computational planning of the synthesis of complex natural products. Nature 588, 83–88 (2020).
  6. [6]Genheden, S. et al. AiZynthFinder: a fast, robust and flexible open-source software for retrosynthetic planning. J. Cheminform. 12, 70 (2020).
  7. [7]Segler, M. H. S., Preuss, M. & Waller, M. P. Planning chemical syntheses with deep neural networks and symbolic AI. Nature 555, 604–610 (2018).DOI
  8. [8]Tetko, I. V., Karpov, P., van Deursen, R. & Godin, G. State-of-the-art augmented NLP transformer models for direct and single-step retrosynthesis. Nat. Commun. 11, 5575 (2020).DOI
  9. [9]Sacha, M. et al. Molecule Edit Graph Attention Network: Modeling Chemical Reactions as Sequences of Graph Edits. J. Chem. Inf. Model. 61, 3273–3284 (2021).DOI
  10. [10]Tu, Z. & Coley, C. W. Permutation Invariant Graph-to-Sequence Model for Template-Free Retrosynthesis and Reaction Prediction. J. Chem. Inf. Model. 62, 3503–3513 (2022).DOI
  11. [11]Xu, L.-C., Tang, M.-J., An, J., Cao, F. & Qi, Y. A unified pre-trained deep learning framework for cross-task reaction performance prediction and synthesis planning. Nat. Mach. Intell. 7, 1561–1571 (2025).DOI
  12. [12]Deng, Y. et al. RSGPT: a generative transformer model for retrosynthesis planning pre-trained on ten billion datapoints. Nat. Commun. 16, 7012 (2025).DOI
  13. [13]Zhang, S. et al. RetroDFM-R: reasoning-driven retrosynthesis prediction with large language models via reinforcement learning. Preprint at https://arxiv.org/abs/2507.17448 (2025).
  14. [14]Maziarz, K. et al. Chemist-aligned retrosynthesis by ensembling diverse inductive bias models. Nature https://doi.org/10.1038/s41586-026-11160-9 (2026).
  15. [15]Coley, C. W. et al. A robotic platform for flow synthesis of organic compounds informed by AI planning. Science 365, eaax1566 (2019).DOI
  16. [16]Tu, Z. et al. ASKCOS: Open-Source, Data-Driven Synthesis Planning. Acc. Chem. Res. 58, 1764–1775 (2025).DOI
  17. [17]Chen, B., Li, C., Dai, H. & Song, L. Retro*: learning retrosynthetic planning with neural guided A* search. Proc. 37th Int. Conf. Mach. Learn. 119, 1608–1616 (PMLR, 2020).arxiv.org/abs/2006.15820
  18. [18]Wang, X. et al. A virtual platform for automated hybrid organic-enzymatic synthesis planning. Nat. Commun. 16, 10929 (2025).DOI
  19. [19]Schwaller, P. et al. Predicting retrosynthetic pathways using transformer-based models and a hypergraph exploration strategy. Chem. Sci. 11, 3316–3325 (2020). https://doi.org/10.1039/C9SC050704H
  20. [20]Coley, C. W., Rogers, L., Green, W. H. & Jensen, K. F. SCScore: Synthetic Complexity Learned from a Reaction Corpus. J. Chem. Inf. Model. 58, 252–261 (2018).DOI
  21. [21]Wang, H. et al. LLM-augmented chemical synthesis and design decision programs. Proc. 42nd Int. Conf. Mach. Learn. 267, 62980–63001 (PMLR, 2025).arxiv.org/abs/2505.07027
  22. [22]Liu, W. et al. Retro-R1: LLM-based Agentic Retrosynthesis. Adv. Neural Inf. Process. Syst. 38, 78799–78827 (2025).DOI
  23. [23]Baker, F. N. et al. LARC: Towards Human-level Constrained Retrosynthesis Planning through an Agentic Framework. Proc. AI Accel. Res. Symp. 3, 153–176 (2026).arxiv.org/abs/2508.11860
  24. [24]Bran, A. M., Neukomm, T. A., Armstrong, D., Jončev, Z. & Schwaller, P. Chemical reasoning in LLMs unlocks strategy-aware synthesis planning and reaction mechanism elucidation. Matter 9, 102812 (2026).arxiv.org/abs/2503.08537
  25. [25]Bran, A. M. et al. Augmenting large language models with chemistry tools. Nat. Mach. Intell. 6, 525–535 (2024).DOI
  26. [26]Boiko, D. A., MacKnight, R., Kline, B. & Gomes, G. Autonomous chemical research with large language models. Nature 624, 570–578 (2023).DOI
  27. [27]Yang, J. et al. SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering. Adv. Neural Inf. Process. Syst. 37, 50528–50652 (2024).arxiv.org/abs/2405.15793
  28. [28]Kwa, T. et al. Measuring AI Ability to Complete Long Software Tasks. Adv. Neural Inf. Process. Syst. 38, 102382–102435 (2025).arxiv.org/abs/2503.14499
  29. [29]Seidl, P. et al. Improving few- and zero-shot reaction template prediction using modern Hopfield networks. J. Chem. Inf. Model. 62, 2111–2120 (2022).DOI
  30. [30]Chen, S. & Jung, Y. Deep retrosynthetic reaction prediction using local reactivity and global attention. JACS Au 1, 1612–1620 (2021).DOI
  31. [31]Sankaranarayanan, K. & Jensen, K. F. Computer-assisted multistep chemoenzymatic retrosynthesis using a chemical synthesis planner. Chem. Sci. 14, 6467–6475 (2023).DOI
  32. [32]Shenfeld, I., Damani, M., Hübоtter, J. & Agrawal, P. Self-distillation enables continual learning. Preprint at https://arxiv.org/abs/2601.19897 (2026).
  33. [33]Landrum, G. et al. RDKIt: open-source cheminformatics. Zenodo https://doi.org/10.5281/zenodo.591637 (2026).
  34. [34]Trost, B. M. The Atom Economy—A Search for Synthetic Efficiency. Science 254, 1471–1477 (1991).pubmed.ncbi.nlm.nih.gov/1962206
  35. [35]Prat, D. et al. CHEM21 selection guide of classical- and less classical-solvents. Green Chem. 18, 288–296 (2016).DOI
  36. [36]Hu, E. J. et al. LoRA: low-rank adaptation of large language models. Proc. Int. Conf. Learn. Represent. https://openreview.net/forum?id=nZeVKeeFYf9 (2022).arxiv.org/abs/2106.09685
  37. [37]Zhao, Y. et al. SWIFT: a scalable lightweight infrastructure for fine-tuning. Proc. AAAI Conf. Artif. Intell. 39, 29733–29735 (2025).
  38. [38]Finnigan, W., Hepworth, L. J., Flitsch, S. L. & Turner, N. J. RetroBioCat as a computer-aided synthesis planning tool for biocatalytic reactions and cascades. Nat. Catal. 4, 98–104 (2021).DOI

Paper details

vlnc:W_tx84kr35
Version
v2 · latest
Published
Added
License
CC BY 4.0
Usage

views · 1

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents