On the Memorization Properties of Contrastive Learning

Ildus Sadrtdinov, Nadezhda Chirkova, Ekaterina Lobacheva

Introduction

Deep Neural Networks (DNNs) exhibit a well-documented "easy-to-hard" transition during training, where they prioritize learning low-frequency, simple patterns before moving on to complex noise or high-frequency details. In supervised learning, this hierarchy is a cornerstone of model generalization. However, the learning dynamics of self-supervised learning (SSL) methods, such as SimCLR, remain less understood. Unlike supervised models that rely on human labels, SimCLR learns by maximizing the agreement between different augmented views of the same image. This paper investigates whether SimCLR follows a similar easy-to-hard hierarchy and how its memorization profile compares to both supervised learning and training on purely random labels.

Methodology

To analyze memorization, we adopt the ensemble training approach proposed by Arpit et al. (2017). We trained 30 ResNet-18 models with varying random initializations on the CIFAR-10 dataset. For every image $x$ at each epoch $t$, we calculated the memorization profile $p_t(x)$, defined as the fraction of models that "correctly recognized" the image. In the supervised context, recognition is defined as correct classification; in SimCLR, it is defined as the successful pairing of two augmentations of the same image within a mini-batch.

These profiles were compared against a "Binomial Noise" baseline. If all images were equally difficult, the distribution of $p_t(x)$ would follow a binomial distribution. Significant deviations from this baseline indicate a structured hierarchy of example difficulty.

Comparative Memorization Profiles

Our analysis reveals a distinct "complexity gap" between supervised and self-supervised learning. In supervised learning, the memorization curves are "top-heavy," showing a sharp distinction between easy images (learned almost instantly) and hard images (learned much later or not at all).

Memorization profiles $p_t(x)$ for different training objectives.

In contrast, SimCLR exhibits "S-shaped" profiles, indicating a more gradual distribution of image difficulty. Interestingly, SimCLR's dynamics at the object level closely resemble those of models trained on random labels, particularly when data augmentations are involved. This suggests that SimCLR effectively treats every image as its own unique class—a form of "instance discrimination" that mirrors the rote memorization required for random label training.

Non-Random Learning Dynamics

Despite the similarities to random label training, SimCLR does not learn examples at a uniform rate. As shown in the comparison against the binomial baseline, SimCLR's learning is non-random, following a clear easy-to-hard progression.

SimCLR memorization compared to a binomial noise baseline.

A critical finding is that while images themselves may have similar inherent complexity in SimCLR, the specific augmentations applied to them drive the difficulty. When augmentations are fixed, SimCLR’s profile shifts to look more like supervised learning. This implies that the model's challenge lies not just in the image content, but in recognizing the semantic identity across varied transformations.

Conclusion

SimCLR's memorization profile reveals that contrastive learning operates as a high-dimensional instance discrimination task. While its dynamics resemble random label training, it successfully clusters semantic features by learning general, low-level patterns robust to heavy augmentation. These insights suggest that training efficiency could be improved through "Advanced Augmentation Ordering"—a curriculum-based approach that starts with light augmentations and progressively increases complexity as the model matures. Future work should extend these findings to other contrastive architectures and larger-scale datasets like ImageNet.

Summary updated

Abstract

Memorization studies of deep neural networks (DNNs) help to understand what patterns and how do DNNs learn, and motivate improvements to DNN training approaches. In this work, we investigate the memorization properties of SimCLR, a widely used contrastive self-supervised learning approach, and compare them to the memorization of supervised learning and random labels training. We find that both training objects and augmentations may have different complexity in the sense of how SimCLR learns them. Moreover, we show that SimCLR is similar to random labels training in terms of the distribution of training objects complexity.
BibTeX
@misc{sadrtdinov2021memorization,
  author = {Ildus Sadrtdinov and Nadezhda Chirkova and Ekaterina Lobacheva},
  title = {{On the Memorization Properties of Contrastive Learning}},
  year = {2021},
  eprint = {2107.10143},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.10143},
}
Figure