RetroDFM-R: A Chemical LLM for Retrosynthesis
- The paper presents RetroDFM-R, a reasoning-driven chemical LLM that separates explicit retrosynthetic rationale from final reactant prediction to enhance explainability and generalization.
- Its training pipeline combines continual pretraining, answer-conditioned reasoning distillation, and reinforcement learning with RDKit-verifiable rewards for robust chemical synthesis predictions.
- The model achieves top-1 accuracies of 65.0% on USPTO-50K and improved higher-rank performance on USPTO-FULL while offering transparent, human-assessable rationales.
Searching arXiv for RetroDFM-R and closely related retrosynthesis papers. Searching arXiv for "RetroDFM-R" exact phrase. RetroDFM-R is a reasoning-driven chemical LLM for single-step retrosynthesis prediction that treats retrosynthesis as an explicit reasoning task rather than a purely opaque mapping from product SMILES to reactant SMILES. Built on ChemDFM-v1.5 and optimized through chemical-domain pretraining, supervised distillation of reasoning traces, and reinforcement learning with chemically verifiable rewards, it is designed to address two persistent limitations of earlier systems: limited generalization across reaction space and poor explainability. Its reported outputs separate a reasoning segment from the final reactant prediction, with the stated aim of making retrosynthetic proposals more transparent and more useful to practicing chemists (Zhang et al., 23 Jul 2025).
1. Conceptual scope and scientific positioning
RetroDFM-R is framed around the central difficulty of retrosynthesis: the inverse mapping from a target product molecule to plausible precursor reactants is one-to-many, reaction classes may be unknown, and successful prediction requires knowledge of bond disconnections, functional-group transformations, selectivity, and reagent accessibility. The model’s defining claim is that these demands are better handled by explicit retrosynthetic reasoning than by direct sequence transduction alone (Zhang et al., 23 Jul 2025).
Within the paper’s taxonomy, RetroDFM-R is positioned against three broad method families. Graph-based retrosynthesis systems such as GLN, MEGAN, Graph2Edits, and Retro model molecules as graphs and frequently emphasize reaction-center prediction or graph edits. Sequence-to-sequence systems, including LSTM-based models, Transformer retrosynthesis, R-SMILES, and EditRetro, recast retrosynthesis as translation from product SMILES to reactant SMILES. Prior chemical LLMs, including ChemDFM and ChemLLM, provide broader chemical priors through large-scale pretraining but are described as generally remaining end-to-end predictors without explicit rationale generation. RetroDFM-R differs from all three families by insisting that the model should first analyze structure and plausible disconnections and only then commit to a reactant set.
This positioning matters because the paper does not present RetroDFM-R as a new graph formalism or a new reaction-template system. It is instead a decoder-only chemical LLM whose novelty resides primarily in training protocol and output structure. A plausible implication is that the work should be read less as an architectural break with modern LLM practice than as a domain-specialized adaptation of LLM reasoning methods to chemical synthesis.
2. Architecture, representation, and output format
RetroDFM-R is built on ChemDFM-v1.5, which is stated to share the architecture of Llama3-8B. The reported configuration is a decoder-only Transformer with 32 layers, model dimension , feed-forward dimension , vocabulary size 128,000, and group query attention with 8 key/value heads and 32 query heads. Training is performed with full-parameter tuning using the OpenRLHF framework (Zhang et al., 23 Jul 2025).
The model takes a product SMILES as input and, at inference, produces two tagged segments: an explicit reasoning trace in > ... </think> and a final reactant prediction in <answer> ... </answer>. The intended reasoning sequence includes structural analysis, key bond disconnection identification, likely reaction type, possible reagents or conditions, and feasibility assessment. This output design is central to the paper’s notion of explainability: the system is not supposed merely to emit reactants, but to externalize an interpretable retrosynthetic rationale.
A technical distinction from ordinary sequence-to-sequence retrosynthesis is that reasoning is not latent. The model is trained to emit intermediate text before the answer. The paper also notes a related but slightly different template in answer-conditioned distillation, where the appendix prompt asks for
<reason> ... </reason>and<reactant> ... </reactant>. This suggests that the tagged decomposition of rationale and final answer is an invariant design principle even when the literal tags differ across training stages.The representation choice is also deliberate. RetroDFM-R is not a graph neural network, does not explicitly predict reaction centers as graph edits, and does not rely on template matching. Instead, it uses text-like molecular representations while attempting to recover structured retrosynthetic behavior through supervised and reinforced reasoning traces.
3. Training pipeline and reinforcement-learning design
The training recipe has three stages: continual pretraining, cold-start reasoning distillation, and reinforcement learning. The paper’s thesis is that RetroDFM-R becomes competitive only when domain adaptation, reasoning supervision, and verifiable reward optimization are combined (Zhang et al., 23 Jul 2025).
Stage Data and supervision Reported scale Continual pretraining SMILES-to-IUPAC, IUPAC-to-SMILES, end-to-end retrosynthesis about 24 million examples Cold-start reasoning distillation answer-conditioned rationales from DeepSeek-R1 165,000 examples Reinforcement learning DAPO with correctness and format rewards trained separately on USPTO-50K and USPTO-FULL Continual pretraining uses over 10 million canonicalized SMILES–IUPAC pairs from PubChem together with retrosynthesis data from USPTO-FULL. The supplementary composition is given as 10M SMILES-to-IUPAC from PubChem, 5M IUPAC-to-SMILES from PubChem, 1M augmented SMILES-to-IUPAC from USPTO, and 8M retrosynthesis examples from USPTO. The rationale for the SMILES–IUPAC conversion tasks is explicit: chemical knowledge in LLMs is often embedded in human-readable text and nomenclature, whereas retrosynthesis inputs and outputs are in SMILES, so conversion is used to transfer structural and functional-group knowledge into the SMILES regime. Data cleaning removes invalid atom mappings, abnormal product sizes, and extraction artifacts, and leakage prevention removes reactions whose products appear in the test sets of USPTO-50K, USPTO-MIT, and USPTO-FULL. The pipeline also uses 10-fold R-SMILES augmentation for retrosynthesis pretraining and 200K SMILES–IUPAC pairs augmented fivefold with different root atoms.
For continual pretraining and reasoning distillation, the reported supervised objective is standard cross-entropy,
The second stage, termed answer-conditioned distillation, uses DeepSeek-R1 as teacher. For each sampled reaction, the teacher receives the product SMILES, the product IUPAC name, the ground-truth reactants, and instructions to generate a detailed expert-style retrosynthetic rationale. Because the teacher is given the correct answer, the rationale is generated conditioned on a known valid solution rather than inferred from scratch.
The third stage is the source of the suffix “-R”. RetroDFM-R is optimized with Dynamic sAmpling Policy Optimization (DAPO), described as improving on GRPO and PPO. The reward is
with . Correctness is determined by extracting the content between
<answer>and</answer>, canonicalizing predicted and ground-truth SMILES with RDKit, and assigning reward 1 if they match and 0 otherwise. Format reward is assigned by regular-expression checking of the structure"<think>...\n<answer>...</answer>". The paper emphasizes that these rewards are chemically verifiable because they are algorithmic rather than learned. RL hyperparameters are reported as rollout batch size 512, samples per prompt 8, rollout temperature 1.0, and asymmetric clipping . Prompts where all group outputs receive identical rewards are filtered out to avoid uninformative updates.
The implementation details are also reported: training uses NVIDIA A800 80G GPUs, Adam with , , and 0, a cosine schedule with warm-up ratio 0.03, and DeepSpeed ZeRO with FlashAttention. Continual pretraining is reported as about 2 days, cold-start distillation about 5 hours, and RL about 2 days on USPTO-50K and 5 days on USPTO-FULL.
4. Inference procedure, datasets, and benchmark performance
Because RetroDFM-R generates both reasoning and answer text, ordinary beam search is reported to diversify reasoning more than reactant predictions. The paper therefore introduces a two-stage inference procedure: repeated sampling for diverse reasoning paths, followed by partial beam search starting from the <answer> tag for diverse reactant completions per reasoning path. With 1 augmented product SMILES, 2 sampled reasoning paths, and 3 beam completions per path, the total number of predictions per product is 4 (Zhang et al., 23 Jul 2025).
To rank unique canonicalized predictions 5, the paper defines
6
where 7 is the set of beam ranks where 8 appears and 9. Final ranking is obtained by sorting these scores. This combines frequency across augmentations and samples with beam rank.
The main datasets are USPTO-50K, with 50,016 curated organic reactions and a 40K/5K/5K train/validation/test split, and USPTO-FULL, with about 1M reactions split 800K/100K/100K. The reported primary metric is top-0 exact-match accuracy using canonical SMILES. On USPTO-50K, RetroDFM-R reports top-1, top-3, top-5, and top-10 accuracies of 65.0, 83.7, 88.9, and 92.5, respectively, in the reaction-class-unknown setting. The best prior sequence model, EditRetro, is reported at 60.8, 80.6, 86.0, and 90.3, while the best prior graph model, Graph2Edits, is reported at 55.1, 77.3, 83.4, and 89.4. On USPTO-FULL, RetroDFM-R reports 50.5, 67.6, 72.7, and 77.5, compared with EditRetro’s 52.2, 67.1, 71.6, and 74.2. The result therefore combines a new top-1 on USPTO-50K with stronger higher-rank performance on USPTO-FULL, but not a universal top-1 advantage on the larger benchmark.
The paper also compares RetroDFM-R with general and chemical LLM baselines on USPTO-50K. Without augmentation or repeated sampling, RetroDFM-R reports 59.0%; with augmentation, 65.0%. Other reported accuracies are 0.7% for gpt-4o, 11.3% for gpt-4.1-mini, 8.6% for DeepSeek-V3, 12.2% for o4-mini, 11.2% for DeepSeek-R1, 17.9% for ChemDFM-v1.5, and 2.0% for LlaSMol-Mistral.
Additional evaluation goes beyond exact match. On USPTO-50K, round-trip accuracy using a pretrained Molecular Transformer forward-synthesis model is reported as 88.3% top-1, 97.2% top-3, 98.6% top-5, and 99.4% top-10. MaxFrag accuracy is reported as 68.4% top-1, 86.5% top-3, 91.1% top-5, and 94.0% top-10. Diversity is assessed through mean Tanimoto similarity among top-10 predicted reactants using concatenated ECFP4 fingerprints, with low-diversity predictions accounting for only 22% of the test set. The paper also reports stronger performance on chirality, ring-forming transformations, and ring-opening transformations, and gives a reaction-class breakdown for USPTO-50K top-1 that includes 75.6% on acylation, 53.0% on C–C bond formation, 58.9% on heterocycle formation, 69.5% on oxidations, and 39.8% on FGI.
5. Explainability, human assessment, and multistep use
RetroDFM-R’s explainability claim rests on explicit reasoning traces and human evaluation rather than on a formal explainability metric. The paper presents qualitative examples in which the model identifies a key C–N disconnection and proposes reductive amination, recommends sodium cyanoborohydride as a suitable reducing agent, and compares multiple plausible routes such as Suzuki–Miyaura coupling versus Buchwald–Hartwig amination before selecting one (Zhang et al., 23 Jul 2025).
Human evaluation is conducted through double-blind AB testing by three independent organic chemistry experts. Two evaluators judge each pair and a third adjudicates disagreements. The labels are “A is better,” “B is better,” “Both are equally good,” and “Both are equally bad/unclear.” The criteria prioritize correctness and rationality of the retrosynthetic analysis, constructive decomposition into simpler molecules, likely yield and fewer side reactions, mild conditions and common reagents, and greener and safer solutions. Against ground truth on USPTO-50K, 64% of responses said RetroDFM-R outputs were preferred or equally good. On USPTO-FULL, 52% preferred RetroDFM-R and 23% rated it equally good versus ground truth. Compared to EditRetro, RetroDFM-R was consistently preferred on USPTO-50K and showed similar favorable trends on USPTO-FULL.
The paper extends the single-step model to multistep route generation by recursive application rather than by a separately specified planner. It does not introduce MCTS, best-first search, A*, an explicit value function, or a route cost function. Instead, multistep planning is presented as sequential retrosynthetic prediction. The case studies include Osimertinib, for which the literature route has 5 steps and the model reportedly predicted all five steps at rank 1; Salmeterol, for which all steps were rank 1 except step 3 at rank 2; Selective STING synergists, for which all steps were correctly ranked within top-2; and a GL-B437 derivative, for which all steps were rank 1 except step 7 at rank 2. Supplementary examples also cover MPA-CPA and V1036 in perovskite-related materials synthesis. The paper stresses that neither the final products nor intermediates in these case studies appeared in training data.
A technical caveat is crucial here: RL does not directly score the chemical truthfulness of the reasoning text. Reasoning is reinforced only indirectly, through answer correctness and format compliance. The paper therefore explicitly acknowledges that rationales may still contain hallucinations or irrelevant content.
6. Limitations, interpretation, and terminological distinctions
The paper’s reported strengths are paired with explicit limitations. The reward is narrow: exact-match correctness and format compliance do not directly reward faithful reasoning, route optimality, reagent availability, safety, cost, or realistic conditions. The correctness reward is binary and benchmark-label dependent, which is problematic in a one-to-many domain where chemically valid alternatives need not match the canonical label. The explainability evidence is qualitative plus human preference rather than a formal measure of rationale faithfulness. Multistep planning remains heuristic because there is no fully specified search framework, stock model, route scoring function, or reaction-feasibility simulator. Finally, the advantage is not uniform across all settings, since EditRetro remains slightly better at top-1 on USPTO-FULL even though RetroDFM-R is stronger at top-1 breadth (Zhang et al., 23 Jul 2025).
These limitations also clarify a common misconception. RetroDFM-R does not show that explicit rationale generation guarantees faithful chemical reasoning. It shows that a chemical LLM can be trained to emit explicit rationales and that such a system can achieve strong benchmark performance and favorable expert judgment. This suggests that reasoning-style supervision is useful, but it does not establish that the generated rationales are always causally responsible for the answer or always chemically sound.
The name also requires disambiguation. “RetroDFM-R” in this context denotes a reasoning-driven retrosynthesis model, and it should be distinguished from unrelated acronym families in other fields: Fourier-domain Difference Map methods for coded diffraction phase retrieval (Fannjiang, 2014), decision-feedback differential detection for reconfigurable intelligent surfaces (Qiu et al., 30 Jun 2026), and modular delayed-feedback reservoir models (Ikeda et al., 2023). The overlap is terminological rather than methodological.
In the paper’s own framing, RetroDFM-R’s main technical identity lies not in a new molecular graph architecture but in a composite training paradigm: chemical-domain alignment between SMILES and IUPAC, answer-conditioned distillation of expert-style retrosynthetic rationales, and reinforcement learning with RDKit-verifiable rewards. Its reported contribution is therefore an overview of domain adaptation, explicit reasoning supervision, and verifiable optimization for retrosynthesis, rather than a redefinition of the underlying Transformer formalism.