In organic chemistry, retrosynthesis is the ultimate puzzle: given a complex target molecule, how do you work backward to find a sequence of chemical reactions that starts from simple, commercially available ingredients?
For years, AI researchers have treated this as a search problem. They built "planners" that look at a molecule and pick a "single-step retrosynthesis" (SSR) model to predict the precursors. The catch? Most planners commit to a single SSR model for the entire search. But as a new paper from researchers at NTU and Zhejiang University points out, chemical models have "skill disparities"—one model might be a virtuoso at rings, while another excels at long chains.
Enter RetrOrchestrator, an LLM-powered agent that doesn't just plan the route, but dynamically selects the best "tool" (SSR model) for every single step of the synthesis.
The Challenge: Navigating the Transition Space
The search space for a single 15-step chemical pathway is estimated at a staggering $3.5 \times 10^{28}$ possibilities. To navigate this, current AI planners usually use a fixed transition model.
However, the authors observed a significant "skill disparity" among these models. In certain molecular clusters (like complex fused rings), a specific model might vastly outperform others, yet perform poorly elsewhere. Using a single static model—or even a simple ensemble—is inefficient. The challenge is that there are no "labels" telling us which model is best for which molecule. The agent must learn this compatibility autonomously through trial and error, but rewards in chemistry are "sparse and delayed"—you only know if a plan worked at the very end of a multi-step route.
Methodology: A Scaffold-Aware POMDP
The authors reframed retrosynthesis planning as a Partially Observable Markov Decision Process (POMDP). In this setup, the LLM’s internal context (its KV cache) acts as a "belief state," helping it track which models have worked well for similar structures in the past.
Key innovations include:
- RetrOrchestrator Agent: Built on a 1.5B parameter LLM (Qwen2.5), the agent treats seven different SSR models as tools. At each step, it decides which molecule to expand, which tool to use, and how many predictions to request.
- SA-GRPO (Scaffold-aware Group-Relative Policy Optimization): To solve the sparse reward problem, the researchers introduced "scaffold-aware" clustering. Instead of needing an exact molecule match to assign credit (which is rare), they group molecules by their Bemis–Murcko scaffolds (their core structural skeletons). This allows the agent to generalize: "This type of structure usually needs this model."
- Two-Stage Curriculum: The agent is first trained on "easy" molecules to learn basic chemical rules, then moves to "hard" molecules to develop high-level strategic planning.
Key Insights and Results
RetrOrchestrator was evaluated on the Retro*-190 benchmark (190 hard-to-synthesize molecules) and out-of-distribution (OOD) subsets from the Protein Data Bank (PDB-120 and PDB-600).
- State-of-the-Art Performance: RetrOrchestrator achieved a 94.21% success rate on Retro*-190. For context, an off-the-shelf LLM gets only 9.47%, and the previous best non-LLM router hit 82.63%.
- The "Orchestra" is Real: 92.49% of successful routes invoked two or more different SSR models. The agent didn't just find one "super-model"; it learned to switch tools as the molecule changed during the synthesis.
- Efficiency: It reached the Pareto frontier for both wall-clock time and model-query count. It solves targets using about 10 SSR calls on average—roughly half of what some specialized graph-based models require.
- Robustness: On the OOD PDB-600 set, it maintained a 68.83% success rate, outperforming the best static baseline by nearly 10%.
- Scaffolds are the Key to Learning: By grouping by scaffold similarity, the researchers reduced the number of "singleton" clusters (where an agent has no neighbors to learn from) from 20% to under 6%. This "densified" the reward signal, making RL stable.
Limitations and Future Work
While highly successful, the agent still struggles with rare motifs (like silyl or organotin) where the underlying SSR tools have poor coverage, as well as complex stereochemistry (3D spatial arrangements). Furthermore, while Pareto-optimal, the LLM still adds some inference latency overhead. The authors suggest that future gains will likely come from optimizing the SSR "tool stack" itself rather than the orchestrator.
Code is available at: https://github.com/ScottLiao920/verl-retro-agent
Summary updated