NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Better Training of GFlowNets with Local Credit and Incomplete Trajectories

Ling Pan, Nikolay Malkin, Dinghuai Zhang, Yoshua Bengio

Abstract

Generative Flow Networks (GFlowNets) are designed to sample objects with probabilities proportional to their rewards. However, standard GFlowNet objectives often suffer from delayed credit assignment, as they typically rely on rewards received only at the end of a trajectory. This paper introduces Forward-Looking GFlowNets (FL-GFN), a novel framework that leverages local credit by decomposing rewards into intermediate steps. This approach not only accelerates convergence in long-horizon tasks but also enables learning from incomplete trajectories, a significant advancement over traditional methods.

1. Introduction

Generative Flow Networks (GFlowNets) have emerged as a powerful tool for generating complex, discrete structures like molecules or graphs. By treating the generation process as a flow in a Markov Decision Process (MDP), GFlowNets learn a policy that samples objects according to a target reward distribution. Despite their success, a primary bottleneck remains: the reliance on terminal rewards. In many real-world scenarios, trajectories can be long, and waiting until the final state to receive a learning signal leads to inefficient training and poor credit assignment.

2. The Challenge of Delayed Credit Assignment

In standard GFlowNet formulations, such as Trajectory Balance (TB) or Detailed Balance (DB), the model learns from the total reward $R(x)$ associated with a terminal state $x$. For a trajectory consisting of many steps, the model lacks a mechanism to evaluate the quality of intermediate transitions. This "sparse supervision" makes it difficult for the agent to identify which specific actions contributed to a high-reward outcome. Furthermore, existing methods require complete trajectories to update the model, which is computationally expensive and unlike human cognition, where partial plans can often be evaluated before completion.

3. Forward-Looking GFlowNets (FL-GFN)

The authors propose Forward-Looking GFlowNets (FL-GFN) to address these limitations. The core innovation lies in the reparameterization of the flow function and the decomposition of the energy function.

3.1 Energy Decomposition

FL-GFN assumes that the total energy $\mathcal{E}(x)$ (where reward $R(x) = \exp(-\mathcal{E}(x))$) can be decomposed into additive components accrued at each transition. For an intermediate state $s$, the energy $\mathcal{E}(s)$ represents the partial energy accumulated up to that point. The energy difference between two consecutive states, $\Delta \mathcal{E}(s, s') = \mathcal{E}(s') - \mathcal{E}(s)$, provides a local learning signal.

3.2 Forward-Looking Flow

The authors introduce a new state flow function, $\tilde{F}(s)$, which represents the "energy-to-go"—the remaining flow needed to reach a terminal state from state $s$. By focusing on the remaining energy rather than the total flow, the model can utilize local energy changes at every step.

3.3 The FL-DB Objective

Using this reparameterization, the authors derive the Forward-Looking Detailed Balance (FL-DB) objective. This formulation provides "dense supervision," allowing the model to learn from every transition independently of the final outcome. This is theoretically consistent; the authors provide proof (Proposition 4.2) that the model still converges to the correct global target distribution despite the focus on local credit.

4. Experimental Evaluation

The performance of FL-GFN was evaluated across three distinct domains:

  1. Set Generation: A task involving the construction of sets of elements, testing the model's ability to scale with state space size.
  2. Bit Sequence Generation: The agent generates sequences by appending $k$-bit words, with rewards determined by the edit distance to target sequences.
  3. Molecule Discovery: A high-dimensional task where the model generates molecular graphs to bind to the sEH protein, involving a state space of approximately $10^{16}$ states.

5. Key Results and Insights

The experimental results demonstrate several advantages of the FL-GFN approach:

  • Faster Convergence: In both set and bit sequence generation, FL-GFN reached optimal performance significantly faster than standard Trajectory Balance (TB) or Subtrajectory Balance (SubTB) methods.
  • Learning from Incomplete Trajectories: A breakthrough feature of FL-GFN is its ability to learn from unfinished sequences. Experiments showed that training on partial trajectories yielded performance nearly identical to training on full trajectories, suggesting high data efficiency.
  • Superior Diversity: In the molecule discovery task, FL-GFN found more high-quality, diverse candidates (measured by Tanimoto similarity) than the baselines. This is attributed to the model's better understanding of the reward landscape through local signals.
  • Robustness to Scale: As trajectory lengths increased, the performance gap between FL-GFN and traditional methods widened, proving that local credit is essential for long-horizon tasks.

6. Conclusion and Future Work

Forward-Looking GFlowNets represent a significant step forward in making GFlowNet training more efficient and robust. By decomposing rewards and focusing on local credit, FL-GFN overcomes the challenges of delayed credit assignment and enables learning from incomplete data.

The primary limitation is the requirement for an energy function that can be extended to intermediate states. Future research may focus on learning these intermediate energy functions when they are not explicitly provided, or applying FL-GFN to large-scale reasoning chains where partial "thoughts" must be evaluated.

Summary updated

BibTeX
@inproceedings{pan2023better,
  author = {Ling Pan and Nikolay Malkin and Dinghuai Zhang and Yoshua Bengio},
  title = {{Better Training of GFlowNets with Local Credit and Incomplete Trajectories}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=beHp3L9KXc},
}
Figure