MolEditRL: Structure-Preserving Molecular Editing via Discrete Diffusion and Reinforcement Learning

Yuanxin Zhuang, Dazhong Shen, Ying Sun

TL;DR

MolEditRL is a novel two-stage framework that treats molecular editing as a discrete graph-to-graph transformation rather than a text-translation task. By combining discrete graph diffusion with reinforcement learning, it achieves a staggering 74% improvement in editing success rate over state-of-the-art models while using 98% fewer parameters.

The Challenge of Molecular Editing

In drug discovery, "molecular editing" is the art of tweaking a molecule to improve specific properties—like solubility or binding affinity—without destroying its core structure, known as the scaffold.

Most current AI approaches treat this like a language translation problem, using SMILES strings (text representations of molecules). However, SMILES are brittle; a single character change can represent a massive, unpredictable leap in chemical space. Other methods use continuous latent spaces that often "blur" the discrete nature of atoms and bonds. The result is a lack of structural fidelity: models often fail to preserve the scaffold or generate chemically nonsensical structures. MolEditRL aims to bridge this gap by operating directly on the molecular graph.

Methods: The MolEditRL Framework

The authors propose a two-stage approach centered on a Structure-Preserving Editing Network.

MolEditRL Framework Overview
  1. Discrete Graph Diffusion (Pretraining): Instead of predicting a molecule in one go, the model learns to "denoise" a corrupted molecular graph. During pretraining, target molecules are gradually masked (atoms and bonds hidden), and the model learns to reconstruct them conditioned on both the source molecule and a natural language instruction (e.g., "Increase the solubility of this molecule").
  2. Editing-Aware Reinforcement Learning (Fine-tuning): To ensure the model actually hits the desired property targets, it undergoes RL fine-tuning. It receives rewards based on property oracles (like RDKit). Crucially, they use a KL-regularized objective, which prevents the model from "drifting" too far from the structural priors learned during the diffusion stage.

Technical Highlight: The architecture uses a "Structure-Aware Attention" mechanism. It injects the molecule's adjacency matrix (its connectivity) directly into the transformer's attention layers as a bias. This forces the model to respect the existing chemical topology while it decides which parts to edit.

Datasets

The researchers introduced MolEdit-Instruct, the largest and most diverse molecular editing dataset to date.

  • Scale: 3 million molecular pairs.
  • Diversity: Covers 10 chemical attributes (e.g., biological activity, molecular weight, synthetic accessibility).
  • Tasks: Includes both single-property and complex multi-property editing scenarios.
  • Comparison: They also evaluated on the existing C-MuMOInstruct benchmark to prove generalizability.

Key Insights

  • Graphs > Strings: The most significant insight is that respecting the discrete, graph-structured nature of molecules is more important than model scale. By using a graph-native approach, a 126M parameter model outperformed 7B+ parameter "Large Language Models" adapted for chemistry.
  • Structural Inductive Bias: Injecting bond-level connectivity into the attention mechanism acts as a powerful constraint, ensuring that the model doesn't "break" the molecule while trying to optimize a property.
  • Zero-Shot Property Generalization: The model can be fine-tuned via RL to optimize properties it never saw during pretraining (like hERG or BBBP) simply by using a reward oracle. It doesn't need new paired "before and after" data for every new property.

Key Results

MolEditRL sets a new standard for both performance and efficiency in molecular editing.

Performance vs. Parameter Size
  • Performance: MolEditRL achieved a 74% improvement in editing success rate over leading baselines like DrugAssist and BioT5.
  • Realism: It achieved the lowest Fréchet ChemNet Distance (FCD), indicating that its generated molecules are much closer to the distribution of real-world drugs than competing models.
  • Efficiency: It achieves state-of-the-art results with only 126 million parameters—roughly 1/50th the size of the Llama-based models it beats.
  • Multi-Property Mastery: In the most difficult "3-property" editing tasks, MolEditRL's accuracy (0.363) was more than double the next best baseline (0.165).

Limitations and Future Work

  • Oracle Dependency: The RL stage relies on predictive models (oracles). If a property is extremely rare or lacks a reliable simulator, the model's performance is capped by the quality of that feedback.
  • Contradictory Instructions: The model currently struggles if a user provides logically impossible instructions (e.g., asking to simultaneously increase and decrease the same property).
  • Future Directions: The authors plan to explore interactive, dialogue-based editing, where a chemist can iteratively refine a molecule through a conversation with the AI. They also aim to scale the framework to larger biomolecules like proteins.

Summary updated

BibTeX
@inproceedings{zhuang2026moleditrl,
  author = {Yuanxin Zhuang and Dazhong Shen and Ying Sun},
  title = {{MolEditRL: Structure-Preserving Molecular Editing via Discrete Diffusion and Reinforcement Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=40QphlZ9fY},
}
Figure