# 深度生成模型

深度生成模型是一种基于神经网络的方法，它学习训练数据集的概率分布，学得足够好，以至能从中抽取与训练数据相似的新样本。已发表的综述将该领域按分布的表示方式划分为若干族系：生成对抗网络（GAN）从不定义似然，属于隐式密度模型；变分自编码器（VAE）与扩散模型则定义并最大化似然，属于近似显式密度模型；自回归模型与归一化流补全了主要的族系集合。<sup>[1](https://link.springer.com/article/10.1186/s40537-025-01247-x)</sup><sup> • </sup><sup>[2](https://arxiv.org/pdf/2103.04922v4.pdf)</sup> 在操作层面上，“生成”一个样本意味着抽取一个隐变量或噪声向量，让它通过训练好的网络（对自回归模型而言，则是一次产生一个元素），从而得到一个类数据的对象，例如一幅图像、一段文本序列或一个分子结构。

| 关键事实 | 数值 |
|---|---|
| 对比综述中的族系 | GAN、基于能量的模型、VAE、自回归模型与归一化流<sup>[2](https://arxiv.org/pdf/2103.04922v4.pdf)</sup> |
| 密度处理方式 | GAN 为隐式；VAE 与扩散模型为近似显式似然；归一化流与自回归模型为精确似然<sup>[1](https://link.springer.com/article/10.1186/s40537-025-01247-x)</sup><sup> • </sup><sup>[2](https://arxiv.org/pdf/2103.04922v4.pdf)</sup> |
| 扩散模型的表述形式 | DDPM、基于得分的生成模型（SGM）与得分 SDE，彼此可以相互归约<sup>[3](https://dl.acm.org/doi/10.1145/3626235)</sup> |
| 对比综述中 CIFAR-10 上报告的最佳 FID | DDPM++ Continuous 2.20；StyleGAN2+ADA 2.42<sup>[2](https://arxiv.org/pdf/2103.04922v4.pdf)</sup> |
| CIFAR-10 上归一化流的精确似然 | Residual Flow 3.28 比特/维；GLOW 3.35；FFJORD 3.40；RealNVP 3.49<sup>[2](https://arxiv.org/pdf/2103.04922v4.pdf)</sup> |
| 扩散模型的推理开销 | 每个样本需要多次串行的网络前向传播<sup>[1](https://link.springer.com/article/10.1186/s40537-025-01247-x)</sup> |
| 2023 年之后的方向 | 整流流与流匹配，搭配 MM-DiT 等 Transformer 主干<sup>[4](https://doi.org/10.48550/arxiv.2403.03206)</sup> |

## 工作原理

每个族系优化不同的目标。GAN 通过对抗训练目标，让生成器对抗判别器进行训练；生成器直接从紧凑的隐空间（往往是 \( \mathbb{R}^{100} \)）产生样本，而从不写出密度。<sup>[1](https://link.springer.com/article/10.1186/s40537-025-01247-x)</sup> VAE 将一个近似难以处理的后验的编码器与一个产生样本的解码器配对，通过最大化证据下界（ELBO）来训练，该下界在重建精度与编码器近似分布和隐先验之间的散度之间取得平衡。<sup>[1](https://link.springer.com/article/10.1186/s40537-025-01247-x)</sup>

基于得分的方法绕开了密度中难以处理的归一化常数，转而学习得分函数，其定义为 \( s(x) = \nabla_{x} \ln p(x) \)，它不依赖于那个难以处理的分母。<sup>[2](https://arxiv.org/pdf/2103.04922v4.pdf)</sup> 扩散模型是这一思想的具体化：它们在固定的步数 \( T \) 内，按[噪声调度](https://www.edgepedia.org/zh/noise-schedule) \( \beta_{1:T} \) 逐步加噪破坏数据 \( x_{0} \)，该调度被选得使 \( x_{T} \) 近似服从正态分布，其前向转移为

\[ q(x_{t} \mid x_{t-1}) = \mathcal{N}\bigl(x_{t};\, \sqrt{1-\beta_{t}}\, x_{t-1},\, \beta_{t} I\bigr), \]

同时训练一个参数化的逆向过程，通过优化 ELBO 的重加权变体来去除噪声。<sup>[2](https://arxiv.org/pdf/2103.04922v4.pdf)</sup> DDPM 论文将训练目标写作负对数似然的常规变分上界，

\[ L = \mathbb{E}_{q}\Bigl[-\log p(x_{T}) - \sum_{t \geq 1} \log p_{\theta}(x_{t-1} \mid x_{t})\Bigr], \]

并证明一种特定的参数化可使训练等价于在多个噪声水平上的去噪得分匹配，使采样等价于退火[朗之万动力学](https://www.edgepedia.org/zh/langevin-dynamics)。<sup>[5](https://doi.org/10.48550/arxiv.2006.11239)</sup> 一篇关于扩散方法的综述归纳出三种主流表述：去噪扩散概率模型、基于得分的生成模型与[随机微分方程](https://www.edgepedia.org/zh/stochastic-differential-equation)，它们共享同一条原则：先用逐渐增强的随机噪声逐步扰动数据，再逐步去噪以生成新样本；三者可以相互归约。<sup>[3](https://dl.acm.org/doi/10.1145/3626235)</sup> 较新的表述“整流流”用直线连接数据与噪声，其前向过程为数据点与标准正态随机变量之间的 \( z_{t} = (1 - t)\, x_{0} + t\,\varepsilon \)。<sup>[4](https://doi.org/10.48550/arxiv.2403.03206)</sup>

## 如何实施

训练循环因族系而异。GAN 的训练交替更新生成器与判别器，但要达到对抗博弈的[纳什均衡](https://www.edgepedia.org/zh/nash-equilibrium)十分困难，而且随着判别器变强，传给生成器的梯度可能消失。<sup>[2](https://arxiv.org/pdf/2103.04922v4.pdf)</sup> VAE 的训练是变分式的：编码器与解码器在 ELBO 上联合优化，因此不涉及对抗博弈。<sup>[1](https://link.springer.com/article/10.1186/s40537-025-01247-x)</sup> 自回归模型能在序列上取得很强的似然，但生成时一次只采样一个元素，这使得采样很慢。<sup>[2](https://arxiv.org/pdf/2103.04922v4.pdf)</sup>

扩散训练在各噪声水平上优化重加权的 ELBO，而得分匹配参数化需要在许多噪声水平上训练，以便朗之万动力学采样能从高噪声退火到低噪声。<sup>[2](https://arxiv.org/pdf/2103.04922v4.pdf)</sup><sup> • </sup><sup>[5](https://doi.org/10.48550/arxiv.2006.11239)</sup> 从训练好的扩散模型采样，便是运行学到的逆向过程，其代价是需要多次串行的网络前向传播。<sup>[1](https://link.springer.com/article/10.1186/s40537-025-01247-x)</sup> 对于[整流流](https://www.edgepedia.org/zh/rectified-flow)模型，SD3 的工作发现，从偏向中间噪声尺度的 logit 正态分布中采样时间步取值，能比先前的扩散表述改善训练，同时保留整流流有利的少步采样行为。<sup>[4](https://doi.org/10.48550/arxiv.2403.03206)</sup>

## 起源

早期的神经生成模型是基于能量的：它们将概率定义为与负能量的指数成正比，并在训练与推理时都需要缓慢的[马尔可夫链蒙特卡洛](https://www.edgepedia.org/zh/markov-chain-monte-carlo)采样。<sup>[2](https://arxiv.org/pdf/2103.04922v4.pdf)</sup><sup> • </sup><sup>[15](https://arxiv.org/abs/1605.07371)</sup> 变分自编码器这一脉络源自 自编码变分贝叶斯（AEVB）算法，该算法利用 SGVB 估计器，在具有连续隐变量的独立同分布数据集上，将识别模型与生成模型一同优化，从而使推断与学习变得高效。<sup>[6](https://arxiv.org/abs/1312.6114)</sup> 对抗框架由 伊恩·J·古德费洛（Ian J. Goodfellow）及其同事在 2014 年的一篇论文中提出。作为变分推断工具的归一化流由 达尼洛·希门尼斯·雷森德（Danilo Jimenez Rezende）与沙基尔·穆罕默德（Shakir Mohamed）于 2015 年提出。<sup>[7](https://doi.org/10.48550/arxiv.1505.05770)</sup> 受非平衡态统计物理启发，前向过程系统性地破坏数据分布中的结构，学到的逆向过程则将其恢复，使得在具有数千层或数千时间步的模型中能够快速学习、采样和概率评估。<sup>[8](https://proceedings.mlr.press/v37/sohl-dickstein15.html)</sup> 使扩散模型具备竞争力的现代 DDPM 表述由 乔纳森·何（Jonathan Ho）、阿杰伊·贾因（Ajay Jain）与[彼得·阿比尔](https://www.edgepedia.org/zh/pieter-abbeel)（Pieter Abbeel）于 2020 年发表。<sup>[5](https://doi.org/10.48550/arxiv.2006.11239)</sup>

## 变体

这些族系在似然保真度与采样速度之间权衡。蒸馏式变体致力于降低采样开销：《一致性模型》（Consistency Models，宋（Song）、达里瓦尔（Dhariwal）、陈（Chen）与苏茨克维（Sutskever），2023）学习将扩散轨迹上的任意点直接映射到数据，<sup>[9](https://doi.org/10.48550/arxiv.2303.01469)</sup> TRACT 对去噪扩散模型施加传递闭包时间蒸馏（贝瑟洛（Berthelot）及同事，2023），<sup>[10](https://doi.org/10.48550/arxiv.2303.04248)</sup> 一致性轨迹模型则学习扩散的概率流 ODE 轨迹（金（Kim）及同事，2023）。<sup>[11](https://doi.org/10.48550/arxiv.2310.02279)</sup> 在训练一侧，整流流（Rectified Flow，刘（Liu）、龚（Gong）与刘（Liu），2022）与《用于生成建模的流匹配》（Flow Matching for Generative Modeling，利普曼（Lipman）及同事，2022）将生成重新表述为学习噪声与数据之间的直线或一般速度场。<sup>[12](https://doi.org/10.48550/arxiv.2209.03003)</sup><sup> • </sup><sup>[13](https://doi.org/10.48550/arxiv.2210.02747)</sup>

## 应用

标准的自回归网络在文本与音频生成中广受欢迎，因为顺序分解与数据本身相符。<sup>[2](https://arxiv.org/pdf/2103.04922v4.pdf)</sup> VAE 在异常检测、科学分析与数据压缩中仍然有用，在这些场景中，隐空间控制、不确定性建模与可解释性比单纯的样本保真度更重要。<sup>[14](https://link.springer.com/article/10.1007/s10462-026-11546-1)</sup> 在 SD3 的工作中，搭配 Transformer 主干的整流流在高分辨率文生图合成上优于 LDM-Linear 与 EDM 等既有扩散表述。<sup>[4](https://doi.org/10.48550/arxiv.2403.03206)</sup>

## 局限与替代方案

GAN 因对抗目标而训练不稳定，且容易出现模式崩塌，即生成器只覆盖数据分布的一小部分；所提出的变体中没有哪一个能完全克服 GAN 的所有局限。<sup>[1](https://link.springer.com/article/10.1186/s40537-025-01247-x)</sup><sup> • </sup><sup>[14](https://link.springer.com/article/10.1007/s10462-026-11546-1)</sup> VAE 面临后验崩塌，即解码器忽略隐变量；高斯假设限制了表达能力；在没有监督的情况下难以获得解耦的隐因子；其模糊的重建使其在高保真生成上不及 GAN、扩散模型与大型自回归 Transformer。<sup>[14](https://link.springer.com/article/10.1007/s10462-026-11546-1)</sup>

扩散模型受益于基于似然的表述，训练稳定、样本多样性增强，但推理时计算效率较低，因为需要多次串行的网络前向传播。<sup>[1](https://link.springer.com/article/10.1186/s40537-025-01247-x)</sup>

评估存在已知的失效模式。Inception 分数（Inception Score）奖励单样本标签熵低、跨样本类别分布熵高，而一个每类只生成一张图像的模型也能得到完美的 IS；这促使了弗雷歇 Inception 距离（Fréchet Inception Distance）的提出，它将真实数据与生成数据在分类器某一层上的激活建模为多元高斯，并度量两者之间的弗雷歇距离。<sup>[2](https://arxiv.org/pdf/2103.04922v4.pdf)</sup>

## References

1. [Generative AI in depth: A survey of recent advances, model variants, and real-world applications](https://link.springer.com/article/10.1186/s40537-025-01247-x)
2. [Deep Generative Modelling: A Comparative Review and Unification (IEEE TPAMI)](https://arxiv.org/pdf/2103.04922v4.pdf)
3. [Diffusion Models: A Comprehensive Survey of Methods and Applications](https://dl.acm.org/doi/10.1145/3626235)
4. [Esser, Patrick and colleagues (2024). Scaling Rectified Flow Transformers for High-Resolution Image Synthesis. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2403.03206)
5. [Ho, Jonathan, Jain, Ajay, Abbeel, Pieter (2020). Denoising Diffusion Probabilistic Models. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2006.11239)
6. [Auto-Encoding Variational Bayes](https://arxiv.org/abs/1312.6114)
7. [Rezende, Danilo Jimenez, Mohamed, Shakir (2015). Variational Inference with Normalizing Flows. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1505.05770)
8. [Deep Unsupervised Learning using Nonequilibrium Thermodynamics](https://proceedings.mlr.press/v37/sohl-dickstein15.html)
9. [Song, Yang and colleagues (2023). Consistency Models. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2303.01469)
10. [Berthelot, David and colleagues (2023). TRACT: Denoising Diffusion Models with Transitive Closure Time-Distillation. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2303.04248)
11. [Kim, Dongjun and colleagues (2023). Consistency Trajectory Models: Learning Probability Flow ODE Trajectory of Diffusion. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2310.02279)
12. [Liu, Xingchao, Gong, Chengyue, Liu, Qiang (2022). Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2209.03003)
13. [Lipman, Yaron and colleagues (2022). Flow Matching for Generative Modeling. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2210.02747)
14. [Generative Artificial Intelligence Models: A Survey](https://link.springer.com/article/10.1007/s10462-026-11546-1)
15. [Semiparametric energy-based probabilistic models](https://arxiv.org/abs/1605.07371)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Neural networks and deep learning › Titles A to H

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/deep-generative-model

English original: https://www.edgepedia.org/deep-generative-model
