What do larger image classifiers memorise?

Michal Lukasik, Vaishnavh Nagarajan, Ankit Singh Rawat, Aditya Krishna Menon, Sanjiv Kumar

Abstract

The success of modern neural networks has prompted study of the connection between memorisation and generalisation: overparameterised models generalise well, despite being able to perfectly fit (“memorise”) completely random labels. To carefully study this issue, Feldman (2019) proposed a metric to quantify the degree of memorisation of individual training examples, and empirically computed the corresponding memorisation profile of a ResNet on image classification benchmarks. While an exciting first glimpse into what real-world models memorise, this leaves open a fundamental question: do larger neural models memorise more? This aligns with the common practice of training models of different sizes, each offering different cost-quality trade-offs: while larger models are typically observed to have higher quality, it is of interest to understand whether this is merely a consequence of them memorising larger numbers of input-output patterns. We present a comprehensive empirical analysis of this question on image classification benchmarks. We find that training examples exhibit an unexpectedly diverse set of memorisation trajectories across model sizes: most samples experienced decreased memorisation under larger models, while the rest exhibit cap-shaped or increasing memorisation. We show that various proxies for the Feldman(2019) memorisation score fail to capture these fundamental trends. Lastly, we find that knowledge distillation — an effective and popular model compression technique — tends to inhibit memorisation, while also improving generalisation. Specifically, memorisation is mostly inhibited on examples with increasing memorisation trajectories, thus pointing at how distillation improves generalisation.

Introduction

In the era of overparameterised neural networks, it is well-established that models can perfectly fit random labels while still performing well on unseen data. However, a fundamental question remains: as we scale up model size, do we simply observe a linear increase in memorisation? Contrary to the intuition that bigger models simply "memorise more," this research reveals that as image classifiers grow, their memorisation of training data follows complex, often non-linear trajectories. While larger models polarise the dataset—making easy examples easier and hard examples harder—they do not uniformly increase memorisation across all samples.

Methodology and Datasets

The study employs the stability-based memorisation score proposed by Feldman (2019). This metric defines memorisation as the difference between a model's accuracy on a sample when it is included in the training set versus when it is not. To make this computationally feasible, the authors use a "leave-one-out" approximation, training hundreds of models on different random subsets (e.g., 70%) of the data for each architecture.

The researchers evaluated these scores across different model depths and widths within the ResNet and MobileNet families. Experiments were conducted on four standard image classification benchmarks: CIFAR-10, CIFAR-100, ImageNet, and Tiny-ImageNet.

Diverse Memorisation Trajectories

A key finding of this work is that training examples exhibit a diverse set of memorisation trajectories as model capacity increases. Rather than a uniform increase, the authors identified four distinct patterns based on the nature of the images:

  • Least Changing: These are typically easy, unambiguous images (e.g., a clear picture of a sunflower) that are learned early and maintain low memorisation scores.
  • Decreasing/Cap-shaped: These represent hard but "clean" images. As model capacity grows, they eventually become "learnable" through generalisation, causing their memorisation scores to peak and then decline.
  • Increasing: These are often ambiguous or mislabeled images (e.g., a "sunflower" label on an image dominated by a bee). Larger models use their extra capacity to force-fit these noisy labels, leading to higher memorisation scores.
Memorisation trajectories for different types of training examples across ResNet model depths.

As models get larger, the distribution of memorisation scores becomes increasingly bi-modal. Most samples move toward a score of 0 (learned via generalisation), while a small subset moves toward a score of 1 (memorised due to noise or extreme ambiguity).

The Role of Knowledge Distillation

The study further investigates how Knowledge Distillation (KD)—a popular model compression technique—affects these profiles. The results indicate that KD acts as a powerful regulariser by specifically inhibiting the memorisation of ambiguous and mislabeled samples.

When distilling from a larger teacher (e.g., ResNet-110) to a smaller student (e.g., ResNet-32), 97.2% of the images that showed an "increasing" memorisation trajectory saw their scores drop. This suggests that KD improves generalisation precisely because it prevents the student from wasting capacity on memorising the "wrong" things that the teacher model has already flagged as uncertain.

Conclusion and Future Work

This analysis demonstrates that larger models do not merely memorise more; they distinguish more effectively between learnable patterns and noise. Common metrics like C-scores and prediction depth often fail to capture this bi-modal nuance, highlighting the need for more sophisticated proxies for memorisation. While this study focuses on image classification, future work is needed to determine if these trends hold in other domains, such as Natural Language Processing, and to develop more computationally efficient ways to track these trajectories in massive-scale models.

Summary updated

BibTeX
@article{lukasik2024what,
  author = {Michal Lukasik and Vaishnavh Nagarajan and Ankit Singh Rawat and Aditya Krishna Menon and Sanjiv Kumar},
  title = {{What do larger image classifiers memorise?}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=Ew73inSyhG},
}
Figure