Deep Reward Supervisions for Tuning Text-to-Image Diffusion Models

Xiaoshi Wu,Yiming Hao,Manyuan Zhang,Keqiang Sun,Zhaoyang Huang,Guanglu Song,Yu Liu,Hongsheng Li
2024-05-01
Abstract:Optimizing a text-to-image diffusion model with a given reward function is an important but underexplored research area. In this study, we propose Deep Reward Tuning (DRTune), an algorithm that directly supervises the final output image of a text-to-image diffusion model and back-propagates through the iterative sampling process to the input noise. We find that training earlier steps in the sampling process is crucial for low-level rewards, and deep supervision can be achieved efficiently and effectively by stopping the gradient of the denoising network input. DRTune is extensively evaluated on various reward models. It consistently outperforms other algorithms, particularly for low-level control signals, where all shallow supervision methods fail. Additionally, we fine-tune Stable Diffusion XL 1.0 (SDXL 1.0) model via DRTune to optimize Human Preference Score v2.1, resulting in the Favorable Diffusion XL 1.0 (FDXL 1.0) model. FDXL 1.0 significantly enhances image quality compared to SDXL 1.0 and reaches comparable quality compared with Midjourney v5.2.
Computer Vision and Pattern Recognition,Artificial Intelligence
What problem does this paper attempt to address?
The problem that this paper attempts to solve is to optimize the text - to - image diffusion model given the reward function. Specifically, existing methods face several challenges when optimizing the diffusion model through the reward model: 1. **Computational Overhead**: Directly back - propagating gradients from the output image to the input noise will lead to significant memory consumption, especially when dealing with text - to - image diffusion models with multiple sampling steps. 2. **Gradient Explosion**: The problem of gradient explosion is prone to occur during the early sampling steps of training, which will hinder the convergence of the model. 3. **Low - level Reward Optimization**: Existing methods perform poorly when optimizing certain low - level rewards (such as symmetry rewards). To solve these problems, the paper proposes the **Deep Reward Tuning (DRTune)** algorithm, which efficiently supervises the early denoising steps of the diffusion model through the following two main improvements: 1. **Stop - gradient**: Stop the gradient at the input of the denoising network, thereby avoiding the gradient explosion problem and accelerating convergence. 2. **Selective Training Sampling Steps**: In each training iteration, a subset is uniformly spaced selected from all sampling steps for back - propagation, so that the untrained intermediate steps can be skipped, reducing the computational and memory overhead. Through these improvements, DRTune can optimize the diffusion model more effectively, especially performing well when optimizing low - level rewards. The paper also shows the use of DRTune to fine - tune Stable Diffusion XL 1.0 (SDXL 1.0) to optimize the Human Preference Score v2.1 (HPS v2.1), generating the Favorable Diffusion XL 1.0 (FDXL 1.0) model. Experimental results show that FDXL 1.0 is significantly superior to SDXL 1.0 in image quality and is comparable to the commercial model Midjourney v5.2.5.