NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

How Compositional Generalization and Creativity Improve as Diffusion Models are Trained

Alessandro Favero, Antonio Sclocchi, Francesco Cagnetta, Pascal Frossard, Matthieu Wyart

Abstract

Modern diffusion models exhibit a remarkable capacity for "creativity," generating novel and complex data across text and image domains. However, learning high-dimensional distributions typically faces the "curse of dimensionality," requiring an exponential number of samples. This paper investigates how diffusion models bypass this limitation by exploiting hierarchical, compositional structures. Through the lens of a Random Hierarchy Model (RHM), the authors demonstrate that diffusion models learn rules bottom-up—mastering local constraints before achieving global coherence—with a sample complexity that scales polynomially rather than exponentially.

Introduction

Human intelligence is defined by compositional generalization: the ability to construct an infinite variety of novel concepts from a finite set of rules. While modern generative AI shows similar capabilities, the statistical mechanism behind this success is poorly understood. Theoretically, learning the structure of high-dimensional data is an intractable problem due to the curse of dimensionality. This research addresses how diffusion models successfully learn these structures, what statistical signals they exploit, and how training set size dictates the structural quality of the generated output.

Theoretical Framework: The Random Hierarchy Model

To bridge the gap between symbolic logic and statistical learning, the authors utilize the Random Hierarchy Model (RHM). The RHM is a simplified Probabilistic Context-Free Grammar (PCFG) that generates data through a tree-like structure. In this model, hidden variables at higher levels produce visible tokens at the base through fixed, random rules.

By analyzing this model, the researchers mathematically derived the sample complexity—the number of training examples required to reconstruct latent variables at various depths of the hierarchy. Their analysis suggests that diffusion models function by detecting correlations between tokens and their surrounding contexts, effectively performing a hierarchical version of feature clustering.

The Hierarchical "word2vec" Mechanism

A central insight of the paper is that diffusion models learn latent variables by clustering features that share statistical contexts. This process is analogous to the word2vec algorithm, which learns word embeddings based on distributional semantics. In diffusion models, however, this clustering occurs iteratively across multiple levels of abstraction.

This mechanism allows the model to beat the curse of dimensionality. Because the model leverages local statistical correlations to build these clusters, the sample complexity required to learn a rule at a specific depth $\ell$ scales polynomially ($m^{\ell+1}$, where $m$ represents the number of rules or synonyms) rather than exponentially relative to the total data dimension.

Staged Learning and Empirical Results

The research identifies a distinct staged learning process where models inherently learn from the bottom up. This was verified through three distinct experimental setups:

  1. Synthetic Data: Training U-Nets on RHM-generated data confirmed that the sample complexity for learning level-$\ell$ rules perfectly matched the theoretical $m^{\ell+1}$ prediction.
  2. Natural Language: The authors trained the MD4 masked diffusion model on the OpenWebText corpus. They observed that models trained on intermediate data volumes ($\\approx 10^9$ tokens) could generate locally valid phrases but failed at global sentence structure. Global coherence only emerged after the training set reached $\\approx 10^{10}$ tokens.
  3. Image Generation: Using ImageNet 64x64 and DDPMs, the authors tracked convergence using Maximum Mean Discrepancy (MMD) on ResNet-18 embeddings. Early training stages produced basic textures (captured by early ResNet layers), while coherent global scenes (captured by deeper layers) only emerged much later in the training process.

Connection to Statistical Physics

The authors highlight a compelling parallel between this hierarchical learning and the renormalization group in physics. In physics, the renormalization group is used to study complex systems by progressively averaging variables over larger spatial scales. Diffusion models appear to perform a similar "hierarchical coarsening," moving from fine-grained local details to large-scale global structures as they gain more data and training time.

Conclusion and Future Directions

While the RHM provides a powerful analytical tool, it is a simplified, regular tree structure that does not fully capture the irregular complexities of natural language or visual scenes. Furthermore, the current theory focuses primarily on the low-noise limit of the diffusion process.

Future work may involve designing algorithms that explicitly perform hierarchical clustering to improve the interpretability of generative models. By moving away from "black-box" architectures and toward systems that mirror the hierarchical coarsening of the renormalization group, researchers may unlock new ways to control and understand artificial creativity. Additionally, this perspective offers a potential new tool for physics, applying generative modeling insights to complex problems like turbulence.

Summary updated

BibTeX
@inproceedings{favero2025how,
  author = {Alessandro Favero and Antonio Sclocchi and Francesco Cagnetta and Pascal Frossard and Matthieu Wyart},
  title = {{How Compositional Generalization and Creativity Improve as Diffusion Models are Trained}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=1OUEnfusEd},
}
Figure