[论文解读] Fast Training of Diffusion Models with Masked Transformers
MaskDiT 通过对输入补丁遮蔽50%并使用非对称的编码器–解码器,在未遮蔽补丁处应用 DSM + 遮蔽补丁的 MAE 风格重建,训练时间仅约为 DiT 的31%,即可实现与 DiT 相当的 FID。
We propose an efficient approach to train large diffusion models with masked transformers. While masked transformers have been extensively explored for representation learning, their application to generative learning is less explored in the vision domain. Our work is the first to exploit masked training to reduce the training cost of diffusion models significantly. Specifically, we randomly mask out a high proportion (e.g., 50%) of patches in diffused input images during training. For masked training, we introduce an asymmetric encoder-decoder architecture consisting of a transformer encoder that operates only on unmasked patches and a lightweight transformer decoder on full patches. To promote a long-range understanding of full patches, we add an auxiliary task of reconstructing masked patches to the denoising score matching objective that learns the score of unmasked patches. Experiments on ImageNet-256x256 and ImageNet-512x512 show that our approach achieves competitive and even better generative performance than the state-of-the-art Diffusion Transformer (DiT) model, using only around 30% of its original training time. Thus, our method shows a promising way of efficiently training large transformer-based diffusion models without sacrificing the generative performance.
研究动机与目标
- 在不牺牲生成质量的前提下,降低大规模扩散模型的训练成本。
- 利用遮蔽的变换器训练来降低扩散模型的每次迭代计算和内存需求。
- 提出一个非对称编码器–解码器骨干网络及双重目标来处理遮蔽输入。
- 在 ImageNet-256×256 上展示具备显著训练时间节省的竞争性生成性能。
提出的方法
- 采用一个非对称编码器–解码器变换器骨干,编码器对未遮蔽的补丁进行处理,轻量解码器处理完整的 token。
- 在扩散模型训练中随机遮蔽大量输入补丁(50%),以降低每次迭代的计算量。
- 引入两部分训练目标:对未遮蔽补丁进行去噪得分匹配(DSM),对遮蔽补丁进行辅助的 MAE 风格重建损失。
- 在整个时间步上使用相同的遮蔽比率进行训练,随后进行最小化的“取消遮蔽”微调以缩小训练与推理之间的差距。
- 使用取消遮蔽微调计划(零比率或余弦比率)来在遮蔽训练后提升 CFG 采样性能。
- 在 ImageNet-256×256 上使用 FID 等相关指标进行评估,并与 DiT 和 MDT 基线进行对比,同时比较有无分类器自由引导。
![Figure 1 : A comparison of our MaskDiT architecture with DiT [ 33 ] . During training, we randomly mask a high proportion of input patches. The encoder operates on unmasked patches, and after adding learnable masked tokens (marked by gray), full patches are processed by a small decoder. The model is](https://ar5iv.labs.arxiv.org/html/2306.09305/assets/x1.png)
实验结果
研究问题
- RQ1遮蔽式变换器训练是否可以在不牺牲生成性能的前提下降低扩散模型的训练成本?
- RQ2应如何设计架构与训练目标以适应扩散模型中的遮蔽输入?
- RQ3遮蔽比率、重建损失权重与取消遮蔽微调之间的权衡对扩散模型质量有何影响?
- RQ4MaskDiT 在 ImageNet-256×256 上与最先进的扩散模型在效率和样本质量方面相比如何?
- RQ5引导(CFG)与取消遮蔽微调对最终生成指标有何影响?
主要发现
- MaskDiT 在没有引导的情况下在 ImageNet-256×256 上达到 5.69 的 FID,超越多种非级联扩散模型,并在有引导时接近状态‑艺术水平。
- 在使用分类器自由引导时,MaskDiT 达到 2.28 的 FID,与 DiT-XL/2-G(2.27)相当,同时训练时间仅为 DiT-XL/2 的约 31%。
- 训练速度和每个 GPU 的显存显著降低:MaskDiT 的前向计算仅占 DiT 的 54.0% 和 MDT 的 31.7% GFLOPs,并且在较大批量(1024)时收敛更快。
- MaskDiT-G(有引导)在计算成本较 MDT-XL/2-G 低的情况下,达到接近最佳引导模型的强性能。
- 当与 DSM 损失在未遮蔽 token 上结合时,MAE 重建损失(MAE 系数约为 0.1)提升了生成质量和稳定性。
- 取消遮蔽微调进一步提升 CFG 性能,随着微调步数增加,最佳引导尺度向上移动。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。