Graph-GRPO: Training Graph Flow Models with Reinforcement Learning
Organizations: Beijing University of Posts and Telecommunications · National University of Singapore · University of Sheffield · Beihang University
Abstract
Graph generation is a fundamental task with broad applications, such as drug discovery. Recently, discrete flow matching-based graph generation, \aka, graph flow model (GFM), has emerged due to its superior performance and flexible sampling. However, effectively aligning GFMs with complex human preferences or task-specific objectives remains a significant challenge. In this paper, we propose Graph-GRPO, an online reinforcement learning (RL) framework for training GFMs under verifiable rewards. Our method makes two key contributions: (1) We derive an analytical expression for the transition probability of GFMs, replacing the Monte Carlo sampling and enabling fully differentiable rollouts for RL training; (2) We propose a refinement strategy that randomly perturbs specific nodes and edges in a graph, and regenerates them, allowing for localized exploration and self-improvement of generation quality. Extensive experiments on both synthetic and real datasets demonstrate the effectiveness of Graph-GRPO. With only 50 denoising steps, our method achieves 95.0% and 97.5% Valid-Unique-Novelty scores on the planar and tree datasets, respectively. Moreover, Graph-GRPO achieves state-of-the-art performance on the molecular optimization tasks, outperforming graph-based and fragment-based RL methods as well as classic genetic algorithms.
Figures & tables
| Model | Step | Planar | Tree | ||
| V.U.N. | Ratio | V.U.N. | Ratio | ||
| Train set | - | 100 | 1.0 | 100 | 1.0 |
| GraphRNN | - | 0.0 | 490.2 | 0.0 | 607.0 |
| BiGG | - | 5.0 | 16.0 | 75.0 | 5.2 |
| GraphGen | - | 7.5 | 210.3 | 95.0 | 33.2 |
| CatFlow | - | 80.0 | - | - | - |
| Target | Metric | RL-optimized Generative Models | Basic Generative Models | |||||||
| Graph-GRPO | GDPO | DDPO | FREED | REINVENT | GCPN | DiGress-G | DiGress | MOOD | ||
| parp1 | DS (top 5%) | -12.515 | -10.938 | -9.247 | -10.579 | -8.702 | -8.102 | -9.463 | -9.219 | -10.865 |
| Hit Ratio | 60.763 | 9.814 | 0.419 | 4.627 | 0.480 | 0 | 1.172 | 0.366 | 7.017 | |
| fa7 | DS (top 5%) | -9.099 | -8.691 | -7.739 | -8.378 | -7.205 | -6.688 | -7.318 | -7.736 | -8.160 |
| Hit Ratio | 9.367 | 3.449 | 0.342 | 1.332 | 0.213 | 0 | 0.321 | 0.182 | 0.733 | |
| 5ht1b | DS (top 5%) | -11.399 | -11.304 | -9.488 | -10.714 | -8.770 | -8.544 | -8.971 | -9.280 | -11.145 |
| Oracle | w/ Prescreening | Cold-Start (w/o Prescreening) | |||||||
| Graph-GRPO | InVirtuoGen | GenMol | f-RAG | Graph-GRPO | InVirtuoGen | Gen. GFN | Mol GA | REINVENT | |
| Albuterol Similarity | 0.994 | 0.975 | 0.937 | 0.977 | 0.994 | 0.950 | 0.949 | 0.896 | 0.882 |
| Amlodipine MPO | 0.823 | 0.836 | 0.810 | 0.749 | 0.823 | 0.733 | 0.761 | 0.688 | 0.635 |
| Celecoxib Rediscovery | 0.890 | 0.839 | 0.826 | 0.778 | 0.890 | 0.798 | 0.802 | 0.567 | 0.713 |
| Deco Hop | 0.942 | 0.968 | 0.960 | 0.936 | 0.762 | 0.748 | 0.733 | 0.649 | 0.666 |
| DRD2 | 0.995 | 0.995 | 0.995 | 0.992 | 0.995 | 0.985 | 0.974 | 0.936 | 0.945 |
| Method | RL | Refine- ment | Pre- screening | Dynamic Prior | AUC-top10 |
| DeFoG | - | - | - | - | 11.079 |
| DeFoG | - | ✓ | - | - | 15.251 |
| DeFoG | - | ✓ | ✓ | - | 15.887 |
| Graph-GRPO | ✓ | - | - | - | 16.901 |
| Graph-GRPO | ✓ | - | - | ✓ | 17.450 |
| Graph-GRPO | ✓ | ✓ | - | - | 17.950 |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Task | 0.9 | 0.7 | 0.5 | 0.3 | 0.0 |
| Deco Hop | 0.682 | 0.709 | 0.641 | 0.646 | 0.638 |
| Osimertinib MPO | 0.918 | 0.899 | 0.865 | 0.862 | 0.878 |
| Valsartan SMARTS | 0.949 | 0.827 | 0.584 | 0.211 | 0.174 |
| Method | Reward @Step 0 | Reward @Step 500 | Grad Norm | Clip Rate |
| REINFORCE w/o analytic | 1.03 | 0.312 | 130.6 | 100% |
| Graph-GRPO w/ analytic | 1.03 | 1.537 | 0.97 | 0.7% |
| Target | Valid. | Uniq. | Nov. | Avg. QED | Avg. SA | Avg. Reward |
| parp1 | 97.803 | 100.000 | 0.945 | 0.667 | 0.655 | 0.459 |
| fa7 | 98.617 | 100.000 | 0.992 | 0.726 | 0.650 | 0.358 |
| braf | 98.405 | 100.000 | 0.976 | 0.723 | 0.679 | 0.447 |
| jak2 | 98.763 | 100.000 | 0.987 | 0.750 | 0.674 | 0.466 |
| 5ht1b | 98.145 | 100.000 | 0.977 | 0.720 | 0.675 | 0.421 |
| Planar Dataset | ||||||||||
| Model | Deg. | Clus. | Orbit | Spec. | Wavelet | Ratio | Valid | Unique | Novel | V.U.N. |
| Train set | 0.0002 | 0.0310 | 0.0005 | 0.0038 | 0.0012 | 1.0 | 100 | 100 | 0.0 | 0.0 |
| GraphRNN | 0.0049 | 0.2779 | 1.2543 | 0.0459 | 0.1034 | 490.2 | 0.0 | 100 | 100 | 0.0 |
| GRAN | 0.0007 | 0.0426 | 0.0009 | 0.0075 | 0.0019 | 2.0 | 97.5 | 85.0 | 2.5 | 0.0 |
| SPECTRE | 0.0005 | 0.0785 | 0.0012 | 0.0112 | 0.0059 | 3.0 | 25.0 | 100 | 100 | 25.0 |
| DiGress | 0.0007 | 0.0780 | 0.0079 | 0.0098 | 0.0031 | 5.1 | 77.5 | 100 | 100 | 77.5 |
Graph Generation
Graph generation builds models and algorithms that create graphs with desired structures, properties, or distributions.
See all 66 papers