arXiv:2511.11746cs.LGcs.AI2025-11

从零推导扩散模型数学原理,揭示生成机制与实践方法。

Diffusion Models: A Mathematical Introduction

  • 基于高斯分布性质,从头构建去噪扩散概率模型
  • 推导出精确的逆过程和变分界,简化为实际噪声预测目标
  • 涵盖采样加速、连续时间形式与引导生成,适合算法实现者

本文以简洁自洽的方式推导了基于扩散的生成模型。从高斯分布的基本性质(密度、二次期望、重参数化、乘积与KL散度)出发,从零开始构建去噪扩散概率模型,包括前向加噪过程、闭式边缘分布、精确离散逆后验及相关的变分界。该界可简化为实际应用中的标准噪声预测目标。随后讨论似然估计与加速采样,涵盖DDIM、对抗性学习逆动力学(DDGAN)以及多尺度变体如嵌套与潜在扩散,以Stable Diffusion为例。接着引入连续时间形式,通过连续性方程与福克-普兰克方程,从扩散SDE推导概率流ODE,提出流匹配方法,并表明修正流在时间重参数化下恢复DDIM。最后处理引导扩散,将分类器引导解释为后验得分修正,分类器无关引导则视为条件与无条件得分间的合理插值。全文注重透明代数、明确中间步骤与一致符号,使读者既能理解理论,也能实际实现相应算法。

原文摘要 · Abstract (English)

We present a concise, self-contained derivation of diffusion-based generative models. Starting from basic properties of Gaussian distributions (densities, quadratic expectations, re-parameterisation, products, and KL divergences), we construct denoising diffusion probabilistic models from first principles. This includes the forward noising process, its closed-form marginals, the exact discrete reverse posterior, and the related variational bound. This bound simplifies to the standard noise-prediction goal used in practice. We then discuss likelihood estimation and accelerated sampling, covering DDIM, adversarially learned reverse dynamics (DDGAN), and multi-scale variants such as nested and latent diffusion, with Stable Diffusion as a canonical example. A continuous-time formulation follows, in which we derive the probability-flow ODE from the diffusion SDE via the continuity and Fokker-Planck equations, introduce flow matching, and show how rectified flows recover DDIM up to a time re-parameterisation. Finally, we treat guided diffusion, interpreting classifier guidance as a posterior score correction and classifier-free guidance as a principled interpolation between conditional and unconditional scores. Throughout, the focus is on transparent algebra, explicit intermediate steps, and consistent notation, so that readers can both follow the theory and implement the corresponding algorithms in practice.

扩散模型概率建模生成模型数学推导

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。