Abstract
Generative models see increasing use in computer-aided drug design. However, while performing well at capturing distributions of molecular motifs, they often produce synthetically inaccessible molecules. To address this, we introduce SynFlowNet, a GFlowNet model whose action space uses chemical reactions and purchasable reactants to sequentially build new molecules. By incorporating forward synthesis as an explicit constraint of the generative mechanism, we aim at bridging the gap between in silico molecular generation and real world synthesis capabilities. We evaluate our approach using synthetic accessibility scores and an independent retrosynthesis tool to assess the synthesizability of our compounds, and motivate the choice of GFlowNets through considerable improvement in sample diversity compared to baselines. Additionally, we identify challenges with reaction encodings that can complicate traversal of the MDP in the backward direction. To address this, we introduce various strategies for learning the GFlowNet backward policy and thus demonstrate how additional constraints can be integrated into the GFlowNet MDP framework. This approach enables our model to successfully identify synthesis pathways for previously unseen molecules.
Introduction
In computer-aided drug design, generative models are highly effective at proposing molecules with high predicted binding affinity. However, a persistent challenge is "synthetic inaccessibility"—the proposal of "fantasy" molecules that are chemically impossible or prohibitively expensive to manufacture. Traditional solutions, such as post-hoc filtering with Synthetic Accessibility (SA) scores or virtual screening of massive libraries, often fall short due to oversimplification or computational intractability.
SynFlowNet addresses this by embedding chemical synthesis directly into the model's action space. Presented at ICLR 2025, SynFlowNet is a Generative Flow Network (GFlowNet) that designs molecules by simulating actual chemical reactions using purchasable building blocks, ensuring that every discovered molecule has a guaranteed synthesis pathway.
Methodology
The core of SynFlowNet is a reaction-based Markov Decision Process (MDP). Instead of atom-by-atom construction, the model acts as a virtual chemist, selecting from five forward actions: starting with a reactant, performing uni-molecular or bi-molecular reactions, adding a second reactant, and stopping.
Key Technical Innovations
- Reaction-based MDP: The generative process is constrained to documented chemical reactions (105 common templates) and purchasable building blocks from libraries like Enamine REAL (up to ~221k molecules).
- Learned Backward Policy: Unlike standard GFlowNets with uniform backward policies, SynFlowNet learns a backward policy using REINFORCE or Maximum Likelihood to avoid "dead ends" in chemical space. This ensures the model stays within the valid synthesizable manifold.
- Morgan Fingerprint Scaling: To handle large building block libraries, the model uses fixed Morgan fingerprints to compute selection probabilities. This allows the model to generalize to unseen building blocks without a linear increase in parameters.
Results and Discussion
SynFlowNet was evaluated on its ability to design inhibitors for several biological targets, including the SARS-CoV-2 main protease (Mpro).
Synthesizability and Diversity
A key result is the significant improvement in synthesizability. SynFlowNet molecules achieved a 62% success rate when tested with AiZynthFinder, an independent retrosynthesis tool, compared to 0% for traditional fragment-based GFlowNets. Furthermore, SynFlowNet consistently produced lower (better) SA scores than baselines.
Beyond synthesizability, SynFlowNet maintains high sample diversity. While standard Reinforcement Learning often collapses to a few high-reward modes, SynFlowNet successfully identifies multiple distinct chemical scaffolds with high predicted affinity. It also demonstrates superior novelty, producing molecules with lower similarity to known drugs in the ChEMBL database compared to state-of-the-art models like REINVENT.
Conclusion
SynFlowNet represents a significant step toward practical AI-driven drug discovery by treating synthesis as a hard constraint rather than an optimization goal. While currently limited to linear pathways and simplified reaction conditions, the framework's ability to scale to industrial libraries and incorporate experimental data (e.g., X-ray crystallography fragments) makes it a powerful tool for real-world applications. Future work will focus on convergent synthesis pathways and incorporating more nuanced chemical properties like stereochemistry and reaction yields.
Summary updated