Self-Play Fine-Tuning of Diffusion Models for Text-to-Image Generation

Fine-tuning Diffusion Models remains an underexplored frontier in generative artificial intelligence (GenAI), especially when compared with the remarkable progress made in fine-tuning Large Language Models (LLMs). While cutting-edge diffusion models such as Stable Diffusion (SD) and SDXL rely on supervised fine-tuning, their performance inevitably plateaus after seeing a certain volume of data. Recently, reinforcement learning (RL) has been employed to fine-tune diffusion models with human preference data, but it requires at least two images ("winner"and"loser"images) for each text prompt. In this paper, we introduce an innovative technique called self-play fine-tuning for diffusion models (SPIN-Diffusion), where the diffusion model engages in competition with its earlier versions, facilitating an iterative self-improvement process. Our approach offers an alternative to conventional supervised fine-tuning and RL strategies, significantly improving both model performance and alignment. Our experiments on the Pick-a-Pic dataset reveal that SPIN-Diffusion outperforms the existing supervised fine-tuning method in aspects of human preference alignment and visual appeal right from its first iteration. By the second iteration, it exceeds the performance of RLHF-based methods across all metrics, achieving these results with less data.

Paper

Similar papers

Peer review

Reviewer WzS96/10 · confidence 3/52024-06-29

Summary

The paper introduces a novel method called SPIN-Diffusion for fine-tuning text-to-image diffusion models. SPIN-Diffusion uses a self-play mechanism where the model competes against its earlier versions to iteratively improve its performance. This approach eliminates the need for human preference data, which is a significant requirement for traditional reinforcement learning-based fine-tuning methods. The experiments on the various dataset demonstrate that SPIN-Diffusion outperforms existing supervised fine-tuning methods and reinforcement learning-based approaches, achieving higher human preference alignment and visual appeal with less data.

Strengths

S1: The paper presents an innovative self-play fine-tuning method that does not rely on human preference data, addressing a significant limitation in current fine-tuning approaches. S2: Extensive experiments are conducted, showing that SPIN-Diffusion outperforms both supervised fine-tuning and reinforcement learning-based methods in terms of human preference alignment and visual appeal. S3: The theoretical analysis provides a strong foundation for the proposed method, demonstrating its convergence and superiority over traditional supervised fine-tuning methods. S4: The paper effectively communicates the technical challenges and solutions, making the methodology accessible to readers.

Weaknesses

W1: The paper lacks a comparison with traditional fine-tuning methods for diffusion models, e.g., LoRA. W2: The computational overhead of the self-play mechanism is high, requiring 5-10 times more training time compared to baselines, which might limit its practical application. W3: The motivation of this method is unclear to me. It would paint a more holistic picture of the problem and solution. W4: The paper assumes that the data distribution can be adequately represented by the parameterized family, which may not hold in all practical scenarios. W5: The evaluation is primarily focused on a single dataset (Pick-a-Pic), and additional benchmarks could strengthen the generalizability of the results. W6: The font size of Figure 1 is too small.

Questions

- Why should fine-tuning the DMs use RL methods? Could you please discuss the advantages of fine-tuning DMs with RL compared to traditional methods? - As the authors claimed, "In many datasets including the community-sourced ones featuring custom content, it is often the case to have only one image associated with each prompt. This makes RL fine-tuning infeasible."I do not understand why this approach is considered infeasible. In my prespective, one image and its prompt can be considered as the observation of agents. The other processes are similar to the standard RL paradigm. Therefore, it would be greater to discuss more.

Rating

6

Confidence

3

Soundness

3

Presentation

3

Contribution

3

Limitations

Please refer to weaknesses.

Reviewer CNjW5/10 · confidence 3/52024-07-12

Summary

This paper introduces a method called self-play fine-tuning for diffusion models (SPIN-Diffusion), where the model engages in a competitive process with its earlier versions, driving iterative self-improvement. This method presents an alternative to conventional supervised fine-tuning and RL strategies. Experimental results on the Pick-a-Pic dataset show that SPIN-Diffusion outperforms previous supervised fine-tuning in human preference alignment and visual appeal. Key contributions of this work include the introduction of SPIN-Diffusion and its empirical validation demonstrating superior performance compared to existing fine-tuning methods.

Strengths

1. The paper for the first time applies SPIN to diffusion model to my knowledge. 2. Theoretical analysis shows that the proposed approximate SPIN loss is an upper bound of exact SPIN loss.

Weaknesses

1. The main contribution of this work is an approximate SPIN loss compared to the previously proposed exact SPIN loss. The major modification is moving the average over sampling steps $t$ outside the loss function, resulting in an upper bound. I kindly argue this improvement is straightforward when transferring SPIN from LLM to diffusion model, without much insights into diffusion model itself. 2. Since the approximate SPIN loss is proposed for data/memory/time efficiency, I didn't see any computing efficiency comparisons of the approximate and exact SPIN loss in the main paper or supplements. As noted by the authors, "it requires additional sampling overhead, approximately 10 times of the training time when using traditional DDIM sampling." This additional computing cost significantly limits the method in practice. 3. Assumption 4.1 assumes the loss $l(t)$ being monotonically decreasing and convex. It seems like the SPIN loss proposed in Equations. 3.8 and 3.9 do not meet this strong assumption. It makes the analysis results less convincing. 4. Quantitative performance improvement (Table 1) is mild. 5. It's hard to tell which method generates the best pictures in qualitative comparison (Figure 2).

Questions

1. The "(ours)" notations in the tables are a bit confusing, may misleading the audience considering them as a method proposed in this work. --- After rebuttal: Some of my initial concerns have been addressed, while I still hold concerns on the method insight, time efficiency, and quantitative improvements. By comprehensively considering the cons and pros of this paper, my final raiting would be borderline accept.

Rating

5

Confidence

3

Soundness

3

Presentation

3

Contribution

2

Limitations

N/A

Reviewer K3rU7/10 · confidence 4/52024-07-24

Summary

- This paper introduces SPIN-Diffusion, a new self-play fine-tuning technique for diffusion models that improves iteratively by competing with previous versions. - They show that SPIN-Diffusion outperforms existing supervised and reinforcement learning fine-tuning methods in aligning with human preferences and enhancing visual appeal starting from the first iteration. - This method is more data-efficient, achieving superior results with fewer data, which is beneficial in cases where there are limited images available per text prompt. - The paper uses a competitive setup between two iterations of the model to generate and evaluate images, considering all generated images in the evaluation process, not just the final product. - Their experiments on the "Pick-a-Pic" dataset demonstrate that SPIN-Diffusion consistently surpasses other methods in multiple performance metrics through successive iterations. - The approach is cost-effective and offers a practical solution for improving diffusion models, particularly useful in environments with restricted data access.

Strengths

- The extension of SPIN to diffusion models is well-formulated for the problem at hand. - Theoretical explanations are detailed and well-supported. - The design of an approximate version of the objective function, considering computational efficiency, appears practical. - The method shows practical utility by outperforming previous methods that required "loser" samples within a few iterations.

Weaknesses

- The sampling overhead is significant, requiring 5-10 times more training time. - There is insufficient explanation regarding the assignment of the hyperparameter \( \beta_t \) and its variation across iterations. - If a stronger approximation is applied and the sampling overhead is reduced by focusing on trajectories rather than all time steps, it might be possible to compare improvements with significantly reduced training time. Showing improvements within a setup that grants no more than twice the training time compared to SFT could have demonstrated the efficacy of SPIN-Diffusion more clearly.

Questions

- I would like to see a practical comparison of computation time in GPU hours between SPIN-Diffusion and other methods.

Rating

7

Confidence

4

Soundness

3

Presentation

4

Contribution

3

Limitations

- The sampling overhead is significant, requiring 5-10 times more training time.

Reviewer CNjW2024-08-08

Thank you for the response! The authors addressed my concerns in Q3, Q5, Q6. I still hold my concerns for Q1, Q2, Q4. For Q2, it's fair that we only consider the method presented in the initial submission, whose efficiency is 146h vs. 20h (SFT). It's a trade-off stuff, whether it deserves to use much more time for the performance improvement. For Q4, if we compare SFT vs SPIN-Diffusion, most of the metrics are close.

Authorsrebuttal2024-08-09

Thank you for your reply. We’re glad that we have resolved your concerns in Q3, Q5 and A6. We would like to further clarify and address your remaining concerns in Q4, Q2 and Q1. **For Q4**: We would like to clarify that SPIN-Diffusion's performance actually significantly outperforms that of SFT in 3 out of 4 metrics, rather than being close to each other. Both models use the same base model, SD-1.5, and are trained on the same dataset. SPIN-Diffusion achieves improvements over SD-1.5 that are approximately **three** times that of SFT in the Aesthetic and PickScore metrics, while also maintaining a lead in HPS and ImageReward. | | HPS | Aesthetic | ImageReward | PickScore | |----------------|---------------------|---------------------|---------------------|-----------------------| | SD-1.5 | 0.2699 | 5.7691 | 0.8159 | 21.1983 | | SFT | 0.2749 ($\textcolor{red}{+0.005}$) | 5.9451 ($\textcolor{red}{+0.176}$) | 1.1051 ($\textcolor{red}{+0.2892}$) | 21.4542 ($\textcolor{red}{+0.2559}$) | | Diffusion-DPO | 0.2753 ($\textcolor{red}{+0.0054}$/$\textcolor{purple}{+8\\%}$) | 5.8918 ($\textcolor{red}{+0.1227}$/$\textcolor{purple}{-30.3\\%}$) | 1.0495 ($\textcolor{red}{0.2336}$/$\textcolor{purple}{-19.2\\%}$) | 21.8866 ($\textcolor{red}{0.6883}$/$\textcolor{purple}{+168\\%}$) | | SPIN-Diffusion | 0.2759 ($\textcolor{red}{+0.006}$/$\textcolor{purple}{+20\\%}$) | 6.2481 ($\textcolor{red}{+0.479}$/$\textcolor{purple}{+172\\%}$) | 1.1239 ($\textcolor{red}{+0.308}$/$\textcolor{purple}{+7\\%}$) | 22.0024 ($\textcolor{red}{+0.8041}$/$\textcolor{purple}{+214\\%}$) | Note: The increments marked in red represent improvement relative to SD-1.5. The increments/decrements marked in purple indicate changes relative to the increments of SFT over SD-1.5. Moreover, according to Kirstain et al. (2023), PickScore’s ratings, strongly correlates with real users’ Elo ratings (0.790 ± 0.054), while ImageReward (0.492 ± 0.086) and HPS (0.670 ± 0.071) correlates less. Therefore, the 214% increase in PickScore gains achieved by SPIN-Diffusion over those of SFT should be considered very significant. In addition, the other closely related method Diffusion-DPO cannot outperform SFT consistently, even if it uses more data. This further suggests the advantage of SPIN-Diffusion. --- **For Q2**: We understand your concern on the performance-efficiency trade-off. However, we want to clarify that the computational time reduction we presented during the rebuttal is solely due to implementation improvements in the stable diffusion (SD) pipeline, leveraging the latest tools from updated versions of PyTorch and the HuggingFace diffusers library. These improvements do not need to change our method at all. Below, we provide a summary of the improvements achievable through basic implementation enhancements: | | Sampling Time (Per 2048 Images) | Training Time (Per 2048 Images) | Total Time | Data | |-------------------------------------|---------------------------------|---------------------------------|------------|------| | SPIN-Diffusion (Original SD Pipeline) | 342s | 73s | 146h | SFT | | SPIN-Diffusion (Improved SD Pipeline) | 56s | 73s | 38h | SFT | | SFT | - | 37s | 20h | SFT | As you can see, the total computational time is less than twice that of SFT. In addition, we believe whether the extra time for performance improvement is worthwhile depends on the user and the specific application scenarios. For users with enough computing resources such as many AI companies, resources are usually not the biggest concern, because the extra time can be mitigated by using more GPUs. GPT-4, for example, required millions of GPU hours to achieve industry-leading performance.

Authorsrebuttal2024-08-09

**For Q1**: Regarding your comment that "I kindly argue this improvement is straightforward when transferring SPIN from LLM to diffusion model, without much insights into diffusion model itself," we agree that the SPIN-Diffusion loss can be interpreted in your way; however, there are also significant insights from the diffusion model itself. In terms of derivation, we start with the SPIN objective for diffusion models by considering the main player (reward function) across the full trajectory \(x_{0:T}\). We formulate an exact objective function up to Equation (3.8), and then develop a practical approximation strategy specifically tailored to diffusion models, which is not present in SPIN for LLMs. In terms of theoretical analysis, Theorem 4.2 in our paper suggests that the optimization process of the approximate loss ends when the score matching loss $L_{DSM}(\theta) = E[\gamma_t||\epsilon_\theta(x_t, c, t) - \epsilon_t||^2_2]$ reaches optimality. In contrast, the corresponding analysis in SPIN for LLMs only suggests that the optimization process of the exact loss ends when $p_{\theta_t}(\cdot \mid \mathbf{x}) = p_{data}(\cdot \mid \mathbf{x})$. This distinction is quite significant because it offers a precise and measurable criterion for convergence within the framework of diffusion models.

Reviewer CNjW2024-08-12

Thank you for the further response! My concerns of Q1, Q2, and Q4 still remain. However, by considering the cons and pros of this paper again, I would lift my final rating to 5.

Authorsrebuttal2024-08-12

Thank you for increasing the rating. We are committed to incorporating all the clarifications, discussions, and additional experimental results from the rebuttal into the final version to fully address your concerns.

Reviewer K3rU2024-08-10

I appreciate the authors' efforts. My concerns seem to have been addressed. I intend to maintain my current score.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC