DGFN: Double Generative Flow Networks

Elaine Lau, Nikhil Murali Vemgal, Doina Precup, Emmanuel Bengio

TL;DR

Generative Flow Networks (GFlowNets) often suffer from mode collapse and premature exploitation in large, sparse-reward spaces such as molecular design. Inspired by Double Deep Q-Learning (DDQN), Double Generative Flow Networks (DGFNs) decouple exploration and learning by using a lagging target network to sample training trajectories for the online network. This simple architectural change prevents the model from collapsing onto early discovered modes, leading to significantly better exploration, faster mode discovery, and more diverse high-reward candidates.

What Problem Does This Paper Address?

GFlowNets are generative models trained to sample discrete objects (like graphs or molecules) with probability proportional to a given reward function. Unlike standard reinforcement learning (which focuses strictly on maximizing reward), GFlowNets are designed to discover a diverse variety of high-reward candidates, making them ideal for de novo drug discovery.

However, in practice, GFlowNets struggle in high-dimensional environments with sparse rewards. When an agent stumbles upon an early mode (a cluster of good solutions), the online policy can rapidly become overly confident ("peaked" or "opinionated"). As a consequence, the agent repeatedly generates trajectories around that single mode, halting exploration and failing to discover other high-reward regions of the search space.

Methods

DGFN adapts the core intuition of Double Q-Learning—decoupling policy behavior from parameter updates—to flow networks:

  • Two Networks: Instead of using the online model $F_\theta$ to generate its own training data, DGFN maintains an online network ($F_\theta$) and a delayed target network ($F_{\theta'}$).
  • Decoupled Trajectory Sampling: Complete trajectories are sampled using the target network $F_{\theta'}$, and the resulting trajectories are used to compute the loss (e.g., Trajectory Balance, TB) for updating the online network $F_\theta$.
  • Two-Phase Target Updates:
  • Initial Phase ($t < T^I$): Trajectories are initially random and low-reward, so the target network is updated frequently to avoid lagging too far behind early learning.
  • Periodic Polyak Averaging ($t \ge T^I$): Every $T^U$ steps, the target parameters are smoothly updated via Polyak averaging: $$\theta' \leftarrow \alpha \theta + (1 - \alpha)\theta'$$

This delay prevents policy feedback loops where the sampling distribution sharpens too fast, maintaining state-space coverage while stabilizing gradient updates.

Datasets

The authors evaluate DGFNs on two established benchmarks:

  1. Synthetic Hypergrid Benchmark: A 6-dimensional grid world with side lengths $H \in \{8, 10, 12\}$ where an agent steps from $(0, \dots, 0)$ to coordinate increments and can terminate at any state. Rewards are made exceptionally sparse ($R_0 = 10^{-3}$) to test exploration.
  2. Small Molecule Synthesis (sEH Protein): A fragment-based molecular graph construction task targeting soluble epoxide hydrolase (sEH) inhibition. Rewards are computed via a pre-trained proxy docking model (AutoDock Vina scoring). The state space contains roughly $10^{16}$ states with branching factors ranging from 100 to 2,000 actions per state.

Key Insights and Ideas

  • Slowing down data distribution shift preserves exploration: In off-policy RL, target networks stabilize value estimates. In GFlowNets, using a target network stabilizes the data-generating distribution itself, preventing premature convergence to a narrow subset of modes.
  • Warm-up scheduling is crucial: If target parameters lag too much during early training, the agent samples purely random noise for too long. A frequent update schedule during the initial burn-in phase ($T^I$) followed by slow Polyak updates achieves the best trade-off between fast learning and stable exploration.
  • Compatibility across flow objectives: The target-network mechanism is objective-agnostic; it improves exploration whether using standard Trajectory Balance (TB) or Subtrajectory Balance (SubTB).

Key Results

  • Hypergrid: DGFNs discovered all modes consistently faster and achieved lower empirical $L_1$ error to the true reward distribution compared to standard GFNs. The performance gap widened as the grid dimension/complexity increased ($12 \times 12 \times 12 \times 12 \times 12 \times 12$).
  • Molecular Design Modes Discovered: In the sEH task, DGFN-TB discovered over 25,000 modes with reward $R > 0.90$, drastically outperforming GFN-SubTB (~12,000 modes) and standard GFN-TB (~7,000 modes).
  • Quality and Diversity:
  • Diverse Top-100 Reward: DGFN-TB reached $1.035 \pm 0.002$ vs. $0.972 \pm 0.028$ for GFN-TB.
  • Diverse Top-1000 Reward: DGFN-TB achieved $1.017 \pm 0.002$ vs. $0.836 \pm 0.097$ for GFN-TB and $0.992 \pm 0.002$ for GFN-SubTB.
  • DGFN exhibited substantially reduced training variance compared to vanilla GFN-TB, which suffered severe performance oscillations.

Limitations and Future Work

  • Empirical Focus over Theoretical Guarantees: The paper provides intuitive and empirical evidence for DGFNs, but lacks a formal theoretical proof characterizing the convergence properties of flow matching under delayed sampling distributions.
  • Hyperparameter Sensitivity: Introducing $T^I$, $T^U$, and $\alpha$ adds extra hyperparameters that required grid search / Optuna tuning.
  • Scope of Tasks: Experiments were restricted to grid-worlds and a single molecular docking target (sEH). The authors note that validation across broader biochemistry benchmarks and testing other RL-inspired stabilization schemes remain open avenues for future work.

Summary updated

BibTeX
@inproceedings{lau2023dgfn,
  author = {Elaine Lau and Nikhil Murali Vemgal and Doina Precup and Emmanuel Bengio},
  title = {{DGFN: Double Generative Flow Networks}},
  booktitle = {GenBio @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=1wa9JEanV5},
}
Figure