Manuscript Offprint
arXiv:2610.27754Detection of Memorization in Diffusion Models Through Thermodynamic Singularity
Abstract
In diffusion models, proper distributional learning entails reversing a diffusion process over underlying density functions, whereas a key failure is memorization, in which the reverse process instead learns diffusion from individual training samples. We provide an analytical characterization of such memorized reverse processes, along with a criterion that detects the associated thermodynamic singularity. The proposed criterion reliably distinguishes between properly learned and memorizing networks across a range of neural network models designed to promote or mitigate memorization.
1 Introduction
High-fidelity generation with diffusion models has led to their widespread use, while also raising concerns about memorization. Memorization can be understood as overfitting to the forward diffusion dynamics, where the learned reverse process becomes tied to sample-specific trajectories originating from individual training samples. In the extreme, exact time-reversal of forward diffusion trajectories can reproduce training samples, resulting in limited diversity and generalization and introducing privacy risks [3, 15].
Detecting such behavior is not straightforward. Direct comparison between generated samples and training data has been widely used to assess memorization [16], but it requires access to the full training dataset and a suitable similarity metric. Several proxy measures of these overfitting have also been proposed, including those based on the training loss, the Hessian spectrum of the log density [7], and the difference between conditional and unconditional scores [19]. However, the measures based on these proxies are largely empirically motivated and rely on high-dimensional estimation, making them difficult to interpret in a principled manner and sensitive to noise.
In principle, these trajectories should reveal clear and observable differences between overfitted and properly learned networks. However, such differences diminish as the number of training samples grows, since the trajectory structure induced by individual samples becomes progressively smeared. Nonetheless, retrieval of training samples and the generation of new samples remain fundamentally different, and detecting the difference is important even in large datasets, as the possibility of reproducing training samples—even if small—can severely limit the applicability of the model.
In this paper, we provide a simple derivation using the equation of continuity, showing that the velocity field diverges in the diffusion of Dirac delta functions. This singularity, which can serve as a necessary condition for memorization, arises in all forward processes constructed from finite samples, regardless of sample size. Memorization in the reverse process cannot occur without learning this singularity, and this singularity provides a direct analytical characterization of the presence of memorization.
Corresponding authors
Preprint.
The mathematical analogy of the velocity field and its corresponding flux naturally leads to a thermodynamic quantity—the Helmholtz free energy of the diffusive process. The memorization characteristic can be interpreted using the instantaneous rate of change of the Helmholtz free energy over time, providing a principled and interpretable scalar measure that does not require access to training data. Using this rate of change as a criterion, the detection of memorization was effective across both overfitting and non-overfitting neural networks, outperforming conventional methods on synthetic and real-world datasets. In addition, we further propose a simple modification of the training loss function that suppresses excessive growth of the diffusive velocity above a predefined threshold based on the free energy rate, significantly reducing memorization without degrading the fidelity of generated samples.
The remainder of the paper is organized as follows. Section 2 derives the low-noise behavior of velocity fields associated with diffused delta functions. Section 3 introduces the thermodynamic criterion and its interpretation. Section 4 presents experiments on synthetic and real-world datasets, including memorization mitigation. Section 5 concludes.
Forward process:
for . The reverse process is augmented by an additional term for control:
Reverse process:
The control term incorporates neural networks in various forms, which are designed to reverse the diffusive flow of the forward process using the information learned during that process.
Score field: The diffusive flow induced by the diffusion of a density can be explained using the convolution with a small Gaussian kernel, . The density after a small diffusion step can be written as , yielding
Fick's law, , describes the diffusive flux driven by the density gradient, with a constant coefficient . Along with the equation of continuity , we can produce the equation which corresponds to Eq. (3). The correspondence yields the constant . Then, from the definition of flux, , we can obtain the diffusive velocity field:
where is the score vector of a density . The score field in a pure diffusion system is proportional to the velocity field induced by diffusion.
For the forward process, along with that , it induces a velocity field in the infinitesimal limit :
where the two terms arise from the corresponding components in the update rule in Eq. (1). In general, neural networks are designed to directly predict a score or the expected total accumulated noise , which corresponds to , with or depending on continuous- or discrete-time formulation.
When the neural network overfits to approximate the exact reverse process, it learns the control field which induces the reverse-process velocity field: . If the reverse process is performed without noise, i.e., without noise addition, the control field is simply .
2.1 Diffusion of -Functions
A surprising yet general property of the forward process emerges from deriving the induced velocity field associated with the diffusion of a Dirac -function. Consider a Gaussian kernel which satisfies the convolution property: .
The density recovers the Dirac -function in the limit . The induced velocity field associated with the diffusion satisfies the continuity equation:
with the flux . Expanding both sides yields
The plug in of an equation of the form for some scalar function , we obtain , which yields the velocity field associated with this vanilla diffusion:
Note that the velocity field "diverges" as everywhere, indicating that the diffusion of a Dirac -function induces an infinite initial velocity, which subsequently decays proportionally to . Note that this pure diffusive property of the velocity does not depend even on the noise magnitude .
Extensions of this single -function derivation to mixtures of -functions are straightforward. In this view, training samples can be interpreted as a mixture of Dirac delta functions. Since the velocity grows linearly with distance from each center, while Gaussian densities decay exponentially, the resulting flux is dominated by the Gaussian mixture structure. Consequently, the velocity field at any point is largely determined by the nearest center. As long as the diffused Gaussians are not sufficiently smeared, the singular behavior of the initial velocity field persists throughout the space. In diffusion models, when centers correspond to training samples, the velocity field diverges in the early stage of the forward process; moreover, due to , this divergence is more pronounced farther from the centers than nearby, which may appear counterintuitive.
Our key inference for detecting memorization is as follows. Networks trained on finite samples in the forward process induce singularities in the early stage. The absence of such singularities in the final stage of the reverse process indicates that the network has not memorized.
3 Criterion for Detecting Memorization
Memorization has been identified by examining nearest neighbors of generated samples within the training dataset. Detecting duplication of training data via nearest-neighbor comparisons is considered a gold-standard indicator of memorization [3, 15, 16]. However, this approach requires access to the full training dataset, which limits its practical applicability.
Instead, memorization can be investigated through intrinsic properties of the learned neural networks. Because gold-standard indicators can, even in large datasets, unambiguously distinguish memorizing networks from non-memorizing ones, it is natural to seek corresponding signatures within trained networks. Existing approaches pursue this direction by introducing empirical proxies for memorization.
These approaches include guidance-based methods that identify the explosion of guidance (showing large magnitude in the difference between conditional and non-conditional scores) under the premise that such behavior sharpens the conditioned probability landscape [19], attention-based methods that identify anomalous late-stage attention behavior [4], and geometrical approaches that detect sharp and highly localized regions encoded in the Hessian of the log density [7]. Notably, these methods, to varying degrees, attempt to analytically relate their criteria to the norm of the score function, motivated by empirical observations of irregular score behavior in memorizing networks, which remain only partially understood. These works interpret the empirical growth of score magnitudes as a consequence of the criteria they propose as principled.

Figure 1: 2D Gaussian generation. (A) The rate of Helmholtz free energy dissipation for an affine network, a small MLP, and a large MLP, plotted on a logarithmic scale over time steps. (B) K-L divergence between the generated samples and the true density as a function of training sample size. (C–E) Generated samples from the affine network, small MLP, and large MLP models, respectively. After sufficient training, the failure of the low-capacity model to capture free energy dissipation until a certain time leads to the successful reproduction of the underlying Gaussian structure.
On the contrary, we argue that the explosion of the score itself constitutes a central identifier of memorization. Specifically, within the diffusion model pipeline, memorization consistently occurs in conjunction with the explosion of the velocity over the entire space. Consequently, in the absence of large velocity values, memorization cannot occur. Therefore, the absence of large velocity values intuitively indicates non-memorization, while the converse does not necessarily hold. Furthermore, suppressing large velocity magnitudes—either explicitly or implicitly, e.g., via architectural constraints of neural networks or early stopping—will lead to the inhibition of memorization.
3.1 Helmholtz Free Energy Rate Criterion
We propose a criterion for assessing the non-memorization behavior of neural networks in diffusion models:
The samples are the -th sample at time obtained during the reverse process, and the vector is defined based on the output of the learned neural network. Specifically, we use its form when the network learns accumulated noise, and when learns the score. is the Helmholtz free energy which will be introduced later.
3.2 Behavior of the Criterion for Two-Dimensional Gaussian Generation
Previously, various explanations have been proposed for why diffusion models tend to generalize, including early stopping [2, 11], network architecture [8], and optimization methods such as stochastic gradient descent and learning rate [20]. We consider an affine neural network. In our example, the network takes the form
(10) where is a symmetric matrix and is a vector. The independent entries of and the entries of are parameterized as outputs of neural networks. A simple derivation shows that this network recovers the score corresponding to a Gaussian with maximum-likelihood estimates of the mean and covariance. The full derivation is provided in Appendix A.1.
We hypothesize that the large multilayer perceptron (MLP) overfits and reproduces the training samples, the small MLP generates samples near the training data, and the aforementioned affine network produces Gaussian samples with the empirical mean and covariance. Using the forward and reverse processes, we analyze movement of criterion, or the dissipation rate of the Helmholtz free energy, induced by each model. For our synthetic experiment, we generated a small dataset (N = 10) from a Gaussian and trained diffusion models using an MLP with both large and small capacities, as well as an affine model.
We could expect that the forward diffusive field initialized from the 10 samples exhibits singular behavior in the initial velocities. As shown in Figure 1(A), the large MLP appears to have learned detailed trajectories, moving from to during the reverse process, including the singular behavior ( ) of the initial diffusion around .
In contrast, the small MLP and the affine model do not follow this dissipation behavior; their dissipation rates stop decreasing around . The affine model, being well-aligned with the true underlying density, produces samples that closely match the true density, as shown in the K-L divergence estimation in Figure 1(B). The generated samples in Figure 1(C–E) illustrate that the affine model produces Gaussian samples with the empirical mean and covariance of the 10 training points. The small MLP exhibits partial generalization beyond the training data, whereas the large MLP memorizes the training set, accompanied by a pronounced decay in the Helmholtz free energy dissipation rate.
In Figure 1(A), we also observe that Helmholtz free energy dissipation rate is negative and monotonically decreases throughout the reverse process. Including these properties, we next elucidate how the norm of the score is intimately connected to a thermodynamic quantity, shedding light on the mechanism that links large score magnitudes to a principled theoretical criterion.
3.3 Helmholtz Free Energy in Diffusion Models
The forward and reverse processes in diffusion can be interpreted within a thermodynamic framework, where their states are represented by the following thermodynamic functional:
Here, denotes the probability density that changes over time, represents the energy function, and denotes the fixed temperature in the system. The quantity denotes the expectation of with respect to , and is the Helmholtz free energy with the Boltzmann constant is set to unity.
Given , the thermodynamic law decreases over time by updating according to the equation of continuity. The rate of change of the Helmholtz free energy is represented using the change with respect to by the chain rule:
where denotes the functional inner product of two functions and , and both and are pointwise functions of . Applying the equation of continuity and integration by parts, we obtain
(15) where denotes the expectation of under . Given a fixed kinetic energy , the velocity field that maximizes the reduction of Helmholtz free energy is , and the magnitude of the dissipation rate becomes proportional to the kinetic energy. The theoretical significance of the free energy lies in the fact that its maximal rate explains the thermodynamic motion observed in nature, analogous to the principle of least action.
Because at each x, the velocity and the flux of the system are
For the correspondence to the velocity field of diffusion models in Eq. (5), we use the temperature , and the energy for control is from .
The forward process behaves under a fixed control potential . At equilibrium, the probability flux vanishes, i.e., . We can write the equation , which yields the equilibrium density after sufficient forward updates:
The forward process therefore simply corresponds to the evolution of from a mixture of Dirac -functions to an isotropic single Gaussian with unit variance. The trajectories and velocities jointly maximize a single quantity, the rate of decrease of the Helmholtz free energy under the equation of continuity. The following summarizes the behavior of Helmholtz free energy rate during the forward and reverse processes.
Helmholtz free energy does not increase: With the velocity field , the Helmholtz free energy is non-increasing in time, since from Eq. (15). When reaches the equilibrium density, the flux vanishes, and the free energy no longer decreases. Throughout the forward process, the free energy continuously decreases under a fixed potential . During the reverse process, the potential becomes time-dependent to induce the control . Nevertheless, the rate of free energy dissipation remains unchanged for a fixed at time , since the velocity field is identical up to a sign reversal.
The rate of change decreases over time during the forward process: The second derivative is positive, as implied by results on the dissipation of Fisher information in [18, 1] provided that the potential is convex. Under the convex potential , the initially large rate of change does not persist over time during the forward process. The large rate of change occurs only when is small.
From these two theoretical properties, the proposed criterion is always negative, and its magnitude does not increase during the forward process. The absence of these properties in the criterion during the reverse process indicates that the network has not overfit the forward diffusive flow and can be used as a criterion for ensuring non-memorization.
In the experiments, we evaluate the effectiveness of the proposed criterion in detecting memorization in neural networks, as well as memorization at the level of individual samples. We also incorporate the criterion into the objective function to encourage the model to generate outputs without memorization.
4 Experiments
In this section, we evaluate the criterion proposed in Eq. (9) across various benchmark datasets and discuss the results. While the criterion is computed at every step of the reverse data-generating process using trained neural networks, in practical applications it can be evaluated at a single time step—specifically at the final stage of generation. We use pretrained networks for CIFAR-10 and CelebA-HQ, and then induce catastrophic corruption by fine-tuning them on a small number of samples. We also evaluate the individual score to assess the degree of memorization of each generated sample. Finally, we incorporate the proposed criterion into the training loss and examine whether it mitigates memorization while preserving the quality of generated samples. Details of the experiment are explained in Appendix A.

Figure 2: CIFAR-10 pixel-space fine-tuning. (A) Catastrophic corruption. Pretrained networks are fine-tuned using a fixed subset of size . (B) Non-catastrophic corruption. Pretrained networks are fine-tuned using a fixed subset of size , with occasional training on additional samples from the full dataset.

Figure 3: CelebA-HQ latent-space fine-tuning. (A) Catastrophic corruption. (B) Non-catastrophic corruption with occasional training on additional samples from the full dataset.
4.1 Catastrophic and Non-Catastrophic Corruptions
Pretrained networks for real-image generation were used: a CIFAR-10 pixel-space diffusion model [10] and a CelebA-HQ latent diffusion model [12, 9, 14]. These models were fine-tuned using subsets of the training data. For the catastrophic corruption experiment, we selected subsets of varying sizes and performed 50,000 fine-tuning epochs using only those subsets. For the non-catastrophic corruption setting, we fixed the subset of sample size . After steps of training on this subset, we randomly sampled 5,000 additional data from the full dataset and performed one epoch of fine-tuning using these samples. We evaluated the criterion throughout the reverse process in Figure 2 and 3, where darker curves correspond to more memorizable setting. The CIFAR-10 model operates in pixel space, whereas the CelebA-HQ model operates in latent space. Note that the time scale in all graphs is logarithmic.
In these experiments, nearest neighbor LPIPS scores for the generated samples are reported in Table 1. Entries indicate the percentage of 1,024 generated samples whose nearest training image falls below a specified LPIPS threshold. CIFAR-10 uses LPIPS ≤ 0.03 to avoid false positives due to low resolution, while CelebA-HQ uses LPIPS ≤ 0.1. Smaller and larger lead to increased memorization during fine-tuning. Representative generated examples and their nearest neighbors are shown in Figure 4. In the catastrophic corruption setting, all generated samples are memorized when , whereas no samples exhibit memorization when . In non-catastrophic setting, both memorized and non-memorized samples appear; however, the parameter explains the proportion of memorization. These observations are consistent with the criterion at across all cases in Figure 2 and 3. These observations regarding the extent of memorization are consistent with the behavior of the criterion near in these figures.
4.2 Sample-Level Memorization
We evaluated the score norm obtained as a byproduct of sample generation. The criterion was calculated using the conditional and unconditional velocities, and , respectively, at the end of the reverse-process trajectory. This sample-level metric quantifies the magni-
Table 1: Memorization with fine tuning. Percentage of memorized samples during fine-tuning whose nearest neighbor in the training set falls below the LPIPS threshold. denotes the subset size used in catastrophic corruption, and denotes the number of consecutive epochs for which the subset is used during fine-tuning.
| Catastrophic Corruption | Non-Catastrophic Corruption | ||||
|---|---|---|---|---|---|
| CIFAR-10 | CelebA-HQ | τ | CIFAR-10 | CelebA-HQ | |
| 100 | 99.80% | 57.71% | 0 | 0.00% | 0.00% |
| 200 | 94.53% | 8.01% | 10 | 0.78% | 0.00% |
| 1,000 | 3.71% | 0.00% | 20 | 5.08% | 0.00% |
| 2,000 | 0.78% | 0.00% | 50 | 18.95% | 6.35% |
| 10,000 | 0.49% | 0.00% | 100 | 32.52% | 25.88% |
| 20,000 | 0.39% | 0.00% | - | - | - |

Figure 4: Generated samples from fine-tuned networks and their nearest neighbors. The first two rows show CIFAR-10 generated samples and their nearest neighbors in the training data, while the next two rows show CelebA-HQ generated samples and their nearest neighbors. We present samples obtained after catastrophic corruption with and , as well as after non-catastrophic corruption with subset training for and consecutive epochs. Ordered from least to most memorization, the settings are , , , and .
tude of the prompt-conditioned score via where , and is classifier-free guidance scale. Given a score , .
We compare the sample-level detection performance of this criterion with the score-difference norm [19] and Hessian-sharpness baseline [7]. Memorized samples are defined as samples generated by controlled prompts for the purpose of memorization. The results in Table 2 show that the norm of the individual score serves as a reliable indicator for identifying safe generation without memorization. The experiments were conducted using Stable Diffusion v1.4 [14].
4.3 Loss Function Modification
We examined the incorporation of the criterion into the loss function to assess its ability to improve fidelity without inducing memorization. With a threshold , we penalize the norm along the trajectory for points whose values exceed , where is a control parameter. This discourages the neural network from learning excessively large scores. Here, denotes the dimensionality, and is the accumulated variance defined as , where denotes the noise schedule at each time step .
In the CelebA-HQ non-catastrophic corruption setting described in Section 4.1, the latent diffusion model is fine-tuned for 50,000 steps starting from a pretrained model with a subset-to-full update ratio of . For samples whose score norm exceeds , the algorithm suppresses the norm, while fidelity improvements are driven only by samples with small score norms. Let denote the subset of training data satisfying . With corresponding small , the standard diffusion loss , the training objective at time step is modified as
Table 2: Sample-level detection on SD v1.4. The generated samples from memorizing prompts and non-memorizing prompts are discriminated by various memorization criteria. All measurements are performed on DDPM 1,000-step trajectories. Bold entries are statistically indistinguishable from the best value in each column under an approximate two-sided test. Time step 1,000 corresponds to the beginning of diffusion, and time step 1 to its end.
| Method | Time step | AUC | TPR@1% FPR |
|---|---|---|---|
| 1,000 | |||
| [19] | 1 | ||
| [7] | 1,000 | ||
| 1 | |||
| (Ours) | 1 |
Table 3: CelebA-HQ fine-tuning with velocity norm suppression. Norm-suppressing penalty replaced the fine-tuning objective once the norm exceeds a threshold. Suppression is applied to and to the score alone.
| Condition | LPIPS | LPIPS | FID | |||
|---|---|---|---|---|---|---|
| Pretrained model | 0.00% | 0.08% | 14.93 | |||
| No reference scale | 28.53% | 33.11% | 24.33 | |||
| Condition | Full velocity | Score-only | ||||
| LPIPS | LPIPS | FID | LPIPS | LPIPS | FID | |
| 31.85% | 36.79% | 26.19 | 23.14% | 31.59% | 22.71 | |
| 11.39% | 28.14% | 17.99 | 2.47% | 18.01% | 53.80 | |
| 3.50% | 20.65% | 15.88 | 1.46% | 15.75% | 25.74 | |
| 0.05% | 15.31% | 14.38 | 0.29% | 2.31% | 156.08 | |
| 0.00% | 3.80% | 15.87 | 0.02% | 0.23% | 295.58 | |
Here, the term acts as a norm-suppressing penalty. Smaller values of place greater emphasis on norm suppression.
As shown in Table 3, norm suppression effectively reduces nearest-neighbor replication in the repeated-sample fine-tuning setting. While it mitigates memorization, it does not hinder the improvement of the quality of generated images. For the full-velocity suppression objective, with , the replication rate drops from 28.53% to 0.05%, while the FID improves from 24.33 to 14.38. Further suppression with continues to reduce replication to 0.00%, but at the cost of slightly degraded fidelity. Learning with score penalizing compromises fidelity and fails to improve both LPIPS and FID.
4.4 Large-Scale Memorization Mitigation
We further evaluate the proposed regularization method on the large-scale LAION-Aesthetics-12M-UMAP dataset using Stable Diffusion v1.4. We compare our method with the memorization mitigation approach of Wen et al. [19]. Memorization is evaluated using the fraction of generated samples with SSCD similarity exceeding 0.7, while generation fidelity is assessed using CLIP scores.
Table 4: Memorization mitigation on LAION-Aesthetics-12M-UMAP. Comparison of regularization methods on Stable Diffusion v1.4 using 200 generated samples. CLIP denotes the change in CLIP score relative to the unmitigated model.
| Method | SSCD > 0.7 | Count | CLIP | CLIP |
|---|---|---|---|---|
| No mitigation | 39.00% | 78 | 0.3019 | - |
| Wen () [19] | 0.00% | 0 | 0.2917 | -0.0102 |
| Wen () | 0.50% | 1 | 0.2978 | -0.0041 |
| Ours (, ) | 0.00% | 0 | 0.2987 | -0.0032 |
As shown in Table 4, the unmitigated model produces 78 memorized samples out of 200 generations (39.00%). Our method reduces the observed memorization rate to 0.00%, matching Wen et al. ( ), while achieving a higher CLIP score (0.2987 vs. 0.2917). Furthermore, our method incurs a smaller reduction in CLIP score (-0.0032) than either configuration of Wen et al. These results suggest that the proposed regularization can effectively mitigate memorization while better preserving generation fidelity in this evaluation.
5 Conclusion
We introduced a thermodynamic diagnostic for model-level memorization in diffusion networks. The proposed criterion is based on a thermodynamic quantity—the rate of change of the Helmholtz free energy—computed from the learned score. Across a range of settings exhibiting memorization and non-memorization, networks for which this criterion does not diverge do not produce memorized samples. The proposed criterion achieves competitive performance compared with existing methods and can further mitigate memorization when incorporated into the training loss.
References
[1] D. Bakry and M. Émery. Diffusions hypercontractives. In Séminaire de Probabilités XIX 1983/84, volume 1123 of Lecture Notes in Mathematics, pages 177–206. Springer, Berlin, Heidelberg, 1985.
[2] T. Bonnaire, R. Urfin, G. Biroli, and M. Mézard. Why diffusion models don’t memorize: The role of implicit dynamical regularization in training. In Advances in Neural Information Processing Systems, 2025.
[3] N. Carlini, J. Hayes, M. Nasr, M. Jagielski, V. Sehwag, F. Tramèr, B. Balle, D. Ippolito, and E. Wallace. Extracting training data from diffusion models. In Proceedings of the 32nd USENIX Security Symposium, pages 5253–5270, 2023.
[4] C. Chen, D. Liu, M. Shah, and C. Xu. Exploring local memorization in diffusion models via bright ending attention. In International Conference on Learning Representations, 2025.
[5] J. Ho, A. Jain, and P. Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems, volume 33, pages 6840–6851, 2020.
[6] A. Hyvärinen. Estimation of non-normalized statistical models by score matching. Journal of Machine Learning Research, 6:695–709, 2005.
[7] D. Jeon, D. Kim, and A. No. Understanding and mitigating memorization in generative models via sharpness of probability landscapes. In Proceedings of the 42nd International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research, pages 27091–27112, 2025.
[8] Z. Kadkhodaie, F. Guth, E. P. Simoncelli, and S. Mallat. Generalization in diffusion models arises from geometry-adaptive harmonic representations. In International Conference on Learning Representations, 2024.
[9] T. Karras, T. Aila, S. Laine, and J. Lehtinen. Progressive growing of GANs for improved quality, stability, and variation. In International Conference on Learning Representations, 2018.
[10] A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
[11] P. Li, Z. Li, H. Zhang, and J. Bian. On the generalization properties of diffusion models. In Advances in Neural Information Processing Systems, volume 36, pages 2097–2127, 2023.
[12] Z. Liu, P. Luo, X. Wang, and X. Tang. Deep learning face attributes in the wild. In Proceedings of the IEEE International Conference on Computer Vision, pages 3730–3738, 2015.
[13] I. Loshchilov and F. Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019.
[14] R. Rombach, A. Blattmann, D. Lorenz, P. Esser, and B. Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10684–10695, 2022.
[15] G. Somepalli, V. Singla, M. Goldblum, J. Geiping, and T. Goldstein. Diffusion art or digital forgery? investigating data replication in diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6048–6058, 2023.
[16] G. Somepalli, V. Singla, M. Goldblum, J. Geiping, and T. Goldstein. Understanding and mitigating copying in diffusion models. In Advances in Neural Information Processing Systems, volume 36, pages 47783–47803, 2023.
[17] Y. Song, J. Sohl-Dickstein, D. P. Kingma, A. Kumar, S. Ermon, and B. Poole. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2021.
[18] C. Villani. Optimal Transport: Old and New, volume 338 of Grundlehren der Mathematischen Wissenschaften. Springer, Berlin, Heidelberg, 2009.
[19] Y. Wen, Y. Liu, C. Chen, and L. Lyu. Detecting, explaining, and mitigating memorization in diffusion models. In International Conference on Learning Representations, 2024.
[20] Y.-H. Wu, P. Marion, G. Biau, and C. Boyer. Taking a big step: Large learning rates in denoising score matching prevent memorization. In Proceedings of the 38th Conference on Learning Theory, volume 291 of Proceedings of Machine Learning Research, pages 5718–5756, 2025.
Appendix
A Experimental Details
The details of the experiment are as follows: Figure 1(A), 2, and 3 provides the plot of at each calculated using . The experiments have been performed with the network estimating the total accumulated error with training sample and the forward diffused sample at time . The neural network in our experiments estimates as in [5], and the learned score is obtained using with or for discrete algorithm. In all experiments, the diffusion timestep axis is shown on a logarithmic scale to enhance the visibility of the low-noise region near .
The reverse process begins at in our experiments, and data are generated at . The low-noise region lies near , where noise has accumulated through the forward process.
A.1 Two-Dimensional Gaussian Details
Affine network learns scores that generate Gaussian data: The derivation below shows that this network recovers the score corresponding to a Gaussian with maximum-likelihood estimates of the mean and covariance.
We consider the following score matching objective function:
which is a modified expression using the integration by parts from the mean squared error between the estimated score and the true score [6, 17]. Consider an affine score function where , , and . Plugging into yields . The optimal and that minimize , obtained from the conditions and , are given in closed form as
(21) where and denote the empirical mean and covariance, respectively. The resulting score corresponds to that of a Gaussian with mean and covariance , since the Gaussian score is for . Therefore, Langevin dynamics using an affine score model generates Gaussian data with the empirical mean and covariance of the training data, regardless of whether the original data are Gaussian.
The experiment was conducted on a two-dimensional Gaussian distribution with zero mean. The covariance matrix is constructed by rotating a diagonal matrix with entries (4.0, 0.25) by . We use N = 10 samples from this distribution for training. Subsequently, the Kullback–Leibler (K-L) divergence is computed using the generated samples and the analytical form of the underlying density.
We use 1,000 time steps for both the forward and reverse processes, with a constant of 0.0095. Each model is trained for 20,000 optimization steps using AdamW, an Adam variant with decoupled weight decay [13], with the standard -prediction loss, a batch size of 256, and a learning rate of . Figure 1 presents a comparison of model capacity for between an affine denoiser, a small MLP, and a large MLP.
The affine denoiser uses a 3-layer time MLP with 64 hidden nodes and has 10,757 trainable parameters. The small MLP has 2 hidden layers with 28 hidden nodes, resulting in 1,850 trainable parameters, whereas the large MLP has 6 hidden layers with 1,024 hidden nodes and 5,285,890 trainable parameters. Thus, the small MLP has limited capacity, while the large MLP has sufficient capacity to form sample-specific representations around the finite training set.
The small and large MLP denoisers share the same input variables but differ in capacity:
where is a sinusoidal time embedding.
The affine denoiser has the following formulation:
where is a symmetric matrix and both and are produced from the time embedding. Score has been obtained using , Eq. (23).
In Figure 1(B), we compare the generated distribution of each model with the true underlying Gaussian density. For each trained model, we first generate samples from the model distribution and fit a Gaussian KDE, denoted by , to these samples. We then draw evaluation samples from the fitted KDE and compute the following Monte Carlo estimate of the divergence to the true density:
A.2 Real-World Experiment Using Benchmark Dataset
For CIFAR-10 and CelebA-HQ, fine-tuning updates the pretrained model for 50,000 steps using a subset of the data. This subset is repeatedly presented to the model to promote memorization. Under the subset-to-full update ratio setting, 5,000 randomly sampled images from the full dataset are intermittently introduced every steps. The CIFAR-10 experiment measures statistics in RGB pixel space, whereas the CelebA-HQ experiment uses the latent denoising space provided by the pretrained model. The resolution of CIFAR-10 is , while that of CelebA-HQ is . After fine-tuning, nearest-neighbor LPIPS and FID are computed using the full training dataset.
B Samples of Generated Images
We present examples of generated samples from the real-world experiments. Settings that promote memorization are shown on the left, while settings that discourage memorization are shown on the right, for both the CIFAR-10 in Figure 5 and CelebA-HQ in Figure 6. Red boxes indicate images with LPIPS scores below the memorization threshold used in Table 1: LPIPS ≤ 0.03 for CIFAR-10 and LPIPS ≤ 0.1 for CelebA-HQ.
Memorized: N = 100

Memorized:
Less Memorized: N = 20,000


Less Memorized:

Figure 5: CIFAR-10 generated examples. Top: catastrophic corruption conditions with learned subset size . Bottom: non-catastrophic corruption conditions with subset-to-full update ratio . Red boxes indicate that the generated samples are flagged as nearest-neighbor replication under the criterion LPIPS .
In experiment, all samples in CIFAR-10 and many samples in CelebA-HQ are highlighted with red boxes, indicating severe memorization by the networks. Under the non-catastrophic corruption setting with , many examples are also red-boxed, although they do not constitute the majority. In contrast, for the non-memorizing settings ( and ), none of the generated samples exhibit memorization. These observations are consistent with the norm of the rate of Helmholtz free energy dissipation shown in Figures 2 and 3.
Memorized: N = 100

Memorized:
Less Memorized: N = 20,000

Less Memorized:
Figure 6: CelebA-HQ generated examples. Top: catastrophic corruption conditions with learned subset size . Bottom: non-catastrophic corruption conditions with subset-to-full update ratio . Red boxes indicate that the generated samples are flagged as nearest-neighbor replication under the criterion LPIPS .
C Sample-Level Memorization in Stable Diffusion 2 Base
We present sample-level memorization detection results on Stable Diffusion 2 Base. The same 1,000-step DDPM measurement protocol used in Section 4.2 is applied. As in the Stable Diffusion v1.4 experiments, memorization labels are assigned based on prompts categorized as memorization-prone or non-memorization-prone, rather than verified replication of training images.
Table 5: Sample-level memorization detection on Stable Diffusion 2 Base. All measurements are performed on DDPM 1,000-step trajectories. Bold entries are statistically indistinguishable from the best value in each column under an approximate two-sided test at using the reported standard errors.
| Method | Time step | AUC | TPR@1% FPR |
|---|---|---|---|
| [19] | |||
| [7] | |||
D Derivation of the Threshold for the Loss Function Modification
In this section, we derive the threshold used in Section 4.3. The threshold is chosen as the value of the penalized quantity when the network has fully memorized the training data, i.e., when the learned score coincides with the score of a single diffused -function.
Forward process and learned velocity: Accumulating the forward update in Eq. (1) over steps, a training sample is diffused to
where is the accumulated variance. The network predicts , from which the learned score is . Following Eq. (5), the velocity field is , and its learned counterpart without the common factor is
Point-mass score: As shown in Section 2.1, the velocity field around a training sample is dominated by the nearest -function. A memorizing network therefore reproduces, near , the score of the diffused -function centered at , which is the Gaussian :
where the last equality follows from Eq. (25). This is exactly the score obtained when the network predicts the injected noise without error, .
Point-mass velocity: Substituting the point-mass score and Eq. (25) into gives
(28)
Taking the expectation over , the cross term vanishes since , and . The expected penalized quantity for the sample is then
(29)
Threshold: Eq. (29) depends on the individual sample only through . For normalized data with unit variance per dimension, ; this holds for the scaled latents of the latent diffusion model.
Under this approximation, the two terms combine as , and the sample-independent threshold becomes
For data that are not normalized, in Eq. (29) can be replaced by its dataset average .
A training sample is assigned to the subset in Section 4.3 when
i.e., when the learned velocity norm exceeds the fraction of the point-mass reference. Since the penalty acts only on such samples, it prevents the network from approaching the singular velocity of the memorized reverse process, while the remaining samples are trained with the standard loss.