Random Policy Evaluation Uncovers Policies of Generative Flow Networks

Haoran He, Emmanuel Bengio, Qingpeng Cai, Ling Pan · DOI

Abstract

The Generative Flow Network (GFlowNet) is a probabilistic framework in which an agent learns a stochastic policy and flow functions to sample objects proportionally to an unnormalized reward function. A number of recent works explored connections between GFlowNets and maximum entropy (MaxEnt) RL, which modifies the standard objective of RL agents by learning an entropy-regularized objective. However, the relationship between GFlowNets and standard RL remains largely unexplored, despite the inherent similarities in their sequential decision-making nature. While GFlowNets can discover diverse solutions through specialized flow-matching objectives, connecting them can simplify their implementation through established RL principles and improve RL's diverse solution discovery capabilities. In this paper, we bridge this gap by revealing a fundamental connection between GFlowNets and one RL's most basic components -- policy evaluation. Surprisingly, we find that the value function obtained from evaluating a uniform policy is closely associated with the flow functions in GFlowNets through the lens of flow iteration under certain structural conditions. Building upon these insights, we introduce a rectified random policy evaluation (RPE) algorithm, which achieves the same reward-matching effect as GFlowNets based on simply evaluating a fixed random policy in these cases, offering a new perspective. Empirical results across extensive benchmarks demonstrate that RPE achieves competitive results compared to previous approaches, shedding light on the previously overlooked connection between (non-MaxEnt) RL and GFlowNets.

Introduction

Generative Flow Networks (GFlowNets) have emerged as a powerful paradigm for diverse solution discovery, particularly in domains like drug discovery and materials science where sampling multiple high-quality candidates is more valuable than finding a single global optimum. Unlike standard Reinforcement Learning (RL) which typically seeks to maximize expected return, GFlowNets aim for "reward matching"—sampling objects with a probability proportional to their unnormalized rewards.

While previous research has linked GFlowNets to Maximum Entropy (MaxEnt) RL, the relationship between GFlowNets and the most fundamental components of standard RL has remained elusive. This work bridges that gap by demonstrating a mathematical equivalence between GFlowNet flow functions and the value functions obtained through simple policy evaluation on a fixed uniform policy.

Theoretical Framework: Bridging GFlowNets and Policy Evaluation

The core contribution of this work is the revelation that the state flow $F(s)$ in a GFlowNet is identical to the value function $V(s)$ of a uniform random policy, provided the terminal rewards are appropriately "rectified" or scaled.

Flow Iteration and Rectification

The authors reformulate GFlowNet training as a dynamic programming problem termed "Flow Iteration," which propagates flow values from child states back to parent states. They prove that in tree-structured tasks, if terminal rewards are scaled by the branching ratio (the product of available actions along a path), the resulting value function from evaluating a uniform policy matches the GFlowNet flow exactly.

Equivalence between GFlowNet flow F(s) and scaled value function V(s) in a Tree MDP.

Path-Invariance in DAGs

This equivalence extends to Directed Acyclic Graphs (DAGs) under the condition of "path-invariance." In environments where the ratio of outgoing to incoming actions remains consistent across different paths to the same state, the relationship between $F(s)$ and $V(s)$ holds. This insight leads to the Rectified Random Policy Evaluation (RPE) algorithm. Instead of complex GFlowNet-specific losses like Trajectory Balance, RPE performs standard policy evaluation on a transformed reward signal using a fixed uniform policy, turning a moving-target problem into a stable regression task.

Experimental Evaluation

The RPE algorithm was evaluated against standard GFlowNet benchmarks, including DNA sequence generation (TF Bind), RNA sequence generation, and molecular graph generation (QM9).

  • Accuracy and Reward Matching: In RNA generation tasks, RPE achieved nearly 100% accuracy in matching target distributions, significantly outperforming traditional GFlowNet variants like FM-GFN and TB-GFN, which typically range between 66% and 88%.
  • Efficiency in Discovery: In the QM9 molecule generation task, RPE discovered high-reward "modes" faster than baseline methods, demonstrating that the simplified, stable objective of RPE leads to more efficient exploration.
  • Diversity: RPE maintained the characteristic diversity of GFlowNets, matching or exceeding the performance of MaxEnt RL algorithms such as Soft DQN.
Performance comparison of RPE against GFlowNet and MaxEnt RL baselines in terms of mode discovery and accuracy.

Discussion and Conclusion

RPE offers a streamlined and theoretically grounded alternative to GFlowNets by leveraging the most basic building blocks of RL. However, its current reliance on the "path-invariance" condition in DAGs presents a limitation for environments with irregular boundaries. Future research will explore relaxing this requirement and applying the rectification approach to non-uniform policies to further enhance exploration capabilities. By uncovering the hidden bridge between GFlowNets and standard RL, this work simplifies the implementation of diverse generative models and opens new avenues for applying RL theory to GFlowNet development.

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