Efficient Diversity-Preserving Diffusion Alignment via Gradient-Informed GFlowNets

Technical Report

1Mila, Université de Montréal, 2Max Planck Institute for Intelligent Systems - Tübingen,
3University of Tübingen, 4Cambridge University
Corresponding author   *Equal contribution  

 

Nabla-GFlowNets is an efficient, diversity-preserving finetuning method for diffusion alignment by achieving a balance between all ''forces'':

1) the score of the finetuned diffusion model, 2) the score of the pretrained model,

3) the (predicted) reward gradient, 4) the learned (residual) flow score function

Abstract

While one commonly trains large diffusion models by collecting datasets on target downstream tasks, it is often desired to align and finetune pretrained diffusion models on some reward functions that are either designed by experts or learned from small-scale datasets. Existing methods for finetuning diffusion models typically suffer from lack of diversity in generated samples, lack of prior preservation, and/or slow convergence in finetuning. Inspired by recent successes in generative flow networks (GFlowNets), a class of probabilistic models that sample with the unnormalized density of a reward function, we propose a novel GFlowNet method dubbed Nabla-GFlowNet (abbreviated as \methodname), together with an objective called \graddb, plus its variant \resgraddb for finetuning pretrained diffusion models. These objectives leverage the rich signal in reward gradients for diversity- and prior-aware finetuning. We show that our proposed method achieves fast yet diversity- and prior-preserving finetuning of Stable Diffusion, a large-scale text-conditioned image diffusion model, on different realistic reward functions.

Qualitative Comparison on Aesthetic Score

We finetune all models for 200 update steps and pick the model with the best reward but without collapsed samples.


Core Idea

We treat the inference process of a diffusion model as a GFlowNet, which satisfies the Detailed Balance (DB) condition: the forward (denoising) PF and the backward (noising) PB process must be bridged by a function called the flow function F(x_t).

From the DB condition, we derive the equivalent gradient-informed ∇-DB condition that is better suited for diffusion models.

Given a pretrained model PF# as the prior, we further derive the Residual ∇-DB condition.

BibTeX