Improved Exploration in GFlownets via Enhanced Epistemic Neural Networks

Sajan Muhammad, Salem Lahlou · DOI

Introduction

Generative Flow Networks (GFlowNets) have emerged as a powerful framework for sampling diverse, high-reward objects in complex search spaces, such as molecular structures or material configurations. However, a persistent challenge in GFlowNet training is exploration. In environments with sparse rewards, agents often suffer from "mode collapse," where they repeatedly sample from a few discovered high-reward regions while failing to explore the broader landscape. Traditional exploration methods, like $\epsilon$-greedy noise or simple ensembles, often lack the sophistication to handle the epistemic uncertainty inherent in sequential decision-making.

Methodology: Epistemic Neural Networks for GFlowNets

To address these limitations, this research introduces ENN-GFN and ENN-GFN-Enhanced, which integrate Epistemic Neural Networks (ENNs) into the GFlowNet framework.

Joint Predictive Distributions

The core innovation lies in leveraging "joint predictive distributions." Unlike standard neural networks that provide point estimates, ENNs use an epistemic index ($z$) to produce a distribution of possible outputs. This allows the agent to estimate uncertainty across an entire sequence of actions (a trajectory) rather than just a single step. This "joint" insight is crucial for sequential tasks where uncertainty compounds over time.

The Epinet Architecture

The authors utilize the epinet architecture, which augments a standard base model with a small, trainable MLP and a fixed prior network. This setup provides calibrated uncertainty estimates with significantly lower computational overhead than traditional deep ensembles, making it suitable for large-scale applications.

ENN-GFN-Enhanced

The "Enhanced" variant draws inspiration from Thompson Sampling. By randomly selecting an ensemble member from the prior network to guide a specific trajectory, the agent is encouraged to commit to a "hypothesis" about the reward landscape. This leads to deeper, more intentional exploration compared to simple stochastic noise.

Experimental Results

The proposed methods were evaluated on benchmarks including 2D/4D Hypergrids and BITSEQUENCES (structured sequence generation).

Convergence and Accuracy

In the Hypergrid tasks, the ENN-based models demonstrated significantly faster convergence. The $L_1$ distance—a metric measuring the divergence between the learned and true reward distributions—dropped much more rapidly for ENN-GFN variants compared to the default GFlowNet and simpler Thompson Sampling baselines.

L1 distance comparison showing faster convergence for ENN-GFN variants.

Mode Discovery

A critical test of exploration is the ability to find all reward peaks (modes) in a sparse environment. In a 2D grid where rewards are hidden in the corners, the default GFlowNet often fails to move beyond the starting region. In contrast, ENN-GFN-Enhanced successfully identified all target modes within a limited sample budget.

Comparison of learned distributions. ENN-GFN-Enhanced (d) most accurately recovers the target distribution (e) compared to the baseline (a).

Diversity in Sequence Generation

In the BITSEQUENCES task, which requires generating valid balanced parentheses, the epinet-equipped model discovered a higher number of unique valid strings. For instance, at a sequence length of 16, the Epinet model found 260 unique valid strings, outperforming the baseline's 207.

Conclusion and Future Directions

By incorporating epistemic uncertainty through ENNs, GFlowNets can achieve more robust and efficient exploration in sparse-reward landscapes. While these results on benchmark tasks are promising, future work will focus on scaling these techniques to real-world scientific domains, such as molecular lead optimization, where reward evaluations are computationally expensive and the search spaces are vast.

Summary updated

BibTeX
@inproceedings{muhammad2025improved,
  author = {Sajan Muhammad and Salem Lahlou},
  title = {{Improved Exploration in GFlownets via Enhanced Epistemic Neural Networks}},
  booktitle = {EXAIT @ ICML},
  year = {2025},
  url = {https://openreview.net/forum?id=AHyxLDrd6P},
}
Figure