Generative models now write working code, produce realistic images, and hold long conversations, yet the mechanisms behind their intelligence still evade our understanding. This thesis explores that puzzle through Associative Memory (AM), in which patterns are stored as energy minima and retrieved through attractor dynamics. Beyond their capacity, AMs form new minima known as spurious states, long regarded as a failure of memory. We argue that this failure is where creativity begins, and that memorization and generalization can coexist as outcomes of one retrieval process. First, we show that diffusion models behave as AMs. With little data, a diffusion model forms a distinct basin of attraction around each training sample. As the data grows, these basins shrink, and spurious states emerge as attractors that blend stored samples yet match none of them. They are the first signs of generative capability. We characterize this transition by measuring the volume, energy, and curvature of these basins across datasets and architectures, including Stable Diffusion. We then turn to language and move beyond the energy-based view of AM. We show that uniform-state discrete diffusion models are AMs capable of retrieving unseen data, with basins of attraction that arise from conditional likelihood maximization alone. As the training set grows, basins around training examples contract while basins around unseen examples expand, until corrupted test sentences are recovered as reliably as training ones. Conditional entropy exposes this coexistence within a single sequence and cheaply diagnoses where a model lies along the transition. Together, these results suggest that AM is a general principle defined by basins of attraction, and that memorization and generalization can coexist within one model. AM thus offers a framework for asking when a generative model recalls and when it creates.
Figures & tables
Figure 2.1 : The relationship between energy and probability. The energy assigned to each state (left) and the probability of the same states under Equation 2.7 (right) are shown. States with low energy have high probability, as indicated by the dashed gray arrow.
Figure 2.2 : The effect of training an EBM on the energy landscape around the data points (shown in black). Before training, the data may lie anywhere on the landscape, including at its highest points. After training, the data sit at the lowest points, as local minima of the learned energy.
Figure 2.3 : The forward process of a diffusion model. A clean image x0 is progressively corrupted by Gaussian noise over T steps, until xT is indistinguishable from pure noise (top row). The corresponding marginal distribution (bottom row) evolves from the complex and multimodal data distribution pdata toward a simple Gaussian. Generation reverses this process. It starts from a sample of the Gaussian and removes the noise step by step until a sample resembling the data is obtained. Reproduced from: Krotov, D., Hoover, B., Ram, P., & Pham, B. (2025). Modern methods in associative memory . arXiv. https://doi.org/10.48550/arXiv.2507.06211
Figure 2.4 : An illustration of the retrieval process in a high-capacity AM network. Given a query x , the network performs gradient descent on its energy function with respect to the query. Because the energy is a Lyapunov function ( Lyapunov, 1992 ) , the dynamics are guaranteed to settle at a fixed point, here the memory x∗ closest to the query. The animal images are retrieved from the ImageNet-1K dataset ( Deng et al., 2009 ) .
Figure 2.5 : The energy landscape of a classical AM network (left) and of a DenseAM (right). Memories in classical AM networks interfere with one another much more strongly than in DenseAMs. This interference produces spurious patterns (shown as ξ′ ), which can be combinations of stored patterns or random-like states. In the classical network (left), they are shown as an interpolation between two stored patterns, and they hamper retrieval. DenseAMs instead use higher-order interaction functions, which reduce the interference among memories. The animal images are retrieved from the ImageNet-1K dataset ( Deng et al., 2009 ) .
Figure 2.6 : An illustration of the DenseAM update rule ( 2.47 ). The query x is compared with the memories ξ , which serve as both the key matrix K and the value matrix V . The softmax assigns a weight to each memory according to its similarity to the query x , and the weighted sum of the values retrieves the closest memory x∗ . The animal images are retrieved from the ImageNet-1K dataset ( Deng et al., 2009 ) .
Figure 3.1 : Schematic illustration of the energy landscape and the sample type at each phase of the transition. (A) Behavior of the energy landscape around generated samples as the size of the training dataset is increased. In the small data regime, the model stores the training data as local minima of the energy. When the amount of training data exceeds the model’s memory capacity, spurious patterns are formed and training data points are no longer energy minima. Subsequent increase of the training data size leads to the generalization phase, defined by the formation of continuous manifold of the low energy states.(B) Examples of memorized, spurious, and generalized samples in their respective columns for four datasets, MNIST ( Deng, 2012 ) , FASHION-MNIST ( Xiao et al., 2017 ) , CIFAR-10 ( Krizhevsky, 2009 ) , and LSUN-CHURCH ( Yu et al., 2015 ) . See Section 3.3 for our definitions of these three sample types. For each target image (shown on the left), its top-4 nearest neighbors from the training set (top row) and the synthetic set (bottom row) are shown to highlight the novelty and commonality of the target image with respect to its training and synthetic sets. To help highlight the novelty of spurious patterns, we provide rectangular markers guiding where the features differ in their corresponding nearest neighbors.
Figure 3.2 : Different sample types identified in accordance to the bi-modality in distance histograms for CIFAR-10 ( Krizhevsky, 2009 ) . The grey histogram shows the distances between synthetic samples and their nearest neighbors from the synthetic set S′ (which is 4 x the size of the training set). The threshold δs defines a boundary between the two peaks. The olive histogram depicts the distances from the synthetic samples to their closest neighbor from the training set S , with threshold δm separating the two peaks. Memorized samples are located in the left peak of the olive histogram, below δm . In contrast, generalized and spurious samples appear to the right of δm in the olive histogram. Examples of the generated samples forming each of the four peaks of the histograms are shown in the inset frames. For each generated sample, top-4 nearest neighbors from the training set are shown in the top row, and those from the synthetic set are shown in the bottom row. Training set size K=7310 is used in this figure, but the discussed phenomena are general and largely independent of this specific value. The fraction of the memorized, spurious, and generalized samples in the pool of all generated samples is shown in the bottom left panel as a function of the training set size. The inset shows amplified spurious fraction (green curve).
Figure 3.3 : Fractions of memorized, spurious, and generalized samples in synthetic sets across training set sizes and various datasets. As the training data size K increases, memorization decreases and the fraction of generalized samples steadily increases (top row). The fraction of spurious patterns rises and decreases at the boundary between the memorization and generalization phases (bottom row). The synthetic set size at each point is 4 x its respective training set size.
Figure 3.4 : Volume of the basins of attraction for three distinct sample types and various datasets as the training set size increases. The average log-volume is computed using Eq. ( 3.9 ). In general, memorized samples have the largest basin volume at the beginning of the transition. However, as the training set size increases, their basin volume decreases and approaches that of the spurious samples’ volume. Statistically, memorized and spurious samples have larger basin volume than that of the generalized samples across all datasets. The shaded regions indicate the standard deviation of the log-volume.
Figure 3.5 : Spectral analysis of the energy curvature for different sample types and various datasets. The shaded region is the standard deviation of the singular values. The average singular values computed for the three distinct sample types are shown in the top row. Memorized and spurious samples generally exhibit higher energy curvature, characterized by fewer near-zero singular values than generalized samples. The average singular values computed for the training data points are shown in the bottom row, where the changing color scheme denotes small to large data sizes, suggesting a drop in curvature (indicated by the decrease in singular values) as K increases.
Figure 3.6 : Energy landscape evolution for the 2D toy model as training data size K increases. Models trained at K∈{2,9,1000} , using the VE-SDE based diffusion pipeline from Song, Sohl-Dickstein, et al. (2021) , with training data (represented as pink triangles) sampled from the unit circle (shown in gray). Generated samples are shown alongside the learned score field or neural network, aligned with the negative gradient of the energy ( 3.3 ). Hierarchical clustering identifies structure within the generations, with the generated samples’ centroids (represented as cyan crosses) are visualized by their numerical value of the energy at the location of that centroid. The energy values of the training points are also shown for memorized samples and data points located close to spurious samples. The right-most panel shows the exact solution as K→∞ derived in Eq. ( 3.15 ). As K grows, the model initially memorizes individual data points, forming isolated basins. Around K=9 , spurious patterns, distinct low-energy attractors not present in the data, emerge and signal the onset of generalization. At large K , the model enters a fully generalized regime, where low-energy states lie on a flat continuous manifold. The visualization is shown at t=10−5 .
Figure 3.7 : Spectral analysis of energy curvature for different candidate examples of the three distinct sample types in Stable Diffusion model trained on LAION ( Schuhmann et al., 2022 ) . Here, each candidate exhibits different spectra signatures. The candidate memorized sample has much larger singular values, while the candidate generalized sample has much smaller ones. The selected and possibly spurious candidates have larger singular values than the candidate generalized sample, but smaller than that of the candidate memorized sample. The common trait between candidate memorized and spurious samples is that both are stable attractors, as demonstrated by their repeated generations given 4 different initial points (or noise vectors) and the associated text-prompt. The y-axis is clipped at the value of 1500 to better contrast the shown examples’ spectra.
Training Data Size
Dataset
Point A
Point B
Total
MNIST
4000
32000
60000
CIFAR-10
2000
16000
50000
LSUN-CHURCH
2000
16000
126227
FASHION-MNIST
4000
16000
60000
Table 3.1 : A table showing the critical points A and B of the memorization-generalization transition for each dataset. We use 30 linearly spaced points between A and B to finely characterize the memorization-to-generalization transition.
Figure 3.8 : The fractions of memorized, spurious, and generalized samples in synthetic sets across different training sizes for CIFAR-10 ( Krizhevsky, 2009 ) and various model’s widths. As the training data size K increases, memorization decreases while the emergence of spurious patterns follows and the fraction of generalized patterns steadily increase (top row). The fraction of spurious patterns rises and decreases at the boundary between the memorization and generalization phases (bottom row). Additionally, with a smaller number of parameters, the memorization-generalization transition happens at an earlier stage (or smaller K ), since the model has a memorization capacity. In contrast, as the model’s size increases, the transition happens at an later stage (or larger K ), where it is able to memorize more training data. The numbering, e.g., 64 , 96 , and 128 , denotes the initial latent dimension of the U-Net, see Table ( 3.3 ).
Figure 3.9 : The fractions of memorized, spurious, and generalized samples in synthetic sets across different training sizes for LSUN-CHURCH ( Yu et al., 2015 ) and various model’s widths. As the training data size K increases, memorization decreases while the emergence of spurious patterns follows and the fraction of generalized patterns steadily increase (top row). The fraction of spurious patterns rises and decreases at the boundary between the memorization and generalization phases (bottom row). Additionally, with a smaller number of parameters, the memorization-generalization transition happens at an earlier stage (or smaller K ), since the model has a memorization capacity. In contrast, as the model’s size increases, the transition happens at an later stage (or larger K ), where it is able to memorize more training data. The numbering, e.g., 64 , 96 , and 128 , denotes the initial latent dimension of the U-Net, see Table ( 3.3 ).
Figure 3.10 : Memorization-Generalization transition plots for the CIFAR-10 dataset comparing 4× and 8× synthetic set sizes. The memorization-generalization transition is computed with 4× synthetic sets (left) and with 8× synthetic sets (right) for the same training data sizes. With the larger synthetic sets, more spurious patterns are detected around the peak of the transition. However, the overall trend is maintained, as these patterns quickly rise during the co-existence of memorization and generalization and fall as generalization becomes the dominant phase. Both figures use the same memorized and spurious threshold values detailed in Table ( 3.3 ).
Figure 3.11 : Different sample types across the memorization-to-generalization transition for LSUN-CHURCH ( Yu et al., 2015 ) , defined by the spurious and memorized thresholds, δs and δm . The grey histogram shows the distances between synthetic samples and their nearest neighbors from the synthetic set S′ . The threshold δs is defined as a boundary between the two peaks. The olive histogram depicts the distances from the synthetic samples to their closest neighbor from the training set S , with threshold δm separating the two peaks. The threshold δm is chosen much stricter here such that it works well for all training dataset sizes via visual inspection. Memorized samples are located in the left peak of the olive histogram, below δm . In contrast, generalized and spurious samples appear to the right of δm (olive histogram). Examples of the generated samples forming each of the four peaks of the histograms are shown in the inset frames. For each generated sample top-4 nearest neighbor images from the training set are shown in the top row, and top-4 nearest neighbors from the synthetic set are shown in the bottom row. Training set size K=4896 was used in this figure (at the peak of the frequency of spurious states), but phenomena discussed are generic and largely independent of this specific value. The fraction of the memorized, spurious, and generalized samples in the pool of all generated samples is shown in the bottom left panel as a function of the training set size. The inset shows amplified spurious fraction (green curve).
Figure 3.12 : Different sample types across the memorization-to-generalization transition for FASHION-MNIST ( Xiao et al., 2017 ) , defined by the spurious and memorized thresholds, δs and δm . The grey histogram shows the distances between synthetic samples and their nearest neighbors from the synthetic set S′ . The threshold δs is defined as a boundary between the two peaks. The olive histogram depicts the distances from the synthetic samples to their closest neighbor from the training set S , with threshold δm separating the two peaks. Memorized samples are located in the left peak of the olive histogram, below δm . In contrast, generalized and spurious samples appear to the right of δm (olive histogram). Examples of the generated samples forming each of the four peaks of the histograms are shown in the inset frames. For each generated sample top-4 nearest neighbor images from the training set are shown in the top row, and top-4 nearest neighbors from the synthetic set are shown in the bottom row. Training set size K=7724 was used in this figure (at the peak of the frequency of spurious states), but phenomena discussed are generic and largely independent of this specific value. The fraction of the memorized, spurious, and generalized samples in the pool of all generated samples is shown in the bottom left panel as a function of the training set size. The inset shows amplified spurious fraction (green curve).
Figure 3.13 : Different sample types across the memorization-to-generalization transition for MNIST ( Deng, 2012 ) , defined by the spurious and memorized thresholds, δs and δm . The grey histogram shows the distances between synthetic samples and their nearest neighbors from the synthetic set S′ . The threshold δs is defined as a boundary between the two peaks. The olive histogram depicts the distances from the synthetic samples to their closest neighbor from the training set S , with threshold δm separating the two peaks. Memorized samples are located in the left peak of the olive histogram, below δm . In contrast, generalized and spurious samples appear to the right of δm (olive histogram). Examples of the generated samples forming each of the four peaks of the histograms are shown in the inset frames. For each generated sample top-4 nearest neighbor images from the training set are shown in the top row, and top-4 nearest neighbors from the synthetic set are shown in the bottom row. Training set size K=21379 was used in this figure, which is slightly past the peak of the frequency of spurious states. The phenomena discussed are generic and largely independent of this specific value. The fraction of the memorized, spurious, and generalized samples in the pool of all generated samples is shown in the bottom left panel as a function of the training set size. The inset shows amplified spurious fraction (green curve).
Figure 3.14 : Average singular value spectra of the approximated score’s Jacobian for memorized, spurious, and generalized samples from diffusion models trained on the LSUN-CHURCH ( Yu et al., 2015 ) dataset, shown across 38 increasing training data sizes K . The plots reveal a clear geometric hierarchy in the intermediate training regime, where memorized samples consistently exhibit the highest curvature (largest singular values), followed by spurious, and finally generalized samples. As the model enters the full generalization phase at large K , the average spectra for all three sample types become very distinguishable. Shaded region is the standard deviation of the singular values of different samples of each category.
Figure 3.15 : Average singular value spectra of the approximated score’s Jacobian for memorized, spurious, and generalized samples from diffusion models trained on the FASHION-MNIST ( Xiao et al., 2017 ) dataset, shown across 38 increasing training data sizes K . The plots reveal a clear geometric hierarchy in the intermediate training regime, where memorized samples consistently exhibit the highest curvature (largest singular values), followed by spurious, and finally generalized samples. As the model enters the full generalization phase at large K , the average spectra for all three sample types become very distinguishable. Shaded region is the standard deviation of the singular values of different samples of each category.
Figure 3.16 : Average singular value spectra of the approximated score’s Jacobian for memorized, spurious, and generalized samples from diffusion models trained on the MNIST ( Deng, 2012 ) dataset, shown across 38 increasing training data sizes K . The plots reveal a clear geometric hierarchy in the intermediate training regime, where memorized samples consistently exhibit the highest curvature (largest singular values), followed by spurious, and finally generalized samples. As the model enters the full generalization phase at large K , the average spectra for all three sample types become very distinguishable. Shaded region is the standard deviation of the singular values of different samples of each category.
Figure 3.17 : Average singular value spectra of the approximated score’s Jacobian for memorized, spurious, and generalized samples from diffusion models trained on the CIFAR-10 ( Krizhevsky, 2009 ) dataset, shown across 38 increasing training data sizes K . In contrast to the clear separation as seen in other datasets, the spectra for all three sample types remain heavily overlapped throughout the entire transition from memorization to generalization. However, as the model enters the full generalization phase at large K , the average spectra for all three sample types become less indistinguishable. Shaded region is the standard deviation of the singular values of different samples of each category.
Figure 3.18 : Additional examples of candidate memorized, spurious, and generalized samples from Stable Diffusion trained on LAION dataset ( Schuhmann et al., 2022 ) , each corresponding to a distinct curvature signature. The candidate memorized sample has much larger singular values, while the candidate generalized sample has much smaller ones. The selected possible spurious samples have larger singular values than the candidate generalized sample, but much less in contrast to the candidate memorized sample. The common trait between candidate memorized and spurious samples is that both are stable attractors, as demonstrated by their repeated similar generations given different initial points (or noise vectors) and the conditioning on text-prompt. The y-axis is clipped at the value of 1500 to better contrast the shown examples’ spectra. The associated training image for each prompt can be found in Carlini, Hayes, et al. (2023) , Webster (2023) , and Wen et al. (2024) and on our code repository . For copyright reasons, we omitted the inclusion of original training images in this figure.
Figure 3.19 : Circular interpolation of a target image x1 and a reference image x2 over α∈{0,…,2π} for different datasets.
Figure 3.20 : Average energy gap of each sample type and the training samples for the four datasets as the training data size K grows, computed using Eq. ( 3.47 ). Gaps are measured relative to training samples, whose energy is set to zero since there is no gap to itself. A maximum of 512 samples per type is used at each K , or the full set is used instead if there are fewer than 512 points. Shaded regions show standard deviation of the gap values. With the exception of LSUN-CHURCH, the relative energy of the memorized samples matches that of the training data samples at K=2 , but quickly diverges as K increases. Similarly, spurious samples’ relative potential resembles that of the training data samples during the intermediate phase of the memorization-generalization phase. However, the potential quickly diverges as the later stages of generalization are initiated and consequently, the gap between generalized and training data samples’ relative energy significantly decreases.
Figure 4.1 : Basins around training examples shrink and basins around test examples expand as the training dataset size increases. (A) Textual examples showing two Tiny ( ∼ 24M) UDDMs’ token recovery at noise level t=0.2 , where each is trained on two different training dataset sizes. With a small training dataset, the model fails to recognize unseen test sequences and alters all tokens. With a larger training set, the tokens of unseen sequences, however, become stable and recoverable by the sampling process. (B) Average total token recovery rates (%), including both non-corrupt and corrupted tokens, for training (left) and test (right) sequences across varying corruption levels. Line colors indicate the fractions of the training dataset used (ranging from small to large). As data scales, the model’s ability to flawlessly recover training examples drops (indicating shrinking basins), while its recovery rate of unseen test examples improves (indicating expanding basins). The convergence of these rates at large training set sizes (red curves) marks the transition from memorization to generalization. Deterministic (greedy) sampling was used across these experiments to isolate from stochastic noise.
Figure 4.2 : The convergence of corrupted training and test token recovery rates marks the phase transition from memorization to generalization. The plots display the average token recovery rate (%) as the fraction of the training dataset grows, comparing the model’s ability to denoise perturbed tokens (using stochastic sampling) from the training set (solid lines) against unseen test sequences (dashed lines) across various perturbation levels based on time t on the LM1B dataset ( Chelba et al., 2014 ) for the Tiny ( ∼ 24M, left), Small ( ∼ 135M, middle), and Medium ( ∼ 384M, right) models. In the limited-data regime, the model exhibits memorization, perfectly recovering training samples while failing on test data. As the dataset expands, the recovery rates for training and test sequences converge to an identical recovery rate, demonstrating that unseen samples have become stable attractors. Notably, the model’s size dictates the timing of this shift, where the Medium model requires a significantly larger fraction of data to trigger the transition, effectively prolonging the memorization phase.
Figure 4.3 : Perplexity trends during the memorization-to-generalization transition. Evaluation of the Tiny (left), Small (middle), and Medium (right) UDDMs as the fraction of the training set increases. The vertical dashed lines roughly illustrate the transition point where the model switches from memorization to generalization. Perplexity starts at a very low value during the memorization regime, increases as the training dataset size grows, and it then decreases to a lower value upon reaching generalization. The horizontal dashed lines highlight the converging perplexity value, showing that scaling up the model leads to improved perplexity at the end of this transition. The precise position of each vertical line is the last point where the recovery rate is 100% for training tokens in Figure 4.2 . Perplexity is computed using GPT-2 Large ( Radford et al., 2019 ) as the critic model.
Figure 4.4 : Token-level conditional entropy highlights different token recovery behaviors. (A) Textual examples showing how two Medium UDDMs, trained on two different training dataset sizes, recover corrupted training sequences at noise level t=0.5 . The model trained on a small training set perfectly memorizes and restores the original text. In contrast, the model trained on a large training set recovers some original words but actively alters others to synthesize a novel sentence. (B) Density histograms of conditional entropy for individual tokens from Figure 4.2 for the Tiny (left), Small (middle), and Medium (right) models. Successfully recovered tokens consistently demonstrate much lower entropy, indicating higher model confidence. While this gap between recovered and unrecovered tokens narrows in larger models, a surprising number of highly stable, low-entropy tokens persist even during the generalization phase. The y -axis is clipped to better contrast these two token types.
Figure 4.5 : Sequence conditional entropy highlights the memorization to generalization transition. The histograms compare the sequence entropy distributions of training and synthetic (or generated) sequences respectively, for three selected fractions of the training set for the Medium UDDMs. At a very low fraction of the training set, the conditional entropy of training sequences is near zero, aligning very well alongside the conditional entropy of many generated sequences, indicating the regime of memorization. However, as the fraction of the training set reaches the total, the synthetic and training distributions of the sequence conditional entropy converge, signifying generalization. See Section 4.7.5 for the full range of histograms across various model sizes.
Model Type
Hyperparameters
Tiny
Small
Medium
Hidden Size
256
768
1024
Conditioning Size
128
128
128
Length
128
128
128
Num. of Blocks
8
12
24
Num. of Heads
8
12
16
Table 4.1 : A table showing hyperparameters of the UDDMs for the Tiny , Small , and Medium sets. These variables are obtained from Sahoo et al. (2025) . Scale by sigma indicates that the model takes the inverse temperature or the appropriate diffusion scheduling parameter at time t instead of the typical approach of conditioning on t .
Figure 4.6 : The implicit maximization of the margin guarantees large basins of attraction. Both panels refer to an associative memory model trained with conditional likelihood on random bit sequences. Average total bit recovery rates for training sequences across varying corruption levels are shown in the left panel. Line colors indicate the sizes of the training datasets used. This panel captures the same qualitative memorization phenomenon of Figure 4.1 . The right panel shows the basin size ρc(γ) of the trained model (red curve) compared to the margin-derived lower bound, evaluated both at the idealized κmax(γ) and at the empirically achieved κachieved(γ) (blue and green curves, respectively). The measured basin size remains above the achieved-margin bound at every load, confirming margin maximization is sufficient to produce basins of the predicted size. The red points correspond to the critical noise level for which the token recovery rate drops below 0.99. Each point is the average of five samples, and the error bars are too small to be visible.
Figure 4.7 : Average conditional entropy for training versus synthetic sequences. As the training dataset size increases, the average (over sequences and tokens) conditional entropy for both training and synthetic (or generated) sequences naturally rises for the Tiny (left), Small (middle), and Medium (right) models. Here, we plot the dashed horizontal line in each plot to show the location of the separation between the average conditional entropies of training and synthetic sequences. Initially, there exists an “entropy gap” which separates these two sample types given small fractions of the training set, depicting the UDDM’s uncertainty during generation. However, scaling up the model’s size narrows this entropy gap, demonstrating that higher parameter counts increase the model’s confidence in its own generated text during the generalization regime.
Figure 4.8 : Shrinkage and expansion of training and test samples’ basins of attraction during the memorization-to-generalization transition for various UDDM sizes. Total token recovery rates (%), including non-corrupt and corrupted, are shown across varying levels of corruption for training sequences (left column) and unseen test samples (right column), with the Tiny ( ∼ 24M), Small ( ∼ 135M), and Medium ( ∼ 384M) models in the top, middle, and bottom rows, respectively. The color gradient represents the fraction of the training dataset used, ranging from small to large. As the training dataset grows, the recovery rate for training examples diminishes, reflecting a shrinkage in the basins of attraction around explicitly memorized points. Simultaneously, the recovery rate for unseen test samples improves, demonstrating an expansion of the basins of attraction around novel examples within the broader data distribution. The convergence of these recovery rates at large dataset sizes (red curves) signifies that unseen test samples have effectively become stable attractors, marking the shift from pure memorization to generalization.
Figure 4.9 : An illustration of the model’s ability to recover tokens from perturbed sequences on training examples at three different fractions of the training dataset and sizes of the UDDMs. Results are shown for the Tiny ( ∼ 24M, top), Small ( ∼ 135M, middle), and Medium ( ∼ 384M, bottom) models. Perturbation is computed at t=0.5 and the typical stochastic reverse process is performed afterwards. As the training dataset size increases, the model’s ability to recover perturbed tokens becomes worse and in contrast, its generative ability improves. Meanwhile, there is no distinction among the various UDDMs’ sizes, where the overall trend of memorization and generalization in relation to the training dataset size persists.
Figure 4.10 : An illustration of the model’s ability to recover tokens from perturbed sequences on test examples at different fractions of the training dataset and sizes of UDDMs. Results are shown for the Tiny ( ∼ 24M, top), Small ( ∼ 135M, middle), and Medium ( ∼ 384M, bottom) models. Perturbation is computed at t=0.5 and the stochastic reverse process is performed afterwards. In the beginning, the model is unable to recognize unperturbed unseen test tokens, where it often changes them to other tokens. However, as the training dataset size increases, the UDDM is more likely to maintain the unperturbed test tokens rather than ‘flipping’ them.
Figure 4.11 : An illustration of the density of conditional entropy for two categories of tokens, recovered and unrecovered, computed at t=0.25 for the Tiny model. The subplots are ordered by the fraction of training dataset, ranging from 10−4 (top-left) to 1.0 (bottom-right). As the fraction of training data increases, recovered tokens concentrate near zero entropy (high confidence), while unrecovered tokens exhibit a broad distribution at higher entropy.
Figure 4.12 : An illustration of the density of conditional entropy for two categories of tokens, recovered and unrecovered, computed at t=0.25 for the Small model. The subplots are ordered by the fraction of training dataset, ranging from 10−4 (top-left) to 1.0 (bottom-right). As the fraction of training data increases, recovered tokens concentrate near zero entropy (high confidence), while unrecovered tokens exhibit a broad distribution at higher entropy.
Figure 4.13 : An illustration of the density of conditional entropy for two categories of tokens, recovered and unrecovered, computed at t=0.25 for the Medium model. The subplots are ordered by the fraction of training dataset, ranging from 10−4 (top-left) to 1.0 (bottom-right). As the fraction of training data increases, recovered tokens concentrate near zero entropy (high confidence), while unrecovered tokens exhibit a broad distribution at higher entropy.
Figure 4.14 : An illustration of the evolution of the density of the average conditional entropy for the probabilities of training and synthetic sequences respectively, computed at t=10−5 using the Tiny models, as the training dataset size grows. When the fraction of training set is small, there exists a separation in the average conditional entropies of training and synthetic samples. However, as the training dataset size grows, this separation is reduced and the conditional entropy of synthetic samples becomes similar to that of the training samples.
Figure 4.15 : An illustration of the evolution of the density of the average conditional entropy for the probabilities of training and synthetic sequences respectively, computed at t=10−5 using the Small models, as the training dataset size grows. When the fraction of training set is small, there exists a separation in the average conditional entropies of training and synthetic samples. However, as the training dataset size grows, this separation is reduced and the conditional entropy of synthetic samples becomes similar to that of the training samples.
Figure 4.16 : An illustration of the evolution of the density of the average conditional entropy for the probabilities of training and synthetic sequences respectively, computed at t=10−5 using the Medium models, as the training dataset size grows. When the fraction of training set is small, there exists a separation in the average conditional entropies of training and synthetic samples. However, as the training dataset size grows, this separation is reduced and the conditional entropy of synthetic samples becomes similar to that of the training samples. Due to larger model size, the UDDM exhibits stronger memorization (and chaotic) behaviors, where the two distributions initially merge at certain fractions of the training dataset and later diverge. Nonetheless, with the full training set, both distributions overlap each other at the end.
Figure 4.17 : Perplexity trends during the memorization-to-generalization transition together with corrupted token recovery. This figure demonstrates the alignment of phase transitions across perplexity (top row) and the average corrupt token recovery rate (bottom row) for the Tiny (left column), Small (middle column), and Medium (right column) models. The vertical dashed lines roughly represent the critical transitional points where the perplexity (calculated using GPT-2 Large ( Radford et al., 2019 ) ) aligns with the initial decrease of corrupt token recovery rate for training and the increase of test tokens’ recovery rate. This alignment of the two metrics showcases the usefulness of the token recovery rate in determining whether generalization has been reached in UDDMs.
Memorization in generative models studies when models retain training examples, how to detect their recall, and how to limit it without losing utility.
Yardi School of Artificial Intelligence, Indian Institute of Technology Delhi · Department of Computer Science and Engineering, Indian Institute of Technology Delhi · Jawaharlal Nehru Centre for Advanced Scientific Research +2