Table of Contents
Fetching ...

RL for Consistency Models: Faster Reward Guided Text-to-Image Generation

Owen Oertell, Jonathan D. Chang, Yiyi Zhang, Kianté Brantley, Wen Sun

TL;DR

To optimize text-to-image generative models for task specific rewards and enable fast training and inference, a framework for fine-tuning consistency models via RL is proposed, called Reinforcement Learning for Consistency Model (RLCM), which frames the iterative inference process of a consistency model as an RL procedure.

Abstract

Reinforcement learning (RL) has improved guided image generation with diffusion models by directly optimizing rewards that capture image quality, aesthetics, and instruction following capabilities. However, the resulting generative policies inherit the same iterative sampling process of diffusion models that causes slow generation. To overcome this limitation, consistency models proposed learning a new class of generative models that directly map noise to data, resulting in a model that can generate an image in as few as one sampling iteration. In this work, to optimize text-to-image generative models for task specific rewards and enable fast training and inference, we propose a framework for fine-tuning consistency models via RL. Our framework, called Reinforcement Learning for Consistency Model (RLCM), frames the iterative inference process of a consistency model as an RL procedure. Comparing to RL finetuned diffusion models, RLCM trains significantly faster, improves the quality of the generation measured under the reward objectives, and speeds up the inference procedure by generating high quality images with as few as two inference steps. Experimentally, we show that RLCM can adapt text-to-image consistency models to objectives that are challenging to express with prompting, such as image compressibility, and those derived from human feedback, such as aesthetic quality. Our code is available at https://rlcm.owenoertell.com.

RL for Consistency Models: Faster Reward Guided Text-to-Image Generation

TL;DR

To optimize text-to-image generative models for task specific rewards and enable fast training and inference, a framework for fine-tuning consistency models via RL is proposed, called Reinforcement Learning for Consistency Model (RLCM), which frames the iterative inference process of a consistency model as an RL procedure.

Abstract

Reinforcement learning (RL) has improved guided image generation with diffusion models by directly optimizing rewards that capture image quality, aesthetics, and instruction following capabilities. However, the resulting generative policies inherit the same iterative sampling process of diffusion models that causes slow generation. To overcome this limitation, consistency models proposed learning a new class of generative models that directly map noise to data, resulting in a model that can generate an image in as few as one sampling iteration. In this work, to optimize text-to-image generative models for task specific rewards and enable fast training and inference, we propose a framework for fine-tuning consistency models via RL. Our framework, called Reinforcement Learning for Consistency Model (RLCM), frames the iterative inference process of a consistency model as an RL procedure. Comparing to RL finetuned diffusion models, RLCM trains significantly faster, improves the quality of the generation measured under the reward objectives, and speeds up the inference procedure by generating high quality images with as few as two inference steps. Experimentally, we show that RLCM can adapt text-to-image consistency models to objectives that are challenging to express with prompting, such as image compressibility, and those derived from human feedback, such as aesthetic quality. Our code is available at https://rlcm.owenoertell.com.
Paper Structure (36 sections, 6 equations, 11 figures, 1 table, 2 algorithms)

This paper contains 36 sections, 6 equations, 11 figures, 1 table, 2 algorithms.

Figures (11)

  • Figure 1: Reinforcement Learning for Consistency Models (RLCM). We propose a new framework for finetuning consistency models using RL. On the task of optimizing aesthetic scores of a generated image, comparing to a baseline which uses RL to fine-tune diffusion models (DDPO), RLCM trains (left) and generates images (right) significantly faster, with higher image quality measured under the aesthetic score. Images generated with a batch size of 8 and RLCM horizon set to 8.
  • Figure 2: Consistency Model As MDP: In this instance, $H=3$. Here we first start at a randomly sampled noised state $s_0 \sim \left(\mathcal{N}(0, I), \delta_{\tau_0}, p(\bm{c})\right)$. We then follow the policy by first plugging the state into the the consistency model (red line) and then noising the image back to $\tau_1$ (green line). This gives us $a_0$ which, based off of the transition dynamics becomes $s_1$ (green circle). We then transition from $s_1$ by applying $\pi(\cdot)$, which applies the consistency function to $\widehat{x}_0$ and then noises up to $\tau_2$. To calculate the end of trajectory reward, we apply the consistency function one more time (yellow line) to get a final approximation of $\widehat{x}_0$ and apply the given reward function to this image. Note that the red and green lines on both sides of the diagram represent the same thing.
  • Figure 3: Qualitative Generations: Representative generations from the pretrained models, DDPO, and RLCM. Across all tasks, we see that RLCM is able to finetune output of the model to fit specific reward functions. Due to the lack of regularization to the pretrained model, some artifacts (seen in the compression task) and significant similarity in output are indeed seen).
  • Figure 4: Learning Curves: Training curves for RLCM and DDPO by number of reward queries on compressibility, incompressibility, aesthetic, and prompt image alignment. We plot three random seeds for each algorithm and plot the mean and standard deviation across those seeds. RLCM seems to produce either comparable or better reward optimization performance across these tasks.
  • Figure 5: Training Time: Plots of performance by runtime measured by GPU hours. We report the runtime on four NVIDIA RTX A6000 across three random seeds and plot the mean and standard deviation. We observe that in all tasks RLCM noticeably reduces the training time while achieving comparable or better reward score performance.
  • ...and 6 more figures