Interpreting GFlowNets for Drug Discovery: Extracting Actionable Insights for Medicinal Chemistry

Amirtha Varshini A S, Duminda S.Ranasinghe, Hok Hei Tam · 2025

Read Interpreting GFlowNets for Drug Discovery: Extracting Actionable Insights for Medicinal Chemistry by Amirtha Varshini A S, Duminda S.Ranasinghe, Hok Hei Tam (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2511-19264.txt.

Introduction

Amirtha Varshini A S, Duminda S. Ranasinghe, and Hok Hei Tam test what probing tools can truly show about GFlowNets, models that build molecules step by step. Chemists hesitate to use such models because their choices are hard to read. The study examines SynFlowNet, a synthesis-aware version trained toward drug-like molecules.

Probes, saliency maps, and sparse autoencoders are checked against strict controls, including shuffled labels and an untrained twin network. Chemical traits decode easily from the trained model, but the untrained one does almost as well. That result means the signal comes mostly from graph structure, not learned policy. Only narrower claims survive, a caution for interpretability work.

Catalog record

CREATORAmirtha Varshini A S, Duminda S.Ranasinghe, Hok Hei Tam
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE25 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2511-19264

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Interpreting GFlowNets for Drug Discovery: Extracting Actionable Insights for Medicinal Chemistry Amirtha Varshini A S, Duminda S.Ranasinghe, Hok Hei Tam Abstract Generative Flow Networks (GFlowNets) offer a powerful framework for molecular design, yet their internal decision policies remain opaque. This limits adoption in drug discovery, where chemists require interpretable rationales for proposed structures. We introduce an interpretability framework for SynFlowNet [ 4 ] , a GFlowNet trained on documented chemical reactions and purchasable starting materials, which confines generation to synthetically accessible chemical space and enables sampling of both viable target molecules and the synthetic routes that produce them. Our approach integrates (i) gradient-based saliency with counterfactual perturbations of molecular substructures, (ii) concept attribution via sparse autoencoders (SAEs) trained on internal embeddings, and (iii) motif probes that assess whether functional groups are linearly decodable from those embeddings. Applied to SynFlowNet, our analysis shows that its internal representations organize drug-likeness (QED [ 3 ] ) along physicochemically interpretable axes such as polarity, lipophilicity, and size, and that halogens and aromatic ring systems are reliably encoded as motif-level features. Counterfactual saliency further identifies substructures whose targeted replacement produces systematic shifts in predicted rewards, yielding actionable, intervention-based attributions [ 6 ] aligned with medicinal chemistry heuristics. Together, these results extend interpretability tools to structured generative policies and provide practical insights for medicinal-chemistry–driven molecule design. Figure 1: Overview of the proposed interpretability framework for GFlowNets. Our pipeline integrates (1) sparse autoencoders [ 10 ] (SAEs) for discovering disentangled chemical factors such as polarity and lipophilicity, (2) motif probes to test whether embeddings encode functional groups, and (3) gradient-based saliency and counterfactual perturbations for atom- and motif-level attribution. Together, these approaches span fine-grained atomic rationales to high-level medicinal chemistry concepts. 1 Introduction Drug discovery demands exploration of vast chemical spaces while adhering to strict constraints on synthesizability, drug-likeness, and safety. Although modern deep generative models—including variational autoencoders (VAEs), generative adversarial networks (GANs), and diffusion models—have shown strong capability in proposing novel molecules, they often produce structures that are synthetically infeasible, insufficiently diverse, or justified through opaque decision-making processes. Medicinal chemists, however, require explanations grounded in molecular structure: which functional groups guide the model’s choices, which physicochemical properties are being prioritized, and how small structural modifications affect predicted reward or synthetic feasibility. Without such explanations, even high-performing models remain difficult to trust and integrate into design–make–test–analyze (DMTA) cycles. Generative Flow Networks (GFlowNets) [ 2 , 8 ] provide a compelling alternative to conventional likelihood- or score-based generative models. Rather than producing molecules in a single denoising or decoding step, GFlowNets learn stochastic policies that construct molecules sequentially, allocating probability mass across a diverse set of high-reward structures. Recent extensions such as SynFlowNet [ 4 ] incorporate synthesis constraints and reaction-template–based assembly, enabling chemically meaningful and synthetically aware molecule generation. Despite this promise, the interpretability of GFlowNets remains largely unexplored. In contrast to diffusion models—where attribution methods and latent-space analyses have matured—GFlowNets pose unique challenges: the policy must choose among heterogeneous action types, and intermediate graph states contain rich structural information that is rarely interrogated. Interpreting these internal representations is essential for practical deployment. Medicinal chemists routinely examine how polarity, lipophilicity, aromaticity, and functional-group context influence model predictions, and they seek mechanistic explanations for why a model favors one synthetic route or scaffold over another. Yet current GFlowNet architectures provide little visibility into their decision-making processes, and existing attribution methods are not designed for discrete, graph-based generative policies. To address this gap, we introduce an interpretability toolkit that adapts methods from supervised learning [ 11 , 1 , 13 ] to structured, sequential, graph-based generative settings. Our approach integrates gradient-based saliency, counterfactual perturbations, sparse autoencoders, and motif-level probes to reveal how SynFlowNet encodes and manipulates chemical information during generation. In doing so, our framework links machine-learning explanations with medicinal-chemistry reasoning and aligns with the growing emphasis on explainability in molecular design [ 5 , 12 ] . 2 Methods In our experiments, we analyze SynFlowNet trained with QED (Quantitative Estimate of Drug Likeness) as the reward function. Our interpretability framework combines three complementary approaches, each targeting a different level of explanation. Gradient based saliency identifies the atoms and bonds that influence specific generative actions, providing fine grained local attribution. Counterfactual perturbations extend this by testing the sensitivity of action probabilities and reward outcomes to structured molecular edits [ 12 , 7 ] . Sparse autoencoders (SAEs) uncover disentangled, axis aligned latent factors, enabling analysis of how abstract representations relate to physicochemical properties [ 1 , 9 ] . Finally, motif probes test whether discrete chemical motifs are encoded in the learned embeddings, linking internal representations to recognizable medicinal chemistry concepts. Together, these methods provide multi scale interpretability, spanning atom level rationales, latent space structure, and motif level detectors. 2.1 Gradient-Based Saliency with Counterfactual QED Analysis We estimate atom-level saliency for SynFlowNet by applying integrated gradients (IG) [ 11 ] to the log-probability of the Stop action. Given an input molecular state s_{t} represented by atom features x and a baseline \tilde{x} (either a zero vector or the mean feature vector), we approximate the IG attribution for atom feature x_{i} on the Stop log-probability as \mathrm{IG}_{i}(\text{Stop},s_{t})\approx(x_{i}-\tilde{x}_{i})\frac{1}{M}\sum_{m=1}^{M}\nabla_{x_{i}}\log\pi_{\theta}(\text{Stop}\mid s_{t}^{(m)}), where s_{t}^{(m)} linearly interpolates between \tilde{x} and x and M=64 steps are used in practice. In our implementation, we obtain logits from SynFlowNet, apply a log_softmax over the action dimension, and backpropagate gradients from the Stop log-probability to the atom features. Atom-level importance scores are then computed by aggregating the absolute attributions across feature dimensions. We focus on the Stop action because it is the point in generation where the entire molecule is present, and the model decides that the structure is complete. This allows us to attribute importance to the full molecular graph. A current limitation of this choice is that it provides saliency only at the final decision step and does not capture how intermediate states influence earlier action probabilities. Extending this analysis to other decision points in the trajectory is an important direction for future work. To move beyond purely gradient-based attributions, we construct motif-level explanations and evaluate their effect on drug-likeness. Given a molecule, we first threshold atom scores at the 75th percentile, extract connected components of high-saliency atoms, and augment these with ring systems detected by RDKit (via GetSymmSSSR ) as candidate motifs. Each candidate motif is scored by the sum of its atom attributions (with a slight boost for rings), and we select the top- k non-overlapping motifs. We then perform counterfactual edits targeted to these motifs using a fixed set of chemically motivated RDKit transformation rules (e.g., ether \rightarrow thioether, methyl \rightarrow fluorine, chloro \rightarrow bromo, amide \rightarrow ester). For each selected motif, we apply all compatible transformations, sanitize the resulting molecules, and compute QED using RDKit. This yields a set of valid counterfactuals with associated reward changes \Delta\mathrm{QED}=\mathrm{QED}(m^{\prime})-\mathrm{QED}(m) . For each motif, we report the best counterfactual edit (if any) and its corresponding \Delta\mathrm{QED} , providing an intervention-based view of how salient motifs contribute to and can be modified to improve drug-likeness. 2.2 Sparse Autoencoders (SAEs) To analyze whether SynFlowNet embeddings capture chemically meaningful structure, we apply sparse autoencoders (SAEs). Given a hidden embedding h\in\mathbb{R}^{d} from the policy network, the SAE encodes a nonnegative,

Read the complete text