FORGE: Fragment-Oriented Ranking and Generation for Context-Aware Molecular Optimization

Qingchuan Zhang, He Cao, Hao Li, Yanjun Shao, Zhiyuan Liu, Shihang Wang, Shufang Xie, Shenghua Gao, Xinwu Ye

TL;DR

FORGE (Fragment-Oriented Ranking and Generation) moves away from treating molecular optimization as a "text-to-SMILES" translation task, instead reformulating it as a two-stage local editing process. By focusing on where to edit and how to replace specific fragments, this compact 0.6B parameter model outperforms 8B reasoning models and specialized graph methods across major drug discovery benchmarks.

What Problem Does This Paper Address?

In drug discovery, "molecular optimization" is the process of taking a "lead" compound—a molecule that shows promise—and making small structural tweaks to improve its properties (like solubility or binding affinity) while keeping its core structure intact.

Recently, researchers have used Large Language Models (LLMs) to do this by prompting them: "Improve the solubility of [SMILES string]." However, the authors identify three major flaws in this approach:

  1. Semantic Mismatch: Natural language is a poor proxy for complex chemical oracles (like a proprietary binding score). LLMs often ignore the prompt text and rely on internal biases.
  2. Chemical Hallucinations: Standard tokenization (BPE) often breaks chemical sub-structures in ways that lead to invalid molecules.
  3. Context Blindness: A specific chemical fragment (like a methyl group) might improve a property in one molecule but ruin it in another. Most models treat fragment effects as global constants rather than context-dependent variables.

Methods

The authors introduce FORGE, a framework built on a 0.6B Qwen3 backbone that treats optimization as context-aware local editing. It operates in two supervised stages:

  • Stage 1: Ranking (Where to edit?): The model learns to look at a full molecule and rank its fragments by their contribution to a target property. It identifies "vulnerable" areas that are dragging down the molecule's score.
  • Stage 2: Generation (How to edit?): The model proposes explicit fragment replacements (e.g., "Replace Fragment A with Fragment B").

Key Innovations: * Atom-level Retokenization: Instead of standard subword tokens, FORGE uses a regex-based atomic parser. This ensures that a "benzene ring" is always represented consistently, preventing the model from getting "confused" by different string contexts. * SME+ Data Mining: Rather than using expensive human labels or error-prone LLM-distilled data, the authors automatically mined millions of "low-to-high" edit pairs from the ChEMBL database and rule-based property predictors. * In-Context Learning (ICL) for Black Boxes: To adapt to new, unnamed properties at test time, FORGE uses a "replay buffer." It looks at previous successful edits it has made during the search and uses them as few-shot demonstrations to guide its next move.

Datasets

The model was trained on a mixture of ~2M examples derived from:

  • ZINC: Used for rule-based property attribution (QED, LogP, etc.).
  • ChEMBL: Used for Matched Molecular Pairs (MMPs) and real-world bioactivity data.
  • Mol-Instructions: To maintain general chemical reasoning.

Evaluation was performed on five major benchmarks: Prompt-MolOpt, PMO-1k (22 black-box tasks), ChemCoTBench, QED-DRD2, and Lead Optimization (real-target docking).

Key Insights and Ideas

  • The "Where" is as important as the "How": Ablation studies showed that Stage 1 (ranking) is critical for performance. Simply knowing which part of a molecule is the "weakest link" significantly narrows the search space for the generative stage.
  • Context is King: The authors proved that fragment utility depends heavily on the local environment. By grouping fragments by their ECFP (Extended-Connectivity Fingerprints) neighborhoods, they reduced attribution variance by 8–11%.
  • Prompts are Weak, Feedback is Strong: In a striking experiment, the authors showed that replacing a specific property prompt with "optimize unknown property" barely changed the performance of standard LLMs. FORGE circumvents this by deriving its "semantics" from actual oracle feedback and demonstrations rather than the text of the prompt.

Key Results

  • Efficiency: Despite having only 0.6B parameters, FORGE matched or outperformed Qwen-8B and GPT-4o on ChemCoTBench, particularly on real-target tasks like DRD2 and JNK3.
  • Similarity Constraints: On the Prompt-MolOpt benchmark, FORGE's advantage grew as the similarity constraints became stricter. At a Tanimoto similarity of 0.6, it achieved a score of 2.882, nearly triple the performance of the previous state-of-the-art (0.824).
  • Sample Efficiency: In the PMO-1k benchmark (limited to 1,000 oracle calls), FORGE reached an aggregate score of 12.42, outperforming the previous leader, LICO (11.71).

Limitations and Future Work

  • Synthesizability: While the model uses real-world fragments, it doesn't explicitly check if a proposed edit is chemically "easy" to synthesize in a lab. Some outputs had high Synthetic Accessibility (SA) scores, indicating they might be difficult to make.
  • Model Capacity: The 0.6B model lacks "broad memorization" of specific named drugs. The authors suggest that scaling the FORGE pipeline to a larger backbone (like a 7B or 14B model) could solve this.
  • Future Directions: The authors propose integrating a retrosynthesis filter into the inference loop and applying the fragment-replacement format to reaction prediction tasks.

Summary updated

BibTeX
@inproceedings{zhang2026forge,
  author = {Qingchuan Zhang and He CAO and Hao Li and Yanjun Shao and Zhiyuan Liu and Shihang Wang and Shufang Xie and Shenghua Gao and Xinwu Ye},
  title = {{FORGE: Fragment-Oriented Ranking and Generation for Context-Aware Molecular Optimization}},
  booktitle = {GenBio @ ICML},
  year = {2026},
  url = {https://openreview.net/forum?id=7XVxKLbVrj},
}
Figure