Modern generative models are typically studied for their ability to generalize, while memorization is treated as a failure mode. We invert this perspective and ask how a generative model can recall a single datum. We frame memorization as a control problem: a learned conditioning signal steers a frozen diffusion model toward a target image, and we follow the formation of this memory throughout training. Before converging to exact reproduction (verbatim), memory passes through a regime of abstraction: samples preserve the target's semantic content (gist) while remaining diverse in appearance, leaving predictable detail to the generative prior. This semantic organization emerges despite the absence of labels, captions, or any explicit semantic objective. In the abstraction regime, the learned memory approaches ordinary text conditioning and supports editing, one-shot recognition, and retrieval more effectively than in the near-perfect reconstruction regime. These results suggest that memorization can serve as a probe of the relevance structure encoded by a generative model: what must be stored about a datum, what can be reconstructed from prior knowledge, and how learned memories interpolate between reconstructive recall and literal data storage.
Figures & tables
Figure 1: One image, two regimes: abstraction before locking. (a) Three memories ( M=8 vectors each), each trained on a single image (rightmost, red frame) and used to condition a frozen diffusion model. Each 2×2 block shows four samples at different input noise realizations. At initialization, samples follow the prior (first column). During an extended abstraction regime, the memory first generates other subjects sharing the target’s style (second column), then the target’s identity with varying pose, clothing and lighting (third column). By step 2500, locking sets in and the training image is generated regardless of the input noise realization (fourth column). (b) The same trajectory across 30 single-image memories ( 10 animals, 10 vehicles, 10 faces; median ± IQR). Solid: squared distance between the mean sample and the target (bias 2 ), measuring progress toward it. Dashed: dispersion of the samples around their mean (variance), measuring remaining variability. Semantic distance (DINOv2 embedding) collapses within ∼102 steps, while surface distance (VAE latent) collapses an order of magnitude later. Green band: the abstraction window, between the median semantic and surface half-decay steps (Appendix D.1 ). (c) bias 2 by memory size (solid: surface, dashed: semantic). At fixed training budget a larger memory leaves the timescales unchanged but lowers the final surface residual. M=1 does not complete locking within the budget.
Figure 2: Generalization through the prior. (a) Each row corresponds to a caption–noise pair. For each of two captions, we show two input-noise realizations (1-2). Columns: the caption-conditioned sample; memory-conditioned samples ( N=1 ) at initialization, near the peak of the paired advantage (step 100, red frame), later in training (step 250) and after locking (step 4000); the training image. The input noise is held fixed along each row. For each caption, the two realizations shown are those with the largest paired advantage at the peak. (b) Paired advantage over training for twelve captions describing faces, one memory per caption at N=1 (blue) and N=50 (green); median, bands: IQR. Dashed grey: the same samples scored against pools from unrelated captions at the same input noise. (c) Positional fraction f over training, mean over 30 memories per memory size ( 10 each of animals, vehicles and faces; bands: s.e.m.). Dashed: the M=1 control, which cannot directly learn position-dependent addressing.
Figure 3: Fidelity–functionality trade-off. (a) Editability. Edited images are partially noised and denoised under the target’s memory. Top: two same-identity edits and two cross-identity inputs. Columns show the edit, outputs at three checkpoints, and the target. Outputs retain edits during abstraction and revert toward the target during locking. Bottom: DINOv2 distance to the edit ( Dedit ) increases as distance to the target ( Dorig ) decreases, measured over 20 same-identity target–edit pairs with two samples per pair. (b) One-shot recognition. Each of 300 held-out images (10 per identity) is classified among the 30 identity memories, assigned to whichever yields the lowest denoising error over 20 shared timestep–noise pairs (chance: 1/30). Top: the three best-scoring identities (of 30) for five queries (edits) during abstraction and locking. Bottom: top-1 and top-3 accuracy (median and IQR over identities), over 10 queries per identity. (c) Text–memory retrieval. Each of 15 memories is trained without text cues on a single image generated from a detailed caption. Cues at three specificity levels rank memories by cosine similarity between text-encoder EOS embeddings and mean-pooled memory vectors. Top: the two highest-ranked memories for two identities during abstraction and locking, represented by their training images. Bottom: similarity to the correct memory minus mean similarity to the other memories. In (b) and (c), red frames indicate correct matches. Curves: medians, bands: IQR across target–edit pairs in (a) and identities in (b–c).
Figure 4: Abstraction across models and modalities. (a) Video memory on CogVideoX-2b, each block shows two seeds as filmstrips. During abstraction, characteristic motion, e.g., motion of the car and moving direction of the clouds, stabilize while frame content and layout vary. Finally, every seed reproduces the same target. (b) Image memories on FLUX.2 for three identities (rows), each sampled with four seeds. Semantic content emerges well before verbatim appearance.
Appendix figures & tables18 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 5: Abstraction and locking on real photographs. The external data counterpart of Fig. 1 , same layout. (a) three memories ( M=8 ), each trained on a single FFHQ photograph (red frame) and sampled at held-out noise seeds: prior draws at initialization, other people sharing the target’s type, then the target’s identity with expression, lighting and background still varying, then verbatim recall. (b) bias 2 and variance over all 80 single-image memories at M=8 ( 20 per class; median ± IQR), semantic (DINOv2) and surface (VAE) spaces as in Fig. 1 b. (c) the same distances by memory size over the 40 images trained at every M ( 10 per class).
Figure 6: Memorization trajectories, strongly out-of-distribution targets. Same layout as Fig. 19 , one memory ( M=8 ) per class. Each class shows the run whose ratio of surface to semantic half-decay steps is the median of its class.
Figure 7: Semantic and surface bias 2 on strongly out-of-distribution targets. Median ± IQR over the four targets of each class, in DINOv2 and CLIP (semantic) and VAE (surface) spaces; the in-distribution bank and the photographs of Appendix E.1 are shown for reference.
Figure 8: Instance, class, or generic change. DINOv2 bias 2 of the same samples measured against their own target, against another target of the same class, and against a fixed Gaussian-noise image. Only a gap between the first two curves indicates target-specific semantic information.
Figure 9: Memory-norm growth. Mean per-token norm over training (ID bank, 30 runs per memory size, median with IQR band, log scale). Dotted: the initialization norm ∥c∥≈0.32 .
Figure 10: Norm rescaling. One in-distribution target, M=8 , six noise draws per row. Rows: the step- 300 memory as trained; the same memory scaled to the norm it reaches at step 5,000 ( ×3 ); the step- 5,000 memory at half its norm; the same memory scaled to the step- 300 norm ( ×0.33 ); the step- 5,000 memory as trained.
Figure 11: Pinned norm. The same target and M=8 as Fig. 10 , trained with the per-token norm fixed at 8 (left) or 17 (right); rows are checkpoints, columns six noise draws. At norm 8 the memory never locks in 10,000 steps; at norm 17 it locks by step 1,000 .
Figure 12: Abstraction phase with LoRA : A single SD2.1 native image, generated with a curated caption, is then memorized via a rank-1 correction of the UNet’s weights (cross-attention excluded). Abstraction then locking emerge, in analogy to the experiments reported in the Main Text.
Figure 13: All semantic/surface pairings. Rows: semantic metric (DINOv2 cos, DINOv2 raw, CLIP cos, CLIP raw); columns: surface metric (VAE raw, VAE cos, pixel raw, pixel cos). Solid: bias 2 ; dashed: variance; median over the 30 in-distribution memories at M=8 , bands are interquartile ranges. Same protocol as Fig. 1 b, whose pairing is the top-left panel.
Figure 14: Three training runs of the same memory. One in-distribution target, M=8 , three independent initializations (A is the run of Fig. 1 ); rows are checkpoints, columns the same three noise draws for every run.
Figure 15: Editability controls. (a) Dedit (red) and Dorig (blue) for memory-conditioned reversal at tswitch=800 (solid; mean ± std over 20 target–edit pairs), for the no-memory control (dashed), and Dorig for the original-image control (dotted). (b) Dorig (solid) and Dedit (dashed) for four noising levels. (c) Fraction of outputs that revert to the stored target, keep the edit, or are blurred/failed (sharpness <100 , or both distances >0.5 ).
Figure 16: One-shot recognition controls (30 identities, 300 held-out queries). (a) Median per-identity top-1 accuracy of learned memories (IQR band) versus empty, norm-matched random, equal-norm, and text conditioning. (b) Per-identity top-1 trajectories (grey) with median and IQR. (c) Leave-one-identity-out accuracy (mean and min–max over 30 folds) versus the full gallery. (d,e) Confusion matrices at s=50 and s=5k (rows: true identity; entries: % of that identity’s queries).
Figure 17: Text–memory retrieval controls (30 identities, three cue levels). (a) Cue-specific margin of learned memories, after centering and standardization (dashed), versus norm-matched random memories (mean ± std), untrained memories, and the shuffled-label 95th percentile. (b) Top-1 accuracy (solid) and MRR (dashed) per cue level, with random memories and chance for reference. (c) Matching (solid) versus non-matching (dashed) cue–memory similarity. (d) Margin for the original and the reworded detailed captions.
Figure 18: Additional memorization trajectories, in-distribution. Rows: the first two evaluation seeds of each run (a target’s own generating seed is skipped). Columns: seven stored checkpoints and the training image (red frame). The face was drawn at random among those not shown in Fig. 1 . The animal and the vehicle are the runs whose ratio of surface to semantic half-decay steps is the median of their class.
Figure 19: Memorization trajectories, external targets. Same layout as Fig. 18 on the bank of Appendix E.1 . The animal and the vehicle are the runs whose ratio of surface to semantic half-decay steps is the median of their class.
Figure 20: Generalization at random test seeds. Three face captions at the median of the twelve by peak advantage, and a black dog picture generated by SD2.1, each at three held-out seeds drawn at random. Columns as in Fig. 2 a.
Figure 21: Additional U-turn qualitative examples , extending Fig. 3 with five more same-identity rows (left, red border) and five more different-identity rows (right, purple border). The protocol is the same as in Appendix D.4 . Each row shows, left to right, the edited input xedit , the U-turn output x^ at the untrained memory ( s=0 ), an abstract checkpoint ( s=200 ), a memorized checkpoint ( s=5000 ), and the stored target xorig (blue border). In same-identity rows the memory belongs to the same person shown in the edit; in different-identity rows it belongs to a different person, so the output overwrites the edit with a foreign identity as memorization progresses. Across both groups, the edit is largely preserved at s=0 and s=200 and is overridden by s=5000 , which is consistent with what is observed in Fig. 3 .
Figure 22: Additional examples (CogVideoX-2b). Each column trains one memory on a single target clip on top of the frozen video model and samples it at held-out noise seeds; columns are, left to right, breaking waves , an octopus waving its tentacles, a flying butterfly , and a spinning top . Rows follow the training trajectory top to bottom: draws from the prior at initialization, the abstraction regime, locking, and the training clip (red frame). Each block shows two seeds, each rendered as a filmstrip of four time-ordered frames. In the abstraction regime the memory fixes the scene and its characteristic motion (the wave breaking, the tentacles curling, the butterfly drifting across the sky, the top spinning) while the instance-specific appearance still varies across seeds (the umbrella’s shape, the octopus’ body, the butterfly’s wing pattern, the top’s silhouette). Only during the locking phase does every seed converge to the target clip.
Memorization in generative models studies when models retain training examples, how to detect their recall, and how to limit it without losing utility.
Department of Mathematics, University of California, Los Angeles, CA 90095, USA. · Elmore Family School of Electrical and Computer Engineering, Purdue University, West Lafayette, IN 47907, USA.