Random Policy Evaluation Uncovers Policies of Generative Flow Networks

Haoran He, Emmanuel Bengio, Qingpeng Cai, Ling Pan

TL;DR

This paper reveals a surprising theoretical bridge between Generative Flow Networks (GFlowNets) and standard Reinforcement Learning (RL). The authors prove that the complex "reward-matching" behavior of GFlowNets is mathematically equivalent to the simplest operation in RL—policy evaluation of a uniform random policy—provided the rewards are appropriately transformed. Based on this insight, they introduce Rectified Random Policy Evaluation (RPE), a simplified algorithm that matches or exceeds GFlowNet performance across DNA, RNA, and molecule design tasks.

What Problem Does This Paper Address?

Generative Flow Networks (GFlowNets) have become a hot topic for their ability to sample diverse, high-reward objects (like molecules or DNA sequences) with a probability proportional to their reward. This is called "reward matching," and it’s distinct from standard RL, which typically focuses on "reward maximization" (finding the single best object).

While researchers have previously linked GFlowNets to Maximum Entropy (MaxEnt) RL, the connection to standard (non-MaxEnt) RL has remained fuzzy. This gap makes GFlowNets feel like a separate, more complex ecosystem. The authors ask: Can we achieve the diversity of GFlowNets using the most fundamental building blocks of classic RL?

Methods

The authors first reformulate GFlowNet training as a dynamic programming problem called Flow Iteration. They then compare this to Policy Evaluation, the standard RL method for calculating the "value" (expected future reward) of a fixed policy.

The core contribution is the Rectified Random Policy Evaluation (RPE) algorithm. Instead of the specialized losses usually used to train GFlowNets (like Flow Matching or Trajectory Balance), RPE simply evaluates a fixed uniform random policy. To make this work, they "rectify" the process by:

  1. Transforming the Reward: Scaling the terminal reward by a "branching ratio" that accounts for the number of ways to reach a state.
  2. Value-Flow Mapping: Showing that the resulting value function $V(s)$ is directly proportional to the GFlowNet state flow $F(s)$.
Tree MDP and Value-Flow Equivalence

Crucially, because the policy being evaluated is fixed (uniform random), RPE avoids the "moving target" problem (non-stationarity) that plagues most RL and GFlowNet training.

Datasets

The authors evaluated RPE against a suite of standard GFlowNet benchmarks:

  • TF Bind: Generating DNA sequences that bind to human transcription factors.
  • RNA Sequence Generation: Designing RNA strings of length 14 to achieve specific binding energies (using the ViennaRNA package).
  • QM9 Molecule Generation: Constructing molecular graphs where the reward is based on the HOMO-LUMO energy gap (a key chemical property).

Key Insights and Ideas

  • The "Aha!" Moment: In a tree-structured task, the total flow through a state is exactly equal to the value of a random policy if you multiply the reward by the product of all available actions along the path.
  • Path Invariance is Key: For more complex graphs (DAGs) where multiple paths lead to the same state, the equivalence holds as long as the "branching ratio" (the ratio of outgoing to incoming actions) is the same regardless of the path taken.
  • Simplicity Wins: By reducing GFlowNet training to simple policy evaluation, the authors eliminate the need to learn a policy and a flow function simultaneously. You just learn the flow (via the value function) and derive the sampling policy from it.
  • Diversity via Evaluation: It turns out you don't need complex entropy regularization to get diversity; you just need to correctly evaluate how "accessible" different high-reward regions are to a random explorer.

Key Results

RPE consistently matched or outperformed established GFlowNet objectives (FM, DB, TB, SubTB) and MaxEnt RL baselines (Soft DQN):

  • Higher Accuracy: In RNA generation tasks, RPE achieved nearly 100% accuracy in matching the target distribution, significantly higher than most baselines (which hovered between 66% and 89%).
  • Better Mode Discovery: RPE discovered more "modes" (distinct high-reward solutions) faster. For example, in the RNA4 task, RPE found 90 modes, while the next best baseline found only 79.
  • Stability: Because RPE evaluates a fixed policy, the training curves are generally smoother and converge more reliably.
TFBind 2 Results: Modes and Accuracy

Limitations and Future Work

  • Structural Constraints: The equivalence relies on a "path-invariance" condition. While this holds for many generative tasks (like building a set or a sequence), it fails in environments with complex boundary conditions, such as the "HyperGrid" benchmark.
  • Computational Efficiency: The current implementation requires separate forward passes for every possible "child" state to calculate the next value, which can be slow in environments with very large action spaces.
  • Non-Uniform Policies: The paper focuses on uniform random policies. Exploring whether this connection extends to non-uniform or learned "exploratory" policies is a promising next step.

Summary updated

BibTeX
@inproceedings{he2025random,
  author = {Haoran He and Emmanuel Bengio and Qingpeng Cai and Ling Pan},
  title = {{Random Policy Evaluation Uncovers Policies of Generative Flow Networks}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=pbkwh7QivE},
}
Figure