Diffusion and Flow-Matching: From Memorization to Generalization & Beyond
Mathurin Massias, Quentin Bertrand
International Conference on Machine Learning 2026 · Tutorial
Overview
Generative modeling has undergone a paradigm shift over the last several years, with diffusion models (originally introduced in 2015 and popularized around 2020) and flow-matching (introduced via three simultaneous papers at ICLR 2023) establishing themselves as state-of-the-art techniques for creating high-fidelity images, audio, video, and protein structures. More recently, this paradigm has expanded into discrete data and text generation, evidenced by models like DeepMind's Gemma diffusion text model, which reportedly achieves four times the generation speed of classical autoregressive Large Language Models (LLMs). Despite their empirical dominance, these models remain largely black boxes, plagued by fundamental theoretical puzzles regarding how they manage to generate novel, out-of-sample data rather than merely regurgitating their training sets.

Key moments
- 0:00 Introduction, puzzles of diffusion, and roadmap
- 4:00 Generative modeling setup and big picture
- 6:00 Flow matching mechanics and conditional expectation
- 26:00 The memorization paradox and empirical distribution
- 44:00 Curse of dimensionality and dataset size experiments
- 54:00 Defining memorization and generalization metrics
- 58:00 Architectural versus dynamical regularization
Diffusion and Flow-Matching: From Memorization to Generalization & Beyond
Speakers: Mathurin Massias; Quentin Bertrand
Conference: ICML
YouTube: https://slideslive.com/39083457
Overview
Generative modeling has undergone a paradigm shift over the last several years, with diffusion models (originally introduced in 2015 and popularized around 2020) and flow-matching (introduced via three simultaneous papers at ICLR 2023) establishing themselves as state-of-the-art techniques for creating high-fidelity images, audio, video, and protein structures. More recently, this paradigm has expanded into discrete data and text generation, evidenced by models like DeepMind's Gemma diffusion text model, which reportedly achieves four times the generation speed of classical autoregressive Large Language Models (LLMs). Despite their empirical dominance, these models remain largely black boxes, plagued by fundamental theoretical puzzles regarding how they manage to generate novel, out-of-sample data rather than merely regurgitating their training sets.
In this comprehensive ICML tutorial, Mathurin Massias and Quentin Bertrand from Inria (the French national institute for computer science and applied mathematics) tackle three central puzzles of modern generative flow-matching and diffusion: why mathematical derivations dictate that these models should exclusively memorize their training data, how empirical generalization emerges despite this theoretical contradiction, and what underlying mechanisms—ranging from architectural regularization to optimization dynamics—actually govern their behavior. Limiting their scope primarily to unconditional image generation for mathematical clarity, the speakers deconstruct the gap between loss minimizers and practical generation, offering both rigorous analytical insights and experimental frameworks to understand state-of-the-art generative systems.
This talk matters deeply to the machine learning and systems research community because it confronts a foundational contradiction in statistical learning theory: how high-dimensional generative models (such as those operating in 200,000-dimensional pixel spaces for 256x256 RGB images) avoid the curse of dimensionality and benign overfitting. By examining closed-form minimizers and non-local correlation constraints, the speakers bridge the gap between abstract functional optimization and concrete empirical success, providing practitioners with a clearer mental model of what diffusion and flow-matching networks actually compute during training and inference.
Background
▶ Watch: Introduction, puzzles of diffusion, and roadmap (0:00)
To understand why diffusion and flow-matching present such a profound puzzle, one must examine the standard statistical framing of generative modeling. Given an unknown target data density $P_{\text{data}}$ and $n$ independent training samples $X_1, X_2, \dots, X_n \sim P_{\text{data}}$, the goal of a generative model is to construct a mapping $T$ that transforms a simple source distribution $P_0$ (typically an isotropic Gaussian) into the target distribution $P_{\text{data}}$.
In flow-matching, this mapping is defined implicitly by solving an ordinary differential equation (ODE) governed by a velocity field $u_t(x)$ parametrized in space $\mathbb{R}^d$ and time $t \in [0, 1]$:
$$\frac{dX_t}{dt} = u_t(X_t), \quad X_0 \sim P_0, \quad X_1 \sim P_{\text{data}}$$
The training objective relies on constructing a linear interpolation between noise ($X_0$) and clean data ($X_1$):
$$X_t = (1-t)X_0 + tX_1$$
The theoretical ideal velocity field that minimizes the flow-matching regression objective is given by the conditional expectation $\mathbb{E}[X_1 - X_0 \mid X_t = x]$. Similarly, diffusion models formulate this as a stochastic process governed by a stochastic differential equation (SDE), where learning the score function (the gradient of the log-density of noised data, $\nabla_x \log P_t(x)$) serves an equivalent role to learning the velocity field.
Prior work in the generative modeling literature—most notably generative adversarial networks (GANs) and variational autoencoders (VAEs)—faced severe training instability or blurry reconstructions. While diffusion and flow-matching solved these stability issues via stable $L_2$ regression objectives, they introduced a paradoxical theoretical hurdle: because the true data density $P_{\text{data}}$ is never accessible, practitioners must substitute the empirical distribution $P_{\text{data}}^{\text{hat}}$ derived from the finite training set $\{X_1, \dots, X_n\}$. This substitution changes the theoretical minimizer entirely, transforming the ideal conditional expectation into a sum over the training samples that diverges as $t \to 1$, driving trajectories straight toward individual training points. Prior work by researchers such as Nicholas Carlini and Somepalli et al. empirically documented this exact memorization behavior at small dataset scales, setting up the central conflict between theory and practice in modern generative systems.
Key Findings
▶ Watch: Flow matching mechanics and conditional expectation (6:00)
The primary discoveries presented in the tutorial revolve around the tension between theoretical memorization and empirical generalization, supported by several seminal experiments from the literature:
- The Closed-Form Memorization Trap: When training objectives substitute $P_{\text{data}}$ with the empirical distribution $P_{\text{data}}^{\text{hat}}$, the exact minimizer of the flow-matching loss can be written in closed form as a softmax-weighted sum of individual directional vectors pointing directly toward training samples $X_i$. As time $t$ approaches 1, this velocity field blows up, guaranteeing that any exact ODE integration will terminate precisely at a training sample.
- The Transition from Memorization to Generalization: Empirical evaluations (such as those by Somepalli et al. using the CelebA dataset split into disjoint subsets $S_1$ and $S_2$) demonstrate that training on extremely small datasets ($N = 10$ to $1,000$) results in single-sample memorization. However, increasing the dataset size by orders of magnitude ($N = 100,000$) causes memorization to vanish, yielding high-fidelity generation of novel, out-of-sample data.
- Convergence to Shared Representations: When models are trained on different disjoint subsets of the same dataset using identical random seeds, they eventually generate structurally identical images at large $N$. This suggests that the optimization process and architecture constrain the network to discover a universal limiting model rather than arbitrary local minima.
- Critical Time Intervals: Through hybrid evaluation experiments—where trajectories follow the closed-form ideal velocity for an initial window $\tau$ and transition to a neural network-learned velocity thereafter—researchers found that the low-frequency, high-level structure of generated images is locked in extremely early (within $t \in [0, 0.4]$), proving that small times are critical for structural formation.
- Non-Local Correlation Constraints: By replacing traditional rigid locality masks (used in architectures like U-Nets) with data-informed Wiener filters and linear score estimators, closed-form models can capture long-range pixel dependencies (such as symmetry between human eyes) without cross-validating complex neural network receptive fields.
Technical Deep Dive
▶ Watch: Curse of dimensionality and dataset size experiments (44:00)
The technical core of flow-matching and diffusion rests on vector field approximation and the regularization mechanisms that prevent the theoretical memorization collapse.
The Flow-Matching Training Pipeline
The standard training procedure for flow-matching requires no complex adversarial loops. At each stochastic gradient descent (SGD) step:
- Sample noise $X_0 \sim P_0$ (isotropic Gaussian).
- Sample a clean training image $X_1 \sim P_{\text{data}}^{\text{hat}}$.
- Sample time uniformly $t \in [0, 1]$.
- Construct the interpolated point $X_t = (1-t)X_0 + tX_1$.
- Update network weights $\theta$ via the $L_2$ regression loss:
$$\mathcal{L}(\theta) = \mathbb{E}_{X_0, X_1, t} \left[ \| u_\theta(X_t, t) - (X_1 - X_0) \|^2 \right]$$
Explaining Generalization: Two Competing Hypotheses
To explain why neural networks avoid the closed-form memorization minimizer $u^{\text{hat}*}$, the community currently debates two main theoretical frameworks:
- Architectural Regularization (Inductive Bias): The neural network parametrization (e.g., restricted capacity of a U-Net or Vision Transformer (ViT)) lacks the capacity to represent the true discontinuous, exploding closed-form minimizer $u^{\text{hat}*}$. Consequently, the network is forced to learn a smoothed approximation that naturally generalizes across data modes.
- Dynamical Regularization (Optimization Dynamics): The network possesses infinite capacity (over-parameterization), but gradient-based optimizers (like Adam or SGD) combined with early stopping act as an implicit regularizer. If trained for infinite epochs, the model would theoretically memorize, but practical training schedules halt before convergence.
Analytical Closed-Form Approximations
Recent work by Artem Lukoyanov and collaborators explores replacing deep neural networks entirely with analytical formulations derived from Wiener filters. By computing the sensitivity matrix of a linear velocity field:
$$S = \frac{\partial u_t}{\partial x}$$
practitioners can extract the most predictive pixel correlations at time $t$ without relying on U-Nets. Binarizing these correlation matrices yields binary masks that replace hand-crafted receptive fields, proving that diffusion models function fundamentally by "mixing and matching" patches from training images.
Experimental Setup & Results
▶ Watch: Defining memorization and generalization metrics (54:00)
While theoretical analyses occupy the core of the tutorial, the speakers reference several prominent empirical studies to ground their discussion:
- Datasets: Experiments cited utilize CelebA (faces), CIFAR-10 (32x32 natural images, 3 channels), FFHQ, MNIST, and subsets of ImageNet and LAION-5B.
- Evaluation Metrics:
- Frechet Inception Distance (FID): Used as a standard proxy for generation fidelity and generalization, despite well-documented limitations.
- Memorization Ratio: The proportion of generated samples whose distance to their nearest training neighbor is less than one-third of their distance to the second-nearest neighbor, measured across batches of 10,000 generated items.
- Headline Observations:
- On CelebA subsets, transitioning training set sizes from $N = 512$ to $N = 100,000$ shifts models out of the pure memorization regime.
- Linear Wiener filter approximations combined with closed-form trajectory mixing successfully reconstruct recognizable faces and CIFAR objects, achieving visual fidelity approaching small U-Net architectures without training deep neural networks.
Practical Implications
▶ Watch: Non-local receptive fields and closed-form models (100:00)
For infrastructure teams, model builders, and deployers, these findings carry profound practical consequences:
- Dataset Scale vs. Memorization: Practitioners scaling up generative models must recognize that smaller datasets dramatically elevate memorization risk. Curating diverse, large-scale training sets is not merely about improving semantic variety, but actively preventing the velocity field from collapsing into closed-form training point attractors.
- Architectural Trade-offs: The choice of backbone (U-Net vs. ViT) and parametrization (predicting noise $\epsilon$, velocity $v$, or clean data $x_0$) directly alters the inductive bias and susceptibility to memorization. Teams building proprietary generators must evaluate whether their network capacity accidentally permits exact memorization.
- Computational Efficiency and One-Step Models: Modern industry shifts toward one-step generation models (such as MeanFlow and FlowMaps) bypass ODE/SDE solvers to reduce latency. However, how these one-step distillation techniques interact with memorization bounds and optimization dynamics remains an open research frontier.
- Limitations of FID: Deployers relying solely on FID to measure generalization must remain cautious, as FID fails to capture fine-grained novelty, mode collapse, or the precise proportion of memorized training instances.
Key Takeaways
- The Memorization Paradox: When flow-matching and diffusion objectives substitute the true data distribution $P_{\text{data}}$ with the empirical dataset distribution $P_{\text{data}}^{\text{hat}}$, the exact mathematical minimizer collapses into a velocity field that exclusively generates training samples.
- Generalization Realities: Despite theoretical memorization, models successfully generalize in practice when trained on sufficiently large datasets (e.g., $N > 10,000$), escaping the curse of dimensionality.
- Two Competing Explanations: Generalization is attributed either to architectural regularization (neural network capacity limits preventing the learning of the exploding minimizer) or dynamical regularization (optimization paths and early stopping preventing convergence to memorization).
- Early Time Criticality: Hybrid trajectory experiments show that low-frequency structural details of generated outputs are locked in very early ($t \in [0, 0.4]$), highlighting the importance of initial ODE/SDE integration steps.
- Closed-Form Patchworking: Analytical models using linear Wiener filters demonstrate that diffusion models operate fundamentally by mixing and matching patches from the training dataset.
- Open Frontiers: Modern challenges include understanding discrete diffusion for text (e.g., Gemma), one-step distillation models, and the lack of theoretical guarantees for text-conditioned generation on massive web-scale datasets like LAION-5B.
About the Speaker(s)
- Mathurin Massias: Speaker presenting a tutorial on diffusion and flow-matching models, focusing on memorization, generalization, and their mechanisms for generating new data.
- Quentin Bertrand: Co-presenter of the tutorial on diffusion and flow-matching alongside Mathurin Massias.
Reviews
→ Top-rated talks at International Conference on Machine Learning 2026
All talks from International Conference on Machine Learning 2026