Avoiding mode collapse in diffusion models fine-tuned with reinforcement learning

## Abstract

Abstract Fine-tuning foundation models via reinforcement learning (RL) has proven promising for aligning to downstream objectives. In the case of diffusion models (DMs), though RL training improves alignment from early timesteps, critical issues such as training instability and mode collapse arise. We address these drawbacks by exploiting the hierarchical nature of DMs: we train them dynamically at each epoch with a tailored RL method, allowing for continual evaluation and step-by-step refinement of the model performance (or alignment). Furthermore, we find that not every denoising step needs to be fine-tuned to align DMs to downstream tasks. Consequently, in addition to clipping, we regularise model parameters at distinct learning phases via a sliding-window approach. Our approach, termed Hierarchical Reward Fine-tuning (HRF), is validated on the Denoising Diffusion Policy Optimisation method, where we show that models trained with HRF achieve better preservation of diversity in downstream tasks, thus enhancing the fine-tuning robustness and at uncompromising mean rewards.

## 1 Introduction

Diffusion models (DMs) are the *de facto* state of the art in prompt-based generative modelling across various tasks including text-to-image, text-to-video, molecular graph modelling and medical image reconstruction (Ramesh et al., ; Rombach et al., ; Ho et al., ; Singer et al., ; Jing et al., ; Song et al., ). Most of these applications build on the original Denoising Diffusion Probabilistic Model (DDPM) by Ho et al. (), but the extension to other formulations and variants is fast growing. It includes Score-based and Flow matching generative models, among others (Song and Ermon, ; Song et al., ; Lipman et al., ).

Recent works use Reinforcement Learning (RL) to align DMs to downstream tasks that are otherwise difficult to address, e.g., via explicit class labelling, such as generating *aesthetic* images following a specific prompt, or producing images admitting significant JPEG compression rates. These methods, such as the Denoising Diffusion Policy Optimization (DDPO) (Black et al., ) and others (Deng et al., ; Fan et al., ), formulate the denoising steps as a Markov Decision Process (MDP) controlled through a reward function. Despite recent works (Ouyang et al., ; Schulman et al., ) making RL fine-tuning more stable and accurate, the consequence for alignment in reward-based DDPM extensions are skewed generated samples, which lead to *mode collapse*, i.e., when the model’s inherent diversity vanishes. Fig. 1 shows samples from DDPM and DDPO to illustrate that, although DDPO provides better samples than DDPM (in terms of the LAION aesthetic score in this case), it sacrifices sample diversity: the images look the same.

We build on the hierarchical interpretation of DDPMs (Sclocchi et al., ) and propose a methodology called *Hierarchical Reward Fine-tuning* (HRF), which performs reward-based learning from different timesteps in the diffusion using a sliding window approach. In DDPM, the HRF window selection mechanism fixes high-level features and generates variations in low-level features, facilitating exploration while preserving the sample’s semantics, as illustrated in Fig. 3. To achieve this, we identify distinct stages in the learning process, distinguishing between high- and low-level features, and apply online RL at each stage, thus effectively training intermediate steps in the diffusion. Our proposal thus enables a controlled learning scheme promoting sample diversity, mitigating mode collapse, and thus successfully aligning diffusion models (DMs) to downstream tasks.

The proposed HRF is implemented and experimentally assessed in the generation of RL-optimised diversity-preserving samples within DDPM. To this end, we consider a DM pre-trained on CelebaHQ (Karras et al., ), and fine-tuned over three downstream tasks originally considered in (Black et al., ): compressibility, incompressibility and LAION aesthetic score. Fig. 4 shows a succinct illustration of the results of our method for each of these tasks.

The key contributions of our work are:

- •
Insights into the learning dynamics of DDPMs when fine-tuned via online RL.
- •
A critical assessment of the state of the art, in terms of its inability to preserve sample diversity due to an overoptimisation in noisy (early) stages of the diffusion chain.
- •
A novel framework for preserving sample diversity in DDPMs fine-tuned with RL, based on a hierarchical interpretation of diffusion models, called Hierarchical Reward Fine-tuning (HRF).
- •
An experimental validation of HRF demonstrating: i) advantages in controlled learning, ii) reduced need for reward handcrafting, and iii) improved preservation of sample diversity compared to DDPO.

Figure: Figure 1: Comparison of Image Synthesis Using CelebA-HQ-Based Models. 2D projection of CLIP embeddings for two sets of 1,000 samples: i) DDPM samples (black borders) and ii) DDPO samples fine-tuned with the LAION aesthetic reward (white borders). The DDPO samples were optimized to achieve a higher average aesthetic score ($5.58$ vs. $5.11$), indicating better aesthetic quality. Notably, the DDPO samples cluster more tightly (red ellipse) around the highest-scoring DDPM sample, indicating a mode collapse effect. Both sets of samples were generated using the same seed.
Refer to caption: extracted/5917608/imgs/emb-space-ddpo-vs-ddpm2.png

## 2 Related work

### 2.1 Hierarchical features of diffusion models

Recent studies have highlighted the hierarchical nature of data generation in diffusion models, particularly in the case of images. For instance, Sclocchi et al. () found that a phase transition occurs during the backward diffusion at a specific timestamp. Beyond this point, the probability of reconstructing high-level features drops rapidly, while low-level features (details) change slower. High-level features typically refer to global attributes, such as overall face structure or hair type, whereas low-level features involve finer details, like skin texture or small facial details. This implies that high-level features are more susceptible to temporal changes in the diffusion process, whereas low-level features remain relatively stable across the diffusion. This observation is pivotal in our work, as we will develop a methodological approach to learn favourable representations for downstream tasks at distinct steps in the diffusion process. The main rationale behind our diversity-preserving approach is to target the early steps of the diffusion process trajectory we are training on.

### 2.2 Diffusion model training at different noise levels

The learning dynamics and convergence properties of DDPM at different stages of the diffusion process have been studied by Hang et al. (), finding that convergence speed is related to the learning difficulty associated with each timestep. Additionally, Xu et al. () adopted a perspective of curriculum learning and found that DDPMs learn the early steps easier than the later ones across the denoising procedure. This curriculum learning approach allows for the design of learning strategies tailored for each step of the diffusion, thus improving the convergence speed.

### 2.3 Training diffusion models with reinforcement learning

Approaches to train DDPMs by modelling the diffusion chain as an MDP leverage different loss formulations and regularization techniques (Black et al., ; Fan et al., ; Deng et al., ). However, they all build upon the same RL setup: they refine loss definitions and mitigate the degeneration of sample diversity through regularization and hyperparameter tuning, but they do not exploit the hierarchical nature of data generation inherent in diffusion models. This means that although these approaches successfully fine-tune the models for downstream tasks in terms of their achieved rewards, they do so struggling to propagate learning across all diffusion steps in a controlled manner, ultimately compromising diversity. Our contribution aims to address this limitation.

## 3 Background

### 3.1 Diffusion models

Let us consider denoising diffusion probabilistic models (DDPMs) (Ho et al., ; Sohl-Dickstein et al., ), which represent a distribution $p(\mathrm{x}_{0}|c)$ over data samples $\mathrm{x}_{0}\in\mathcal{X}$ conditioned on contexts $c\in\mathcal{C}$. This distribution is defined by reversing the forward Markovian process $q(\mathrm{x}_{t}|\mathrm{x}_{t-1},c)$, where the chain $\{\mathrm{x}_{t}\}_{t=0}^{T}$ is a sequence of samples with increasing levels of noise such that $\mathrm{x}_{0}$ represents a clean data sample and $\mathrm{x}_{T}$ a completely noisy one, where all the data structure has been broken.

The transition probability of the backward process is typically modelled as a Gaussian with a learnable mean $\mu_{\theta}(\mathrm{x}_{t},c,t)$ and a fixed variance $\sigma_{t}^{2}$ (Ho et al., ; Song et al., ), that is,

$$ $p_{\theta}(\mathrm{x}_{t-1}|\mathrm{x}_{t},c)=\mathcal{N}(\mathrm{x}_{t-1}|\mu _{\theta}(\mathrm{x}_{t},c,t),\sigma_{t}^{2}I).$ (1) $$

The mean $\mu_{\theta}(\mathrm{x}_{t},c,t)$ is usually parameterised by a neural network trained with the objective:

$$ $L_{\text{DDPM}}(\theta)=\mathbb{E}_{(\mathrm{x}_{0},c)\sim p(\mathrm{x}_{0},c) ,t\sim U\{0,T\},\mathrm{x}_{t}\sim q(\mathrm{x}_{t}\mid\mathrm{x}_{0})}\left[ \|\mu(\mathrm{x}_{0},t)-\mu_{\theta}(\mathrm{x}_{t},c,t)\|^{2}\right],$ (2) $$

where $\mu(\mathrm{x}_{0},t)=\mathbb{E}(\mathrm{x}_{t}|\mathrm{x}_{0})$ is the expectation of $\mathrm{x}_{t}$ under the forward process defined by the transition kernel $q(\mathrm{x}_{t}|\mathrm{x}_{t-1})$. This objective maximizes a variational lower bound on the log-likelihood of the data (Ho et al., ; Luo, ).

Once the DDPM is trained, i.e., the neural net $\mu_{\theta}(\mathrm{x}_{t},c,t)$ is learned, data generation occurs via sampling. This starts by first drawing a pure-noise sample $\mathrm{x}_{T}\sim\mathcal{N}(0,I)$ and then realising the reverse process in equation 1 to produce the sequence (or trajectory) $\{\mathrm{x}_{T},\mathrm{x}_{T-1},\ldots,\mathrm{x}_{0}\}$, where $\mathrm{x}_{0}$ is the desired sample.

### 3.2 Diffusion model as a sequential decision-making process

Figure: Figure 2: Equivalence of the backward process of a diffusion model as a sequential decision-making process. The initial state distribution of this MDP corresponds to an isotropic Gaussian, $\rho_{0}(s_{0})\sim\mathcal{N}(0,\mathrm{I})$, where we assign the noise instance to the initial state $s_{0}=\mathrm{x}_{T}$. The agent follows a sequence of decisions $a_{t}$ determined by the policy $\pi_{\theta}(a_{t}\mid s_{t}):=p_{\theta}(\mathrm{x}_{T-t-1}\mid\mathrm{x}_{T- t})$, moving from a noisy state $\mathrm{x}_{T-t}$ to a less noisy one $\mathrm{x}_{T-t-1}$ until it reaches to the sample $\mathrm{x}_{0}$, illustrated as the terminal state $s_{T}$ in the diagram. This process generates the whole denoising trajectory $\tau=\{\mathrm{x}_{T},\mathrm{x}_{T-1},\mathrm{x}_{T-2},\dots,\mathrm{x}_{0}\}$, which is associated with a reward. In the case of DDPO, the reward model $R$ only depends on the final, i.e., sample $r(\mathrm{x}_{0})$.
Refer to caption: extracted/5917608/imgs/diffusion-model-MDP.png

As a starting point, let us consider the denoising diffusion policy optimization (DDPO) formulation (Black et al., ). In this setting, the DDPM backward process can be interpreted as an MDP, where the policy describes how an agent moves from a state $s_{t}$ with a noisy sample $\mathrm{x}_{T-t}$ to a state $s_{t-1}$ with a cleaner sample $\mathrm{x}_{T-t-1}$, through its denoising actions $a_{t}:\mathrm{x}_{T-t}\rightarrow\mathrm{x}_{T-t-1}$. This occurs from the
initial state $\mathrm{s}_{0}$, where a noise sample is drawn from an isotropic Gaussian distribution
$\rho_{0}\sim\mathcal{N}(0,I)$ and assigned to $\mathrm{x}_{T}$, until arriving at a terminal state $s_{T}$, where the sample $\mathrm{x}_{0}$ is generated. Fig. 2 illustrates this RL formulation of DDPM.

In DDPO, a denoising neural network $p_{\theta}$ is used to directly estimate $s_{t}$ at timestep $t-1$ (or, indirectly, estimate the corresponding noise), defining the policy $\pi_{\theta}(a_{t},s_{t})$. In this post-training framework, the diffusion model parameters $\theta$ can be directly optimized via policy gradient estimation to maximize any arbitrary scalar-reward signal over the sample. $\mathrm{x}_{0}$ In other words, the agent learns to denoise trajectories in order to maximize the expected reward, leveraging the denoising diffusion reinforcement learning (DDRL) objective
(Black et al., ):

$$ $\mathcal{J}_{\text{DDRL}}(\theta)=\mathbb{E}_{c\sim p(c),\mathrm{x}_{0}\sim p_ {\theta}(\mathrm{x}_{0}|c)}[r(\mathrm{x}_{0},c)].$ (3) $$

A critical aspect of this formulation is that the reward $R(s_{t},a_{t})$
only considers the final sample $\mathrm{x}_{0}$, neglecting every non-terminal state $s_{T}$, or equivalently samples $\mathrm{x}_{t\neq 0}$, as depicted in Figure 2.

Furthermore, DDPOs compute gradients either via a score function method, also known as REINFORCE (Schulman et al., ), or optimising a surrogate objective via importance sampling (Schulman et al., ). The latter, denoted $\text{DDPO}_{\text{IS}}$ with gradient given by

$$ $(\text{DDPO}_{\text{IS}})~{}~{}\nabla_{\theta}\mathcal{J}=\mathbb{E}_{\mathrm{ x}_{T:0}\sim p_{\theta_{\text{old}}}}\bigg{[}\sum_{t=0}^{T}\frac{p_{\theta}( \mathrm{x}_{t-1}|\mathrm{x}_{t})}{p_{\theta_{\text{old}}}(\mathrm{x}_{t-1}| \mathrm{x}_{t})}\nabla_{\theta}\log p_{\theta}(\mathrm{\mathrm{x}_{t-1}| \mathrm{x}_{t}})r(\mathrm{x}_{0})\bigg{]},$ (4) $$

is used as a baseline in our paper to compare the proposed method.(^1^11From now on, when we refer to DDPO, we mean $\text{DDPO}_{\text{{IS}}}$ unless specified otherwise.)
Note that computing
$p_{\theta}$ and $\log p_{\theta}$ in equation 4 is straightforward when
$p_{\theta}$ is a conditional Gaussian distribution.

### 3.3 Diversity loss due to overparameterization in the early phases of denoising

As discussed in Secs. 2.1 and 2.2, learning in DDPM models is more effective during the noisy stages of diffusion and becomes increasingly difficult as noise is reduced. We confirm that this trend also applies to RL-based diffusion via a succinct experimental example. By employing injection sampling, a process where sampling is started with the fine-tuned model and then switched to the base model at step $t$ to continue the sampling, we observed that interventions made in the noisier stages of the denoising process have the most significant impact on the resulting samples. A detailed description of the experiment can be found in Appendix A.1.

## 4 Hierarchical reward fine-tuning for diffusion models

Figure: Figure 3: Hierarchical Reward Fine-tuning (HRF). In DDPO (purple), the entire denoising trajectory is influenced, affecting both high- and low-level features. In contrast, HRF intervenes at later timesteps of the trajectory, selecting an specific timestep $t$ based on a window selection schema. At this point, an intermediate state $s_{t}\sim\rho_{t}$ is drawn from a new prior distribution, primarily adjusting low-level features while preserving high-level features and diversity, yet still achieving high rewards ($s_{T}^{1}$ yellow star). During policy rollouts, HRF generates divergent trajectories from $s_{t}$ by introducing noise at intermediate timesteps. This serves as a low-level feature exploration mechanism to discover regions with higher reward potential ($s_{T}^{2}$ yellow star) given the high-level information set by the new prior $\rho_{t}$. In both cases, the dataset of trajectories and rewards $\mathcal{D}^{\pi_{\theta}}$ is used to estimate the gradients via Monte Carlo sampling, which are then applied to update the diffusion model parameters. HRF-D dynamically adjusts the vertical window selection line during fine-tuning.
Refer to caption: extracted/5917608/imgs/ddpo-to-hrf.png

This section describes our main contribution by defining the problem statement and the methodology employed to solve it.

### 4.1 Hierarchical representation of training

Our approach, HRF, is underpinned by the hierarchical nature of sample generation in diffusion models as identified by Sclocchi et al. (). With this in mind, we propose the training diagram illustrated in Figure 3. Each training step starts at a noisy step $t$ using an image prior, guiding the model to learn from favorable policies at that stage. This is achieved by computing the trajectories and their corresponding rewards for every chosen initial step and then propagating the learning to those starting points. This approach leverages the fact that structural changes in generated samples occur at different stages of the diffusion chain, where the rate of change varies depending on the learning difficulty (Xu et al., ; Hang et al., ). The methodology remains flexible enough to allow evaluation on fully denoised samples for each step $t$, while also facilitating the assessment of reward functions at intermediate steps. This capability helps in selecting better policies throughout the diffusion chain.

We propose two variants of the aforementioned methodology based on the window selection mechanism: HRF, which uses manually defined windows for selecting initial steps, and HRF-D, which employs a dynamic window sampling strategy. Refer to Section 4.3 for more details about the window selection schemes.

A major benefit of our proposed methodology is the control over when and where to optimize the DMs distinct phases, particularly for training using RL on downstream rewards that are hard to describe explicitly. Furthermore, HRF is independent of the chosen loss definitions since it still uses the final sample to represent the information conveyed in the segment of the denoising trajectory under evaluation. Another significant benefit of HRF comes from splitting the learning task into multiple training steps (abiding by the hierarchical nature of training), which allows us to optimize hyper-parameters or skip phases in a controlled manner.

### 4.2 Trajectory of Interest Sampling

We define each denoising step in the diffusion chain as $p_{\theta}(\mathrm{\mathrm{x}_{t-1}|\mathrm{x}_{t}},c)$. For a given time step $t$, we use importance sampling so that the objective function defined in DDPO with our modified trajectory window is:

$$ $(\text{DDPO}_{\text{IS}_{\text{window}}})~{}~{}\nabla_{\theta}\mathcal{J}= \mathbb{E}_{\mathrm{x}_{0:t}\sim p_{\theta_{\text{old}}}}\bigg{[}\sum_{t=0}^{t }\frac{p_{\theta}(\mathrm{x}_{t-1}|\mathrm{x}_{t},c)}{p_{\theta_{\text{old}}}( \mathrm{x}_{t-1}|\mathrm{x}_{t},c)}\nabla_{\theta}\log p_{\theta}(\mathrm{ \mathrm{x}_{t-1}|\mathrm{x}_{t}},c)r(\mathrm{x}_{0})\bigg{]},$ (5) $$

where the likelihood is computed over the modified diffusion trajectory. This is from $t\to 0$, as its computed over the intermediate step selected by the window selection mechanism to the final state. We also employ trust regions to address inaccurate estimations of $p_{\theta}$.

To maintain the consistency of our MDP definition, and as importance sampling operates over the batch where the likelihood is computed, it is important to ensure that the initial sampling step originates from the same distribution. In the original formulation of DDPO, this is achieved by defining the initial state as a sample from random noise. To replicate these conditions for each batch, we start with a clean image, add random noise up to step $t$ a total of $n$ times, based on a scheduler, and generate trajectories for $n$ samples per batch.

Our MDP definition could be written as:

$$ $\displaystyle s_{t}$ $\displaystyle=(c,t,\mathrm{x}_{t})$ $\displaystyle\pi(a_{t}\mid s_{t})$ $\displaystyle=p_{\theta}(\mathrm{x}_{t-1}\mid\mathrm{x}_{t},c)$ $\displaystyle P(s_{t+1}\mid s_{t},a_{t})$ $\displaystyle=(\delta_{c},\delta_{t-1},\delta_{\mathrm{x}_{t-1}})$ $\displaystyle a_{t}$ $\displaystyle=\mathrm{x}_{t-1}$ $\displaystyle\rho_{0}(s_{0})$ $\displaystyle=(p(c),\delta_{t},\rho(x_{\text{noised}}))$ $\displaystyle R(s_{t},a_{t})$ $\displaystyle=\begin{cases}r(\mathrm{x}_{0},c)&\text{if }t=0\\ 0&\text{otherwise}\end{cases}$ $$

where $\rho(x_{\text{noised}})$ is the distribution of the initial state at step $t$, which is obtained by adding noise sampled from $\mathcal{N}(0,I)$ to a clean image $\mathrm{x}_{0}$ up to step $t$.

For $t=T$, the distribution of the initial state is equal to $\mathcal{N}(0,I)$, which is the original definition provided by DDPO. Generally, this framework is flexible enough to be adapted to any method that uses the original MDP formulation for diffusion models.

### 4.3 Window Selection

We evaluate two window selection schemes: (1) predefined windows that determine initial sampling steps and (2) dynamic window selection, where windows are dynamically chosen by evaluating policies at each noise step. In the dynamic approach, we identify the step $t$ that optimizes the sampling trajectory by finding the policy $\pi(a_{t}\mid s_{t})$ that maximizes reward variation while minimizing divergence from the image prior $\rho(x_{\text{noised}})$. This reward is given by:

$$ $\displaystyle R_{\theta,t}=\text{Reward from}~{}\tilde{x}_{t\rightarrow 0}~{} \mid~{}\pi(a_{t}\mid s_{t}),\quad\pi_{\text{best}}(a_{t}\mid s_{t})=\max_{t} \left(R_{\theta,t}-R_{\theta,t+1}\right)~{}\forall t\in[T-1,0].$ $$

where $\tilde{x}_{t\rightarrow 0}$ is the noise-free version of $x_{t}$. We incorporate a diversity-promoting term by considering the mean distance between samples (at each step) and the prior. The optimal policy is defined as:

$$ $\displaystyle\pi_{\text{best}}(a_{t}\mid s_{t})=\max_{t}\left((R_{\theta,t}-R_ {\theta,t+1})-\beta\cdot D(\rho_{0}(s_{0}),\tilde{x}_{t\rightarrow 0})\right) \quad\forall t\in[T-1,0],$ $$

where $\beta$ is a hyperparameter and $D$ is a distance metric such as cosine distance:

$$ $\displaystyle D(\rho_{0}(s_{0}),\tilde{x}_{t\rightarrow 0}))=\text{mean}\left( D_{\cos}(\rho_{0}(s_{0}),\tilde{x}_{t\rightarrow 0}))\right)\quad\forall\, \text{samples at step }t.$ $$

With this, our training process is as follows:

*Algorithm 1: Initial Step*. For a predefined window, a sampling cluster $C$ is generated for each epoch. For each sample within the batch, a starting step $t_{i}$ is sampled from a uniform distribution over the cluster $C$, and the final state $s_{0}$ for the current batch is generated. If we are dynamically selecting the initial step, we sample all possible intermediate states and select the ones that maximizes the objective detailed above in section 4.3.

*Algorithm 2: Hierarchical Training*. It extends this sampling strategy to the full batch training process. Initially, several reference images are sampled from the selected initial steps (Initial Step). For each batch, noise is added to the final state of the reference image per batch $s_{0}$ to create new initial states $\{s_{i}\}_{i=t}^{\text{num_batches}}$. The algorithm then generates trajectories for a specified number of samples from the corresponding starting steps and applies DDPO to each clipped trajectory.

Figure: Algorithm 1 Initial Step

Figure: Algorithm 2 Hierarchical Training

## 5 Experiments

### 5.1 Tasks and Reward Functions

We employed three downstream tasks as outlined in Black et al. (): compressibility, incompressibility, and aesthetic quality. The first two tasks are defined by the size of images after applying a JPEG compression algorithm, serving as the reward function. For aesthetic quality, we utilized the LAION aesthetic model (Schuhmann, ), a multilayer perceptron that assigns a scalar value from 1 to 10 to indicate the aesthetic quality of an image.

These tasks show RL’s ability to optimize objectives like compressibility, which are hard to encode in a loss function. The LAION aesthetic model further demonstrates how RL leverages human feedback to align diffusion models (Ouyang et al., ).

Figure: Figure 4: Alignment of diffusion model to downstream tasks. This figure shows the visual performance of a diffusion model on three tasks: aesthetic quality, incompressibility, and compressibility. DDPO and HRF achieve similar semantic changes, but HRF better preserves visual diversity, especially for aesthetic quality. While DDPO risks mode collapse by generating similar high-reward images, HRF maintains diversity while improving rewards. HRF-D shows a significant visual shift, with samples differing greatly from the originals but maintaining high diversity. Compressibility skews towards darker samples, yet retains diverse representations.
Refer to caption: extracted/5917608/imgs/hrf-quality-comparison-100dpi.png

### 5.2 Experimental setup

We train our base model using DDPO and our proposed DDPO-based methods with three random seeds each, applying early stopping at a common stable point. First, we train DDPO to a target reward, then fine-tune our hierarchical models to achieve similar scores, resulting in 16 models: one baseline, one DDPO per task, three HRF per task, and one HRF-D per task. We evaluated these models via the following performance indices:

- 1.
Inception Score (IS) Salimans et al. (): Measures both sample quality and diversity by evaluating the probability of generated samples belonging to distinct classes. A higher score indicates better visual quality and diversity, while a score closer to baseline score reflects preserved sample diversity and distribution.
- 2.
Vendi Score (Dan Friedman and Dieng, ), which measures diversity as the exponential of the Shannon entropy of a similarity matrix. It approximates the effective number of distinct classes in a sample based on a distance metric. For our evaluation, scores closer to baseline indicate better sample diversity preservation.
- 3.
Reward Score: Evaluates a model’s adaptability to a given downstream task by assigning a numerical value to task-specific performance. Higher scores indicate better alignment with the task, providing an intuitive measure for comparing model behavior under similar conditions.

Hyperparameter settings and resources can be found in Appendix A.2.

### 5.3 Ablations on window selection in Hierarchical Reward Fine-tuning

We performed a sensitivity analysis on window selection based on three regimes: baseline, early, and later stages, each trained with three seeds. With 40 sampling steps (0 = noisiest, 40 = final image), the windows used are:

- 1.
Baseline: [(8,12), (18,22), (28,32)]—three equidistant windows.
- 2.
Early: [(3,7), (18,22), (28,32)]—first window shifted to noisier states.
- 3.
Later: [(8,12), (28,32)]—middle window removed, iterating more on the last window.

Figure 5 shows that different rewards favor different strategies: Aesthetic Quality prefers less noisy windows, while Compressibility and Incompressibility favor noisier ones.

Figure: Figure 5: Rewards (y-axis) vs Diversity (x-axis, Vendi Score). Ablations on window selections for three hierarchical regimes: baseline (blue), early (orange) and latter stages (green) over the three downstream tasks considered. Each result is reported as the average of three-run seeds.
Refer to caption: extracted/5917608/imgs/hrf-sensibility-compressibility-vs2.png

### 5.4 Results

**Table 1: Reward Mean and standard error for each downstream task across using google/ddpm-celebahq-256 as pretrained model. All samples were generated using the same initial noise to ensure a fair comparison. Baseline refers to the generative capabilities of the pretrained model. DDPO displays results from the fine-tuned models using DDPO with importance sampling (see Section 3.2). HRF represents our proposed method based on the average results reported on different window selection schemas (see Section 5.3). On the other side, HRF-D results are obtained using a dynamic window selection method.**
| Downstream Tasks | Baseline | DDPO | HRF | HRF-D |
| --- | --- | --- | --- | --- |
| Aesthetic Quality ($\uparrow$ better) | 5.11 $\pm$ 0.01 | 5.55 $\pm$ 0.01 | 5.18 $\pm$ 0.01 | 5.41 $\pm$ 0.01 |
| Compressibility ($\downarrow$ better) | 17.26 $\pm$ 0.05 | 5.30 $\pm$ 0.06 | 8.40 $\pm$ 0.08 | 5.20 $\pm$ 0.07 |
| Incompressibility ($\uparrow$ better) | 17.26 $\pm$ 0.05 | 21.59 $\pm$ 0.08 | 23.81 $\pm$ 0.10 | 38.77 $\pm$ 0.15 |

**Table 2: Sample Diversity Assessment Using Inception Score. The Inception Score (IS) represents the mean value calculated across $2,142$ images, with values closer to baseline indicating better diversity preservation.**
| Downstream Tasks | Baseline | DDPO | HRF | HRF-D |
| --- | --- | --- | --- | --- |
| Aesthetic Quality | 2.07 $\pm$ 0.03 | 1.58 $\pm$ 0.02 | 2.04 $\pm$ 0.03 | 1.91 $\pm$ 0.03 |
| Compressibility | 2.07 $\pm$ 0.03 | 2.28 $\pm$ 0.03 | 2.16 $\pm$ 0.03 | 2.26 $\pm$ 0.03 |
| Incompressibility | 2.07 $\pm$ 0.03 | 1.99 $\pm$ 0.05 | 2.10 $\pm$ 0.04 | 2.39 $\pm$ 0.05 |

**Table 3: Sample Diversity Assessment Using Vendi Score computed using cosine similarity metric on raw pixels and CLIP embeddings. Vendi score measures the number of distinct classes: scores closer to the baseline preserve the same number of unique samples, indicating better sample diversity preservation. Higher values show greater diversity but do not guarantee preservation within the original distribution support.**
| Vendi Score | Raw Pixels | CLIP Embeddings |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Downstream Tasks | DDPM | DDPO | HRF | HRF-D | DDPM | DDPO | HRF | HRF-D |
| Aesthetic Quality | 2.80 | 1.53 | 2.74 | 2.46 | 10.34 | 4.55 | 9.89 | 9.59 |
| Compressibility | 2.80 | 6.51 | 3.90 | 3.53 | 10.34 | 13.04 | 11.92 | 12.80 |
| Incompressibility | 2.80 | 2.05 | 2.48 | 3.20 | 10.34 | 8.63 | 9.84 | 10.30 |

We evaluated the baseline DDPM model’s generation capacity, measuring the mean reward over 2,142 samples for the three downstream tasks considered. Reproducing the DDPO method from Black et al. (), our approach outperformed the baseline across all tasks considered (see Table 1).

The HRF and HRF-D methods performed on par with –or better than– standard DDPO. While achieving similar mean rewards, our approach successfully optimized the reward without collapsing samples into a single mode, thus preserving diversity. This claim was validated via the Inception Score (IS) (Salimans et al., ; Heusel et al., ) as described in Section 5.2. Table 2 shows that HRF and HRF-D achieved IS values closer to the baseline, indicating improved sample diversity over DDPO while successfully fine-tuning the model for the tasks of interest.

Table 3 further validates our claims. Vendi Scores closer to the baseline indicate better diversity preservation, and both HRF and HRF-D outperformed DDPO in that regard. While higher Vendi scores typically mean more diversity, our goal is to maintain diversity within the support of the original distribution, making excessive diversity undesirable for this study. These metrics were computed using $2,142$ samples. For more details on how the scores change as the number of samples increases, refer to Appendix A.4.

The evidence shows a trade-off between optimizing for a downstream objective and maintaining sample diversity, as reinforcement learning inherently skews samples toward policy preferences. Our approach appears to balance this trade-off by focusing on learning dynamics and training in a more controlled step-wise manner, rather than manipulating the reward.

In summary, our findings suggest that our RL-based training approach achieved comparable performance to DDPO in reward optimization, while better preserving model diversity. This highlights the robustness and efficacy of HRF and HRF-D as a method, showcasing its potential for enhancing model performance across various tasks while avoiding mode collapse.

## 6 Conclusions

We have presented HRF, a novel methodological framework that leverages the hierarchical nature of data generation in diffusion models and improves the multi-step decision-making interpretation. In this line, we have also introduced a phase training scheme that enhances specific parts of the diffusion model during fine-tuning. The method provides new insights into learning via reinforcement learning and the effects on each diffusion step. Our hierarchical formulation has proven to be an effective method for fine-tuning diffusion models on downstream tasks while successfully preserving the inherent models’ diversity. Our evaluation utilized known and validated metrics such as the Inception Score (IS) and Vendi Score to measure the performance of the generative models considered, thus providing a trustworthy assessment of the

##### Future work.

Some future work directions include optimizing cluster selection and hyperparameters to balance learning and sample diversity. Also, exploring alternative RL formulations within this framework could yield interesting results. While we showed that manual step selection improves performance, finding optimal training scenarios remains an open question that we initially explored with HRF-D, which employs an algorithm to identify optimal training steps, but it is not yet fully optimized and requires further research. Finally, we find it extremely necessary to define benchmarks with specific pre-trained models and tasks to measure and compare different post-training strategies, as this is an area rather unexplored. Methodologies like the one proposed in this paper would benefit from better and more concise evaluation.

##### Limitations.

Our method aims to control diffusion models to align with downstream tasks via reward functions, offering benefits like avoiding mode collapse. However, risks include generating explicit content, and more research is needed to understand its broader impact.

## Acknowledgements

We thank Camilo Carvajal-Reyes (Imperial) for thought-provoking discussions during the development of this work. We acknowledge financial support from Google and the following ANID-Chile grants: Fondecyt-Regular 1210606, Basal FB210005 Center for Mathematical Modeling, and Basal FB0008 Advanced Center for Electrical and Electronic Engineering.

## Appendix A Appendix

### A.1 Injection Sampling

When investigating the impact of learning with the MDP formulation we propose that most of the learning prowess is being done at the early steps of the diffusion model (the noisier states). To verify this experimentally we propose the following method:

- 1.
Sample 15 trajectories with all fine-tuned models using DDPO on three tasks.
- 2.
Select initial injection steps: $[38,35,30,25,20,10]$, where 40 is the noisiest and 0 is the final sample.
- 3.
Resample 15 trajectories, switching to the base model at selected injection steps, and compute all trajectory variations.
- 4.
Compute cosine distances between denoised images of the original and fine-tuned models for all starting timesteps for the same starting seed. This is between the estimated noiseless image for each timestep.
- 5.
Plot the distances for all three models.

Figure: (a) Aesthetic Quality Injection
Refer to caption: extracted/5917608/imgs/aesthetic_injection_sampling.png

Following these steps we get the differences that each model makes for the denoising trajectory at different timesteps. We confirm that most of the differences in the final image come from the early stages of the diffusion model (See Figure 6). This insight further solidifies the fact that almost all of the learning tends to happen at the early stages of the diffusion model due to the training inherent dynamics.

### A.2 Implementation Details

We provide the implementation details we used, such as computational resources and relevant hyperparameters settings. All this hyperparameters may be subject to changes and exploration, especially in the HRF implementations. Where the hyperparameters where found experimentally.

#### A.2.1 Resource details

For HRF: GPU experiments were conducted on the default NVIDIA system within the cloud computing provider Hyperstack, with one A100 Tensor Core GPU and 150GB of GPU memory. The training time for each iteration took approximately 4 hours. Inference for the reward model was performed on a single NVIDIA L4 GPU and takes about 2 minutes per 40 images.

### A.3 Full hyperparameters

**Table 4: Full Hyperparameters for Aesthetic Quality**
|  | DDPOIS | HRF | HRF-D |
| --- | --- | --- | --- |
| Diffusion |  |  |  |
| Denoising steps ($T$) | 40 | 40 | 40 |
| Optimization |  |  |  |
| Optimizer | AdamW | AdamW | AdamW |
| Learning rate | 3e-7 (With warm up) | 3e-7 | 9e-6 |
| Weight decay | 1e-3 | 1e-3 | 1e-3 |
| Gradient clip norm | 4.5 | 4.5 | 4.5 |
| HRF and HRF-D |  |  |  |
| Batch size | - | 4 | 25 |
| Samples per iteration | - | 160 | 150 |
| Gradient updates per iteration | - | 1 | 1 |
| Clip range | - | 1e-4 | 1e-4 |
| Clusters | - | [(3,7),(18,22),(28,32)] | - |
| Number of iters per cluster | - | [8,8,8] | - |
| beta | - | - | 1.0 |
| DDPO |  |  |  |
| Batch size | 10 | - | - |
| Samples per iteration | 100 | - | - |
| Gradient updates per iteration | 1 | - | - |
| Clip range | 1e-4 | - | - |

**Table 5: Full Hyperparameters for Compressibility and Incompressibility**
|  | DDPOIS | HRF | HRF-D |
| --- | --- | --- | --- |
| Diffusion |  |  |  |
| Denoising steps ($T$) | 40 | 40 | 40 |
| Optimization |  |  |  |
| Optimizer | AdamW | AdamW | AdamW |
| Learning rate | 9e-7 | 9e-7 | 9e-7 |
| Weight decay | 1e-3 | 1e-3 | 1e-3 |
| Gradient clip norm | 4.5 | 4.5 | 4.5 |
| HRF and HRF-D |  |  |  |
| Batch size | - | 10 | 25 |
| Samples per iteration | - | 150 | 150 |
| Gradient updates per iteration | - | 1 | 1 |
| Clip range | - | 1e-4 | 1e-4 |
| Clusters | - | [(8,12),(18,24),(28,36)] | - |
| Number of iters per cluster | - | [8,8,8] | - |
| Beta | - | - | 1.0 |
| DDPO |  |  |  |
| Batch size | 10 | - | - |
| Samples per iteration | 150 | - | - |
| Gradient updates per iteration | 1 | - | - |
| Clip range | 1e-4 | - | - |

### A.4 Vendi Score

We conducted an empirical analysis of the incrementally computed Vendi Score using the cosine distance metric on CLIP embeddings. The results are shown in Figure 7
. The analysis begins with an initial sample size of $500$, increasing by 5 samples at each step until reaching $2000$. Afterwards, the sample size is increased by $500$ samples per step until reaching a total of $11,000$ samples. We ended up using $2,142$ samples to compute the Vendi Score, capturing the major increase in diversity.

Figure: Figure 7: Incremental Vendi Score based on cosine distance over CLIP embeddings and the number of DDPM samples (x-axis).. The analysis starts with $500$ images, increasing by 5 samples per step until reaching $2,000$, after which steps increase by $500$ samples up to a total of $11,000$. The vertical line marks the Vendi Score at $2,142$ samples, the same number used for diversity evaluation in ablation studies and Table 3 This consistent sample size ensures a fair comparison of diversity across different experimental conditions.
Refer to caption: extracted/5917608/imgs/vendie-score-incremental-baseline.png

## Peer Reviews

confidence: 3
contribution: 1
initial_rating: 3
presentation: 2
questions: 1.	What does the sampling cluster mean in line 340?
2.	Can the author show more examples and results on more datasets to show the superiority of their method? I am willing to raise my score with more convincing results.
soundness: 2
strengths: The paper is overall well-written and the idea of hierarchically-finetuning the diffusion foundation model is interesting.
summary: This paper proposes a new fine-tuning method for diffusion foundation models based on reinforcement learning. With the hierarchical interpretation of diffusion models, the proposed method, called Hierarchical Reward Fine-tuning can better preserve the sample diversity in DDPM compared to the previous DDPO method.
weaknesses: 1.	The proposed method seems a little bit trivial. In the reviewer’s opinion, it just chooses a specific diffusion step and applies RL-based finetuning after this step.
2.	The hierarchical nature seems limited to images. It is hard to say this phenomenon still holds in other applications of diffusion model such as text, audio and decision-making.
3.	The authors need to conduct more experiments on different datasets/diffusion foundation models and give more example images. Otherwise, the results is not convincing to confirm the efficiency of their methods.
4.	In line 200, x_0 should be set before the period or full stop.
5.	Some usage of notation confuses me in this paper. For instance, in line 326, why $\pi_{best}(a|s)$ is the difference of reward rather than probability density? In line 332, $\tilde{x}$ is an estimated image but $\rho_0$ is a combination of distribution. How can we measure the distance?

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 2
questions: 1. What is $c$ in Eq. 5?
2. Can you elaborate more on why different windows have different impacts on compressibility and aesthetic quality?
soundness: 3
strengths: 1. The paper addresses an important and relevant problem when optimizing/fine-tuning diffusion models with RL. 
2. The proposed method is sound and novel to me.
summary: This paper introduces Hierarchical Reward Fine-tuning (HRF), a novel approach to address mode collapse when fine-tuning diffusion models with reinforcement learning. It proposes two sliding-window approaches to sample intermediate diffusion steps as initial starting points for the fine-tuning. The experiments validate the contribution of the paper, showing an increase in output diversity.
weaknesses: 1. The proposed window selection mechanism seems handcrafted and requires a lot of tuning. This may limit the algorithms' further application. For example, when the diffusion step increases, you have to manually define the windows. 
2. Have you considered randomly sampling the noise step $t$? how is it compared to the two proposed mechanism?
3. The proposed window selection mechanism, especially the HRF-D, introduces a lot of additional computation. 
3. It seems unfair to fine-tune based on DDPO. It is better to either fine-tuning the pre-trained model with HRF or extending DDPO training to equalize training steps.
4. The writing can be improved a lot. For example, the symbol $i$ is inconsistently defined throughout. In addition, it is a big claim to say "avoid" in the title. I suggest the author to moderate the claim a bit.

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 3
questions: **Q1:** In my view, the Figure 4 is unclear to show the outperforming performance of HRF compared to other baselines. I wonder if the reviewers provide much more clearer figures to show the effectiveness of HRF

**Q2:** In Table 4 and Table 5, (HRF and HRF-D) and (DDPO) are separated although all parameters of DDPO belong to those of  (HRF and HRF-D). It would be better if the authors combined them. In addition, I recommand that the reviewers check typos in the supplementary materials.

**Q3:**  HRF uses the predefined windows, and the authors used the uniform distribution over the cluster. If the authors can provide reasonable pre-defined non-uniform distributions with some experimetal results, I think that it must be useful to improve the quality of this paper. I would like to hear the authors' opinions.

**Q4:** Comparing HRF and HRF-D, it looks like that the performance gap between them is marginal. Thus, one may think that sliding strategy seems to be marginal. Therefore, I believe that an ablation study without the sliding strategy, using DDPO with noisy initial states to generate diverse trajectories, could enhance the quality of this paper.

**Q5:** It would be beneficial if the code could be made publicly available in the future. Some parameters of interest are not clear. For instance, the definition of epoch $e$ for each task is being unclear in the paper from my perspective.
soundness: 3
strengths: 1. The authors proposed a new fine-tuning method which is an extension of DDPO to address the collapse issues in the diffusion model.
2. The authors provided clear motivation, e.g., Figure 1
3. They showed well-structured experiments to validate their proposed method HRF.
summary: Previous methods suffer from issues such as training instability and mode collapse. To address these challenges, the authors propose HRF, which utilizes a window selection strategy, avoiding the full denoising trajectory by starting at intermediate time steps. They introduce two strategies: manual and dynamic window selection. From these intermediate steps, HRF explores diverse trajectories by adding noise, and it is trained similarly to the previous DDPO approach.
weaknesses: 1. Figure 4 is unclear to support the effectiveness of HRF compared to the previous methods
2. No explicit reasons between the performances between the two strategies (manual vs dynamic)

---

confidence: 3
contribution: 2
initial_rating: 3
presentation: 2
questions: * How is the objective function (5) optimized? Does it use proximal policy optimization (PPO) as in the DDPO paper or trust region policy optimization (TRPO)? The only information I could find is "We also employ trust regions to address inaccurate estimations of $p_\theta$." in line 296-297.

* What is the architecture of the model $\pi_\theta$?

* Can we use metrics other than cosine distance to measure the distance between $\rho_0(s_0)$ and $\tilde{x}_{t \rightarrow 0}$?
soundness: 2
strengths: * The problem is motivated well.

* Related work and background are adequately discussed.
summary: This paper introduces an approach called Hierarchical Reward Fine-tuning (HRF), which aims to address training instability and mode collapse issues when fine-tuning diffusion models with reinforcement learning (RL), specifically by improving the diversity of generated samples. The algorithm builds upon the Denoising Diffusion Policy Optimization (DDPO) framework and incorporates two window selection schemes to enhance variation between consecutive steps while minimizing divergence from the prior. Experimental results are provided to demonstrate the effectiveness of the proposed method.
weaknesses: * This approach does not differ significantly from the original DDPO method. For instance, the content in Sections 3.1-3.2 and 4.2 is very similar to Sections 3-4 of the DDPO paper. It seems that the core contribution of this work lies in Section 4.3, where the window selection schemes are proposed. These schemes should be discussed in greater detail, as they appear to be the main novel aspect of this paper.

* Section 4.3 is poorly written compared to the earlier sections. For example, the definition of $\pi_{best}$ is presented twice, which could lead to ambiguity. Additionally, the algorithm tables are too informal, making implementation difficult. It would also be helpful to introduce the definition of the cosine distance for the distance metric $D$, as this would provide greater clarity.

* In Tables 4 and 5, it appears that this paper uses different hyperparameters for DDPO compared to the original settings in the DDPO paper, and this discrepancy should be explained. Additionally, in deep RL, the number of gradient updates per iteration is closely related to the number of samples and the batch size. Typically, PPO performs multiple gradient updates at each iteration. Therefore, having only one gradient update per iteration across all algorithms seems very unusual.

Meta-review: This paper addresses the issue of model collapse in fine-tuning diffusion models. The proposed approach utilizes the hierarchical structure of the diffusion model, uses a window selection strategy, avoids full denoising, and is shown to have more diversity in generation, indicating avoidance of collapse.

The algorithm contains many components, requiring careful ablation studies that are not present. Specifically, the handcrafted nature and computational cost of the window selection mechanism require more careful design and study of the algorithm. The focus on image-only tasks is also limiting.

Decision: Reject