Abstract Deep neural networks (DNNs) exhibit a remarkable ability to generalize from real data while also possessing the capacity to memorize completely random labels. This paper investigates the underlying differences between these two behaviors. By analyzing gradient magnitudes and synthesizing class-representative patterns via GAN-regularized activation maximization, the authors demonstrate that while models converge to similar functional mappings on real data ("One way to Learn"), they develop unique, idiosyncratic mappings when fitting random noise ("N ways to Memorize"). The study identifies distinct "hunting" and "fitting" phases in the memorization process, contrasting with the immediate fitting observed in standard learning.
Introduction
In the field of Deep Learning, it has been well-established since at least 2016 that over-parametrized models can fit random noise with 100% accuracy. This poses a significant theoretical puzzle: if a model has the capacity to memorize anything, why does it typically prioritize learning useful patterns that generalize to unseen data?
In "Neural Network Memorization Dissection," Jindong Gu and Volker Tresp seek to "dissect" this behavior. They investigate whether the internal mechanisms a network employs to learn a legitimate category (e.g., a "cat") are the same as those used to memorize a random image arbitrarily labeled as a "cat." Specifically, they explore whether different models—varying in architecture or initialization—converge to the same functional logic when reaching 100% accuracy on the same dataset.
Methodology
The authors employ two primary techniques to analyze the internal dynamics of DNNs during training:
- Gradient Magnitude Analysis: By tracking the magnitude of gradients at the input layer, the researchers identify different phases of the learning process. This metric reveals how "consistent" the updates are across a batch of data, indicating whether the network has found a common direction for optimization.
- GAN-Regularized Activation Maximization: To compare the internal representations of two different models ($f^1$ and $f^2$), the authors synthesize "ideal" input patterns. They use a Generative Adversarial Network (GAN) to ensure these synthesized images remain within a realistic data manifold. They then find an input that highly activates a specific class in model $f^1$ and measure the Dissimilarity (using KL-Divergence) by checking if that same input activates the same class in model $f^2$.
The Hunting vs. Fitting Stages
A key discovery of the paper is the existence of a "hunting stage" unique to memorization. When training on random labels, models initially struggle. Because the labels are arbitrary, gradients from different images in a batch often conflict and cancel each other out, leading to small gradient magnitudes and stagnant accuracy.
Only after several epochs does the network find a way to map these disparate images to similar internal representations, entering the "fitting stage" where accuracy finally climbs to 100%. In contrast, when trained on true labels, models skip the hunting phase entirely. The inherent patterns in the data provide consistent gradients from the start, allowing the model to enter the fitting stage immediately.
One Way to Learn, N Ways to Memorize
The study reveals a striking dichotomy in how models reach convergence:
- One Way to Learn: When trained on true labels, different architectures (such as VGG and ResNet) and different random initializations all converge to very similar functional mappings. They are all "learning" the same underlying features of the data distribution. Dissimilarity scores between these models are consistently low (near 0.1).
- N Ways to Memorize: When forced to fit random labels, every model—and even the same model with a different starting seed—finds a completely different way to memorize the noise. There is no "universal" way to map random noise to labels; each model creates its own unique, non-transferable "lookup table." Dissimilarity scores in this scenario jump significantly (often > 1.5).
Visualizations support this: patterns synthesized to activate "True Label" models look like recognizable objects (e.g., a bird or a ship). Patterns synthesized for "Random Label" models appear as unrecognizable textures or noise and fail to activate the same classes in other models trained on the same random data.
Conclusion
The authors conclude that DNNs are fundamentally biased toward simple, shared patterns. In true data, these patterns lead to consistent gradients that allow for efficient learning. Memorization is a fallback mechanism that is highly model-specific. While this study provides deep insights using CIFAR-10, future work is needed to determine if these "N ways to memorize" hold true for larger datasets like ImageNet and to develop a more formal mathematical definition of the "simple patterns" that DNNs prioritize.
Summary updated