Context. A diffusion model is a denoiser trained by least squares at every noise level. Over all functions, the objective has a useless exact minimizer: for training images at noise level , the best function is the posterior mean under the empirical measure, with , whose score is that of the Gaussian-blurred training set and whose reverse diffusion returns training images (a standard computation, not made in the paper). Models trained on large sets visibly do not do this, so their novelty comes from the network's inductive bias. This paper measures when that happens and what the bias is. A trained denoiser acts at each noisy image as shrinkage in an orthonormal basis adapted to that image, keeping coefficients above the noise and suppressing the rest, and trained networks tend toward bases of oscillations along contours and inside smooth regions (geometry-adaptive harmonic bases, GAHBs). Photographs are sparse in such bases, so a modest number of images determines essentially the same denoiser.
Setting. Observations , , with . Miyasawa's identity (Tweedie's formula) and its second-order version give Networks minimize over (pixel range ). They are blind (no input) and bias-free (no additive constants anywhere): a UNet and a smaller BF-CNN, sampled by a reverse diffusion driven by the residual . The data are CelebA faces and LSUN bedrooms at , and synthetic classes whose optimal denoiser is known asymptotically. Generalization means vanishing model variance (two networks trained on disjoint sets compute the same function), which can be measured without knowing ; model bias is assessed separately on the synthetic classes.
Main findings. All results are empirical, and GAHBs are described by pictures and never defined. As the training set grows from 1 to faces, denoisers move from memorization to generalization (Step 2). The generalizing denoiser is shrinkage in the eigenbasis of its Jacobian, and that basis is a GAHB. Where a GAHB is optimal, on geometric images (-smooth regions separated by -smooth contours) for which bandlets are near optimal, the networks nearly reach the optimal asymptotic PSNR slope (the slope of output PSNR against input PSNR at small noise) (measured 0.46, 0.61, 0.75, 0.83 against 0.50, 0.67, 0.75, 0.83 for ). Where it is not, on classes supported on low-dimensional manifolds, the networks still keep GAHB components and fall short of the optimal slope, and on faces scrambled by a fixed pixel permutation they do much worse than on the same faces unscrambled.
The density model is as good as the denoiser, so studying the density means studying the denoiser. Substitute into Miyasawa's identity. By the Pythagorean decomposition around , the score error becomes a denoising gap, , and the likelihood bound for score-based models, for the variance-exploding SDE, gives So learning the density is optimal denoising at every noise level, with small noise weighted heavily. The second-order identity says what optimal denoising looks like: , so a small error means a Jacobian with few non-negligible eigenvalues. SURE states the same trade-off for any denoiser: fit the noisy image while keeping the Jacobian's trace, an effective rank, small. The bound is never evaluated for real images, where is unknown.
Denoisers trained on more images fit their training set worse and agree with each other more. UNets are trained on CelebA faces. At and 10 training PSNR rises with unit slope while test PSNR is low and flat, which is what a denoiser that returns stored images produces; at the curves coincide, training PSNR having fallen as test PSNR rose. Two networks trained on disjoint sets and sampled from the same noise agree with this: for each returns an image from its own training set, and at nearly the same image as the other network, unlike the nearest training images. Two things follow. The networks are far from the exact empirical minimizer, whose training error vanishes at small noise, so architecture and optimization set their behavior; the objective alone would memorize. And agreement across disjoint data shows vanishing model variance directly, which train-test parity alone does not.
A bias-free network is exactly adaptive shrinkage, and its basis can be read off. With ReLUs and no additive constants the map is positively homogeneous and piecewise linear, so . Diagonalizing the Jacobian, a shrinkage whose factors and basis both depend on the noisy image. For a UNet trained on faces, the clean image's coefficients decay quickly, so the image lies mostly in the span of the directions the denoiser keeps, and the factors fall with from slightly above 1 toward 0. The eigenvectors are oscillations that follow the contours of the face and fill its smooth regions, with frequency rising as falls.
Approximation theory rates a basis by the decay of the image's coefficients in it. Fix an orthonormal basis and let an oracle choose from the clean image. Its risk , with , is minimized at , the Bayes linear factor for a coefficient of prior variance , and the minimal risk is within a factor 2 of an -term approximation error, where counts coefficients above the noise. If the sorted coefficients obey , then , both terms are of order , and the PSNR curve has asymptotic slope ; soft thresholding of the noisy coefficients reaches this rate up to a log factor (Donoho and Johnstone). Adapting the basis to the image can only steepen the slope, but the basis must be chosen from . Choosing the best basis for from a dictionary of polynomially many vectors and thresholding attains the oracle rate, while unlimited adaptivity such as has too much variance. The question for networks is which dictionary their bias implements.
Where a GAHB is optimal, the networks nearly reach the optimal rate. Geometric images are -regular on regions separated by -regular contours. Their optimal sparse representation is a bandlet basis, harmonics in the smooth regions and along the contours, whose sorted coefficients decay as , so by Step 4 the optimal PSNR slope is . UNets trained on such images come close to it (the slopes in Main findings), and their top eigenvectors are harmonics on the two regions and along the boundary, a bandlet-like basis with more flexible geometry. Model bias is therefore small on this class in the sense of the rate, though the slope fixes only the exponent and says nothing about the constant.
Where a GAHB is not optimal, the networks still use one, which identifies the bias. Disks with random center, radius and foreground and background intensities form a five-dimensional curved manifold. For noise small against the curvature the optimal denoiser projects onto the five-dimensional tangent space, with error about and PSNR slope 1. A UNet trained on disks gets the first five eigenvectors right (they match the tangent basis) but keeps further GAHB eigenvectors with non-negligible , oscillating along the rim and across the background, whose number grows as decreases, so the slope stays below 1. Faces scrambled by one fixed pixel permutation have exactly the optimal error of ordinary faces (unscramble, denoise, rescramble), yet the network trained on them has a much lower PSNR slope and noisier bases. So the preference is specifically for geometry and locality in pixel space; low-dimensional structure in the data is not enough.
Consequences and limits. Memorization and generalization are two regimes of one model. Small sets are fitted closely and sampling returns training images; on large sets the denoiser settles on a function that does not depend on which images were used. That function is adaptive harmonic shrinkage, which explains both the high sample quality on photographs and images and the measurable suboptimality on manifolds and scrambled images. Here diffusion models avoid the curse of dimensionality because the network's approximation class suits images, and nothing in the objective supplies that. The limits are that the evidence is empirical, on small images and on blind, bias-free networks with one sampler; that vanishing model variance does not show that the shared model is the true density; that the KL bound of Step 1 is never evaluated on real data; and that GAHBs have no formal definition, with why convolutions and ReLUs produce them left open.
Terms
- Miyasawa (Tweedie): the optimal denoiser gives the score
- optimal Jacobian is the posterior covariance;
- KL bound
- SURE
- : fit versus effective rank
- Empirical minimizer
- , softmax weights; reproduces the training set (not computed in the paper)
- Model variance
- disagreement of networks trained on disjoint sets; its vanishing is the paper's generalization
- Bias-free denoiser
- no additive constants, so and the Jacobian describes the map
- Adaptive shrinkage
- Oracle factor
- ; risk
- PSNR slope
- rate for sorted coefficients ; optimal for images
- GAHB
- geometry-adaptive harmonic basis: oscillations along contours and in smooth regions
Quiz
- Why does the paper treat generalization of a diffusion model as a question about the network's inductive bias?Least squares over all functions is solved by , the posterior mean for the empirical measure, and the reverse diffusion driven by its score ends at training points. Novel samples therefore require the network not to reach this minimizer.
- What does say about good denoisers?Since , the trace is the total posterior variance in units of , so low error means the posterior spreads over few directions and the denoiser keeps only those.
- Faces scrambled by one fixed pixel permutation have the same optimal denoising error as ordinary faces. What does the network's much worse performance on them show?Unscrambling is a fixed orthogonal map, so the scrambled class is equally learnable in principle and has the same optimal error. The network does worse because the useful harmonics are no longer local in pixel coordinates.
- On geometric images, UNets trained on examples reach PSNR slopes close to the optimal . What does this establish?Bandlets are near optimal for images, and the networks' top eigenvectors are bandlet-like harmonics with more flexible geometry, so they nearly reach the optimal rate. A matching slope says nothing about the constant, and the disk images show the same bias falling short where harmonics are not optimal.
Sources
- Zahra Kadkhodaie, Florentin Guth, Eero P. Simoncelli, and Stéphane Mallat. Generalization in diffusion models arises from geometry-adaptive harmonic representations. ICLR, 2024.