Unifying Generative Models with GFlowNets

Dinghuai Zhang, Ricky T. Q. Chen, Nikolay Malkin, Yoshua Bengio · DOI

Abstract

Generative Flow Networks (GFlowNets) are proposed as a "universal glue" for generative modeling, providing a single framework that encompasses Variational Autoencoders (VAEs), Diffusion models, and Autoregressive models. By viewing these models through the lens of Markovian trajectories, this work introduces MLE-GFN, a new training algorithm that leverages trajectory consistency to improve both sample quality and likelihood estimation.

Introduction

The field of deep generative modeling is currently a collection of powerful but disparate "islands," including VAEs, GANs, Autoregressive (AR) models, and Denoising Diffusion Probabilistic Models (DDPMs). While these models all aim to represent complex data distributions, they are rarely discussed in a unified way. Furthermore, GFlowNets—a relatively new framework—were originally designed for sampling diverse items that satisfy a specific reward function rather than learning a distribution from a fixed dataset. This paper bridges that gap, showing how GFlowNet theory can unify existing models and provide a practical recipe for improving them.

Methodology: Unification via Trajectories

The authors demonstrate that most popular generative models can be interpreted as GFlowNets by defining their sampling processes as Markovian trajectories—sequences of states leading from an initial "nothing" state to a final data object.

The Unification Framework

The researchers mathematically map Hierarchical VAEs, Diffusion models (DDPM and ScoreSDE), Schrödinger Bridges, and Autoregressive models into the GFlowNet framework. For example, in an HVAE, the decoder acts as the GFlowNet's forward policy, while the encoder acts as the backward policy.

Trajectory Balance Consistency (TBC)

Standard GFlowNets require a reward function to train. In generative modeling, where only a dataset is available, the authors propose a consistency loss ($L_{TBC}$). This ensures that different paths leading to the same data point have consistent probability flows, effectively allowing GFlowNet principles to be applied to Maximum Likelihood Estimation (MLE).

Algorithm 1: MLE-GFN training procedure.

The resulting MLE-GFN Algorithm uses a training loop where the forward policy is optimized to maximize the evidence lower bound (ELBO), while the backward policy is regularized using the TBC objective to ensure trajectory consistency.

Experimental Evaluation

The researchers evaluated their approach on two main fronts:

  • 2D Synthetic Benchmarks: Seven complex distributions (e.g., 2spirals, 8gaussians, moons, checkerboard) quantized into 32-dimensional binary space.
  • CIFAR-10: A standard image dataset used to test the model's ability to scale to high-dimensional, natural image data.

Key Results and Insights

The core "aha moment" of this work is that almost all generative models are just different ways of defining a sequence of stochastic decisions. By focusing on the trajectory rather than just the end result, we gain a more flexible toolkit for training.

The Importance of the Backward Policy

In many models, like Diffusion, the backward process is often fixed or constrained. GFlowNets suggest that learning a flexible backward policy and enforcing consistency between the forward and backward paths can act as a powerful regularizer. For instance, in DDPMs, the variance is often kept constant for stability; the authors show that using GFlowNet consistency allows them to "defreeze" these parameters, leading to better expressiveness without the usual instability.

Performance comparison on CIFAR-10.

As shown in the table above, the proposed MLE-GFN method showed significant improvements over standard baselines:

  • CIFAR-10: MLE-GFN achieved a better FID score (10.062) compared to the DDPM baseline (10.616) and improved DDPM (10.823). It also achieved a lower NLL (4.157 bits/dim) than both baselines.
  • Synthetic Data task: MLE-GFN outperformed existing methods like PCD and ALOE in terms of Maximum Mean Discrepancy (MMD) and Negative Log-Likelihood (NLL) across nearly all 2D tasks.

Unlike some "improved" diffusion models that sacrifice sample quality for better likelihood (or vice versa), MLE-GFN improved both metrics simultaneously.

Limitations and Future Work

Despite its success, the authors noted that they trained with limited resources (e.g., fewer denoising steps than state-of-the-art diffusion papers). The full scaling potential of MLE-GFN on massive datasets like ImageNet remains to be seen. Additionally, implementing the trajectory consistency loss adds complexity to the training pipeline compared to simple regression-based denoising.

Future research may lead to "hybrid" models that combine the best traits of different frameworks—for example, a model that has the exact likelihood of an AR model but the fast, parallel sampling of a Diffusion model.

Summary updated

BibTeX
@misc{zhang2022unifying,
  author = {Dinghuai Zhang and Ricky T. Q. Chen and Nikolay Malkin and Yoshua Bengio},
  title = {{Unifying Generative Models with GFlowNets}},
  year = {2022},
  eprint = {2209.02606},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2209.02606},
}
Figure