TinyFusion:学习得到浅层的扩散 Transformer
TinyFusion: Diffusion Transformers Learned Shallow
AI总结:
本文提出 TinyFusion 可学习深度剪枝框架,通过可微采样与模拟微调的协同优化参数,高效获得浅层扩散 Transformer,并在多种架构上以低成本实现优异生成性能。
摘要:
扩散 Transformer 已在图像生成中展现出卓越能力,但通常存在过度参数化问题,导致实际应用中的推理开销相当大。在本文中,我们提出 TinyFusion,这是一种深度剪枝方法,旨在通过端到端学习从扩散 Transformer 中移除冗余层。我们方法的核心原则是创建具有高可恢复性的剪枝模型,使其能够在微调后重新获得强大性能。为此,我们引入一种可微采样技术,使剪枝过程可学习,并配合一个协同优化的参数来模拟未来的微调。以往工作关注最小化剪枝后的损失或误差,而我们的方法显式建模并优化剪枝模型在微调后的性能。实验结果表明,这种可学习范式为扩散 Transformer 的层剪枝带来了显著收益,超过了现有的基于重要性和基于误差的方法。此外,TinyFusion 在 DiT、MAR 和 SiT 等多种架构上表现出很强的泛化能力。在 DiT-XL 上的实验显示,TinyFusion 能够以不足预训练成本 7% 的代价构建浅层扩散 Transformer,实现 2 倍加速,FID 得分为 2.86,并优于效率相当的竞争方法。代码可在 https://github.com/VainF/TinyFusion 获取。
英文摘要:
Diffusion Transformers have demonstrated remarkable capabilities in image generation but often come with excessive parameterization, resulting in considerable inference overhead in real-world applications. In this work, we present TinyFusion, a depth pruning method designed to remove redundant layers from diffusion transformers via end-to-end learning. The core principle of our approach is to create a pruned model with high recoverability, allowing it to regain strong performance after fine-tuning. To accomplish this, we introduce a differentiable sampling technique to make pruning learnable, paired with a co-optimized parameter to simulate future fine-tuning. While prior works focus on minimizing loss or error after pruning, our method explicitly models and optimizes the post-fine-tuning performance of pruned models. Experimental results indicate that this learnable paradigm offers substantial benefits for layer pruning of diffusion transformers, surpassing existing importance-based and error-based methods. Additionally, TinyFusion exhibits strong generalization across diverse architectures, such as DiTs, MARs, and SiTs. Experiments with DiT-XL show that TinyFusion can craft a shallow diffusion transformer at less than 7% of the pre-training cost, achieving a 2$\times$ speedup with an FID score of 2.86, outperforming competitors with comparable efficiency. Code is available at https://github.com/VainF/TinyFusion.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。