Generalization of Diffusion Models Arises with a Balanced Representation Space
Zekai Zhang, Xiao Li, Xiang Li, Lianghe Shi, Meng Wu, Molei Tao, Qing Qu
TL;DR
This work tackles how diffusion models generalize without merely memorizing training data. By analyzing a nonlinear two-layer ReLU denoising autoencoder under a mixture-of-Gaussians data setup, the authors identify memorization as storage of exact training samples in weights (producing spiky activations) and generalization as learning local data statistics (producing balanced, semantic codes). They show three regimes—memorization, generalization, and a hybrid with imbalanced data—and validate that similar representation structures emerge in real-world diffusion models. Leveraging these insights, they propose a representation-based memorization detector and a training-free representation-space steering method for interpretable image editing, highlighting that learning good representations is central to meaningful, controllable generative modeling with practical implications for privacy and reliability.
Abstract
Diffusion models excel at generating high-quality, diverse samples, yet they risk memorizing training data when overfit to the training objective. We analyze the distinctions between memorization and generalization in diffusion models through the lens of representation learning. By investigating a two-layer ReLU denoising autoencoder (DAE), we prove that (i) memorization corresponds to the model storing raw training samples in the learned weights for encoding and decoding, yielding localized "spiky" representations, whereas (ii) generalization arises when the model captures local data statistics, producing "balanced" representations. Furthermore, we validate these theoretical findings on real-world unconditional and text-to-image diffusion models, demonstrating that the same representation structures emerge in deep generative models with significant practical implications. Building on these insights, we propose a representation-based method for detecting memorization and a training-free editing technique that allows precise control via representation steering. Together, our results highlight that learning good representations is central to novel and meaningful generative modeling.
