Researchers at FAIR (Meta) have developed a "one-model" approach to measure how much AI models memorize their training data without needing to retrain them from scratch. By using simple reference classifiers or pre-trained embeddings to account for natural data correlations, they can now audit large, off-the-shelf open-source models for memorization. Surprisingly, they found that these massive models often generalize better and memorize less than their smaller-scale counterparts.
The Challenge of Detecting Memorization
In representation learning (like CLIP or DINO), models learn to map images and text into a shared space where similar concepts sit close together. However, these models sometimes "cheat" by memorizing specific training examples rather than learning general concepts.
A popular way to detect this is the déjà vu method: if a model can predict a foreground object (like a "black swan") just by looking at a background crop (like "rippling water"), it might be memorizing that specific image. The catch? To prove it's memorization and not just a common correlation (e.g., basketballs usually appear on basketball courts), you previously had to train two separate, expensive models on disjoint halves of a dataset. This "two-model" requirement makes it impossible to test large, pre-trained open-source models where the original training splits are unknown or the compute cost is prohibitive.
The "One-Model" Déjà Vu Test
To solve this, the authors propose a one-model déjà vu test that replaces the expensive second model with efficient "reference" estimators of dataset-level correlations.
- For Image Models: Instead of training a second self-supervised model from scratch, they use simple classifiers to predict the foreground label from a background crop. They tested two versions:
- A standard ResNet50 trained directly on background crops.
- A Naive Bayes classifier built on top of an off-the-shelf object detector (like Grounded-SAM), which is even faster and requires no traditional training.
- For Vision-Language Models (VLMs): To see if a model like CLIP memorizes an image-caption pair, they use a pre-trained text embedding model (GTE). They look up the most similar captions in a public dataset and check if the objects in those images match the target. If the VLM predicts the objects much better than this text-lookup method, it’s likely memorizing.
Key Insights and Results
By moving to a one-model setup, researchers can finally audit "black box" models using datasets like ImageNet, Shutterstock, and YFCC15M. You don't need the original training code or the exact data splits; you just need a representative sample of the data distribution.
- Validation: The one-model test identifies almost the same "memorized" examples as the gold-standard two-model test. For example, the ResNet classifier agreed with the two-model intersection for ~86% of top-1 correlated examples.
- Model Comparisons: In the vision domain, VICReg and Barlow Twins were found to memorize more than DINO.
- The Generalization Paradox: Surprisingly, large open-source models trained on massive data show lower aggregate memorization than models trained on smaller subsets. This suggests that as models see more diverse data, they are forced to learn general features rather than relying on memorizing individual samples.
- VLM Scores: For CLIP models trained on 40M images, the one-model test showed a Population Precision Gap (PPG) of 0.07, very close to the 0.06 PPG measured by the expensive two-model approach.
Limitations and Future Work
While highly efficient, the one-model approach relies on approximations. If the reference model (like Naive Bayes) memorizes its small training set, it could skew the results. Additionally, the Naive Bayes approach relies heavily on the quality of automated object detection (e.g., Grounded-SAM); missed objects or poor tags reduce the reliability of correlation estimates.
Future work will focus on refining these reference models and applying the framework to even larger generative models, such as Diffusion models or LLMs, where the predicted data components are more complex than simple foreground labels.
Summary updated