Abstract
Generative Flow Networks (GFlowNets) have traditionally been restricted to Directed Acyclic Graphs (DAGs), limiting their utility in environments with reversible actions or symmetries. This paper, presented at AAAI-2024, extends GFlowNet theory to non-acyclic and continuous spaces. By formalizing flows on measurable spaces and introducing a family of stable loss functions, the authors prevent the "infinite flow" exploit that causes standard GFNs to fail in cyclic environments. Empirical results across discrete and continuous tasks show that Stable GFNs maintain directed trajectories and outperform standard reinforcement learning baselines.
Introduction
The primary constraint of standard Generative Flow Networks (GFNs) is the requirement of an underlying Directed Acyclic Graph (DAG) structure. While suitable for incremental construction tasks like atom-by-atom molecule generation, this restriction limits GFNs in domains such as robotics, game playing, or puzzles where actions can be reversed or states revisited. In non-acyclic graphs, standard GFN loss functions—such as Flow-Matching (FM) and Detailed Balance (DB)—become unstable. Optimizers can minimize these losses to zero by driving infinite "flow" into cycles, leading to models that loop indefinitely during inference.
Theoretical Framework: Beyond DAGs
To address these limitations, the authors generalize GFN theory from discrete nodes to measurable spaces. This transition allows the model to operate in continuous environments, such as 2D coordinate planes, using the tools of measure theory.
A key theoretical contribution is the definition of 0-flows. In a cyclic environment, a 0-flow represents a circulation of flow that does not contribute to the final reward. In continuous spaces, these can manifest as "acyclic 0-flows" or perpetually wandering trajectories. By formalizing these concepts, the framework provides a way to bound sampling times even in infinite or cyclic state spaces.
Stable Loss Functions
The instability in cyclic GFNs arises because standard losses are often scale-invariant regarding circulating flows. To fix this, the authors introduce the concept of Stability. A loss function is stable if the presence of a cycle (a 0-flow) does not artificially lower the loss.
They propose a new family of stable losses, such as Stable FM and Stable DB, which utilize a logarithmic structure to dampen the influence of large flows: $$\mathcal{L} \approx \mathbb{E} [ \log(1 + \epsilon |F_{in} - F_{out}|^\alpha) \times (\text{regularizer}) ]$$ This formulation ensures that as flow increases within a cycle, the loss eventually increases or yields diminishing returns, forcing the optimizer to prefer efficient, reward-directed paths.
Empirical Evaluation
The authors evaluated Stable GFNs across three distinct environments: cyclic Hypergrids, Cayley Graphs (representing complex permutations), and continuous Point-Robot navigation.
Key Results
- Hypergrids: In environments modified to allow multi-directional movement, standard FM loss caused path lengths to explode. In contrast, Stable FM kept trajectories short and focused on reward states, as seen in the comparison between wandering paths and directed ones.
- Cayley Graphs: On highly connected permutation graphs ($S_{20}$), Stable GFNs successfully converged to optimal rewards, whereas standard versions failed due to high cyclicity.
- Continuous Control: In the "Point-Robot-Sparse" task, Stable-CFlowNets outperformed popular RL baselines like PPO, SAC, and TD3. The model demonstrated superior exploration, discovering more "valid-distinctive" trajectories and achieving higher average rewards.
Conclusion
By extending GFlowNets to non-acyclic and continuous spaces, this work significantly broadens the applicability of the framework. While stabilizing the Trajectory Balance (TB) loss remains an open challenge due to its non-linear nature, the introduction of stable FM and DB losses provides a robust foundation for generative modeling in complex, real-world topologies. Future work will explore integrating advanced architectures like Graph Transformers to further enhance performance on intricate topological tasks.
Summary updated