TL;DR
When AI models predict how to synthesize a molecule backward (retrosynthesis), they often generate the right answer in their top 10 guesses—they just fail to rank it first. RetroMol solves this by training an energy-based "critic" to spot the best chemical candidates, then distilling that critic's ranking intuition back into the original compact generator. The result is a 5.7–6.8 percentage-point boost in accuracy with zero extra parameters and no reranking step at inference.
What Problem Does This Paper Address?
Retrosynthesis—working backward from a target molecule to simpler, purchasable starting materials—is a central bottleneck in AI-driven drug and materials discovery. Modern text-based retrosynthesis models treat this as a sequence-to-sequence translation problem, using transformers to translate a product molecule into reactant strings.
Because these models are trained with per-token cross-entropy loss, they learn to predict the next character or token one step at a time, never comparing complete candidate molecules against one another. As a result, a compact 11M-parameter generator like RetroBase actually includes the true reactants in its top-10 beam search 86.1% of the time, yet only ranks them #1 in 46.8% of cases. One fix is to run a second "critic" model at inference to rerank the candidates, but that adds significant compute and memory overhead. The authors ask: can we transfer the critic's candidate-level preferences directly into the generator itself?
Methods
The authors introduce a three-part framework called RetroMol:
- RetroBase (The Generator): An 11M-parameter transformer encoder–decoder (6 encoder, 6 decoder layers) trained with standard teacher forcing. To avoid invalid syntax from single-character edits, molecules are represented as SELFIES strings rather than SMILES.
- RetroERM (The Critic): A 50.8M-parameter energy-based reranking model adapted from prior work. Instead of reading text, it takes Morgan count fingerprints (radius 3, 16,384 bits) of the product, the candidate reactants, and their difference, outputting a scalar energy $E$ (lower means more chemically plausible). It is trained to rank 10-candidate beams from RetroBase.
- RetroDistil (The Distilled Student): RetroBase is warm-started and fine-tuned to match RetroERM's ranking distribution over its own 10-candidate beams. The training loss combines standard per-token cross-entropy ($\alpha = 0.1$) with a KL-divergence term ($\lambda = 1.0$) that aligns the student's length-normalized sequence probabilities with the teacher's energy-based probabilities. Crucially, RetroERM is frozen and never used at inference.
Datasets
The models are trained and evaluated on a curated subset of USPTO-full processed with the Orderly package:
- Restricted to two-reactant reactions so every target has a fixed structure.
- Filtered for validity, deduplicated, and capped at 150 tokens, leaving 941,577 reactions.
- Split 80% / 13.4% / 6.6% into train, validation, and a held-out test set (62,267 reactions).
Key Insights and Ideas
- Generation vs. Ranking: For 39.3% of test products, RetroBase already generates the exact right reactants in its top 10, meaning the bottleneck isn't chemical creativity—it's ranking.
- Distilling Sequence-Level Preferences: Per-token cross-entropy never compares whole candidates. Adding the KL-divergence distillation term gives the compact generator a sequence-level ranking signal, shifting probability mass onto its leading candidates.
- Zero-Cost Inference Gains: Because the critic's preferences are baked into the generator's weights, RetroDistil keeps the exact same 11M-parameter footprint and fast single-pass inference as RetroBase—making it practical for screening large libraries or running inside self-driving laboratories.
Key Results
On the held-out two-reactant USPTO-full test set ($N = 62,267$) using natural beams (no ground-truth injection):
- RetroBase: 46.8% Top-1, 62.9% Top-3, 67.8% Top-5, and 86.1% Top-10 exact-match accuracy.
- RetroDistil: 52.6% Top-1, 69.7% Top-3, and 73.5% Top-5—an improvement of +5.8, +6.8, and +5.7 percentage points over RetroBase at identical model size (11M parameters).
- Per-Class Gains: In critic diagnostics, RetroERM showed the largest ranking improvements on leaving-group substitution (23% $\rightarrow$ 53%) and etherification (36% $\rightarrow$ 51%), where the product alone hides what was displaced.
Limitations and Future Work
The authors note several important caveats:
- Confounded Supervision: In 11.7% of training beams, the ground truth was missing and injected into the 10th slot. Without an injection ablation or a matched-duration cross-entropy-only baseline, the gains cannot be attributed solely to the teacher's preferences.
- Single-Seed & Untuned Weights: Each model was trained once (no seed-variance quantified), and the loss weights ($\alpha, \lambda$) were set by hand.
- Evaluation & Scope: Accuracy is measured strictly by exact match against recorded reactants rather than chemistry-aware metrics (like forward-model round-trip accuracy). Additionally, restricting to two-reactant USPTO reactions under-represents inorganic, organometallic, and polymer chemistry; extending RetroMol to more precursors will require adapting the target format and retraining.
Summary updated