MolHop: Scaffold-Hopping Molecular Design with Agentic Reinforcement Learning
Organizations: State Key Laboratory of Physical Chemistry of Solid Surface, College of Chemistry and Chemical Engineering, Xiamen University, Xiamen, China · Shanghai Artificial Intelligence Laboratory, Shanghai, China · Institute of Artificial Intelligence, Xiamen University, Xiamen, China · Laboratory of AI for Electrochemistry (AI4EC), Tan Kah Kee Innovation Laboratory (IKKEM), Xiamen, China
Abstract
Molecular design is often formulated as an optimization problem over existing molecular spaces. However, molecular optimization and the discovery of structurally distinct replacement molecules represent two fundamentally different search problems. LLM-based molecular design agents typically perform the former, conducting local refinement within the neighborhood of existing structures to improve target properties through structural modifications. In contrast, the latter requires exploration of a broader chemical space to discover molecules with entirely different scaffolds while preserving the functional characteristics of reference molecules. We propose MolHop, an agentic framework for cross-scaffold molecular discovery that enables models to navigate and edit within a pre-organized chemical space. MolHop organizes approximately 1.6 million molecular scaffolds from commercial molecules into a coarse-to-fine hierarchical action space. The agent selects new exploration regions through scaffold navigation actions and adjusts candidate properties through molecular editing. The framework maintains historical trajectory memory to support long-horizon search processes. On drug molecule and commercial compound tasks, connecting Grok-4.6 and DeepSeek-Flash-V4.1 to the MolHop framework substantially improves their cross-scaffold joint success rates. We develop MolHop-9B through agentic reinforcement learning, and MolHop-9B outperforms generative baselines including GPT-5.6-sol, Claude-5-Opus, and Gemini-3.1-Pro, while generating candidate molecules with larger scaffold differences from the reference molecules. These results demonstrate that effective molecular discovery beyond the traditional optimization paradigm requires structured chemical and action spaces, enabling agents to explore new structural regions rather than merely refine existing molecules.
Figures & tables
| Dataset | Model | Method | Joint@H1 | Tanimoto median | MCS median |
|---|---|---|---|---|---|
| Drug | Grok | Baseline | 41.0% | 0.292 | 0.913 |
| With harness | 64.0% | 0.141 | 0.684 | ||
| DeepSeek | Baseline | 15.5% | 0.381 | 0.966 | |
| With harness | 52.5% | 0.133 | 0.700 | ||
| Commercial | Grok | Baseline | 36.5% | 0.317 | 0.833 |
| With harness | 69.0% | 0.145 | 0.600 |
| Model | VER | BOR | EFER | Eff. | ITI |
|---|---|---|---|---|---|
| 2B Base | 21.80% | 71.80% | 0.20% | 1490.9 | 29.50% |
| 2B SFT | 91.10% | 8.10% | 2.20% | 441.8 | 0.60% |
| 4B Base | 18.10% | 81.70% | 3.70% | 218.2 | 3.30% |
| 4B SFT | 97.80% | 2.20% | 19.40% | 125.1 | 0.40% |
| 9B Base | 4.60% | 95.40% | 13.70% | 174.2 | 0.90% |
| 9B SFT | 97.80% | 2.00% | 19.70% | 118.9 | 0.20% |
Appendix figures & tables22 assets
Supplementary material from the paper’s appendix.
Appendix
| Level | Retained structural information | Abstraction rule | Number of nodes |
|---|---|---|---|
| H1 | Ring-count category | Record the number of ring nodes generated by the approximate smallest-ring representation | 14 |
| H2 | Connectivity topology between rings | Represent each ring as a node, retain connections between rings, and remove connection types | 498 |
| H3 | Ring topology with connection types | Distinguish connection types between rings on the basis of H2 | 1,451 |
| H4 | Minimal scaffold topology | Generalize atoms and bonds and reduce degree-2 nodes while retaining minimal ring structures | 14,378 |
| H5 | Ring sizes and reduced connecting chains | Retain topology within rings and compress non-ring connecting chains of degree-2 nodes | 153,699 |
| H6 | Complete connectivity graph of a generalized scaffold | Remove atom and bond types while retaining connectivity and connecting-chain lengths | 412,853 |
| Action group | Action | Description |
|---|---|---|
| Scaffold navigation | nav_where | Query the position of the current molecule in H1-H7 space and the scope available for exploration |
| Scaffold navigation | nav_list | List categories, subregions, and specific scaffolds at a specified level or within a candidate set |
| Scaffold navigation | nav_filter | Apply combined structural constraints to H7 leaf nodes and return a candidate set |
| Scaffold navigation | nav_pick | Select a scaffold from previously returned candidates and load it as a new starting point for molecular editing |
| Molecular inspection | mol_show | Enumerate editable sites for a specified action category, with all mode returning only the number of sites in each category |
| Molecular inspection | mol_site | Obtain permitted actions based on site identifiers returned by mol_show , and obtain the action and fragment identifiers allowed at that site |
| Object | Action | Description |
|---|---|---|
| Fragment | add_fragment | Add a fragment at a permitted attachment site |
| Fragment | delete_fragment | Delete a fragment whose removal is permitted |
| Fragment | replace_fragment | Replace the current fragment with another fragment |
| Fragment | fragment_swap | Replace a degree-2 atom whose two adjacent bonds are both non-ring bonds with a structural fragment having two attachment points to alter the connecting chain |
| Atoms and bonds | mutate_atom | Modify the atom type at a permitted site |
| Atoms and bonds | change_bond | Modify a permitted bond type or bond order |
| Content | Recorded information | Role in search |
|---|---|---|
| Reference target | Starting molecule, five target properties, and initial SA score | Keep the optimization target fixed across multi-turn interactions |
| Current property feedback | Signed differences for each property, absolute relative deviations, match distance, normalized SA score, total cost, and the property with the largest deviation | Indicate which properties should be prioritized for adjustment in the next step and compare different candidates |
| Evaluation status | Current scaffold load identifier, molecular revision identifier, evaluated structure, and gap_is_current | Distinguish feedback on the current candidate from feedback on historical structures |
| Best historical record | Lowest cost observed so far, corresponding SMILES, step identifier, and revision identifier | Retain a search reference for review, which is not equivalent to the best candidate already satisfying joint |
| Scaffold visitation trajectory | Visited scaffold categories, abstraction levels, entry sources, and corresponding scaffolds | Record search transitions between different structural regions |
| Within-category editing trajectory | Revision identifiers, action summaries, property gaps, undo flags, and restoration targets | Associate local structural changes with property feedback |
| Data use | ChEMBL | Enamine | Total size | Data split |
|---|---|---|---|---|
| Drug test set | 200 | 0 | 200 | Scaffold deduplication, ring-count stratification, and diversity selection |
| Commercial test set | 0 | 200 | 200 | Scaffold deduplication, ring-count stratification, and diversity selection |
| SFT starting points | 500 | 1,500 | 2,000 | Stratified sampling, 1,800 train / 200 validation |
| RL starting points | 750 | 4,250 | 5,000 | Supplement with the remaining eligible samples, 4,872 train / 128 validation |
| Setting | Configuration |
|---|---|
| Number of training and validation trajectories | 1,800 and 200 |
| Fine-tuning method | Full-parameter fine-tuning, bf16, FSDP |
| Training epochs | 3 epochs, 675 optimization steps in total |
| Global batch size | 8 |
| Maximum sequence length | 16,384 tokens |
| Optimizer | AdamW |
| Setting | Configuration |
|---|---|
| Number of training and validation starting points | 4,872 and 128 |
| Starting points per batch | 16 |
| Rollouts per starting point | 4 |
| Maximum assistant turns per episode | 50 |
| Training sampling temperature and top-p | 1.0 and 1.0 |
| Validation sampling temperature | 0 |
| joint | Valid | md<1 | SA | H1 | Valid md SA | |
|---|---|---|---|---|---|---|
| Grok | 82 | 170 | 148 | 144 | 103 | 123 |
| Grok + harness | 128 | 200 | 181 | 146 | 190 | 134 |
| DeepSeek | 31 | 187 | 107 | 142 | 87 | 70 |
| DeepSeek + harness | 105 | 200 | 183 | 123 | 192 | 111 |
| joint | Valid | md<1 | SA | H1 | Valid md SA | |
|---|---|---|---|---|---|---|
| Grok | 73 | 166 | 145 | 137 | 86 | 119 |
| Grok + harness | 138 | 200 | 186 | 149 | 195 | 140 |
| DeepSeek | 35 | 186 | 128 | 134 | 82 | 85 |
| DeepSeek + harness | 121 | 200 | 190 | 136 | 188 | 129 |
| joint | Valid | md<1 | SA | H1 | Valid md SA | |
|---|---|---|---|---|---|---|
| MolHop-2B | 57 | 200 | 88 | 134 | 199 | 57 |
| MolHop-4B | 96 | 200 | 137 | 139 | 197 | 97 |
| MolHop-9B | 111 | 200 | 142 | 157 | 195 | 111 |
| Gemini-3.1-Pro | 87 | 199 | 186 | 154 | 109 | 144 |
| GPT-5.6-sol | 99 | 196 | 166 | 168 | 132 | 141 |
| Claude-5-Opus | 107 | 192 | 162 | 173 | 132 | 150 |
| joint | Valid | md<1 | SA | H1 | Valid md SA | |
|---|---|---|---|---|---|---|
| MolHop-2B | 67 | 200 | 100 | 136 | 200 | 67 |
| MolHop-4B | 105 | 200 | 144 | 137 | 197 | 105 |
| MolHop-9B | 147 | 200 | 165 | 170 | 200 | 147 |
| Gemini-3.1-Pro | 94 | 197 | 190 | 165 | 105 | 159 |
| GPT-5.6-sol | 123 | 199 | 180 | 182 | 143 | 163 |
| Claude-5-Opus | 108 | 195 | 159 | 189 | 132 | 154 |
| Drug molecules | Commercial molecules | |||||
|---|---|---|---|---|---|---|
| Model | TESR a | Efficiency | Avg Turns | TESR a | Efficiency | Avg Turns |
| MolHop-9B | 86.2% | 28.0 | 15.6 | 87.8% | 20.0 | 14.7 |
| MolHop-4B | 74.2% | 58.2 | 27.9 | 72.8% | 55.9 | 27.9 |
| MolHop-2B | 79.7% | 25.7 | 7.3 | 80.8% | 21.1 | 7.1 |
| DeepSeek-Flash-V4.1 | 94.0% | 90.1 | 45.9 | 94.3% | 79.5 | 46.6 |
| Grok-4.6 | 78.4% | 76.0 | 48.6 | 78.3% | 70.0 | 48.4 |
| Property | p25 | p75 |
|---|---|---|
| logP | 1.50 | 3.26 |
| TPSA | 52.83 | 84.50 |
| MW | 274.32 | 361.43 |
| LabuteASA | 116.73 | 153.55 |
| MolMR | 75.13 | 100.20 |
| Method | joint@H1 | md<1 | Mean md |
|---|---|---|---|
| Scaffold library upper bound | 0.0% (0/83) | 0.0% (0/83) | 2.376 |
| DeepSeek + harness | 43.4% (36/83) | 90.4% (75/83) | 0.542 |