Reference-guided Policy Optimization for Molecular Optimization via LLM Reasoning

Xuan Li, Zhanke Zhou, Zongze Li, Jiangchao Yao, Yu Rong, Lu Zhang, Bo Han

In the world of drug discovery and materials science, "molecular optimization" is the ultimate balancing act. You start with a molecule that’s almost perfect and try to tweak its structure to improve a specific property (like solubility or toxicity) without changing it so much that it loses its original identity.

While Large Language Models (LLMs) have become surprisingly good at reasoning through math and code, they often stumble in the lab. A new paper from researchers at Hong Kong Baptist University and Alibaba Group, titled "Reference-guided Policy Optimization for Molecular Optimization via LLM Reasoning," introduces a novel framework called RePO to fix this.

TL;DR

RePO (Reference-guided Policy Optimization) is a new training approach that allows LLMs to perform chemically sound, multi-step reasoning for molecular design. By combining reinforcement learning exploration with a clever "reference guidance" term, RePO outperforms standard fine-tuning and RL baselines, achieving a better balance between improving molecular properties and maintaining structural similarity.

What Problem Does This Paper Address?

The authors identify a "supervision mismatch" in how we currently train LLMs for scientific tasks.

Typically, we have two ways to train these models:

  1. Supervised Fine-Tuning (SFT): We show the model a starting molecule and the "correct" optimized version. Because the dataset doesn't include the intermediate "thinking" steps, the model learns to jump straight to the answer, effectively "collapsing" its reasoning capabilities.
  2. Reinforcement Learning with Verifiable Rewards (RLVR): We let the model explore and reward it when it finds a better molecule. However, in molecular optimization, the rewards are incredibly sparse. It is very hard for a model to randomly stumble upon a molecule that is both significantly better and structurally similar to the original. This leads to "conservative" models that barely change the input at all.

The challenge is: How do we encourage the model to explore the vast chemical space while still using the high-quality "gold standard" reference molecules we already have in our datasets?

Methods

The researchers introduce RePO, which treats the reference molecule not as a target to be blindly imitated, but as an answer-level anchor.

RePO Framework

The RePO Objective

RePO updates the model using three distinct terms:

  1. The Exploration Term (RLVR): Based on the GRPO (Group Relative Policy Optimization) algorithm, this term rewards the model for generating molecules that satisfy the property constraints (e.g., "increase LogP") and the similarity constraints.
  2. The Reference Guidance Term: This is the "secret sauce." Instead of forcing the model to follow a specific reasoning path, RePO lets the model generate its own reasoning trajectory. It then applies a supervised loss to the final answer (the molecule), conditioned on the model's own reasoning.
  3. Gradient Masking: To prevent the reference guidance from "polluting" the reasoning process, the authors use gradient masking. The supervised loss only updates the weights for the answer tokens, while the RL term handles the reasoning tokens. This ensures the reasoning remains "deliberative" rather than just a memorized preamble.

Datasets

The authors evaluated RePO on two major instruction-based benchmarks:

  • TOMG-Bench: Focuses on structure-based (e.g., adding/deleting components) and single-property optimization (QED, LogP, Molar Refractivity).
  • MuMOInstruct: A more complex benchmark for multi-objective optimization, requiring the model to balance several competing pharmaceutical properties simultaneously. It also includes "unseen" instruction styles to test generalization.

Key Insights and Ideas

  • Reasoning Collapse is Real: The paper demonstrates that answer-only SFT actually hurts the model's ability to explore. Once a model is trained to "jump to the answer," it's very difficult for subsequent RL to restore its reasoning depth.
  • Anchoring vs. Imitation: RePO shows that you don't need to provide "gold" reasoning trajectories. By anchoring the answer to a reference while letting the reasoning be shaped by RL, the model learns to connect chemical principles to valid structural edits.
  • Chemical Soundness: Qualitative analysis showed that RePO's reasoning actually makes sense to chemists (e.g., identifying that substituting a Bromine atom with Chlorine can reduce steric hindrance), whereas standard RL often produces "hallucinated" or chemically invalid explanations.

Key Results

RePO consistently outperformed SFT and GRPO across the board:

Success Rate Comparison
  • Optimization Success: On TOMG-Bench, RePO achieved the highest Success Rate $\times$ Similarity score in 4 out of 6 tasks, showing a 17.4% improvement in success rate over GRPO in some cases.
  • Multi-Objective Balance: In the MuMOInstruct tasks, RePO was significantly better at balancing competing goals (like increasing permeability while decreasing toxicity) compared to baselines that tended to sacrifice one for the other.
  • Generalization: RePO maintained its performance advantage even when faced with instruction styles it hadn't seen during training.
  • Scaling: The model's performance improved significantly with "inference-time compute"—meaning if you let the model sample multiple candidates and pick the best one (best-of-k), RePO's "best" was much better than the baselines.

Limitations and Future Work

While RePO is a significant step forward, the authors note a few areas for growth:

  • Dependency on References: The framework still relies on having at least one reference molecule per task. For entirely "de novo" design where no reference exists, the guidance term wouldn't apply.
  • Black-Box Reasoning: While the reasoning is more chemically sound, LLMs are still black boxes. Fully verifying the "logic" of a molecular edit remains a challenge for domain experts.
  • Future Directions: The authors suggest applying RePO to even more complex tasks like Retrosynthesis Planning (predicting the steps to build a molecule) and Drug-Drug Interaction Prediction.

For those interested in the implementation, the code is publicly available at github.com/tmlr-group/RePO.

Summary updated

BibTeX
@inproceedings{li2026reference,
  author = {Xuan Li and Zhanke Zhou and Zongze Li and Jiangchao Yao and Yu Rong and Lu Zhang and Bo Han},
  title = {{Reference-guided Policy Optimization for Molecular Optimization via LLM Reasoning}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=m4nvqQkm4X},
}
Figure