Reference-guided Policy Optimization for Molecular Optimization via LLM Reasoning
Organizations: Hong Kong Baptist University · CMIC, Shanghai Jiao Tong University · DAMO Academy, Alibaba Group · Hupan Lab
Abstract
Large language models (LLMs) benefit substantially from supervised fine-tuning (SFT) and reinforcement learning with verifiable rewards (RLVR) in reasoning tasks. However, these recipes perform poorly in instruction-based molecular optimization, where each data point typically provides only a single optimized reference molecule and no step-by-step optimization trajectory. We reveal that answer-only SFT on the reference molecules collapses reasoning, and RLVR provides sparse feedback under similarity constraints due to the model's lack of effective exploration, which slows learning and limits optimization. To encourage the exploration of new molecules while balancing the exploitation of the reference molecules, we introduce Reference-guided Policy Optimization (RePO), an optimization approach that learns from reference molecules without requiring trajectory data. At each update, RePO samples candidate molecules with their intermediate reasoning trajectories from the model and trains the model using verifiable rewards that measure property satisfaction under similarity constraints in an RL manner. Meanwhile, it applies reference guidance by keeping the policy's intermediate reasoning trajectory as context and training only the answer in a supervised manner. Together, the RL term promotes exploration, while the guidance term mitigates reward sparsity and stabilizes training by grounding outputs to references when many valid molecular edits exist. Across molecular optimization benchmarks, RePO consistently outperforms SFT and RLVR baselines (e.g., GRPO), achieving improvements on the optimization metric (Success Rate Similarity), improving balance across competing objectives, and generalizing better to unseen instruction styles. Our code is publicly available at https://github.com/tmlr-group/RePO.
Figures & tables
| Task type | Objective | Metric | Base Model | Distill-SFT | SFT | GRPO | GRPO (SFT init) | RePO |
| Structure- based optimization | AddComponent | SR | 0.086 | 0.100 | 0.238 | 0.005 | 0.246 | 0.307 |
| Sim | 0.763 | 0.604 | 0.619 | 0.992 | 0.635 | 0.778 | ||
| SR Sim | 0.066 | 0.060 | 0.147 | 0.005 | 0.156 | 0.239 | ||
| DelComponent | SR | 0.107 | 0.188 | 0.203 | 0.008 | 0.232 | 0.158 | |
| Sim | 0.864 | 0.682 | 0.755 | 0.994 | 0.759 | 0.887 | ||
| SR Sim | 0.092 | 0.128 | 0.153 | 0.008 | 0.176 | 0.140 |
| Task type | Objective | Metric | Base Model | Distill-SFT | SFT | GRPO | GRPO (SFT init) | RePO |
| Seen instruction | BDP | SR | 0.052 | 0.078 | 0.398 | 0.156 | 0.088 | 0.206 |
| Sim | 0.149 | 0.207 | 0.254 | 0.759 | 0.141 | 0.569 | ||
| SR Sim | 0.008 | 0.016 | 0.101 | 0.118 | 0.012 | 0.117 | ||
| BDQ | SR | 0.034 | 0.022 | 0.319 | 0.082 | 0.022 | 0.160 | |
| Sim | 0.117 | 0.106 | 0.279 | 0.479 | 0.045 | 0.365 | ||
| SR Sim | 0.004 | 0.002 | 0.089 | 0.039 | 0.001 | 0.058 |
| Metric | Base Model | SFT | GRPO | GRPO (SFT init) | RePO | |
| LogP | SR | 0.237 | 0.287 | 0.197 | 0.192 | 0.360 |
| Sim | 0.692 | 0.763 | 0.763 | 0.775 | 0.746 | |
| SR Sim | 0.164 | 0.219 | 0.151 | 0.149 | 0.269 | |
| QED | SR | 0.159 | 0.185 | 0.115 | 0.121 | 0.243 |
| Sim | 0.722 | 0.809 | 0.805 | 0.811 | 0.783 | |
| SR Sim | 0.115 | 0.150 | 0.093 | 0.098 | 0.190 |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Category | Reward Shaping | Knowledge-guided Exploration | RePO |
| Guidance Mechanism | Utilizes environmental signals or LLM knowledge to guide the policy model. | Integrates professional tools (e.g., chemistry toolkits ( M. Bran et al., 2024 ) , databases ( Wang et al., 2025a ) ) to inject expert priors into workflows. | Employs demonstration molecules, offering end-to-end supervision that promotes free-form intermediate reasoning. |
| Signal & Supervision | Introduces dense intermediate signals with manually designed heuristics ( Xie et al., 2024 ; Chan et al., 2024 ) . | Injects expert guidance into the agent’s workflow through domain-specific signals. | Avoids intermediate rewards, eliminating the need for manually designed heuristics. |
| Application Domain | Commonly used in settings with sparse rewards, such as robotics and games. | Focused on solving domain-specific problems by leveraging external expert sources with tool integration. | Designed for enhancing reasoning performance in chemical tasks by narrowing the search space. |
| Overall Role | Complements demonstration guidance by providing additional intermediate cues. | Serves as an additional strategy that can work in tandem with demonstration guidance, offering expert insights. | Acts as a complementary strategy by directly guiding LLM reasoning with demonstrative examples. |
| Models | LogP | MR | QED | ||||||
| SR | Sim. | SR Sim. | SR | Sim. | SR Sim. | SR | Sim. | SR Sim. | |
| Graph GA | 0.509 | 0.125 | 0.064 | 0.509 | 0.122 | 0.062 | 0.493 | 0.140 | 0.064 |
| REINVENT | 0.465 | 0.125 | 0.058 | 0.595 | 0.116 | 0.069 | 0.558 | 0.115 | 0.058 |
| MOLLEO | 0.510 | 0.103 | 0.053 | 0.509 | 0.127 | 0.065 | 0.496 | 0.122 | 0.061 |
| GPT-4o-mini | 0.499 | 0.706 | 0.352 | 0.409 | 0.771 | 0.315 | 0.231 | 0.752 | 0.174 |
| Mol-T5-large | 0.424 | 0.102 | 0.043 | 0.450 | 0.107 | 0.048 | 0.465 | 0.119 | 0.055 |
| Objective | Baseline | 40% demo guidance | RePO |
| QED | 0.130 | 0.215 | 0.236 |
| LogP | 0.168 | 0.312 | 0.297 |
| MR | 0.173 | 0.297 | 0.294 |
| A conversation between User and Assistant. The user asks a question, and the Assistant solves it. |
| The assistant first thinks about the reasoning process in the mind and then provides the user |
| with the answer. The reasoning process and answer are enclosed within <think> and </think> |
| <answer> </answer> tags, respectively, i.e., <think> reasoning process here </think> |
| <answer> answer here </answer> . User: Task . Assistant: |
| Objective | Metric | Baseline | Distill-SFT | SFT | GRPO | GRPO (SFT init) | RePO |
| LogP | SR | ||||||
| Sim | |||||||
| SR Sim | 0.169 | 0.136 | 0.226 | 0.146 | 0.164 | 0.280 | |
| QED | SR | ||||||
| Sim | |||||||
| SR Sim | 0.131 | 0.129 | 0.222 | 0.079 | 0.151 | 0.210 |
| Task type | Objective ( ) | BioT5-base | MolT5-large | Baseline | SFT | GRPO | GRPO (SFT init) | RePO |
| Structure- based optimization | AddComponent | 0.054 | 0.031 | 0.065 | 0.147 | 0.005 | 0.156 | 0.239 |
| DelComponent | 0.027 | 0.027 | 0.092 | 0.154 | 0.008 | 0.176 | 0.140 | |
| SubComponent | 0.011 | 0.016 | 0.047 | 0.264 | 0.052 | 0.300 | 0.344 | |
| Property optimization | QED | 0.080 | 0.055 | 0.130 | 0.207 | 0.123 | 0.193 | 0.236 |
| LogP | 0.079 | 0.043 | 0.168 | 0.206 | 0.305 | 0.183 | 0.297 | |
| MR | 0.081 | 0.048 | 0.173 | 0.238 | 0.188 | 0.225 | 0.294 |
Molecular Optimization
Molecular optimization computationally designs or edits chemical structures to improve desired properties while respecting chemical and practical constraints.
See all 103 papers