Abstract
Generative Flow Networks (GFlowNets or GFNs) are probabilistic models predicated on Markov flows, and they employ specific amortization algorithms to learn stochastic policies that generate compositional substances including biomolecules, chemical materials, etc. With a strong ability to generate high-performance biochemical molecules, GFNs accelerate the discovery of scientific substances, effectively overcoming the time-consuming, labor-intensive, and costly shortcomings of conventional material discovery methods. However, previous studies rarely focus on accumulating exploratory experience by adjusting generative structures, which leads to disorientation in complex sampling spaces. Efforts to address this issue, such as LS-GFN, are limited to local greedy searches and lack broader global adjustments. This paper introduces a novel variant of GFNs, the Dynamic Backtracking GFN (DB-GFN), which improves the adaptability of decision-making steps through a reward-based dynamic backtracking mechanism. DB-GFN allows backtracking during the network construction process according to the current state's reward value, thereby correcting disadvantageous decisions and exploring alternative pathways during the exploration process. When applied to generative tasks involving biochemical molecules and genetic material sequences, DB-GFN outperforms GFN models such as LS-GFN and GTB, as well as traditional reinforcement learning methods, in sample quality, sample exploration quantity, and training convergence speed. Additionally, owing to its orthogonal nature, DB-GFN shows great potential in future improvements of GFNs, and it can be integrated with other strategies to achieve higher search performance.
Introduction
Generative Flow Networks (GFlowNets) have emerged as a robust framework for sampling diverse, high-reward compositional objects like molecular graphs or DNA sequences. Unlike traditional reinforcement learning which often converges to a single global optimum, GFNs aim to sample objects with probability proportional to their reward. However, a significant limitation of standard GFNs is their unidirectional construction process. Once a decision is made in the state space, the model cannot "undo" it, even if the intermediate state suggests a poor final outcome. This "one-way street" problem leads to wasted computational resources on low-reward trajectories. While prior work like LS-GFN attempted to mitigate this through local search at the end of a trajectory, these methods often remain trapped in local optima.
Methodology: Dynamic Backtracking
The proposed Dynamic Backtracking GFlowNet (DB-GFN) addresses these limitations by introducing a reward-dependent adjustment mechanism. This allows the model to retract suboptimal decisions during construction and explore alternative branches.
The core of DB-GFN consists of three primary components:
- Dynamic Step Selection: The number of steps to backtrack ($S$) is calculated dynamically based on the current state's reward. Lower rewards trigger deeper backtracking to escape unfavorable regions of the search space.
- Dynamic Regret: A hyperparameter ($Tg$) regulates the probability of backtracking, balancing exploitation of known high-reward paths with the exploration of new ones.
- Selection Strategies: Upon generating an alternative path via backtracking, the model employs strategies like Reward-Choose, Pearson-Choose, or MH-Choose (Metropolis-Hastings) to decide whether to retain the new trajectory or revert to the original.
Experimental Results
DB-GFN was evaluated across several benchmarks, including small molecule generation (QM9), protein binding affinity (sEH), and genetic sequence design (RNA1-3, TFbind8).
Enhanced Reward Correlation
A key metric for GFN performance is the correlation between the log-probability of sampling an object ($\log P(x)$) and its log-reward ($\log R(x)$). A perfect model would show a linear relationship. DB-GFN demonstrates a significant improvement in this area, achieving a correlation approximately four times higher than that of LS-GFN.
Mode Discovery and Convergence
In the sEH protein binding task, DB-GFN discovered 2,623 high-reward modes, vastly outperforming LS-GFN (1,521 modes) and standard GTB (91 modes). Furthermore, DB-GFN exhibited faster convergence and higher final accuracy across all tasks compared to Reinforcement Learning baselines like PPO and A2C. The model's ability to maintain high uniqueness scores confirms that it explores the search space effectively without collapsing into a few modes.
Discussion and Conclusion
DB-GFN provides a flexible "plug-in" enhancement for existing GFN architectures. By allowing global adjustments to trajectories, it overcomes the greediness of local search methods. While the mechanism adds some computational overhead due to additional forward passes, the gains in sample quality and exploration efficiency are substantial. Future work may explore stochastic backtracking probabilities to further enhance diversity. As with all biochemical generative models, the authors emphasize the importance of ethical oversight to prevent the design of harmful substances.
In summary, Dynamic Backtracking represents a significant step forward in making GFlowNets more adaptive and efficient for complex scientific discovery tasks.
Summary updated