Diffusion Generative Flow Samplers: Improving learning signals through partial trajectory optimization

Dinghuai Zhang, Ricky T. Q. Chen, Cheng-Hao Liu, Aaron Courville, Yoshua Bengio

Sampling from intractable, high-dimensional unnormalized density functions is a fundamental challenge in machine learning and the physical sciences, essential for tasks like calculating partition functions or performing posterior inference.

Recent approaches treat this as a stochastic optimal control problem, training diffusion models to guide a simple starting distribution toward a complex target density. However, existing methods like Path Integral Samplers (PIS) and Denoising Diffusion Samplers (DDS) suffer from a major bottleneck: sluggish credit assignment. Because the learning signal (or "reward") is only available at the very end of a long sampling trajectory, the model struggles to identify which specific intermediate steps contributed to a poor final result. This leads to high gradient variance and slow, unstable convergence.

To solve this, researchers introduce Diffusion Generative Flow Samplers (DGFS), a framework that bridges the gap between diffusion-based sampling and Generative Flow Networks (GFlowNets). By parameterizing an additional "flow function," DGFS allows models to learn from short, partial trajectory segments rather than requiring full paths.

The DGFS Approach

DGFS adapts the principles of GFlowNets to the continuous diffusion setting. The key innovation is the introduction of a state flow function, $F_n(x_n)$, which acts as a helper to approximate the marginal density at each intermediate step. This effectively amortizes the complex integration required to understand the path.

  • Partial Trajectory Optimization: Instead of calculating a loss over the entire path, DGFS uses a "Subtrajectory Balance" (SubTB) objective. This allows the model to update its parameters based on any segment of the path (e.g., from step $n$ to $n+k$).
  • Intermediate Signals: DGFS uses a "forward-looking trick" to provide local learning signals at every step. By interpolating between the simple starting density and the complex target density, it gives the model a hint of where to go throughout the process.
  • Off-Policy Learning: Because the objective is based on consistency (Detailed Balance), DGFS can learn from trajectories it didn't generate itself, allowing for more aggressive exploration of the state space.

Key Insights: Variance Reduction and Mode Coverage

A major advantage of DGFS is its ability to stabilize training. By breaking the problem into smaller pieces, the noise associated with long-term dependencies is mitigated.

Gradient variance comparison between DGFS and PIS

As shown above, DGFS exhibits significantly lower gradient variance compared to baseline methods like PIS. Furthermore, standard diffusion samplers often "collapse" and miss modes in complex landscapes. DGFS’s use of intermediate signals and off-policy exploration helps it discover and maintain all modes in complex distributions, such as a 9-mode Mixture of Gaussians or a 32-dimensional Manywell task.

Experimental Results

DGFS was evaluated on a suite of challenging benchmarks, including a Mixture of Gaussians (MoG), a 10D Funnel distribution, a 32D Manywell task, a 30D VAE latent posterior, and a 1600D Log Gaussian Cox process.

Performance comparison of DGFS against baseline samplers across various benchmarks

DGFS consistently achieves the lowest absolute estimation bias for the log-normalizing constant ($\log Z$) across almost all benchmarks. For instance, on the VAE task, DGFS achieved a bias of 0.180, compared to 2.049 for PIS and 1.740 for DDS. On the high-dimensional Cox task, DGFS significantly outperformed PIS (8.974 vs. 11.28), while DDS failed to produce a valid result.

Limitations and Future Work

While highly effective, DGFS requires training an additional flow network, adding roughly 20% computational overhead per training batch compared to PIS. Additionally, while learning from shorter segments reduces variance, it can theoretically introduce bias if the flow function is poorly approximated. Balancing this bias-variance trade-off remains an open area for refinement. Future work may explore more sophisticated designs for intermediate local signals and applications in protein conformation modeling and computational chemistry.

Summary updated

BibTeX
@inproceedings{zhang2024diffusion,
  author = {Dinghuai Zhang and Ricky T. Q. Chen and Cheng-Hao Liu and Aaron Courville and Yoshua Bengio},
  title = {{Diffusion Generative Flow Samplers: Improving learning signals through partial trajectory optimization}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=OIsahq1UYC},
}
Figure