← Back to Multimodal Mind Map
👁️ MultimodalID: ddpm

DDPM Forward/Reverse Process

DDPM 前向/反向过程
🎯Core Definition
DDPM (Denoising Diffusion Probabilistic Models) builds generation on two Markov chains: a forward process qq that gradually adds noise to an image until it becomes standard Gaussian over TT steps, and a reverse process pθp_\theta that learns to denoise step by step. The forward step is q(xt∣xt−1)=N(xt; 1−βtxt−1, βtI)q(x_t \mid x_{t-1}) = \mathcal{N}(x_t;\ \sqrt{1-\beta_t}x_{t-1},\ \beta_t I); since each step injects independent Gaussian noise, the accumulated noise has a closed form at any time tt:
📌Overview
q(xt∣x0)=N(xt; αˉtx0, (1−αˉt)I),xt=αˉtx0+1−αˉt ϵ, ϵ∼N(0,I)q(x_t \mid x_0) = \mathcal{N}(x_t;\ \sqrt{\bar\alpha_t}x_0,\ (1-\bar\alpha_t)I),\qquad x_t = \sqrt{\bar\alpha_t}x_0 + \sqrt{1-\bar\alpha_t}\,\epsilon,\ \epsilon \sim \mathcal{N}(0, I)
📌Overview
with αt=1−βt\alpha_t = 1 - \beta_t and the cumulative schedule αˉt=∏s=1tαs\bar\alpha_t = \prod_{s=1}^{t}\alpha_s (the SNR αˉt/(1−αˉt)\bar\alpha_t/(1-\bar\alpha_t) decreases with tt); the standard linear schedule runs β1=10−4\beta_1 = 10^{-4} up to βT=0.02\beta_T = 0.02. The training objective follows from maximizing the ELBO: each term is a Gaussian KL between the posterior q(xt−1∣xt,x0)q(x_{t-1} \mid x_t, x_0) and pθ(xt−1∣xt)p_\theta(x_{t-1} \mid x_t), which with known variances reduces to the L2 distance between means; since the mean is a linear combination of xtx_t and the noise ϵ\epsilon, the loss collapses to regressing the injected noise:
📌Overview
L=Et∼Uniform[1,T], x0∼q, ϵ∼N(0,I)[∥ϵ−ϵθ(xt,t)∥2]\mathcal{L} = \mathbb{E}_{t \sim \mathrm{Uniform}[1,T],\, x_0 \sim q,\, \epsilon \sim \mathcal{N}(0,I)}\left[\Vert \epsilon - \epsilon_\theta(x_t, t)\Vert^2\right]
📌Overview
Sampling starts from xT∼N(0,I)x_T \sim \mathcal{N}(0, I) and iterates backward t=T,…,1t = T, \dots, 1: xt−1=1αt(xt−βt1−αˉtϵθ(xt,t))+σtzx_{t-1} = \dfrac{1}{\sqrt{\alpha_t}}\left(x_t - \dfrac{\beta_t}{\sqrt{1-\bar\alpha_t}}\epsilon_\theta(x_t, t)\right) + \sigma_t z, where σt2=β~t\sigma_t^2 = \tilde\beta_t (posterior variance) and z=0z = 0 at the final step t=1t=1.
💡Use Cases
an interview staple — “write the DDPM training/sampling formulas”; the backbone of text-to-image models (Stable Diffusion) and video/audio generation, often followed by “why regress the noise with L2?”.
⚡Key Problems Solved
GANs suffer unstable adversarial training, mode collapse and difficult tuning; DDPM's loss is plain MSE noise regression — stable first-order optimization and full-distribution coverage (good diversity) — at the cost of ~1000 sampling steps, which motivates DDIM/LCM acceleration.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of DDPM Forward/Reverse Process.
Use Cases
In production engineering, what are the primary use cases for DDPM Forward/Reverse Process and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Write the closed-form forward process q(x_t|x_0) and define the cumulative schedule ᾱ_t.
2
Whiteboard: derive the training loss E‖ε−ε_θ(x_t,t)‖² from the ELBO; how each Gaussian KL term simplifies.
3
Write the DDPM reverse-sampling update; why is no noise added at the final step, and what is σ_t?
4
Relation between α_t, β_t and ᾱ_t; why can forward sampling jump to any t in one step?
5
How do DDPM, GAN and VAE compare on training stability, sample diversity and sampling speed?
📖 In-depth Guide:📄 diffusion-models →
Updated 2026-08-12
🎯
Verify Mastery: Practice Exam Questions for "DDPM Forward/Reverse Process"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
← Previous CardMultimodal DPO / RLHF-VNext Card →Classifier-Free Guidance

🔗 More Multimodal Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/Multimodal/card/ddpm
中文速览与面试要点

DDPM 前向/反向过程 (DDPM Forward/Reverse Process)

定义: DDPM (Denoising Diffusion Probabilistic Models, 去噪扩散概率模型) 用两条 Markov 链做生成: 前向过程 q 在 T 步内把图像逐步加噪直至标准高斯噪声, 反向过程 p_ 学习逐步去噪还原数据。前向单步 q(x_t x_t-1) = N(x_t;\ 1- _tx_t-1,\ _t I), 因每一步只加独立高斯噪声, 重参数化叠加后任意时刻 t 都有封闭形式: q(x_t x_0) = N(x_t;\ _tx_0,\ (1- _t)I), x_t = _tx_0 + 1- _t\, ,\ N(0, I) 其中 _t = 1 - _t, 累积噪声调度 _t = _s=1^t _s(t 越大, 信噪比 _t/(1- _t) 越低), 常用线性调度 _1 = 10^-4 线性增至 _T = 0.02。训练目标由最大化变分下界 (ELBO) 推出: ELBO 每项是后验 q(x_t-1 x_t, x_0) 与 p_ (x_t-1 x_t) 之间的高斯 KL, 在方差已知时化简为两均值间的 L2; 该均值是 x_t 与噪声 的线性组合, 最终等价于“预测第 t 步被注入的噪声”的简单回归: L = E_t Uniform[1,T],\, x_0 q,\, N(0,I) [ - _ (x_t, t) ^2 ] 采样从 x_T N(0, I) 出发, 按 t = T, , 1 反向迭代: x_t-1 = 1 _t (x_t - _t 1- _t _ (x_t, t) ) + _t z, 其中 _t^2 = _t (后验方差), 末步 t=1 取 z = 0。 使用场景: 面试必考“写出 DDPM 训练/采样公式”; 是 Stable Diffusion 等文生图模型与视频/音频生成的底座, 常与“为什么 L2 只回归噪声”连问。 解决的问题: GAN 对抗训练不稳定、易模式坍塌且难调; DDPM 的训练目标是噪声回归 MSE, 一阶优化稳定收敛、多样性好(覆盖全分布), 代价是采样需约 1000 步——由此引出 DDIM、LCM 等加速手段。

核心要点

  • 写出 DDPM 前向过程的封闭形式 q(x_t|x_0) 与累积噪声调度 ᾱ_t 的定义?
  • 白板推导: 从变分下界 ELBO 到训练损失 L = E[‖ε − ε_θ(x_t,t)‖²], 每项高斯 KL 如何化简?
  • 写出 DDPM 采样迭代公式, 末步为什么不加噪声? σ_t 取什么?
  • α_t、β_t、ᾱ_t 的关系? 为什么前向可以一步采样到任意时刻 t?
  • DDPM 相比 GAN 与 VAE 在训练稳定性、样本多样性、采样速度上的差异?