Training-data leakage: what models remember and how to keep secrets out
How fine-tuned and trained models can reproduce records from their training data, why secrets and personal data must be removed before training, and how teams test for memorization with canaries.
Diagram
From a support archive to a fine-tuned model
Step 1 of 4
Dataset
Support transcripts are exported for fine-tuning.
transcripts.jsonl 412,000 rows sample: "...my card ending 4417, my account email is ana@example.test..."
The example on the open step is one illustration, or the fix you can paste into an application you own.
What this page is made of
3 pieces. Each one says what fails, who is affected, what you would notice, and what you change.
Memorization
- What fails
- Models can reproduce training examples verbatim, especially repeated or unusual ones.
- Who is affected
- People whose records were in the training set.
- What you would notice
- Fine-tuning data that was never scrubbed or deduplicated.
- What you change
- Remove personal data and secrets before training, not after.
Secrets in corpora
- What fails
- Code and logs used as training data contain keys and passwords.
- Who is affected
- Owners of those credentials.
- What you would notice
- Secret-scanner hits in the training export.
- What you change
- Scan exports and rotate any credential found.
Testing with canaries
- What fails
- Unique planted strings show whether the model memorizes rare data.
- Who is affected
- The team, which needs evidence before release.
- What you would notice
- No memorization test in the release checklist.
- What you change
- Insert canaries and fail release if the model completes them.
Retention and consent
Check that the data’s original purpose and retention rules allow training. Customer contracts and privacy notices often do not, and removing a person’s data from a trained model usually means retraining.
Hosted models
For hosted APIs, read the provider’s data-use terms: whether prompts are retained, whether they are used for training, and how to opt out. Enterprise tiers usually differ from consumer tiers.
Check yourself
Recognition and the fix. Nothing here is a procedure.
Which records are most likely to be memorized?
Sibling techniques
Pages at the same depth, plus a lab and a glossary card for this one.
This page stands on its own. The lab and the glossary card are the next reading.