Guiding Diffusion Models with Reinforcement Learning for Stable Molecule Generation

Zhijian Zhou, Junyi An, Zongkai Liu, Yunfei Shi, Xuan Zhang, Fenglei Cao, Chao Qu, Yuan Qi · OpenReview

Abstract

Generating physically realistic 3D molecular structures remains a core challenge in molecular generative modeling. While diffusion models equipped with equivariant neural networks have made progress in capturing molecular geometries, they often struggle to produce equilibrium structures that adhere to physical principles such as force field consistency. To bridge this gap, we propose Reinforcement Learning with Physical Feedback (RLPF), a novel framework that extends Denoising Diffusion Policy Optimization to 3D molecular generation. RLPF formulates the task as a Markov decision process and applies proximal policy optimization to fine-tune equivariant diffusion models. Crucially, RLPF introduces reward functions derived from force-field evaluations, providing direct physical feedback to guide the generation toward energetically stable and physically meaningful structures. Experiments on the QM9 and GEOM-drug datasets demonstrate that RLPF significantly improves molecular stability compared to existing methods. These results highlight the value of incorporating physics-based feedback into generative modeling.

Introduction

In the field of drug discovery and materials science, the ability to generate 3D molecular structures is critical. Recent advancements have centered on Equivariant Diffusion Models (EDMs), which are designed to respect the fundamental symmetries of 3D space, such as rotation and translation. While these models excel at capturing the statistical distributions of training data, they frequently fail to account for the underlying physical laws that govern molecular stability.

Generated molecules often exhibit "strain," meaning they are not in an energetically stable equilibrium state. In practical terms, if these structures were subjected to physical simulations, the atoms would likely disperse because the model lacked an understanding of force field consistency. This gap between statistical imitation and physical reality necessitates extensive post-processing, which is computationally expensive and limits the utility of AI-generated molecules in downstream applications like molecular docking.

The RLPF Framework

The researchers introduce Reinforcement Learning with Physical Feedback (RLPF) to address these limitations. RLPF reinterprets the diffusion model's denoising process as a Markov Decision Process (MDP). In this framework, each step the model takes to remove noise from a structure is treated as an action taken by a policy.

The RLPF pipeline: from sample trajectories to physical reward calculation and parameter updates.

As shown in the figure above, the process involves three primary stages:

  1. Sample Trajectories: The model generates molecular structures through a series of denoising steps.
  2. Calculate Rewards: Instead of relying solely on static data, the generated molecules are evaluated by a "physical judge." The reward is derived from the Root Mean Square Deviation (RMSD) of atomic forces, calculated using force fields like GFN2-xTB or Density Functional Theory (DFT). Low atomic forces indicate a stable, relaxed structure, resulting in a higher reward.
  3. Fine-tune with RL: The model is optimized using Proximal Policy Optimization (PPO). This allows the model to learn the energy landscape of chemistry directly from physical feedback, similar to how RLHF is used to align language models with human preferences.

Experimental Evaluation

The RLPF framework was evaluated on two benchmark datasets:

  • QM9: A standard dataset for small organic molecules (up to 9 heavy atoms), serving as a baseline for molecular AI.
  • GEOM-drug: A more complex dataset featuring larger, drug-like molecules with an average of 44 atoms, testing the model's scalability.

To ensure the model could handle molecules of varying sizes without bias, the authors implemented a Size-Invariant Likelihood masking mechanism. This technical contribution prevents the RL training from favoring specific molecule sizes due to mathematical scaling in the loss function.

Results and Discussion

The application of RLPF yielded substantial improvements in both physical stability and chemical validity across all tested benchmarks. On the QM9 dataset, the percentage of fully stable molecules (where all atoms are in equilibrium) increased from 82.0% in the baseline EDM to 93.37% with RLPF.

Performance metrics on the QM9 dataset. EDM-RLPF (ours) achieves state-of-the-art stability (M) and validity (V).

As detailed in the table above, EDM-RLPF outperformed existing state-of-the-art models like GeoBFN and UniGEM in both molecule stability (M) and chemical validity (V). Beyond accuracy, RLPF also improved inference efficiency. By learning to generate stable structures directly, the model reduced the number of samples required to find 10,000 stable molecules by 44%, effectively doubling the generation speed.

On the more challenging GEOM-drug dataset, RLPF improved atom stability from 81.3% to 87.52%, demonstrating that the physics-as-a-judge paradigm generalizes well to larger, more complex molecular systems.

Conclusion

RLPF represents a shift from simple data imitation to physical optimization in molecular generative modeling. By bridging the gap between diffusion models and force-field consistency, it produces structures that are not only statistically likely but physically viable. Future work will focus on addressing the computational bottleneck of calculating physical rewards and exploring adaptive weighting to maintain molecular diversity during the reinforcement learning process.

Summary updated

BibTeX
@misc{zhou2025guiding,
  author = {Zhijian Zhou and Junyi An and Zongkai Liu and Yunfei Shi and Xuan Zhang and Fenglei Cao and Chao Qu and Yuan Qi},
  title = {{Guiding Diffusion Models with Reinforcement Learning for Stable Molecule Generation}},
  year = {2025},
  eprint = {2508.16521},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.16521},
}

Loading related content...

Figure