TL;DR
Multi-Task Upcycling (MTU) transforms standard text-to-image diffusion models into versatile "generalists" capable of image editing, super-resolution, and inpainting within a single architecture. By converting dense feed-forward networks into a sparse Mixture-of-Experts (MoE) system, MTU achieves performance on par with specialized single-task models without increasing computational cost (GFLOPs) or sacrificing on-device efficiency.
What Problem Does This Paper Address?
While text-to-image (T2I) models like Stable Diffusion are incredibly powerful, they are typically "one-trick ponies" out of the box. To make them perform other tasks—like increasing image resolution or editing specific objects—researchers usually have to fine-tune a completely separate version of the model for each task.
This creates a massive bottleneck for on-device deployment, such as on smartphones. Storing five different 2GB models for five different tasks is highly impractical. Existing "universal" models often suffer from "parameter inflation," becoming too computationally heavy for edge devices. The core challenge is teaching a single, efficient model to handle multiple diverse image-to-image (I2I) tasks without blowing up its size or slowing down its inference speed.
Methods
The authors introduce Multi-Task Upcycling (MTU), a recipe inspired by recent trends in Large Language Models (LLMs). The central idea is to "upcycle" a pre-trained dense model into a sparse Mixture-of-Experts (MoE) model.
- FFN Splitting: The researchers observed that during fine-tuning, the Feed-Forward Network (FFN) layers in a transformer block change the most to adapt to new tasks. MTU replaces these dense FFNs with several smaller "experts" (shards of the original FFN).
- Dynamic Routing: A lightweight "router" mechanism is added. Given a task embedding (e.g., indicating a super-resolution task), the router dynamically assigns weights to these experts, combining their outputs for that specific task.
- Task-Specific Components: To handle the different data distributions of various tasks, they add task-specific layer norms and specialized input convolution layers to accommodate the extra image channels required for I2I tasks.
- Efficient Training: During training, the bulk of the pre-trained model remains frozen. Only the experts, routers, and task-specific layers are trained, which preserves the original model's generative "prior" knowledge.
Crucially, the model remains iso-FLOP, meaning it uses the same amount of floating-point operations as the original single-task model, making it ideal for hardware with strict power and latency budgets.
Datasets
The models (SDv1.5 and SDXL) were trained and evaluated on four primary tasks using standard benchmarks:
- Text-to-Image (T2I): COCO Captions (to ensure the model doesn't "forget" how to generate images from scratch).
- Image Editing (IE): The InstructPix2pix dataset, which contains pairs of images and natural language editing instructions.
- Super Resolution (SR): Real-ESRGAN dataset, using high-resolution images and synthetically degraded low-resolution versions.
- Image Inpainting (IP): GQA-Inpaint, a multi-modal dataset designed for object removal based on text prompts.
Key Insights and Ideas
- FFNs are Task Specialists: The paper confirms that FFN layers are the primary drivers of task adaptation in diffusion transformers. While attention layers learn general features, FFNs specialize.
- The "Upcycling" Advantage: By splitting a large FFN into smaller experts rather than adding new ones, the authors maintain a constant computational budget.
- Model Depth Dictates Strategy: Interestingly, shallower models like SDv1.5 benefit from having many small experts ($N=4$). However, deeper models like SDXL perform best when the experts are kept at the original FFN size ($N=1$ with task-specific norms), as shrinking experts in very deep networks can destabilize training.
- Task Compatibility: Some tasks are "friends." Training Image Editing and Inpainting together actually improves performance because they both involve localized object manipulation. Conversely, Super Resolution and Inpainting can interfere with each other, as one focuses on adding detail while the other focuses on removing or replacing content.
Key Results
MTU consistently outperformed or matched specialized single-task baselines and existing multi-task frameworks like Versatile Diffusion and UniDiffuser.
- Performance: On SDv1.5, MTU achieved an Image-Text Directional Similarity of 17.2 for editing (vs. 15.4 for the baseline) and a significantly better LPIPS score of 24.8 for super-resolution (vs. 38.0 for the baseline).
- Efficiency: The SDXL version of MTU maintained a computational cost of 1.54 TFLOPs, identical to the standard single-task SDXL model, while supporting four distinct tasks simultaneously.
- PEFT Comparison: MTU significantly outperformed standard Parameter-Efficient Fine-Tuning (PEFT) methods like LoRA and IA3 when applied to the same multi-task setting.
Limitations and Future Work
- Task Interference: While some tasks help each other, others cause "negative transfer." The authors suggest that future work could integrate gradient conflict mitigation or dynamic loss balancing to further reduce this interference.
- Expert Scaling: While the paper provides a "recipe" for choosing expert sizes, the optimal configuration still depends heavily on the specific architecture depth.
- Modality Expansion: The current work focuses on image-to-image tasks. Expanding this upcycling approach to handle video or audio within the same diffusion backbone is a promising next step.
Summary updated