迈向揭示扩散模型创造力的奥秘

qimuai 发布于 阅读:52 一手编译

迈向揭示扩散模型创造力的奥秘

内容来源:https://research.google/blog/towards-demystifying-the-creativity-of-diffusion-models/

内容总结:

谷歌研究揭示:扩散模型的“创造力”源于神经网络“平滑化”学习机制

2026年7月15日,谷歌研究院研究科学家陈正道发表最新研究成果,从数学角度揭示了扩散模型(如AI图像生成工具)具备“创造力”的根本原因。该研究指出,模型的创新能力并非偶然,而是神经网络在学习过程中对“评分函数”进行自然平滑处理后的必然结果。

扩散模型是目前图像生成、分子发现等复杂生成任务中最强大的工具之一。它们在训练时,首先将真实数据(如猫的照片)逐步添加噪声直至完全混乱,然后学习逆向去噪过程,从纯噪声中重建出逼真图像。如果模型完美学习这一过程,它只会“死记硬背”式地复制训练数据;但在实践中,模型往往能生成全新的、从未见过的内容。

研究团队发现,这一“创造力”的数学根源在于神经网络训练的特性:受权重衰减等正则化手段影响,神经网络难以学习到评分函数中陡峭的“悬崖”部分,而是倾向于学习一个更平滑的版本。这导致去噪过程不再将数据点精确拉回原始训练样本,而是将样本“插值”在训练数据点之间的空间内,从而产生合理的新样本。

以简化的一维模型为例:当训练数据仅为+1和-1两个点时,精准的评分函数会在中点0处形成急速转向的陡坡,迫使所有粒子最终落回两个原点。而神经网络学习到的平滑版评分函数则减缓了这一转向,使得粒子在中间区域“减速”并最终落在两个原点之间,即生成了全新的中间值。

更关键的是,在高维真实数据(如图像)场景中,这种平滑效应具有方向选择性。沿着数据流形的切线方向,平滑效应减缓了粒子向训练数据点的“坍缩”;而沿指向流形的方向,评分函数本已平滑,因此不受影响。这使模型在“质量”与“新颖性”间达成平衡:生成图像既真实(成功抵达有意义的流形),又新颖(落在原始数据间的空白区域)。

研究团队强调,扩散模型的所谓“创造力”实则是可预测的数学结果。这一发现为打破生成式AI“黑箱”提供了重要视角,未来可据此主动设计更擅长“插值”的模型,确保其在保持创新引擎功能的同时,避免陷入盲目记忆的陷阱。相关论文已发表于2026年国际学习表征大会。

中文翻译:

2026年7月15日
郑道晨,谷歌研究院研究科学家

我们证明,扩散模型的创造力(即生成新颖数据而非仅仅记忆训练集的能力)是神经网络学习“平滑化”得分函数这一过程的数学结果,这种机制驱使模型沿着隐藏的数据流形在训练数据点之间进行插值。

扩散模型目前是生成任务中最强大的工具类型之一,尤其适用于需要复杂局部结构的场景,如图像生成和分子发现。它们展现出了令人兴奋的泛化能力——能够超越训练数据生成新内容,就此而言,体现了“创造力”。例如,在使用真实图像数据集训练后,它们能将随机噪声样本转化为新颖、高质量的图像。

尽管这种创造能力令人印象深刻,但它引出了一个有趣的问题:这种能力从何而来?理解这个问题的答案,是揭开扩散模型生成式人工智能“黑箱”本质的重要一步。

为此,我们在2026年国际学习表征大会发表的论文《扩散模型中得分平滑的插值效应》中,深入研究了扩散模型的数学原理来回答这个问题。我们证明,模型的创造力并非偶然的巧合。相反,它是神经网络训练在生成过程中自然“平滑”从噪声到数据转换的结果。

训练扩散模型首先需要获取一组真实训练数据样本(比如猫的照片),然后有意地用噪声逐步破坏它们,直到完全无法辨认。接着,模型被训练来逐步逆转这一破坏过程,从而能从纯噪声中重建出逼真的图像,这一过程称为去噪。

如果模型仅基于训练样本完美地学会了执行去噪过程,那么在部署时它应该生成与训练样本完全相同的副本(这种行为称为记忆化)。在这种情况下,模型充当的是检索工具,而非能够生成新颖输出的创造引擎。

然而在实践中,扩散模型通常不仅限于记忆;它们能泛化并生成新的数据样本。

为了理解扩散模型实际是如何去噪数据的,可以把随机噪声想象成散布在房间里的气体粒子云,而某个“力场”将每个粒子拉向特定方向,直到它们形成有意义的形状。在扩散模型中,移动的粒子是正在经历去噪的单个数据点。“力场”则是得分函数,它从训练数据中学习而来,决定了粒子在任何给定时刻应流向何处。

如果模型依赖从训练数据中完美学习到的得分函数,那么力场会将粒子驱动到精确复制训练数据点的位置(即记忆化)。

我们发现,扩散模型的创造力实际上源于神经网络通常学习方式的近似性:由于正则化导致的不完美训练,自然会使得学习到的得分函数在“得分平滑”过程中产生轻微模糊。这进而导致去噪过程生成的数据在训练点之间进行插值(换句话说,落在训练点之间的空间中),从而创造出新的、合理的数据样本。

设想一个只有两个训练数据点的一维世界:+1和-1。在去噪过程的后期,“完美”的得分函数看起来像下图中灰色的曲线,在两个数据点中间有一个陡峭的符号变化,意味着在0附近拉拽方向迅速切换。换句话说,整个空间几乎被截然分成两部分:左边的粒子被拉向-1,右边的粒子被拉向+1。最终,每个粒子都会收敛到两个训练数据点之一,从而发生记忆化。

然而在实践中,扩散模型无法获得“完美”的得分函数,而是使用神经网络学习到的近似版本。由于训练过程中权重衰减的正则化效应,神经网络难以学习具有这些陡峭梯度的函数。相反,它们倾向于学习“完美”得分函数的更平滑版本,将陡峭的下降缓和为更平缓的斜坡。为了说明这一点,我们设计了一个实验,训练两层ReLU神经网络来拟合一维示例中的得分函数,并使用流行的AdamW算法在不同程度的权重衰减下优化神经网络参数。

权重衰减越强,学习到的得分函数在中间区域就越平滑,这意味着该区域的粒子流动比以前更慢,最终将停留在两个训练数据点之间的“插值区域”内。

在论文中,我们通过将神经网络正则化的函数空间理论与去噪的数学原理相结合,量化了这种关联。此外,我们的实验还表明,即使没有权重衰减等显式正则化策略,梯度算法训练的神经网络中存在的隐式正则化效应也可能导致得分平滑。

在现实世界中,像高分辨率图像这样的复杂数据存在于高维像素空间中,而非简单的一维世界。然而,该空间中的绝大部分都只是对人眼毫无意义的随机噪声。只有一小部分数据点对应可识别的图像,它们位于所谓的“数据流形”上(就像嵌入更大空间中的一张薄片)。模型事先并不知道数据流形的形状和位置。因此,图像生成可以被视为一项流形恢复任务,模型需要根据从流形中采样的有限训练数据,推断隐藏的数据流形是什么样子,然后在该流形上生成新的点,这些点将对应新颖且有意义的图像。事实证明,得分平滑对于扩散模型实现这一目标至关重要。

值得注意的是,在多维环境中,得分平滑的效果以方向相关的方式表现出来。沿着与隐藏数据流形平行(或“相切”)的方向,它会产生与一维场景类似的减速效果。然而,沿着指向流形的方向,“完美”的得分函数已经相对平滑(事实上,如果流形是平坦的,它只是一条直线),进一步平滑不会产生太大差异。

因此,得分平滑并非在所有方向上给粒子流“刹车”(那样会使粒子停滞在嘈杂的空旷空间中,导致最终图像模糊),而是既不减慢粒子向流形的移动,又只降低它们沿切线方向向训练数据收敛的趋势。通过这种方式,模型在质量和新颖性之间取得了平衡:生成的图像既逼真(因为它们成功到达了有意义的数据流形),又新颖(因为它们落在了原始训练数据点之间的空白区域)。

我们的研究结果表明,我们称之为扩散模型“创造力”的东西,实际上可能是一个可预测的数学结果。由于神经网络永远不会“完美”地陡峭,它们会在已知数据之间架起插值的桥梁。在图像生成或药物发现中,这可能意味着扩散模型不仅记住了它见过的两张不同的猫图像或药物分子,还会探索它们周围的空间,提出融合了两者特征的第三张全新的图像或分子构型。

我们的工作只是阐明这一机制的初步尝试,当数据分布或神经网络架构变得更加复杂时会发生什么,仍有待观察。尽管如此,通过证明这种行为根本源于神经网络的学习方式,我们可以开始有意地构建更好的“插值器”模型,以确保它们保持创造引擎的功能,同时避免盲目记忆的陷阱。我们还发布了论文中用于生成图表的数值实验代码。

我们感谢Sreenivas Gollapudi和Ravi Kumar对项目的支持,以及Mark Simborg和Kimberly Schwede帮助准备这篇博文。

英文来源:

July 15, 2026
Zhengdao Chen, Research Scientist, Google Research
We show that a diffusion model’s creativity (its ability to generate novel data, rather than just memorize its training set) is a mathematical consequence of neural networks learning a "smoothed" version of the score function, driving the model to interpolate between training data points along the hidden data manifold.
Diffusion models are currently one of the most powerful types of tools for generative tasks that require complex and local structures, such as image generation and molecular discovery. They’ve shown an exciting capability to generalize beyond their training data and, in this sense, exhibit “creativity”. For instance, after being trained with datasets of actual images, they can transform random noise samples into novel, high-quality images.
While this creative capability is impressive, it raises an intriguing question: where does it come from? Understanding the answer to this question is an important step towards demystifying the “black-box” nature of diffusion-based generative AI.
To that end, in "On the Interpolation Effect of Score Smoothing in Diffusion Models", presented at ICLR 2026, we dive into the mathematics of diffusion models to answer this question. We show that a model’s creativity isn’t a random fluke. Instead, it is a consequence of how neural network training naturally "smooths" the transformation from noise back to the data during the generation process.
Training a diffusion model begins with taking a set of real training data samples — like cat photos — and intentionally corrupting them with noise until they become completely unrecognizable. The model is then trained to reverse this corruption step-by-step so that it can reconstruct a realistic-looking image from pure noise, a process called denoising.
If the model learns to perform this denoising process perfectly based only on its training samples, it should produce carbon copies of them during deployment time as well (a behavior known as memorization). In this scenario, the model acts as a retrieval tool rather than as a creative engine capable of generating novel outputs.
In practice, however, diffusion models usually do more than just memorize; they generalize to generate new data samples.
To understand how diffusion models actually denoise data, imagine random noise as a cloud of gas particles scattered across a room, where a “force field” pulls each particle in a specific direction until they form a meaningful shape. In a diffusion model, the moving particles are individual data points undergoing denoising. The “force field” is the score function (SF), which is learned from the training data and dictates where the particles should flow at any given moment.
If the model relies on a score function learned perfectly from the training data, the force field will drive the particles into positions that exactly replicate the training data points (i.e., memorization).
We discovered that the creativity of diffusion models actually originates from the approximate nature of how neural networks typically learn: imperfect training due to regularization naturally leads to a slight blurring of the learned score function in a process called “score smoothing”. This, in turn, causes the denoising process to generate data that interpolates (in other words, fall in the space between) the training points, thus creating new and plausible data samples.
Imagine a one-dimensional world with only two training data points: +1 and -1. At late stages of the denoising process, the “perfect” score function looks like the curvy gray line in the figure below, which has a steep change of sign halfway between the two points, meaning a rapid switch in the direction of pull near 0. In other words, the whole space is divided almost sharply into two, with particles on the left pulled towards -1 and particles on the right pulled towards +1. In the end, every particle converges to one of the two training data points, and thus, memorization occurs.
In practice, however, diffusion models don’t have access to the “perfect” score function but use an approximate version learned by a neural network. Because of the regularization effect of weight decay during training, neural networks have a hard time learning functions with these sharp cliffs. Instead, they tend to learn smoother versions of the “perfect” score function, softening the steep drop into a gentler slope. To illustrate this, we set up an experiment to train two-layer ReLU neural networks to fit the score function in a 1-D example, with the neural networks’ parameters optimized by the popular AdamW algorithm under varying degrees of weight decay (WD).
The stronger the weight decay is, the smoother the learned score function is in the middle area, meaning that particles in that region flow slower than before and will eventually rest within the “interpolation zone” between the two training data points.
In the paper, we quantify this connection by combining the function-space theory of neural network regularization with the mathematics of denoising. Furthermore, our experiments also show that even without explicit regularization strategies such as weight decay, score smoothing can also result from the implicit regularization effect found in neural networks trained by gradient-based algorithms.
In the real world, complex data like high-resolution images live in high-dimensional pixel spaces rather than a simple 1-D world. The vast majority of that space, however, is just random noise that is meaningless to the human eye. Only a small fraction of the data points in that space correspond to recognizable images, and they live in what’s called the data manifold (like a sheet tucked inside a larger space). The shape and location of the data manifold are not known by the model in advance. Thus, image generation can be considered as a task of manifold recovery, where the model needs to infer what the hidden data manifold looks like based on the finite number of training data sampled from it, and then come up with new points on the manifold which will correspond to novel and meaningful images. It turns out that score smoothing is crucial for diffusion models to achieve this.
Remarkably, in multi-dimensional settings, the effect of score smoothing manifests in a direction-dependent manner. Along directions that are parallel (or “tangential”) to the hidden data manifold, it produces a similar slowing-down effect as in the 1-D scenario. However, along directions pointing towards the manifold, the "perfect" score function is already relatively smooth (in fact, just a straight line if the manifold is flat), and further smoothing does not make much difference.
Hence, instead of applying brakes to the particles' flow in every direction (which would stall them in the noisy empty space and result in the final images being blurry), score smoothing does not slow down their movement toward the manifold, but only reduces their tendency to collapse towards the training data along the tangential directions. In this way, the model achieves a balance between quality and novelty: the images are both realistic looking (because they successfully reached the meaningful data manifold) and new (because they settled into the blank spaces between the original training data points).
Our findings suggest that what we call the “creativity" of diffusion models might actually be a predictable mathematical result. Because neural networks are never "perfectly" sharp, they create bridges that interpolate between known data. In image generation or drug discovery, this could mean the diffusion model doesn't just remember two different cat images or drug molecules it was shown; it explores the space around them to suggest a third, brand-new image or molecular configuration that combines traces of both.
Our work only serves as an initial effort towards elucidating this mechanism, and it remains to be seen what happens when the data distribution or the neural network architectures grow more complex. Nonetheless, by showing that this behavior is fundamentally rooted in how neural networks learn, we can begin to intentionally build models that are better "interpolators" to ensure they remain creative engines while avoiding the pitfalls of blind memorization. We have also released the code for the numerical experiments used to generate the figures in our paper.
We thank Sreenivas Gollapudi and Ravi Kumar for supporting the project as well as Mark Simborg and Kimberly Schwede for helping to prepare this blogpost.

谷歌研究进展

文章目录


    扫描二维码,在手机上阅读