Diffusion Model Patching via Mixture-of-Prompts

Seokil Ham, Sangmin Woo, Jin-Young Kim, Hyojun Go, Byeongjun Park, Changick Kim · DOI · OpenReview

Abstract

We present Diffusion Model Patching (DMP), a simple method to boost the performance of pre-trained diffusion models that have already reached convergence, with a negligible increase in parameters. DMP inserts a small, learnable set of prompts into the model's input space while keeping the original model frozen. The effectiveness of DMP is not merely due to the addition of parameters but stems from its dynamic gating mechanism, which selects and combines a subset of learnable prompts at every step of the generative process. This strategy, termed "mixture-of-prompts", enables the model to draw on the distinct expertise of each prompt, essentially "patching" the model's functionality at every step with minimal yet specialized parameters. Experiments show that DMP significantly enhances the converged FID of DiT-L/2 on FFHQ 256x256 by 10.38%, achieved with only a 1.43% parameter increase and 50K additional training iterations.

Introduction

Training state-of-the-art diffusion models is incredibly resource-intensive. Once a model reaches "convergence," researchers typically assume that further training on the same dataset will lead to overfitting or diminishing returns. Furthermore, standard diffusion models use a single set of weights for the entire denoising process. However, the denoising journey is not uniform: high-noise stages focus on global structures and colors, while low-noise stages focus on fine-grained textures and details.

While some researchers have tried to address this by training multiple "expert" networks for different stages, doing so is computationally expensive and requires massive storage. Diffusion Model Patching (DMP) addresses this by "patching" a converged model to handle these stages better without retraining the entire architecture or significantly increasing the parameter count.

Methodology

Architecture of DMP showing frozen DiT blocks and the learnable prompt mechanism with dynamic gating.

DMP relies on two primary innovations:

  1. Learnable Prompts in the Input Space: Instead of modifying the model's internal weights (which remain frozen), DMP inserts a small pool of learnable continuous embeddings (prompts) directly into the input of each transformer block. Unlike NLP prompt tuning, which usually prepends tokens and increases sequence length, DMP adds prompts element-wise to the existing image tokens. This preserves spatial correspondence and keeps computation speeds nearly identical to the base model.
  2. Mixture-of-Prompts (Dynamic Gating): A small gating network takes the current denoising timestep ($t$) and the block depth ($i$) as input. It then generates a weighting mask to combine a subset of prompts from the pool. This allows the model to dynamically "patch" its behavior at every step of the denoising process, effectively giving it a specialized toolkit for different noise levels.

To ensure stability, the authors use Zero-initialization (starting prompts at zero so they don't disrupt pre-trained features early on) and Prompt Balancing Losses to ensure the gating network doesn't suffer from mode collapse.

Experimental Setup

The researchers evaluated DMP across several standard benchmarks for both unconditional and conditional image generation:

  • FFHQ (256×256): 70,000 high-quality human face images.
  • MS-COCO: Used for text-to-image generation tasks.
  • Laion5B: Used to evaluate improvements on Stable Diffusion v1.5.
  • ImageNet (256×256): Used for class-conditional generation with the DiT-XL/2 model.

Key Results and Discussion

DMP significantly improves FID on converged models compared to fine-tuning or standard prompt tuning.
  • Breaking the Convergence Ceiling: The most surprising finding is that you can significantly improve a "fully trained" model using its original training data. On the FFHQ dataset, DMP improved the FID of a converged DiT-L/2 model by 10.38% (moving from 6.26 to 5.61) with only a 1.43% increase in total parameters.
  • Timestep-Specific Expertise: The gating mechanism effectively learns a "schedule" of expertise. At high noise levels, the gate selects prompts that help with global structure; as noise decreases, it shifts toward prompts specialized in fine details.
  • Efficiency over Complexity: DMP achieves better results than full fine-tuning or LoRA (Low-Rank Adaptation) while using fewer trainable parameters. Naive fine-tuning on converged models often leads to performance degradation (overfitting), whereas DMP’s constrained prompt-space acts as a regularizer.
  • Stable Diffusion Boost: When applied to Stable Diffusion v1.5 on the Laion5B dataset, DMP reduced the FID from 47.18 to 35.44—a massive jump in quality for a relatively short "further training" phase.

Limitations and Future Work

The current implementation uses a fixed number of prompts tied to the input patch count. Exploring more flexible prompt architectures that do not diverge could be a future direction. Additionally, DMP prompts are currently tailored to specific resolutions and aspect ratios; generating images at different resolutions might require further tuning. Finally, while the structural bias introduced by prompts was found to be manageable, adding identical prompts to image tokens at specific positions introduces a slight spatial/temporal bias that warrants further study.

Summary updated

BibTeX
@inproceedings{ham2025diffusion,
  author = {Seokil Ham and Sangmin Woo and Jin-Young Kim and Hyojun Go and Byeongjun Park and Changick Kim},
  title = {{Diffusion Model Patching via Mixture-of-Prompts}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i16.33871},
}
Figure