English

Diffusion Models Memorize in Training -- and Generalize in Inference

Machine Learning 2026-05-21 v2

Abstract

Diffusion models generalize well in practice. However, an optimal diffusion model fully memorizes the training data and therefore fails to generalize, raising the question of what induces generalization in a real diffusion model. We show that, despite generalizing at the sample level, diffusion models progressively overfit the denoising training objective and thereby create a generalization gap between the performance on validation and training samples. This gap is most pronounced at intermediate noise levels. Using a fully analytic error-prone toy model, we trace the factors affecting the generalization gap. We find that the optimal denoising flow field localizes sharply around training points, but the model error suppresses the exact recall of training points, yielding a smooth, generalizing flow field. Finally, we find that the generalization gap observed in training does not translate to inference, which would result in a strong similarity between generated samples and training samples. This is because the intermediate states of sampling trajectories are sufficiently far from the distribution of noisy training samples the model is trained on. Together, these findings reveal a novel picture of how diffusion models generalize: the flow field generalizes through model error, which moves sampling trajectories outside the domain of noisy training samples and thereby naturally prevents overfitting.

Keywords

Cite

@article{arxiv.2603.13419,
  title  = {Diffusion Models Memorize in Training -- and Generalize in Inference},
  author = {Tim Kaiser and Markus Kollmann},
  journal= {arXiv preprint arXiv:2603.13419},
  year   = {2026}
}

Comments

31 pages and 29 figures

R2 v1 2026-07-01T11:19:11.169Z