Skip to content

The dataset contains someone's phone number. Can you prove the model will not recite it?

THE ARGUMENT

Memorization is not a question of what is in the data but of what the model will repeat under what conditions; extractability can only be estimated at a stated attack strength and never proven to be zero, so acceptance should aim at a reproducible risk statement.

On this page

Suppose you buy fifty thousand customer support conversations: the transcript, a timestamp, an agent ID, and a column labelled user contact details. The contract annex says the data has been de-identified according to industry practice. You open a sample and see phone numbers with the middle four digits starred out and the first and last three intact, alongside city and timestamp. That still points at a specific person. You raise it, and the vendor is candid: this is how everyone does it, and the model will not actually memorize it. That second half is testable.

The problem is not the column, it is whether the model repeats it

The scene above is invented, but the disagreement inside it is real: the buyer cares whether personal data is present, the model side cares whether the model will say it out loud. The two are strongly related but not the same thing, and they are checked by completely different methods.

De-identification addresses the first. It reduces risk without answering the second, because what a model memorizes may not be the starred column at all. It may be the phrasing of an entire conversation, an order number, a combination of address and time, or one sentence whose wording appears nowhere else. Together those identify a person far better than a masked phone number does.

A 2020 paper by Carlini and colleagues turned the second question into a measurable object. Working black-box, they extracted verbatim training text from the largest GPT-2 model available at the time, including names, phone numbers, email addresses and chat logs.[1] The important words are verbatim and black-box: no access to the corpus, only the model's input and output.

What that attack actually did

The method is not complicated, but one step carries it. First, let the model generate a very large number of samples, on the order of hundreds of thousands, the vast majority of them nonsense. Second, do not read them by hand; score them against a set of smaller models trained on the same distribution. If the large model assigns a much higher likelihood to a passage than the small ones do, the passage is unusually familiar to it rather than merely well-formed English. Third, manually verify only the top candidates to see whether they appear verbatim in the training data.

That likelihood-ratio ranking is the core of the method. It converts memorization from an anecdote about a model saying something odd into a sortable signal: not how rare you find the text, but how unusually fluent this particular model finds it. The idea became the standard move for this class of test.

Four reported findings matter directly to a buyer. The extracted text did contain personal information, so this is not a theoretical risk. Some memorized sequences appear only once in the training data, which means duplication is not a precondition for memorization and undercuts the intuition that deduplication makes you safe. Larger models memorize more. And deduplication reduces memorization without eliminating it.[1]

One misunderstanding has to be cleared up: a model emitting a phone number does not mean it memorized that number, since it may have invented one; and a model not emitting it does not mean it never memorized it. Any test that asks whether the model knows something measures a lower bound. That fixes how such tests must be written: they cannot certify cleanliness, only estimate how much can be dug out under a given attack.

Can you add an extractability test? Yes, if you plant your own markers

You can, and you do not need model weights. The technique is a canary: before delivery, insert a set of unique strings you generated yourself, each appearing exactly once, and record where and in what context. After training, use prefix completion or direct questioning to see whether the model can produce the full string.

A teaching example (invented, to show the mechanics): suppose the corpus holds five million records and you insert 200 canaries, each formatted as four groups of four random characters, such as QK7M-3P2X-RA94-TTD8, all placed mid-document rather than at the start or end. Record position, document ID and insertion time in a list only you can see. Keep an untrained base model as well, and test it first to confirm it cannot produce these strings on its own.

After training, probe three ways: give the first two groups and ask for completion; give the document title and ask for a recap; ask directly whether it has seen a string beginning QK7M. The hit rates will diverge, and the divergence is itself information. Completion implies verbatim memory; recall only under direct questioning implies a weak association. Record both, because they carry different risk.

MethodCostWhat it showsWhat it does not show
Prefix completionLow, a few hundred callsVerbatim memory that can be triggeredA failed completion does not prove absence
Direct questioningLow, but the prompt needs designAn association that can be elicitedModels confabulate along the prompt and also deny
Likelihood-ratio rankingMedium, needs a reference modelThe passage is unusually familiar to this modelFamiliarity can also come from legitimately frequent text
Corpus matchingHigh, requires the corpusThe passage is in the corpusBeing in the corpus is not being repeated

Of the four, you can run the first two yourself, the third needs a reference model, and the fourth is usually available only to the vendor. That is the negotiating handle: ask for permission to plant markers and test, rather than for a copy of the corpus.

Five actions that turn this into a contract clause

  1. Write into the contract that the buyer may insert synthetic markers up to one per thousand records and keep the marker list, and that the vendor may not require advance disclosure of the marker contents. Without this clause, the next four actions are empty talk.
  2. Spread markers across sources, lengths and positions. Put them all at the start of documents and you have measured how well the model memorizes openings, not the batch.
  3. Take a baseline first: run the untrained base model and confirm it cannot generate these strings. Otherwise you are measuring completion ability, not memory.
  4. After training, record hits separately for each probe type. Suppose 4 of 200 hit, a rate of 2 percent. If none hit, the rule of three lets you say only that the extraction rate for single-occurrence content is probably under 1.5 percent; you cannot say it is zero.
  5. Group the hits by source type: web pages, support transcripts, forums, tickets. If hits concentrate in one source type, downweight or drop that source in the next batch.

The fifth is the most often skipped and the only one that informs the next purchase. An overall hit rate does not tell you what to change; a grouped hit rate does. If every hit comes from tickets generated from the same template, the problem is not volume but a generation process that made the content highly repetitive to begin with.

My judgment, and what this test cannot see

The boundaries need stating. Canaries measure whether what you planted gets repeated; that is a proxy for real memorization, not the whole of it. Real personal information tends to sit mid-document, surrounded by near-duplicate text, which is not the same distribution as a carefully designed unique random string. A low canary hit rate does not license the inference that real phone numbers are equally hard to extract.

Attack strength can also be raised without limit: more sampling, better ranking models, stronger prompts and more probing of the output distribution all push the hit rate up. Any extraction rate is meaningless without its attack conditions attached. Vendor reports almost never state them, which is the first thing to check when deciding whether a report is worth reading.

Next time a dataset arrives labelled de-identified, ask for three things: a record of how personal information was identified and handled, a clause permitting you to plant your own markers, and a test report with its attack conditions. If any of the three is missing, the price should carry a risk discount rather than a sentence about trusting the vendor.

References

  1. Extracting Training Data from Large Language Models
  2. Personal Information Protection Law of the PRC (published by CAC)

Read next

All articles

Sign in to Padda

A code in your inbox. No password to remember.

Connecting to sign-in…