arXiv:2610.38994cs.LGOct 2026

Manuscript Offprint

arXiv:2610.38994

Rethinking GFlowNet Training: Negative Reinforce Dynamics

Pedro Dall'Antonia, Daniel Csillag, Diego Mesquita

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Generative Flow Networks (GFlowNets) are models that learn to sample discrete objects proportional to a target reward. They are trained by minimizing balance errors over sampled trajectories, which inherently ties correctness to exploration: if a region is not visited, balance cannot be enforced there. Adaptive exploration is therefore crucial, yet standard training relies on a semi-gradient update that treats the sampling distribution as fixed at each optimization step. On the other hand, the full gradient reveals a second mechanism that reduces the observed errors in an anti-exploratory manner. In this paper, we establish a connection between the full gradient and min-min dynamics between the GFlowNet and a decoupled sampler, showing that the sampler reduces observed violations by avoiding high-error regions. This insight motivates a bridge between two-player games and single-policy dynamics, which underpins the design of our proposed method, Negative Reinforce Dynamics (NRD). By tying the parameters of an adversarial game together, we recover a single-policy dynamic that extends exploration while maintaining correctness. In standard benchmarks, our method outperforms existing approaches in both convergence speed and exploration efficiency, without training a separate teacher or auxiliary exploration policy.

1 INTRODUCTION

Generative Flow Networks (GFlowNets) learn stochastic policies that construct structured objects with probability proportional to a nonnegative reward (Bengio et al., 2021; 2023). Their ability to generate diverse high-reward samples has made them useful in applications ranging from biological sequence design (Jain et al., 2022) and Bayesian structure learning (Deleu et al., 2023) to recent approaches for language-model post-training (Hu et al., 2024; Bartoldson et al., 2025).

Training a GFlowNet to sample from the target distribution is formulated by enforcing balance conditions, with correctness holding if and only if balance is satisfied globally (Bengio et al., 2023). During training, however, balance can only be corrected on trajectories that are observed, leaving poorly visited regions potentially uncorrected (Madan et al., 2025; Dall'Antonia et al., 2026b). To mitigate this problem, training trajectories are often collected from an exploratory sampler, such as an ε\varepsilon-greedy policy, in order to broaden coverage (Whitammer et al., 2022). Previous work has furthermore introduced exploration mechanisms that use auxiliary samplers or teacher policies to expose the GFlowNet to regions where balance errors remain large (Kim et al., 2025; Dall'Antonia et al., 2026a).

In this paper we opt for a different path, revisiting how we solve the balance conditions in GFlowNet training. In the usual training pipeline, balance is enforced by turning local violations into a loss and minimizing its expectation over a sampling policy. However, with an adaptive sampling distribution that evolves during training, decreasing this expected loss may not correspond to correcting the underlying violations: if the policy adapts to avoid high-loss regions, then we will reduce the expected loss while retaining significant balance violations. This can be seen by analyzing the gradient of this expected loss, when differentiating through a parameter-dependent sampler QθQ_\theta, using the score-function identity (Williams, 1992):

∇θEτ∼Qθ[Lθ(τ)]=EQθ[∇θLθ(τ)]⏟semi-gradient+EQθ[Lθ(τ)∇θlog⁡Qθ(τ)]⏟score term.(1)\nabla_{\theta}\mathbb{E}_{\tau\sim Q_{\theta}}[L_{\theta}(\tau)]=\underbrace{\mathbb{E}_{Q_{\theta}}[\nabla_{\theta}L_{\theta}(\tau)]}_{\text{semi-gradient}}+\underbrace{\mathbb{E}_{Q_{\theta}}[L_{\theta}(\tau)\nabla_{\theta}\log Q_{\theta}(\tau)]}_{\text{score term}}. \tag{1}

Figure

Figure 1: Two-trajectory dynamics. Left: log-ratio discrepancy over continuous time. Right: vector fields and trajectories in (p1,log⁡Z)(p_1, \log Z) from a common initialization. NRD reduces the discrepancy faster than semi-gradient TB in this example, while Naive NRD (NNRD) and the full expected-loss gradient fail to reach the balanced solution (green star).

This reveals two mechanisms for decreasing the loss: one which corrects balance violations (the semi-gradient term) and one which avoids high-loss regions (the score term). Standard GFlowNet training keeps only the former by using a semi-gradient, which holds the sampling distribution fixed in the gradient computation even when that distribution depends on θ\theta. The second term reveals an additional mechanism through which the sampling distribution can reduce the expected loss, which, under ordinary minimization, lowers the objective without enforcing balance – which is generally undesirable.

Nevertheless, we ask whether this mechanism can instead be turned into a beneficial exploration signal. To do so, we reframe the full-gradient dynamics encapsulated in Equation 1 as a ‘weight-tied’ version of a cooperative two-player game between the GFlowNet and the sampling policy, and argue that it is this cooperation that leads to the harmful score term. To rectify this we formulate a second game, this time adversarial, which yields a novel beneficial exploration mechanism. By appropriately tying the two players’ weights we obtain our proposed scheme, Negative Reinforce Dynamics (NRD), which we find to perform significantly better than standard trajectory balance training, at little additional cost.

We establish theoretical guarantees for these dynamics in tractable population models. In the free-trajectory setting, NRD converges globally to the balanced solution and admits a pointwise log-ratio discrepancy comparison with semi-gradient Trajectory Balance. In one-dimensional exponential families under fast normalization, NRD reaches any positive Jeffreys-divergence threshold sooner from a common initialization, with an unbounded additive advantage in the two-trajectory setting.

Finally, we evaluate NRD across multimodal distribution-matching and structured-generation tasks. The method improves convergence to target distributions and finite-budget exploration relative to standard Trajectory Balance and comparable-cost baselines, while remaining competitive with approaches that train auxiliary exploration policies. Despite its two-player motivation, NRD requires only a sign-selective score correction, applied only to trajectories with negative residuals, on top of the standard Trajectory Balance update and does not require a separately trained sampler.

References (60)