Reasoning-Driven Retrosynthesis Prediction with Large Language Models via Reinforcement Learning

Situo Zhang, Hanqi Li, Lu Chen, Zihan Zhao, Xuanze Lin, Zichen Zhu, Bo Chen, Xin Chen, Kai YuarXiv 2025 · DOI

Abstract

Retrosynthesis—the process of identifying precursor molecules for a target chemical—is a fundamental challenge in organic chemistry. We present RETRODFM-R, a reasoning-driven Large Language Model (LLM) that integrates specialized chemical pretraining with reinforcement learning and chain-of-thought reasoning. RETRODFM-R achieves a new state-of-the-art top-1 accuracy of 65.0% on the USPTO-50K benchmark. Unlike previous "black-box" sequence-to-sequence models, RETRODFM-R provides human-readable explanations for its chemical logic, bridging the gap between predictive performance and interpretability.

Introduction

In organic chemistry, retrosynthesis involves breaking down a complex target molecule into simpler, commercially available starting materials. Existing computational approaches typically fall into two categories: graph-based models, which offer interpretability but limited scalability, and sequence-to-sequence (seq2seq) models, which treat molecules as text strings (SMILES) to achieve high accuracy but lack transparency. General-purpose LLMs often struggle with the rigid syntax of molecular notations and the underlying rules of chemical reactivity.

RETRODFM-R addresses these limitations by creating a model that not only predicts reactants but also articulates the reasoning behind specific bond disconnections, effectively mapping textual chemical knowledge to structural molecular representations.

Methodology

RETRODFM-R is built upon ChemDFM, an open-source chemical LLM, using a sophisticated three-stage training pipeline:

  1. Continual Pretraining: The model was trained on 10 million SMILES-IUPAC pairs and 8 million retrosynthesis examples. IUPAC names provide a structured description that helps the model understand molecular logic better than raw SMILES strings.
  2. Cold-Start Reasoning Distillation: Using a general reasoning model (DeepSeek-R1), the researchers generated "Chain-of-Thought" (CoT) explanations for known reactions. RETRODFM-R was fine-tuned on these to learn functional group analysis and reactive site identification.
  3. Reinforcement Learning (RL): The model was refined using the Dynamic sAmpling Policy Optimization (DAPO) algorithm. It received verifiable rewards based on chemical validity (verified via RDKit) and adherence to reasoning formats.
The three-stage training pipeline of RETRODFM-R, including pretraining, distillation, and reinforcement learning, alongside a reasoning example.

Key Results

RETRODFM-R sets a new benchmark for retrosynthesis performance. On the USPTO-50K dataset, it achieved a top-1 accuracy of 65.0%, significantly outperforming previous sequence-based methods like EditRetro (60.8%) and leading graph-based approaches like Graph2Edit (55.1%).

Comparison of RETRODFM-R against template-based, graph-based, and sequence-based methods on the USPTO-50K benchmark.

Beyond raw metrics, the model demonstrates high practical utility:

  • Human Preference: In double-blind tests, human experts preferred or found RETRODFM-R’s predictions equal to the ground truth 64% of the time.
  • Multi-Step Synthesis: The model successfully planned synthetic routes for complex drugs such as Osimertinib and Salmeterol, matching routes reported in medicinal chemistry literature.
  • Complex Chemistry: It showed improved handling of chirality and complex ring-forming reactions compared to baseline models.

Discussion and Future Work

While RETRODFM-R represents a significant leap forward, it is not immune to hallucinations. Occasionally, the model's reasoning may reference atoms not present in the target or suggest reactions that are theoretically sound but practically unfeasible.

Future research will focus on integrating Retrieval-Augmented Generation (RAG) to allow the model to reference massive reaction databases, as well as embedding hard-coded cheminformatics rule-checkers directly into the reasoning loop to minimize errors. Expanding the model's scope to inorganic materials and polymers remains a key long-term goal.

Summary updated

BibTeX
@misc{zhang2025reasoning,
  author = {Situo Zhang and Hanqi Li and Lu Chen and Zihan Zhao and Xuanze Lin and Zichen Zhu and Bo Chen and Xin Chen and Kai Yu},
  title = {{Reasoning-Driven Retrosynthesis Prediction with Large Language Models via Reinforcement Learning}},
  year = {2025},
  eprint = {2507.17448},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.17448},
}
Figure