HyperAIHyperAI

Command Palette

Search for a command to run...

Best Paper AwardNeurIPS 2025

확산 모델이 기억하지 않는 이유: 학습에서의 암시적 동역학적 정규화의 역할

Tony Bonnaire Giulio Biroli Raphaël Urfin Marc Mézard

초록

확산 모델은 다양한 생성 작업에서 뛰어난 성과를 거두어 왔다. 중요한 과제 중 하나는 훈련 데이터에 대한 기억 현상을 방지하고 일반화를 가능하게 하는 메커니즘을 이해하는 것이다. 본 연구에서는 일반화에서 기억으로의 전환에 있어 학습 역학의 역할을 탐구한다. 광범위한 실험과 이론적 분석을 통해 두 가지distinct한 시간 규모를 식별한다: 모델이 고품질 샘플 생성을 시작하는 초기 시간 τgen\tau_{\mathrm{gen}}τgen​과, 그 이후 기억 현상이 나타나기 시작하는 후기 시간 τmem\tau_{\mathrm{mem}}τmem​이다. 특히, τmem\tau_{\mathrm{mem}}τmem​은 훈련 세트 크기 n에 대해 선형적으로 증가하는 반면, τgen\tau_{\mathrm{gen}}τgen​은 일정하게 유지됨을 발견하였다. 이는 n이 커짐에 따라 모델이 효과적으로 일반화하는 학습 시간의 창이 확장됨을 의미하며, 이 창을 넘어서는 훈련이 계속되면 강한 기억 현상을 보이게 된다. n이 모델에 의존하는 임계값보다 커질 때에만 무한 학습 시간에서 과적합이 사라진다. 이러한 발견은 학습 역학 내의 암시적 동역학적 정규화 형식을 드러내며, 이는 과매개변수화된 환경에서도 기억 현상을 회피할 수 있게 한다. 본 연구의 결과는 실제 및 합성 데이터셋에 대한 표준 U-Net 아키텍처를 수치 실험으로, 그리고 고차원 극한에서 연구된 처리 가능한 랜덤 피처 모델을 이용한 이론적 분석으로 뒷받침된다.

One-sentence Summary

Researchers at LPENS, Université PSL, and Bocconi University demonstrate that diffusion models exhibit implicit dynamical regularization through two distinct timescales: an early τgen\tau_{\mathrm{gen}}τgen​ at which high-quality samples emerge and a later τmem\tau_{\mathrm{mem}}τmem​ growing linearly with dataset size nnn beyond which memorization occurs, creating a widening generalization window that prevents overfitting even in highly overparameterized settings.

Key Contributions

  • The study identifies two training timescales in diffusion models: τ_gen, when high-quality generation first emerges, and τ_mem, when memorization of training data begins.
  • τ_mem grows linearly with training-set size n while τ_gen remains constant, creating a broader window for early stopping as n increases; memorization at long training times disappears only when n exceeds a model-dependent threshold.
  • Numerical experiments with standard U-Net architectures on realistic and synthetic datasets and a tractable random-features analysis in the high-dimensional limit support the presence of an implicit dynamical regularization that can prevent memorization in highly overparameterized diffusion models.

Introduction

Diffusion models and score-based generative methods are now central for generating images, audio, video, and scientific data. They learn a score function that guides sampling from noise, but models trained to zero loss can recover the empirical score and memorize training examples. Prior work identified memorization in large models and studied regularizers such as architecture, learning rate, and early stopping, yet it remained unclear why highly expressive models often generalize before later overfitting.

The authors show that the training dynamics of score learning create an implicit regularization toward smooth, generalizing solutions. They identify two training timescales: an early time when high-quality novel samples emerge, and a much later time when the model begins memorizing the dataset. This second timescale grows with training set size, creating a wide early-stopping window for reliable generation.

Method

The authors leverage a compact score-learning model to isolate the architecture and training dynamics behind generalization and memorization in diffusion models. The core object is a score network parameterized as a two-layer Random Features Neural Network, where the first layer is random and frozen while the output layer is learned. For data in Rd\mathbb{R}^dRd, the score estimate is

sA(x)=Ap σ ⁣(Wxd),\mathbf{s}_{\mathbf{A}}(\mathbf{x})=\frac{\mathbf{A}}{\sqrt{p}}\, \sigma\!\left(\frac{\mathbf{W}\mathbf{x}}{\sqrt{d}}\right),sA​(x)=p​A​σ(d​Wx​),

with W∈Rp×d\mathbf{W}\in\mathbb{R}^{p\times d}W∈Rp×d drawn from a Gaussian distribution and kept fixed, A∈Rd×p\mathbf{A}\in\mathbb{R}^{d\times p}A∈Rd×p updated during training, and σ\sigmaσ applied elementwise. The analysis is carried out in the high-dimensional regime d,p,n→∞d,p,n\to\inftyd,p,n→∞ while keeping

ψp=pd,ψn=nd\psi_p=\frac{p}{d},\qquad \psi_n=\frac{n}{d}ψp​=dp​,ψn​=dn​

fixed. This parametrization provides a tractable score module: the nonlinear random features σ(Wx/d)\sigma(\mathbf{W}\mathbf{x}/\sqrt{d})σ(Wx/d​) define a fixed nonlinear basis, and the learned matrix A\mathbf{A}A controls how those features are combined into a vector field over the data space.

The overall learning trajectory, in which a model can first reach a generalization phase and later drift toward memorization, is summarized qualitatively in the framework illustration below.

The phase picture emphasizes two control knobs, the number of training points nnn and the expressivity of the score model, often measured by the number of parameters ppp. When nnn is small, training can lead to memorization of the empirical score. As nnn grows beyond a model-dependent threshold, the architecture itself prevents exact memorization, yielding what can be understood as architectural regularization. In addition, stopping training in an intermediate time window yields dynamical regularization, where the learned score is expressive enough to generalize but has not yet adapted fully to individual training samples.

The training pipeline is built around score matching at a fixed diffusion time ttt. For a clean sample x\mathbf{x}x and noise ξ∼N(0,Id)\boldsymbol{\xi}\sim\mathcal{N}(0,\mathbf{I}_d)ξ∼N(0,Id​), the noisy state is of the form

xt(x,ξ)=e−tx+Δt ξ.\mathbf{x}_t(\mathbf{x},\boldsymbol{\xi}) = e^{-t}\mathbf{x}+\sqrt{\Delta_t}\,\boldsymbol{\xi}.xt​(x,ξ)=e−tx+Δt​​ξ.

The empirical training objective is the score matching loss, rescaled by 1/d1/d1/d so that it remains finite as ddd grows. Conceptually, the loss penalizes the score network when its output does not correctly undo the injected noise. The corresponding test loss and the distance to the population score are

Ltest=1dEx,ξ[∥Δt sA(xt(ξ))+ξ∥2],\mathcal{L}_{\mathrm{test}} = \frac{1}{d}\mathbb{E}_{\mathbf{x},\boldsymbol{\xi}} \left[ \left\| \sqrt{\Delta_t}\,\mathbf{s}_{\mathbf{A}} (\mathbf{x}_t(\boldsymbol{\xi})) + \boldsymbol{\xi} \right\|^2 \right],Ltest​=d1​Ex,ξ​[​Δt​​sA​(xt​(ξ))+ξ​2],

and

Escore=1dEx[∥sA(x)−∇log⁡Px∥2].\mathcal{E}_{\mathrm{score}} = \frac{1}{d} \mathbb{E}_{\mathbf{x}} \left[ \left\| \mathbf{s}_{\mathbf{A}}(\mathbf{x}) - \nabla \log P_{\mathbf{x}} \right\|^2 \right].Escore​=d1​Ex​[∥sA​(x)−∇logPx​∥2].

The first quantity measures in-sample and out-of-sample learning behavior, while the second measures how closely the learned field approaches the true population score. The gap

Lgen=Ltest−Ltrain\mathcal{L}_{\mathrm{gen}} = \mathcal{L}_{\mathrm{test}} - \mathcal{L}_{\mathrm{train}}Lgen​=Ltest​−Ltrain​

is used as an indicator of overfitting.

The trainable output layer A\mathbf{A}A is updated by gradient descent,

A(k+1)=A(k)−η ∇ALtrain(A(k)),\mathbf{A}^{(k+1)} = \mathbf{A}^{(k)} - \eta\,\nabla_{\mathbf{A}} \mathcal{L}_{\mathrm{train}} (\mathbf{A}^{(k)}),A(k+1)=A(k)−η∇A​Ltrain​(A(k)),

where η\etaη is the learning rate. In the small-learning-rate limit, and after rescaling discrete updates by

τ=kηd2,\tau=\frac{k\eta}{d^2},τ=d2kη​,

the discrete dynamics converges to a continuous gradient flow,

A˙(τ)=−2ΔtdpAU−2dΔtpVT.\dot{\mathbf{A}}(\tau) = - 2\Delta_t\frac{d}{p}\mathbf{A}\mathbf{U} - \frac{2d\sqrt{\Delta_t}}{\sqrt{p}}\mathbf{V}^T.A˙(τ)=−2Δt​pd​AU−p​2dΔt​​​VT.

The matrix U\mathbf{U}U is the central object controlling the speed of learning. It is an empirical second-moment matrix of the random features under the noisy input distribution,

U=1n∑ν=1nEξ[σ ⁣(Wxtν(ξ)d)σ ⁣(Wxtν(ξ)d)T],\mathbf{U} = \frac{1}{n} \sum_{\nu=1}^n \mathbb{E}_{\boldsymbol{\xi}} \left[ \sigma\!\left(\frac{\mathbf{W}\mathbf{x}_t^\nu(\boldsymbol{\xi})}{\sqrt{d}}\right) \sigma\!\left(\frac{\mathbf{W}\mathbf{x}_t^\nu(\boldsymbol{\xi})}{\sqrt{d}}\right)^T \right],U=n1​ν=1∑n​Eξ​[σ(d​Wxtν​(ξ)​)σ(d​Wxtν​(ξ)​)T],

and V\mathbf{V}V contains correlations between the random features and the injected noise,

V=1n∑ν=1nEξ[σ ⁣(Wxtν(ξ)d)ξT].\mathbf{V} = \frac{1}{n} \sum_{\nu=1}^n \mathbb{E}_{\boldsymbol{\xi}} \left[ \sigma\!\left(\frac{\mathbf{W}\mathbf{x}_t^\nu(\boldsymbol{\xi})}{\sqrt{d}}\right) \boldsymbol{\xi}^T \right].V=n1​ν=1∑n​Eξ​[σ(d​Wxtν​(ξ)​)ξT].

Because the flow is linear in A\mathbf{A}A, the dynamics can be solved exactly once the spectrum of U\mathbf{U}U is known. The principal timescales of training are determined by the inverse eigenvalues of ΔtU/ψp\Delta_t\mathbf{U}/\psi_pΔt​U/ψp​. Thus, the architecture design reduces the training-time behavior of score learning to a spectral analysis problem.

To analyze the spectrum, the method introduces diffusion-time dependent quantities ata_tat​, btb_tbt​, vt2v_t^2vt2​, and st2s_t^2st2​ built from Gaussian expectations of the activation σ\sigmaσ. These quantities capture how the nonlinearity mixes the data scale, the diffusion scale, and the frozen random projection. With these objects, the Stieltjes transform of the eigenvalue density of U\mathbf{U}U satisfies a coupled system of equations. Once this system is solved, the density is recovered from the imaginary part of the Stieltjes transform.

In the strongly overparameterized regime, the spectrum separates into distinct components. When ψp>ψn≫1\psi_p>\psi_n\gg1ψp​>ψn​≫1, the spectral density can be written informally as

ρ(λ)=(1−1+ψnψp)δ(λ−st2)+ψnψpρ1(λ)+1ψpρ2(λ).\rho(\lambda) = \left( 1-\frac{1+\psi_n}{\psi_p} \right) \delta(\lambda-s_t^2) + \frac{\psi_n}{\psi_p}\rho_1(\lambda) + \frac{1}{\psi_p}\rho_2(\lambda).ρ(λ)=(1−ψp​1+ψn​​)δ(λ−st2​)+ψp​ψn​​ρ1​(λ)+ψp​1​ρ2​(λ).

The atom proportional to δ(λ−st2)\delta(\lambda-s_t^2)δ(λ−st2​) does not affect the training or test losses and can be ignored for the dynamics. The two remaining parts, ρ2\rho_2ρ2​ and ρ1\rho_1ρ1​, generate different timescales. The bulk ρ2\rho_2ρ2​ lives on the scale ψp\psi_pψp​, while ρ1\rho_1ρ1​ lives on the scale ψp/ψn\psi_p/\psi_nψp​/ψn​ when the model is strongly overparameterized. In the underparameterized regime ψn>ψp≫1\psi_n>\psi_p\gg1ψn​>ψp​≫1, the spectrum takes the form

ρ(λ)=(1−1ψp)ρ1(λ)+1ψpρ2(λ),\rho(\lambda) = \left( 1-\frac{1}{\psi_p} \right) \rho_1(\lambda) + \frac{1}{\psi_p}\rho_2(\lambda),ρ(λ)=(1−ψp​1​)ρ1​(λ)+ψp​1​ρ2​(λ),

again with ρ1\rho_1ρ1​ and ρ2\rho_2ρ2​ corresponding to distinct learning directions.

The bulk ρ2\rho_2ρ2​ is associated with the early generalization stage. Its eigenvalues produce a timescale τgen\tau_{\mathrm{gen}}τgen​ of order 1/Δt1/\Delta_t1/Δt​. On this timescale, both training and test losses decrease, the generalization gap is effectively zero, and the model improves its approximation of the population score. The component ρ1\rho_1ρ1​ controls the later memorization stage. Its smaller eigenvalues produce a longer timescale,

τmem∼ψpΔtλmin⁡,\tau_{\mathrm{mem}} \sim \frac{\psi_p}{\Delta_t\lambda_{\min}},τmem​∼Δt​λmin​ψp​​,

where λmin⁡\lambda_{\min}λmin​ is the lower edge of the ρ1\rho_1ρ1​ bulk. In the overparameterized regime this becomes large and grows with the dataset size. On this longer timescale, the training loss continues to decrease, but the test loss begins to increase, reflecting overfitting to the finite sample score.

The dynamics predicted by this spectral analysis are visible directly in the Random Features training curves. Refer to the loss evolution figure below.

The trajectories show a fast decay of the distance to the true score followed by a later degradation. The test loss initially decreases along with the training loss, then increases after the memorization timescale is crossed. Rescaling time by τmem\tau_{\mathrm{mem}}τmem​ collapses curves with different dataset sizes, confirming the spectral prediction that the second timescale is governed by the smallest relevant eigenvalues of the feature covariance. Heatmaps over (ψn,ψp)(\psi_n,\psi_p)(ψn​,ψp​) further show how the generalization gap depends on the stopping time and on the parameter-to-data ratios.

For realistic diffusion models, the same training logic is studied with a conditional U-Net score architecture. The pipeline takes an image, applies the forward noise process, and feeds the noisy input together with a diffusion time embedding into the network. The score network uses three resolution levels with a base channel width WWW and multipliers 111, 222, and 333, and a sinusoidal time embedding is added to the features at each resolution. Training proceeds with stochastic gradient descent using momentum, and the learned score is evaluated by generating samples and measuring both sample quality and memorization through nearest-neighbor comparisons.

The architecture-level behavior is shown below.

The curves illustrate how changing the number of parameters and the dataset size shifts the transition between generalization and memorization. When time is rescaled by the appropriate training-timescale factor, curves with different widths or dataset sizes align, indicating that the U-Net dynamics follows the same broad generalization-to-memorization structure identified in the Random Features analysis. The phase diagram also shows how the boundary between generalization and memorization moves with training time, reinforcing the dynamical regularization mechanism.

Experiment

Experiments trained diffusion models on grayscale CelebA images while varying dataset size and network capacity, tracking train and test losses, sample quality, and closeness to training examples to identify the shift from generalization to memorization. The results reveal a consistent two-phase training process: models first learn a reusable generative distribution, then later memorize the training set after a delayed overfitting stage, with larger datasets widening the useful early-training window and larger models compressing it. The study also shows that this behavior is not caused simply by repeated samples, but by the interaction of model expressivity, optimization time, and available data.


AI로 AI 구축

아이디어에서 출시까지 — 무료 AI 코코딩, 즉시 사용 가능한 환경, 최적의 GPU 가격으로 AI 개발을 가속화하세요.

AI 협업 코딩
바로 사용 가능한 GPU
최적의 가격

HyperAI Newsletters

최신 정보 구독하기
한국 시간 매주 월요일 오전 9시 에 이번 주의 최신 업데이트를 메일로 발송합니다
이메일 서비스 제공: MailChimp