Déjà Vu Memorization in Vision–Language Models

Bargav Jayaraman, Chuan Guo, Kamalika Chaudhuri

Introduction

This paper introduces VL-Déjà-Vu, a novel method to quantify how much Vision-Language Models (VLMs) like CLIP "memorize" specific details of their training images. The researchers discovered that these models often remember fine-grained objects from training photos that weren't even mentioned in the captions. Furthermore, they demonstrate that text randomization (masking words during training) is a highly effective way to reduce this privacy risk without sacrificing model performance.

The Challenge of Measuring VLM Memorization

We know that Large Language Models (LLMs) can regurgitate snippets of their training data, but what about models that "see" and "read" simultaneously? Vision-Language Models (VLMs) are the backbone of modern image search and generation, yet measuring their memorization is notoriously difficult.

Unlike a generative model that might produce a near-exact copy of a training image, a VLM like CLIP only produces mathematical embeddings. There is no decoder to show us exactly what the model is visualizing. The challenge is distinguishing between generalization (the model knows what a "black swan" looks like because it saw many of them) and memorization (the model knows this specific black swan is on this specific lake because it saw that exact pair in training). The authors tackle this "hidden" memorization to understand if VLMs are over-fitting on specific training instances, which has major implications for data privacy and generalization.

Methodology: The k-NN Attack Procedure

To uncover this hidden memorization, the authors propose a clever "Two-Model" setup called the k-Nearest Neighbor (k-NN) Attack Procedure.

KNN Attack Procedure
  1. The Setup: They train two identical models: a Target Model ($f_A$) that sees a specific set of images ($A$), and a Reference Model ($f_B$) that sees a completely different set ($B$).
  2. The Test: They take a caption from the Target Model’s training set and use both models to search a third, "public" dataset for images that best match that caption.
  3. The Comparison: They use an automated object detector (Detic) to label the objects in the retrieved images.
Object Detection with Detic
  1. The "Déjà Vu" Moment: If the Target Model retrieves images containing significantly more objects from the original training image than the Reference Model does, it proves the Target Model is "remembering" the specific visual layout associated with that caption, rather than just understanding the text.

To quantify this, they developed three metrics: Population Precision Gap (PPG), Population Recall Gap (PRG), and AUC Gap.

Datasets

The study utilized several massive datasets to ensure the findings were robust:

  • Training: Subsets of filtered LAION (up to 50M pairs) and Shutterstock (up to 40M pairs).
  • Evaluation/Public Sets: ImageNet (1.28M images) and a holdout set of 20M Shutterstock images were used as the search pools for the k-NN test.
  • Ground Truth: MS-COCO was used for high-quality human-annotated labels, while the Detic object detector provided labels for the larger, unannotated sets.

Key Insights and Results

  • Memorization is "Invisible" but Real: Even though CLIP doesn't generate images, it stores specific visual details in its embedding space. It can recall objects that were present in the training image but never mentioned in the text caption.
  • The "Sticky" Sample Phenomenon: Memorization isn't uniform. A small subset of training pairs is memorized much more intensely than the rest, often when the text-image link is uniquely strong or the image is particularly distinct.
  • Scaling Helps, But Doesn't Cure: As the training set grows from 1M to 50M samples, average memorization decreases as the model learns to generalize better. However, significant memorization persists even at the 50M scale.
  • Text Masking is the Winner: The authors found that models often over-fit on specific text tokens. By randomly masking 30-50% of the words in a caption during training (Text Randomization), they forced the model to learn broader visual concepts. Masking 30% of text tokens reduced the Population Precision Gap (PPG) from 9.1% to 3.4%, with only a marginal (~1%) drop in zero-shot accuracy on ImageNet.
  • Comparison to Other Mitigations: They tested early stopping, weight decay, and temperature scaling. While some helped, none offered the same privacy-vs-utility trade-off as text masking.

Limitations and Future Work

  • The Reference Model Requirement: The current method requires training a second "reference" model on disjoint data. This is computationally expensive and impossible for researchers auditing closed, proprietary models.
  • Object Detector Bias: The study relies on the Detic object detector. If the detector misses an object or mislabels it, the memorization metrics could be slightly skewed, though the relative gap between models remains a valid signal.
  • Future Directions: The authors suggest exploring whether this memorization allows for "training data reconstruction"—actually rebuilding the original training image just from the model's weights. They also aim to scale their tests to models trained on billions of parameters.

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