Skip to main content
QUICK REVIEW

[Paper Review] Preventing Verbatim Memorization in Language Models Gives a False Sense of Privacy

Daphne Ippolito, Florian Tramèr|arXiv (Cornell University)|Oct 31, 2022
Topic ModelingComputer Science17 citations
TL;DR

This paper introduces MemFree decoding, an efficient defense that prevents verbatim memorization in language models by filtering n-grams present in the training data using a Bloom filter. Despite eliminating exact copies, the method fails to prevent data leakage through paraphrased outputs—such as stylistic transformations, synonym swaps, or minor spelling errors—demonstrating that verbatim filtering gives a false sense of privacy and highlighting the need for broader definitions of memorization based on semantic similarity.

ABSTRACT

Studying data memorization in neural language models helps us understand the risks (e.g., to privacy or copyright) associated with models regurgitating training data and aids in the development of countermeasures. Many prior works -- and some recently deployed defenses -- focus on "verbatim memorization", defined as a model generation that exactly matches a substring from the training set. We argue that verbatim memorization definitions are too restrictive and fail to capture more subtle forms of memorization. Specifically, we design and implement an efficient defense that perfectly prevents all verbatim memorization. And yet, we demonstrate that this "perfect" filter does not prevent the leakage of training data. Indeed, it is easily circumvented by plausible and minimally modified "style-transfer" prompts -- and in some cases even the non-modified original prompts -- to extract memorized information. We conclude by discussing potential alternative definitions and why defining memorization is a difficult yet crucial open question for neural language models.

Motivation & Objective

  • To investigate whether defenses that prevent verbatim memorization actually protect against training data leakage in language models.
  • To evaluate the effectiveness of verbatim filtering as a privacy-preserving mechanism in real-world deployment scenarios.
  • To demonstrate that paraphrased memorization—via style transfers, synonym swaps, or minor edits—can bypass verbatim filters while preserving semantic fidelity.
  • To argue for a broader definition of memorization that includes semantic similarity, not just exact string matches.
  • To show that even state-of-the-art models like GPT-3 and GPT-Neo are vulnerable to data extraction despite verbatim filtering.

Proposed method

  • MemFree decoding uses a Bloom filter to efficiently store all common n-grams from the training set and checks each candidate token during autoregressive generation.
  • If a next token would create an n-gram matching the training data, an alternative token is selected from the model’s posterior distribution without regeneration.
  • The defense is designed to scale to large training sets (hundreds of GB) by using compact, probabilistic data structures.
  • The method is evaluated on models including GPT-Neo and GPT-3, using prompts that are either unmodified or transformed via style transfer (e.g., variable name translation).
  • Semantic similarity between generated outputs and training data is measured using BLEU scores and human evaluation of paraphrased outputs.
  • The authors compare verbatim memorization with approximate memorization, analyzing how models circumvent filters through subtle linguistic modifications.

Experimental results

Research questions

  • RQ1Can a defense that perfectly prevents verbatim memorization still allow training data to be leaked through paraphrased outputs?
  • RQ2To what extent can style-transfer prompts circumvent verbatim filtering in large language models?
  • RQ3How do models generate semantically similar but non-verbatim outputs when explicitly prevented from copying exact n-grams?
  • RQ4What are the limitations of defining memorization solely by exact string matches in neural language models?
  • RQ5How does the prevalence of approximate memorization compare to verbatim memorization in real-world model deployments?

Key findings

  • MemFree successfully prevents all verbatim memorization in generated text using a scalable, efficient filtering mechanism based on Bloom filters.
  • Despite perfect verbatim filtering, models still generate outputs that are semantically identical to training data, such as through synonym substitution or spelling variations.
  • Style-transfer prompts—such as translating variable names from English to French—successfully bypass verbatim filters and extract memorized code snippets.
  • BLEU scores between generated outputs and true training continuations exceeded 0.95 in many MemFree-generated examples, indicating high semantic similarity despite non-verbatim output.
  • The study demonstrates that GPT-3 and GPT-Neo can produce paraphrased memorization that evades verbatim filters, even when the models are explicitly constrained.
  • The results suggest that prior estimates of memorization in language models may be significantly underestimated, as approximate memorization is not captured by verbatim definitions.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.