RetroInText: A Multimodal Large Language Model Enhanced Framework for Retrosynthetic Planning via In-Context Representation Learning

Chenglong Kang, Xiaoyi Liu, Fei GuoICLR 2025

Executive Summary

RetroInText is a novel multimodal framework that significantly improves retrosynthetic planning by treating chemical synthesis as a "context-aware" problem. By combining 3D molecular geometry with natural language descriptions generated by Large Language Models (LLMs) like ChatGPT, it achieves up to a 5% boost in accuracy over state-of-the-art methods. This improvement is particularly pronounced for complex, multi-step synthesis routes.

The Challenge of Retrosynthetic Planning

Retrosynthesis—the process of working backward from a target molecule to find simpler starting materials—is a cornerstone of drug discovery and organic chemistry. However, it is computationally "explosive" because a single molecule can have thousands of potential precursors.

Current machine learning models face three major hurdles in this domain:

  1. Isolation: They often predict single steps in a vacuum, ignoring the broader context of the entire synthetic route.
  2. Flat Representations: Most models rely on 1D strings (SMILES) or 2D graphs, missing the critical 3D spatial information that dictates how molecules actually interact in physical space.
  3. Data Scarcity: High-quality, annotated data for multi-step pathways is rare and expensive to produce.

The authors of RetroInText argue that chemical synthesis is more like a narrative than a simple calculation; the "story" of how you arrived at an intermediate molecule should inform where you go next.

The RetroInText Methodology

RetroInText uses a multimodal approach to capture the "full picture" of a chemical reaction. The framework consists of several key components designed to fuse different types of chemical data:

  • Multimodal Encoding: The model processes a molecule through three lenses simultaneously: 2D molecular graphs, 3D geometry (using the 3DInfomax encoder), and textual descriptions.
  • LLM-Generated Context: The researchers use ChatGPT to generate natural language descriptions of reaction procedures and structural features. These descriptions act as "in-context" information that guides the model's predictions.
  • Attention-Based Fusion: A specialized module uses an attention mechanism to fuse these diverse data types. It treats the text as a "query" to extract relevant features from the molecular embeddings.
  • Fine-Tuned MolT5: For the actual prediction of reactants, the team fine-tunes MolT5, a large language model specifically pre-trained on chemical data, treating retrosynthesis as a translation task (Product SMILES $\rightarrow$ Reactant SMILES).
  • Hybrid Scoring: To pick the best path, the model uses a combination of synthetic complexity (ScScore), reaction costs, and a novel "captioning score" that measures how well a candidate reactant fits the textual context of the route.
The RetroInText framework overview, showing how molecular data and LLM text are fused to predict reactants.

Datasets and Evaluation

The model was evaluated on RetroBench, a comprehensive dataset derived from the USPTO (U.S. Patent and Trademark Office) reaction database.

  • Scale: It includes pathways for 128,469 molecules.
  • Complexity: The dataset categorizes molecules by "depth" (the number of steps in their synthesis route), ranging from 2 to 13 steps. As depth increases, the available training data drops sharply, making long-route prediction exceptionally difficult.
Statistics of the RetroBench dataset across various synthesis depths.

Key Insights and Results

RetroInText establishes a new state-of-the-art (SOTA) for template-free retrosynthesis through several key breakthroughs:

  • Chemistry has a "Language": The most striking finding is that natural language descriptions of molecules provide critical "semantic" cues that 2D graphs miss.
  • Context Prevents Drift: By incorporating information from previous steps in a route, RetroInText avoids the "compounding error" problem where a small mistake in step one leads to a completely unfeasible step five.
  • 3D Matters: Integrating 3D conformational data significantly improved performance over models that only looked at 1D or 2D data, confirming that spatial arrangement is vital for predicting chemical reactivity.
  • Accuracy Boost: The framework achieved a 41.2% Top-1 accuracy on RetroBench, outperforming existing models like FusionRetro by roughly 1.8% to 5% depending on the search algorithm used.
  • Robustness in Depth: While most models' performance craters as synthesis routes get longer (depth > 4), RetroInText maintained a much more stable accuracy curve, proving its effectiveness for complex organic synthesis.
  • Ablation Success: Removing the textual component dropped the Top-1 accuracy from 41.2% to 40.2%, proving that the LLM's "context" is a statistically significant contributor to the model's success.

Limitations and Future Work

Despite its success, RetroInText has a few areas for improvement. The framework currently relies on external LLM APIs (like ChatGPT), which can introduce latency and cost issues. Additionally, while the prompts are effective, they are currently static. The authors suggest that an end-to-end question-answering model could make the system more dynamic.

Finally, fusing 3D geometry, graphs, and text is more computationally intensive than simpler sequence-to-sequence models. Moving forward, the team plans to evolve this into a fully autonomous "chemistry assistant" that can not only plan routes but explain the underlying chemical logic through a unified question-answering interface.

Summary updated

BibTeX
@inproceedings{kang2025retrointext,
  author = {Chenglong Kang and Xiaoyi Liu and Fei Guo},
  title = {{RetroInText: A Multimodal Large Language Model Enhanced Framework for Retrosynthetic Planning via In-Context Representation Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=J6e4hurEKd},
}
Figure