Abstract: Score-based generative models (SGMs) sample from a target distribution by iteratively transforming noise using the score function of the perturbed target. For any finite training set, this score function can be evaluated in closed form, but the resulting SGM memorizes its training data and does not generate novel samples. In practice, one approximates the score by training a neural network via score-matching. The error in this approximation promotes generalization, but neural SGMs are costly to train and sample, and the effective regularization this error provides is not well-understood theoretically. In this work, we instead explicitly smooth the closed-form score to obtain an SGM that generates novel samples without training. We analyze our model and propose an efficient nearest-neighbor-based estimator of its score function. Using this estimator, our method achieves competitive sampling times while running on consumer-grade CPUs.
Introduction
Score-based Generative Models (SGMs), such as Stable Diffusion, have revolutionized generative AI by learning a "score function"—a vector field pointing toward high-density regions of data. Traditionally, these models rely on deep neural networks to approximate this function. However, this reliance introduces significant computational overhead in both training and sampling. Furthermore, the mechanism by which these networks generalize rather than memorize remains a theoretical "black box," often attributed to implicit biases like spectral bias or approximation errors.
While an exact, closed-form mathematical solution for the score function of any finite training set exists, its direct application is problematic. It is computationally expensive ($O(N)$ per step) and leads to perfect memorization, where the model merely reproduces training samples. This research introduces Smoothed Closed-Form Diffusion Models (smoothed CFDMs), a training-free approach that explicitly addresses these limitations to enable efficient, generalizing generative modeling.
Methodology: Explicit Smoothing and Efficiency
The proposed smoothed CFDM framework rests on three technical pillars designed to transform the closed-form score into a practical generative tool.
1. Explicit Smoothing for Generalization
Instead of relying on the accidental biases of a neural network, the authors explicitly convolve the closed-form score function with a noise distribution. This mathematical operation forces the score function to point toward barycenters (weighted averages) of training points rather than the points themselves. This shift from point-wise attraction to geometric averaging is what allows the model to generate novel data points within the convex hull of the training set.
2. Nearest-Neighbor Estimation
To overcome the $O(N)$ scaling bottleneck of the exact score, the authors observe that at low noise levels, the score is dominated by only a few nearby training points. By employing an efficient nearest-neighbor estimator (using the Faiss library), the model approximates the score using only the $K$ closest points. This optimization makes the model scalable to large datasets and allows it to run efficiently on standard CPUs.
3. Latent Space Sampling
In high-dimensional pixel space, barycenters can appear as blurry overlays. To maintain visual fidelity, the diffusion process is conducted in the latent space of a pre-trained, regularized autoencoder. This ensures that the "averaging" happens in a manifold where the data structure is more linear and amenable to geometric interpolation.
Key Insights: The Geometry of Generalization
A central finding of this work is that generalization in diffusion models can be viewed as a controlled geometric process. By adjusting the smoothing parameter ($\sigma$), users can directly control the trade-off between memorization and over-smoothing.
As illustrated in Figure 4, there is a clear "U-shaped" relationship between the smoothing intensity and the proximity to the true data distribution. This supports the hypothesis that neural SGMs generalize precisely because they are "imperfect" fitters; smoothed CFDMs simply make this implicit smoothing mechanism explicit and controllable.
Results and Performance
The model was evaluated across 2D toy datasets, 3D manifolds, and high-dimensional image sets like CelebA. Key results include:
- Efficiency: On a standard Macbook M1 Pro, the model generated CelebA samples in latent space in just 44ms per sample.
- Quality: In latent space benchmarks, the smoothed CFDM outperformed standard Variational Autoencoders (VAEs), achieving a 15% improvement in Kernel Inception Distance (KID) and a 32.4% improvement in Inception Score.
- Training-Free: The model requires zero training iterations for the generative task, provided a pre-trained latent space is available.
Limitations and Future Work
While smoothed CFDMs offer a high-speed, interpretable alternative to neural models, they are not without limitations. The "barycenter bias" can lead to blurry results on highly curved or sparse manifolds if the latent space is not sufficiently regularized. Additionally, while competitive with VAEs, there remains a quality gap compared to state-of-the-art massive neural models like Stable Diffusion 3. Future research may explore "classifier guidance" to introduce conditional generation (e.g., text-to-image) without sacrificing the training-free nature of the core model.
Summary updated