Déjà Vu Memorization in Vision-Language Models

Bargav Jayaraman, Chuan Guo, Kamalika Chaudhuri

Large-scale Vision-Language Models (VLMs) like CLIP have revolutionized how we bridge the gap between pixels and prose. But as these models ingest hundreds of millions of image-caption pairs, a nagging question remains: are they truly learning general concepts, or are they just memorizing their training data?

In their NeurIPS 2024 paper, researchers from FAIR (Meta) introduce VL-Déjà-Vu, a framework to quantify this "déjà vu memorization"—the phenomenon where a model retains specific details about training images that go far beyond what is described in their captions.

TL;DR

The paper proposes a novel method to measure memorization in Vision-Language Models by testing if a model can "recall" fine-grained objects from a training image when given only its caption. They find that significant memorization persists even in models trained on 50 million samples and demonstrate that random text masking during training is a highly effective mitigation strategy.

What Problem Does This Paper Address?

We know that Large Language Models (LLMs) can regurgitate training text and generative models can reproduce training images. However, measuring memorization in representation learning models like CLIP is much harder because they don't have a "decoder" to directly output what they've stored.

Previous attempts to measure memorization in vision models often relied on simple foreground-background splits (e.g., can the model predict a "black swan" just from seeing "water"?). This doesn't work for VLMs, which deal with two different modalities (text and image) and complex real-world scenes containing dozens of unique objects. The authors set out to determine if VLMs store "extra" information about training samples—like the specific set of fruits on a table—that wasn't even mentioned in the original caption.

Methods

The authors introduce the VL-Déjà-Vu test, which uses a k-nearest neighbor (k-NN) approach to "probe" the model's memory.

  1. The Setup: They train two identical models, a Target VLM ($f_A$) and a Reference VLM ($f_B$), on two disjoint subsets of data ($A$ and $B$).
  2. The Attack: For a specific image-text pair in set $A$, they take the caption and use the Target VLM to retrieve the $k$ most similar images from a separate, "public" image set that neither model has seen during training.
  3. The Measurement: They use an off-the-shelf object detector (Detic) to identify all objects in the original training image and the retrieved public images.
  4. The Comparison: If the Target VLM has memorized the training image, the images it retrieves based on the caption will contain significantly more of the original image's objects than the images retrieved by the Reference VLM.
Figure 1: An example where a CLIP [Radford et al., 2021] model trained on a 40M subset of a Shutterstock data set exhibits d´ej`a vu memorization of objects present in a training image. Public set is a separate collection of 20M images from Shutterstock that has no overlap with the training set. The objects annotated in orange are true positives, i.e., the ones present in the target image, and the objects annotated in blue are false positives. Our test recovers significantly more memorized objects for the target VLM (trained on the target image) compared to the reference VLM (not trained on the target image). Additional qualitative examples can be found in Figure 11 in the appendix.

Datasets

The study evaluates memorization across several prominent datasets:

  • Filtered LAION: Subsets of 1M, 10M, and 50M image-caption pairs.
  • Shutterstock: A privately licensed dataset, using subsets of 1M, 10M, and 40M pairs.
  • MS COCO: Used to provide complex scenes for fine-grained evaluation.
  • ImageNet: Used as one of the "public" image sets for the k-NN retrieval task.

Key Insights and Ideas

  • Memorization $\neq$ Generalization: Even when a model generalizes well (e.g., high zero-shot accuracy on ImageNet), it can still suffer from significant memorization.
  • The "Sticky" Sample Problem: Memorization isn't uniform. A small subset of training samples is memorized much more strongly than others. These are often samples where the model's text embedding for a caption is unusually close to the image embeddings in the public set.
  • Scale Doesn't Solve It: While increasing the training set size from 1M to 50M reduces the average population-level memorization, the model still retains "strong" memories of specific individual samples.
  • Text is the Weak Link: The authors hypothesize that VLMs overfit to specific text-image pairings. By randomly masking tokens in the captions during training (Text Randomization), they can "break" this specific bond, forcing the model to learn more robust, general features.

Key Results

The researchers found that standard CLIP training leads to measurable memorization across all tested scales.

  • Population Gaps: They measured a clear "Population Precision Gap" (PPG) and "Population Recall Gap" (PRG), showing that the Target model consistently outperforms the Reference model at recovering training-image objects.
  • Mitigation Success: Among various regularization techniques (early stopping, weight decay, temperature scaling), Text Masking was the clear winner.
  • The Trade-off: Masking 30% of caption tokens during training reduced memorization metrics by over 60% while only incurring a marginal (~1%) drop in zero-shot ImageNet accuracy. In some cases, it even improved performance on compositional reasoning tasks (like the ARO benchmark) by preventing the model from acting like a simple "bag-of-words."
Figure 2: Utility vs. Memorization across different training sizes. While accuracy (green) goes up with scale, memorization metrics (pink/purple) persist.

Limitations and Future Work

  • Requires Training Access: The current method requires training two models on disjoint sets, making it difficult to apply to "black-box" proprietary models where the training data is unknown.
  • Object Detector Bias: The results rely on the accuracy of the object detector (Detic). While the authors argue that relative gaps between models remain valid, absolute numbers might fluctuate with different detectors.
  • Beyond Objects: The study focuses on object recovery. Future work could explore if VLMs memorize other attributes like textures, styles, or specific spatial relationships.
  • Generative vs. Discriminative: The authors note that measuring memorization in models without decoders is a "subtle" task; extending this to even more complex multi-modal architectures remains an open challenge.

Summary updated

BibTeX
@inproceedings{jayaraman2024deja,
  author = {Bargav Jayaraman and Chuan Guo and Kamalika Chaudhuri},
  title = {{Déjà Vu Memorization in Vision-Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=SFCZdXDyNs},
}
Figure