Physics-Verified Retrosynthesis & Process-Design RL
From raw Scimplify lab spreadsheets and quantum-anchored kinetic ODEs to a multi-turn reinforcement learning loop combining a 17.4M-compound commercial building-block catalog tool, live MLIP transition-state barriers (ΔG‡) & competing side-reaction selectivity, and a gated 10-rubric glm5.3 process-chemistry judge on Tinker (Inkling-2-Mini, $0.00/token).
val_seen Gate-1 (>95% yield + in-stock leaves) jumped 41.7% → 70.8% before any RLmean_R 0.674 → 0.754, pass@6 = 100%, rubric = 0.904)pass@6 = 100%)ΔE < 0) alone cannot separate viable lab chemistry from kinetically dead routes. Pairing a live 17.4M building-block catalog tool with hard Gate 1 physics (ΔG‡ + competing side reactions + >95% yield) and a prose-blind 10-rubric glm5.3 process judge eliminates reward hacking and produces real industrial synthesis pathways — while exposing concrete engineering gaps (2-step training balance, KL anchoring, and live CCSD(T) single-point refinement).
1. Real-World Data Curation & 5-Molecule Physics Simulator Evolution
Before running de-novo pathway RL, we audited the raw Scimplify lab workbook (Reaction_Details___Scimplify____EMACH_2.xlsx) and evolved quantum-anchored kinetic ordinary differential equation (ODE) simulators across all five reaction families using only two bounded physical knobs per simulator (no black-box residual fitting).
- Weight-by-weight ratios misread as % yield: Earlier automated parsing treated
Output_g / Input_gratios such as1.26 g/gin Apremilast EMS Stage II (actually 82.3% molar yield) and1.4–1.5 g/gimpurity preps as1.2–1.5%yields. - Non-synthesis rows mixed into main datasets: Column-purification and impurity-preparation batches were filtered out, leaving clean synthesis sets (Hippuric
n=17, EMSn=40, Apremilast Stage IIn=22, TCPPn=28, TEPn=18). - Hidden process variables in free-text
Procedurecolumns: Reading full procedure notes exposed the actual physical drivers — semi-batch dosing hours (2 hvs.9–15 h) in TCPP, reagent incompatibility and addition-order exotherms in TEP, wet-cake solvent retention in Apremilast Stage II, and solvent-volume solubility loss + unactivatedNaNH2slurry failure in EMS.
Molecule (n clean) |
Physical Mechanism Evolution (Round 1 → Final) | Zero-Fit MAE | LOO MAE / ρ | Rand 40/60 MAE / Go-NoGo | Chrono 40/60 MAE / Go-NoGo |
|---|---|---|---|---|---|
Hippuric Acid (n=17) |
Explicit OH−(H2O)3 + CCSD(T) barriers + flask ODE → +pH-2 workup (rejected reduced anhydride when held-out worsened) |
13.0% → 14.8% | 5.4% / 0.53 | 4.4% / 95% | 3.9% / 100% |
Apremilast EMS (n=40) |
3-stage kinetic ODE → +volume solubility + analogs + NaNH2 activation |
9.2% → 3.0% | 3.1% / 0.874 | 3.1% / 92.1% | 2.4% / 91.7% |
Apremilast Stg-II (n=22) |
2-step amic-acid / imide ODE → +wet-cake retention |
9.2% → 6.5% | 5.2% / 0.607 | 4.9% / 83.3% | 7.7% / 76.9% |
TCPP (n=28) |
Batch ODE → +semi-batch dosing (2–15 h) + fast ring-opening + AlCl3 barrier (+zero-fit Isomer-1 regioselectivity 10.9% MAE from −0.97 kcal/mol MLIP gap) |
20.6% → 7.3% | 7.9% / 0.695 | 10.3% / 69.4% | 10.3% / 100% |
TEP (n=18) |
3-step POCl3 + HCl dealkylation ODE → +reagent incompatibility + addition exotherm |
61.4% → 37.1% | 9.1% / 0.853 | 12.6% / 88.2% | 18.1% / 81.8% |
Provenance: All 27 conformer-searched ground states were optimized live via /v1/mlip/optimize (em1-cc-v2-u4b) and cross-checked against cached live LNO-CCSD(T)/cc-pVDZ + C-PCM energies (within 1–2 kcal/mol). New live CCSD(T) jobs on the A100 worker hit cudaErrorIllegalAddress and remain owed after worker restart.
2. End-to-End RL Progression: Stage 1 → Stage 2 (v1 / v2 / v3) → Stage 3
Every iteration ran real GRPO updates on Tinker (thinkingmachines/Inkling-2-Mini:peft:65536:free, LoRA rank 16, LR 2e-5, $0.00/token) and exposed a specific verifier or systems bottleneck that drove the next design.
| Run | Verifier & Reward Rule | max_tokens / Trunc |
val_seen Base → RL |
val_unseen Base → RL |
Key Finding / Bug Exposed |
|---|---|---|---|---|---|
| Stage 1 15 steps |
5 calibrated ODEs (fixed reaction, tune conditions) | 4096 / 0–5% | 45.8% → 50.0% (@8: 66.7→83.3%) |
85.4% → 77.1% (EMS drift) |
Hippuric ODE raised yield 85.3→89.3%, purity 91.0→93.2%. Prompting by name without SMILES caused EMS hallucinations. |
| Stage 2 v1 12 steps |
De-novo pathway: RDKit balance + live MLIP ΔE < 0 |
3584 / ~10% | 50.0% → 50.0% (@6: 75→100%) |
50.0% → 66.7% (bal: 79→96%) |
Ground-state ΔE accepted kinetically dead glycine + BzOH; heavy-atom tie gate wrongly rejected 4-Nitrobenzamide. |
| Stage 2 v2 12 steps |
+ Live /v1/mlip/transition-state ΔG‡ + side-rxn selectivity + catalyst |
3584 / 33–52% | 25.0% → 25.0% | 50.0% → 58.3% (@6: 100%) |
Blocked dead glycine+BzOH (ΔG‡=37.1) → RL switched to benzoic anhydride; token cap truncated half of rollouts. |
| Stage 2 v3 12 steps |
Strict binary reward: 1.0 iff est_yield > 95%, else 0.0 |
16384 / 4% | 41.7% → 50.0% | 54.2% → 66.7% (@6: 100%) |
Eliminated truncation; RL invented stoichiometric EDC peptide coupling on Hippuric (outsmarting our catalyst-only check!). |
| Stage 3 8 steps |
17.4M ZINC20 tool + Gate 1 (>95%Y + stock) → Gate 2 (10-rubric glm5.3) |
10240 / 4–6% | 70.8% → 79.2% (R: 0.674→0.754) |
77.8% → 72.2% (rub: 0.884→0.897) |
Live catalog tool lifted base accuracy +29 pp; 1-step unseen & rubric quality rose, while 2-step targets drifted without KL. |
3. Stage 3 Architecture: Tool-Use Retrosynthesis + Gated Hybrid Verifier
Naive linear mixing (0.5 * physics + 0.5 * llm_judge) invites GRPO to reward-hack the LLM judge with flattering chemistry prose on broken routes. Stage 3 solves this with a two-stage gated architecture and a prose-blind judge.
Proposes 1–3 step retrosynthesis with stoichiometry, catalyst, solvent, and temperature. Natively calls check_in_stock (1.81–1.92 calls/rollout) against 17,422,843 ZINC20 InChIKeys (<0.7 ms/lookup) before committing JSON.
Enforces valid SMILES, exact atom/charge balance, target identity, all leaf reactants in stock, and estimated_yield > 95% from live em1-cc-v2-u4b ΔE + /v1/mlip/transition-state ΔG‡ + competing side-reaction selectivity. Fail → R = 0.0.
Triggered only on Gate-1 passes. Sarvam glm5.3 (temp=0, 1.4% variance) grades only the structured JSON + physics summary (never thinking prose) across 7 universal + 3 domain-specific rubrics: R = 0.50 + 0.50 * rubric.
Live /v1/mlip/transition-state Barrier Anchors (em1-cc-v2-u4b)
Before Stage 2 v2 / Stage 3 training, we ran live transition-state searches via /v1/mlip/transition-state and verified all 7 physical pass/fail gates:
| Test Case | Mechanism / Competing Channel | ΔG‡ (kcal/mol) |
Est. Yield (4 h) | Gate 1 Result |
|---|---|---|---|---|
glycine + benzoic acid (160 °C, no catalyst) |
Uncatalyzed salt trap (RCOO− R'NH3+) |
37.10 | 0.16% | REJECTED (R=0.0) |
2-phenylethanol + Ac2O in protic ethanol |
Competing solvent alcoholysis ([EtOH] >> [sub]) |
18.67 vs 18.67 | 4.80% | REJECTED (R=0.0) |
ibuprofen + MeOH (65 °C, catalyst: none) |
Uncatalyzed Fischer esterification | 27.79 | 10.50% | REJECTED (R=0.0) |
ibuprofen + MeOH (65 °C, catalyst: H2SO4) |
Protonated Fischer esterification (−8.24 kcal/mol lower!) | 19.55 | 100.0% | PASSED → Gate 2 |
glycine + benzoic anhydride in EtOAc (65 °C) |
Aprotic anhydride N-acylation | 18.67 | 100.0% | PASSED (rub 0.892) |
glycine + BzOH + EDC in EtOAc (25 °C) |
Stoichiometric carbodiimide coupling (N=C=N) |
18.20 | 100.0% | PASSED (rub 0.648) |
4-nitrobenzoyl chloride + NH3 in EtOAc (20 °C) |
Acyl chloride ammonolysis (fixed heavy-atom tie!) | 16.96 | 100.0% | PASSED (rub 0.918) |
4. The 10-Rubric Process Judge (glm5.3) & Unseen Sub-Score Deltas
Pre-flight determinism check at temperature = 0 gave 1.4% variance (0.914 vs. 0.928) and a +0.254 separation between green Ac2O/EtOAc (0.914) and corrosive unbuffered AcCl/DCM (0.660). Seven rubrics apply universally (76% weight) and three switch automatically by domain (24% weight).
- Step Economy & Convergence (12%): Minimal step count, no unnecessary redox or protecting-group detours.
- Building-Block Cost & Bulk Availability (12%): Cheap commodity catalog leaves over expensive specialty reagents (e.g., penalized stoichiometric EDC vs. bulk benzoic anhydride).
- Chemoselectivity & Functional-Group Compatibility (12%): No unprotected reactive handles clashing with reagents.
- Reagent & Catalyst Realism (10%): Standard catalysts or stoichiometrically balanced activating agents.
- Solvent Greenness (10%): Prefers ICH Class 3 solvents (
EtOAc,EtOH,MeOH,water,AcOH,2-MeTHF) overDCM/DMF/NMP. - Process Safety & Thermal Hazard (10%): Penalizes pyrophorics, toxic gases, or unmitigated exotherms.
- Workup, Isolation & Atom Economy (10%): Clean aqueous wash / crystallization vs. chromatographic sludge (
PPh3=O,DCU).
- Stereochemical & Epimerization Control (8%): Preserves stereocenters and avoids harsh racemizing conditions.
- Genotoxic / ICH M7 Impurity Risk (8%): Avoids alkyl halides, sulfonate esters, nitrosamine precursors, and heavy-metal carryover.
- Telescoping & Crystallization Readiness (8%): Compatible solvent sequence across multi-step syntheses without repeated dry-downs.
- Raw-Material Cost & Process Mass Intensity / PMI (8%): Minimal solvent volume and stoichiometric waste.
- Semi-Batch Dosing & Exotherm Control (8%): Realistic temperature and addition control for fast exothermic steps (
POCl3,BzCl, epoxides). - Corrosion & Waste-Stream Handling (8%): Manageable
HCl, salt, and aqueous effluent burden.
val_unseen): Individual Rubric Sub-Scores (Base → RL Step 8, out of 10)5. Real Test-Set Rollouts (Base vs. RL Step 8)
Every route below is an exact, unedited JSON rollout generated by Inkling-2-Mini on held-out test prompts after querying our live 17.4M-compound ZINC20 catalog tool, verified by Gate 1 physics (>95% estimated yield), and graded by glm5.3.
vu_nbz · pharma_api · Unseen)
Gate1@1: 33.3% → 50.0% Rubric: 0.918 Tools: 1.83
Why RL won: Switched from chlorinated DCM (in Stage 2) to green ICH Class-3 ethyl acetate. glm5.3 critique: "Near-ideal one-step acyl chloride ammonolysis in Class-3 EtOAc with water-soluble NH4Cl byproduct and crystalline product."
vu_me_sal · bulk_industrial · Unseen)
Gate1@1: 66.7% → 83.3% Rubric: 0.916 Tools: 2.17
glm5.3 critique: "Textbook one-step Fischer esterification of cheap salicylic acid with MeOH doubling as reagent/solvent under standard H2SO4 catalysis."
vu_ibu_me · pharma_api · Unseen)
Gate1@1: 100.0% → 100.0% R: 0.951 → 0.958 Rubric: 0.934
glm5.3 critique: "Textbook one-step Fischer esterification of cheap bulk ibuprofen in Class-3 methanol with catalytic H2SO4 is near-ideal."
vu_phe_ac · bulk_industrial · Unseen)
Gate1@1: 83.3% → 83.3% Best Rubric: 0.926 → 0.934 Tools: 2.00
glm5.3 critique: "Near-ideal one-step acetylation of cheap 2-phenylethanol with bulk acetic anhydride in green EtOAc at ambient temperature."
vu_lidocaine · pharma_api · Unseen)
Gate1@1: 83.3% → 66.7% Gate1@6: 100% Rubric: 0.890
glm5.3 critique: "This is the classic two-step industrial lidocaine route using commodity 2,6-dimethylaniline, chloroacetyl chloride, and diethylamine." (All 3 leaf reactants verified in 17.4M stock; single-step drift reduced pass@1 from 83.3% to 66.7% without KL.)
vu_me_asp · pharma_api · Unseen)
Gate1@1: 100.0% → 50.0% Gate1@6: 100% Rubric: 0.878
glm5.3 critique: "Excellent two-step route from bulk salicylic acid with clean chemoselectivity and green solvents." (Biggest casualty of having 7/8 1-step training prompts with no KL anchor.)
vs_para_no_cl · pharma_api)
Gate1@1: 83.3% → 100.0% Mean R: 0.801 → 0.960 Tools: 2.00
glm5.3 critique: "This is the actual industrial route: one-step acetylation of cheap p-aminophenol with acetic anhydride in Class 3 AcOH."
vs_asp_green · pharma_api)
Gate1@1: 33.3% → 66.7% Mean R: 0.326 → 0.613 Rubric: 0.978
glm5.3 critique: "This is the canonical one-step industrial aspirin route using cheap salicylic acid and acetic anhydride with a benign phosphoric acid catalyst."
vs_hip_no_cl · bulk_industrial)
Gate1@1: 66.7% → 66.7% Rubric: 0.892 Tools: 1.67
Evolution across stages: Stage 2 v1 passed dead glycine + BzOH; Stage 2 v3 invented stoichiometric EDC coupling (rubric = 0.648); Stage 3 converged on cheap bulk benzoic anhydride in green EtOAc (rubric = 0.892).
vs_phth_2 · bulk_industrial)
Gate1@1: 100.0% → 83.3% Rubric: 0.982 Tools: 1.83
glm5.3 critique: "Textbook one-step imidization of commodity phthalic anhydride with methylamine in recyclable Class 3 AcOH with water as sole byproduct."
6. Honest Audit: What Worked, What Broke & What Remains Owed
What Genuinely Worked
- Live 17.4M building-block catalog tool was the single biggest lever: Giving
Inkling-2-Mininativecheck_in_stockcalls lifted zero-shot Gate-1 accuracy from 41.7% → 70.8% (val_seen) and 54.2% → 77.8% (val_unseen) with<0.7 mslookup latency. - Transition-state + side-reaction physics stopped false positives: Uncatalyzed
glycine + BzOH(ΔG‡=37.1), uncatalyzed Fischer esterification (ΔG‡=27.8), andAc2Oin proticethanol(4.8%selectivity) were cleanly rejected. - Prose-blind gated
glm5.3judge prevented reward hacking: 1.4% determinism variance attemp=0, zero hacked rollouts, and measurable unseen quality gains in PMI (+0.37), telescoping (+0.36), solvent greenness (+0.13), and workup (+0.13). - RL exposed our own verifier bugs: Step-12 Stage 2 v3 proposed fully atom-balanced stoichiometric
EDCpeptide coupling, revealing a gap in our catalyst-only detector, and Stage 2 v1 exposed the heavy-atom tie bug on4-Nitrobenzamide.
What Broke & What Remains Owed
- 2-step unseen drift without KL anchor: Because 7 of 8 Stage 3 training targets were 1-step reactions with no KL penalty, 2-step unseen
Lidocaine(83.3% → 66.7%) andMethyl 2-acetoxybenzoate(100% → 50%) regressed even thoughgate1@6stayed 100%. Fix: KL penalty (β=0.02) + 50/50 1-step / multi-step training mix. - Live
CCSD(T)single-point refinement still owed: New jobs on the A100 worker (ccsd-api-a100-a100) failed withcudaErrorIllegalAddress, so Stage 2 & Stage 3 used liveem1-cc-v2-u4bMLIP optimizations + TS barriers (cachedLNO-CCSD(T)on the 5 Scimplify families). - Template-anchored TS vs. arbitrary-reaction TS search: Our Stage 2/3 verifier anchors Eyring barriers to live
/v1/mlip/transition-statereferences by reaction class; arbitrary unseen reaction classes still need automated TS geometry generation on the fly. - Macroscopic plant physics & Enamine pricing: Enamine's official SDF downloads are login-gated (we used open ZINC20 stock), and crystallization polymorphism, slurry stirrability, scale-up heat transfer, and prospective wet-lab validation remain outside current simulation.