解析Transformer在扩散模型中为何能高效去噪,揭示其收敛机制。
Transformers Learn the Optimal DDPM Denoiser for Multi-Token GMMs
- 理论分析证明Transformer可收敛到最优去噪器
- 仅需少量数据令牌与迭代次数即达理想去噪误差
- 自注意力机制实现均值去噪,逼近最优估计器
基于Transformer的扩散模型在生成高质量样本方面表现优异,但其成功背后的理论机制仍不明确。现有模型通常通过最小化去噪目标进行训练,等价于拟合数据的得分函数。然而,我们尚不清楚为何Transformer能有效匹配该得分函数,以及为何梯度方法能在非凸损失下收敛至最优去噪模型。本文首次对基于Transformer的扩散模型训练过程进行了收敛性分析。具体而言,研究了服从多令牌高斯混合分布的数据在总体去噪扩散概率模型(DDPM)目标下的收敛行为,理论上量化了达到贝叶斯最优风险所需的每样本令牌数与训练迭代次数,从而实现期望的得分匹配误差。深入分析表明,训练后Transformer的自注意力模块实现了均值去噪机制,使模型能够逼近扩散步骤中注入噪声的最优最小均方误差(MMSE)估计器。数值实验验证了上述结论。
原文摘要 · Abstract (English)
Transformer-based diffusion models have demonstrated remarkable performance at generating high-quality samples. However, our theoretical understanding of the reasons for this success remains limited. For instance, existing models are typically trained by minimizing a denoising objective, which is equivalent to fitting the score function of the training data. However, we do not know why transformer-based models can match the score function for denoising, or why gradient-based methods converge to the optimal denoising model despite the non-convex loss landscape. To the best of our knowledge, this paper provides the first convergence analysis for training transformer-based diffusion models. More specifically, we consider the population Denoising Diffusion Probabilistic Model (DDPM) objective for denoising data that follow a multi-token Gaussian mixture distribution. We theoretically quantify the required number of tokens per data point and training iterations for the global convergence towards the Bayes optimal risk of the denoising objective, thereby achieving a desired score matching error. A deeper investigation reveals that the self-attention module of the trained transformer implements a mean denoising mechanism that enables the trained model to approximate the oracle Minimum Mean Squared Error (MMSE) estimator of the injected noise in the diffusion steps. Numerical experiments validate these findings.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。