Measuring Déjà vu Memorization Efficiently

Narine Kokhlikyan, Bargav Jayaraman, Florian Bordes, Chuan Guo, Kamalika ChaudhuriarXiv 2025 · DOI

Abstract

Researchers at FAIR (Meta) have developed a novel "one-model" test to efficiently measure the extent to which image and vision-language models (VLMs) memorize their training data. By replacing computationally expensive "shadow models" with simple reference classifiers, this method enables the auditing of off-the-shelf, open-source models for privacy risks and data leakage without requiring retraining. This approach provides a scalable solution for identifying "déjà vu memorization" in modern large-scale representation learning.

Introduction

In representation learning, the primary goal is for models to learn generalizable concepts rather than specific training instances. When a model recalls a specific sample—such as identifying a foreground object from a background crop solely because it saw that exact image during training—it is referred to as déjà vu memorization.

Historically, measuring this phenomenon required a "two-model test," which involves training two identical models on disjoint halves of a dataset. If Model A can predict a foreground object from a background patch that Model B (which never saw the image) cannot, the sample is considered memorized. However, this approach is computationally ruinous for modern foundation models and impossible to apply to "black-box" pre-trained models where the original data splits are unavailable. This research introduces a one-model bottleneck solution to these challenges.

Methodology: The One-Model Test

The authors propose a one-model déjà vu test that replaces the complex representation model used for estimating "dataset-level correlation" with simpler, off-the-shelf reference models:

  1. Image Models: The system utilizes a standard ResNet50 classifier or a Naive Bayes classifier (built on object detections from Grounded-SAM) to predict foreground labels from background crops. If the target model significantly outperforms these simple baselines, it indicates memorization rather than learned general correlation.
  2. Vision-Language Models (VLMs): For VLMs, the test uses a pre-trained text embedding model (GTE) to find semantically similar captions in a public dataset. By checking if objects in these "neighboring" images match the target image, the system establishes a baseline for what can be inferred via general semantic correlation.
Comparison of the traditional two-model test versus the proposed one-model test for identifying memorized and correlated examples.

Experimental Setup and Datasets

The methodology was validated across several diverse datasets:

  • ImageNet: Used to benchmark the one-model vs. two-model approach using 300k/500k image splits.
  • Shutterstock: A private dataset of 239M image-caption pairs used for training CLIP-style VLMs.
  • YFCC15M: Employed for evaluating open-source VLMs.
  • Public Reference Sets: Utilized for VLM "neighbor searches" to estimate data correlations.

Key Insights and Results

High Fidelity and Scalability

The one-model test yields results remarkably similar to the gold-standard two-model test. For VLMs, the one-model test achieved a 0.07 Population Precision Gap (PPG), nearly identical to the 0.06 PPG of the two-model test. This confirms that simple classifiers are sufficient to establish a baseline for dataset-level correlations.

The Impact of Scale and Algorithm

A striking finding is the "More Data, Less Memorization" paradox: open-source models trained on massive datasets show lower aggregate memorization than those trained on smaller subsets. Larger datasets appear to force better generalization, leaving less capacity for per-sample memorization. Furthermore, the choice of algorithm matters; the study found that VicReg and Barlow Twins tend to memorize more than DINO, suggesting that self-supervised learning loss functions directly influence memorization tendencies.

Performance metrics comparing various classifiers and their ability to identify memorized examples across different object categories.

Discussion and Limitations

While the one-model test provides a principled way to audit "in the wild" models, its accuracy depends on the reference model being a suitable proxy for "Bayes optimal" correlation. A reference model that is too weak may over-report memorization, while one that is too strong (or memorizes data itself) may under-report it. Additionally, the Naive Bayes approach relies on automated annotation tools like Grounded-SAM, where lower-quality labels in background crops could introduce noise.

Future research will focus on why specific samples are more prone to memorization—such as data duplication or "outlier-ness"—and how these metrics scale with next-generation models like GPT-4V or Gemini.

Summary updated

BibTeX
@misc{kokhlikyan2025measuring,
  author = {Narine Kokhlikyan and Bargav Jayaraman and Florian Bordes and Chuan Guo and Kamalika Chaudhuri},
  title = {{Measuring Déjà vu Memorization Efficiently}},
  year = {2025},
  eprint = {2504.05651},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.05651},
}
Figure