How Compositional Generalization and Creativity Improve as Diffusion Models are Trained

Alessandro Favero, Antonio Sclocchi, Francesco Cagnetta, Pascal Frossard, Matthieu Wyart
2/17/2025
stat.MLcs.LG

No official code found. Best implementation: AntonioScl/minimal_diffusion_rhm (0 stars, MIT, last commit 2025-10-31).

Abstract

Natural data is often organized as a hierarchical composition of features. How many samples do generative models need in order to learn the composition rules, so as to produce a combinatorially large number of novel data? What signal in the data is exploited to learn those rules? We investigate these questions in the context of diffusion models both theoretically and empirically. Theoretically, we consider a simple probabilistic context-free grammar - a tree-like graphical model used to represent the hierarchical and compositional structure of data such as language and images. We demonstrate that diffusion models learn the grammar's composition rules with the sample complexity required for clustering features with statistically similar context, a process similar to the word2vec algorithm. However, this clustering emerges hierarchically: higher-level features associated with longer contexts require more data to be identified. This mechanism leads to a sample complexity that scales polynomially with the said context size. As a result, diffusion models trained on an intermediate dataset size generate data coherent up to a certain scale, but lacking global coherence. We test these predictions across different domains and find remarkable agreement: both generated texts and images achieve progressively larger coherence lengths as the training time or dataset size grows. We discuss connections between the hierarchical clustering mechanism we introduce here and the renormalization group in physics.

View on arXivView PDF

Code Implementations(1)

MIT

Code to train diffusion models to generate Random Hierarchy Model data. Paper: "How Compositional Generalization and Creativity Improve as Diffusion Models are Trained" ICML 2025

02Shell, PythonOct 31, 202511 months agoMIT
diffusionhierarchical-data

Similar Papers

Cite this paper

@article{favero2025compositional,
  title  = {How Compositional Generalization and Creativity Improve as Diffusion Models are Trained},
  author = {Alessandro Favero and Antonio Sclocchi and Francesco Cagnetta and Pascal Frossard and Matthieu Wyart},
  year   = {2025},
  eprint = {2502.12089},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.12089v3},
  journal = {ICML 2025 2025}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.12089.svg)](https://codeofpaper.com/paper/2502.12089)

Discussion