TL;DR
This paper introduces Evolution Guided Generative Flow Networks (EGFN), a novel training method that combines evolutionary algorithms (EA) with GFlowNets. EGFN effectively addresses the challenges of training GFlowNets on long trajectories and sparse rewards by leveraging EA's ability to explore and exploit promising regions of the search space, leading to improved mode discovery and sample quality.
What Problem Does This Paper Address?
Generative Flow Networks (GFlowNets) are powerful probabilistic models capable of sampling compositional objects proportionally to a given reward function. However, training GFlowNets becomes significantly challenging in scenarios with long sequences of actions (long trajectories) and infrequent reward signals (sparse rewards). This "temporal credit assignment" problem makes it difficult for standard GFlowNets to learn effectively, as the model struggles to associate early actions with distant rewards. Existing methods like trajectory balance (TB) can be unstable and sensitive to sparse rewards.
Methods
The core innovation is Evolution Guided Generative Flow Networks (EGFN), a three-step training process:
- Evolution (Step One): A population of GFlowNet agents is trained using evolutionary algorithms (EA). EA employs selection, crossover, and mutation to evolve the agents' parameters. The fitness of each agent is determined by the reward of trajectories it samples. Promising trajectories are stored in a prioritized replay buffer (PRB).
- Sampling (Step Two): Training data for the main GFlowNet agent (the "star agent") is gathered from two sources: online trajectories generated by the star agent itself, and offline trajectories sampled from the PRB (which contains high-quality trajectories from the EA-evolved population).
- Training (Step Three): The star agent is trained using standard GFlowNet objectives (like Flow Matching, Detailed Balance, or Trajectory Balance) on the combined dataset of online and offline trajectories.
This approach leverages EA's robustness to long trajectories and sparse rewards (due to fitness evaluation over entire trajectories) and its exploratory nature, while still benefiting from GFlowNets' gradient-based learning for precise distribution matching.
Datasets
The paper evaluates EGFN on a variety of synthetic and real-world tasks:
- Synthetic Tasks:
- Hypergrid: A toy environment designed to test performance on long trajectories and sparse rewards, with varying dimensions (D) and horizons (H).
- Real-World Tasks:
- Antibody sequence optimization: Generating antibody heavy chain sequences to optimize instability index.
- Soluble Epoxy Hydrolase (sEH) binder generation: Generating molecules with specific binding energy to a target protein.
- hu4D5 CDR H3 mutation generation: Generating CDR mutants for antibody sequences.
- Transcription factor binder generation: Generating DNA sequences that bind to a specific transcription factor.
- Small molecule generation (QM9): Generating molecules that maximize energy gap between HOMO and LUMO orbitals.
- TFBind8 task: Generating DNA sequences to maximize binding activity.
Key Insights and Ideas
- EA as a "Long-Term Credit Assignment" Assistant: By evolving a population of agents and storing their successful trajectories, EA effectively scouts for good solutions in complex, sparse reward landscapes, providing high-quality data for the gradient-based GFlowNet training.
- Mutation is Key: Ablation studies highlight that the mutation operator within the EA component is crucial for EGFN's performance improvement, suggesting its role in maintaining diversity and exploration.
- Synergy of Gradient-Based and Gradient-Free Methods: EGFN demonstrates that combining the strengths of gradient-free evolutionary search (for exploration and robustness) with gradient-based GFlowNet training (for precise distribution matching) can overcome limitations of each individual approach.
- Improved Performance Across Objectives: EGFN shows consistent improvements over standard GFlowNets regardless of the specific GFlowNet objective (FM, TB, DB) used for training.
Key Results
- Superior Mode Discovery: EGFN consistently discovers more modes (high-reward solutions) than baseline GFlowNets and RL methods across various tasks, especially in challenging scenarios with long trajectories and sparse rewards. For instance, in the hypergrid task, EGFN shows a broader performance gap with GFlowNets as trajectory length increases.
- Reduced Error: EGFN achieves lower l₁ error (difference between learned and true distribution density) compared to baselines.
- Effective in Diverse Domains: The method shows strong performance in molecule generation, antibody design, and synthetic environments, demonstrating its generalizability.
- Runtime Increase: While effective, EGFN incurs a runtime increase of approximately 35% compared to standard GFlowNets due to the EA step.
Limitations and Future Work
- Runtime Overhead: The evolutionary component adds computational cost, making EGFN slower than standard GFlowNets.
- No Novel Credit Assignment: EGFN doesn't fundamentally change GFlowNets' credit assignment mechanism but rather uses EA-generated diverse samples to mitigate the problem.
- Future Work: The authors suggest exploring more complex EA sub-modules (e.g., CMA-ES), integrating EA and GFlowNet gradients into a feedback loop, and investigating EA formulations that directly optimize for diversity rather than just reward.
Summary updated