Efficient Diversity-Preserving Diffusion Alignment via Gradient-Informed GFlowNets

Zhen Liu, Tim Z. Xiao, Weiyang Liu, Yoshua Bengio, Dinghuai Zhang

TL;DR $\nabla$-GFlowNet (Nabla-GFlowNet) is a novel reinforcement learning framework designed to fine-tune diffusion models. It maximizes specific rewards—such as aesthetic appeal or human preference—without sacrificing sample diversity or causing the model to "forget" how to generate natural images. By directly incorporating reward gradients into the Generative Flow Network (GFlowNet) objective, the method achieves a superior Pareto trade-off between high reward, fast convergence, and the preservation of the original model's creative prior.

The Alignment Trilemma

Large-scale diffusion models like Stable Diffusion are powerful generalists, but aligning them with specific goals (e.g., making images safer, more aesthetic, or better at following complex instructions) typically requires fine-tuning with a reward function. Current alignment methods face a persistent "trilemma":

  1. Mode Collapse: Traditional RL methods often converge on a handful of high-reward samples, destroying the inherent diversity of diffusion models.
  2. Prior Forgetting: A model might achieve a high "aesthetic score" but begin producing unnatural artifacts because it has lost the "prior" knowledge of its pre-training.
  3. Efficiency: Gradient-free methods (like DDPO) maintain diversity but are slow to converge. Conversely, existing gradient-based methods (like ReFL) are fast but prone to severe mode collapse and training instability.

Introducing $\nabla$-GFlowNet

To solve this trilemma, the authors introduce $\nabla$-GFlowNet, which treats the diffusion denoising process as a trajectory within a GFlowNet. Unlike standard RL that seeks to maximize a reward, GFlowNets aim to sample states with a probability proportional to their reward, inherently preserving diversity.

The framework relies on three key technical innovations:

  • $\nabla$-DB (Gradient-Informed Detailed Balance): By taking the derivative of the standard GFlowNet "Detailed Balance" condition, the model utilizes the rich information in reward gradients (the "direction" of better images) to update the denoising policy, drastically speeding up training.
  • Residual $\nabla$-DB: To prevent the model from drifting too far from its original training, it learns a "residual" objective. Instead of learning the entire flow from scratch, the model learns the difference between the pre-trained model and the target reward-aligned model.
  • Forward-Looking (FL) Trick: A "one-step-ahead" prediction of the reward gradient provides better credit assignment during the long chain of denoising steps, helping the model identify which early decisions lead to better final results.
Methodology and Qualitative Results

Datasets and Evaluation

The researchers evaluated $\nabla$-GFlowNet by fine-tuning Stable Diffusion v1.5 using three primary reward models:

  • Aesthetic Score: Predicts human preference for visual quality.
  • HPSv2 (Human Preference Score): Captures general human preference based on large-scale choice data.
  • ImageReward: A text-to-image alignment score designed to reduce hallucinations and improve prompt adherence.

Key Insights and Results

  • Gradients as an Accelerator: While GFlowNets are traditionally "zeroth-order" (only seeing the final reward value), differentiating the objective turns them into a "first-order" method that navigates the optimization landscape much faster.
  • Stability Through Residuals: By focusing on the change required to reach the reward rather than re-learning the whole distribution, the model stays anchored to the high-quality natural image distribution of the original Stable Diffusion.
  • Pareto Superiority: In head-to-head comparisons, $\nabla$-GFlowNet consistently achieved higher rewards at the same level of diversity (measured by DreamSim) and prior preservation (measured by FID) compared to baselines like DDPO, ReFL, and DRaFT.
  • Robustness: While gradient-based baselines often suffered from "semantic collapse" (distorted or repetitive images after many steps), $\nabla$-GFlowNet remained robust even after hundreds of iterations, producing images that look like high-quality, stylized versions of the original model's output.

Limitations and Future Work

The core advantage of $\nabla$-GFlowNet requires a differentiable reward function; it cannot be used directly with non-differentiable rewards (like a human-in-the-loop) without a surrogate model. Additionally, calculating gradients through the reward model and the U-Net at multiple timesteps is more memory-intensive than gradient-free RL. Future work may extend this approach to video or 3D generation, where maintaining diversity and prior knowledge is even more critical.

Summary updated

BibTeX
@inproceedings{liu2025efficient,
  author = {Zhen Liu and Tim Z. Xiao and Weiyang Liu and Yoshua Bengio and Dinghuai Zhang},
  title = {{Efficient Diversity-Preserving Diffusion Alignment via Gradient-Informed GFlowNets}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=Aye5wL6TCn},
}
Figure