TL;DR
This paper introduces Trajectory Distribution Matching (TDM), a novel distillation method that unifies distribution and trajectory matching to accelerate diffusion models for tasks like text-to-image generation. TDM achieves state-of-the-art performance with significantly fewer sampling steps and drastically reduced training costs, even surpassing its teacher models.
What Problem Does This Paper Address?
Diffusion models have revolutionized generative AI, but their slow sampling speed has been a major bottleneck for real-world deployment. While diffusion distillation techniques aim to speed this up, existing methods face a trade-off: distribution matching struggles with complex tasks like text-to-image generation, and trajectory matching often results in suboptimal image quality or requires high model capacity. Few-step generation offers a better balance, but existing approaches are either inflexible or still fall short on demanding tasks. This paper addresses the need for a unified approach that combines the strengths of both distribution and trajectory matching to achieve efficient, high-quality few-step generation.
Methods
The core of TDM is a novel distillation paradigm that unifies trajectory distillation and distribution matching. Key components include:
- Image-Free Score Distillation Objective: TDM introduces an objective that aligns the student model's trajectory with the teacher's at the distribution level, without requiring direct image data from the teacher. This is achieved by matching the marginal reverse KL divergence of intermediate diffusion steps.
- Sampling-Steps-Aware Objective: To enable flexible control over the number of sampling steps during inference, TDM incorporates a sampling-steps-aware objective. This decouples learning targets across different steps, allowing for adjustable sampling without sacrificing quality.
- Surrogate Training Objective: Inspired by consistency models, TDM uses a Pseudo-Huber metric for its surrogate training objective, which has shown to be more effective than L2 metrics for stable training.
- Importance Sampling: For learning the "fake score" (student model's score), importance sampling is employed to improve efficiency and stability.
Datasets
The paper primarily uses the JourneyDB dataset for training and evaluation, specifically focusing on its prompts due to the image-free nature of their method. They also mention using LAION-AeS-6.5+ as a dataset for fine-tuning.
Key Insights and Ideas
- Unifying Distribution and Trajectory Matching: The paper demonstrates that combining these two seemingly disparate distillation approaches leads to superior performance, overcoming the limitations of each individually.
- Image-Free Distillation is Powerful: The ability to distill knowledge without needing direct image samples from the teacher model significantly reduces data requirements and computational overhead.
- Trajectory Matters Even at the Distribution Level: Aligning the distribution of trajectories, rather than just individual points, is crucial for effective knowledge transfer and achieving high-quality results.
- Flexible Sampling is Achievable: The sampling-steps-aware objective is a key innovation, allowing users to choose the number of inference steps without a significant drop in quality, a common issue in prior work.
- Efficiency is Paramount: TDM achieves remarkable training efficiency, requiring a fraction of the computational cost of existing methods, making it highly practical.
Key Results
- State-of-the-Art Performance: TDM-unify achieves state-of-the-art results on various benchmarks, including SDXL and PixArt-α, for text-to-image generation.
- Surpassing Teachers: Notably, TDM can distill PixArt-α into a 4-step generator that outperforms its teacher on user preference metrics.
- Drastic Cost Reduction: TDM requires only 1-2 A800 hours for distillation, which is approximately 1% of the cost of previous state-of-the-art methods. For example, distilling SDXL takes only 2 A800 hours, compared to 32 A100 days for LCM or 160 A100 days for DMD2.
- Text-to-Video Extension: TDM can also be extended to accelerate text-to-video diffusion, outperforming its teacher (CogVideoX 2B) with only 4 NFE on VBench.
- Improved Style Preservation: When integrating LoRA into customized models, TDM shows significantly better style preservation (lower FID) compared to methods like Hyper-SD.
Limitations and Future Work
- Performance Ceiling: The paper acknowledges that the performance upper bound of their image-free method is limited by the quality of the pre-trained teacher diffusion model. They suggest fine-tuning the teacher on high-quality datasets to improve the ceiling.
- Teacher Model Quality: The quality of the teacher model directly impacts the distilled student model. They note that SD-v1.5's generation quality doesn't always align with human preferences due to uneven training data.
- Future Work: The paper suggests that TDM's effectiveness in text-to-video generation opens avenues for further research in video diffusion distillation. The unified paradigm also paves the way for more inclusive and efficient research in diffusion distillation.
Summary updated