Skip to content

Chapter 34: Privacy and PII

Language models memorize, and repeated or rare strings (emails, phone numbers, keys) are the easiest to extract. What is in the corpus can come out of the model. Privacy in an ML system is therefore a data-flow property: personal data enters through the corpus and through user requests, and leaves through model outputs and logs. A policy names each flow and its control, the pipeline and the gateway enforce it, and tests on labelled fixtures show it works.

Concepts from other sections (8)

This section uses these ideas. Each has a short definition and a link to the section that explains it in full. Tap a dotted term in the text to preview it.

This chapter writes that policy and then extends it to media. The first section, on PII, covers what counts as personal data, where it enters and leaves, and why you scrub before training and redact before logging: the corpus pipeline replaces PII with typed placeholders such as <EMAIL>, and the gateway applies the same detector list to its logs. It treats a detector as a classifier with a precision and a recall, measured on labelled fixtures that include the lookalikes (ISBNs, version strings, trace ids) that cause false positives. Throughout, data minimization is the cheapest control: what you never collect or keep cannot leak or need erasing. The second section turns to images and voice, where a license to a recording is not consent to use a person’s face or voice, and builds the evidence program that keeps multimodal model cards honest.

Learning objectives

  • Map every flow by which personal data enters and leaves an LLM system, and assign each a control.
  • Write a PII policy with typed placeholders, an audit that never stores values, log retention, and an erasure procedure.
  • Measure a detector’s precision and recall, and use structural rules such as the Luhn check to keep precision high.
  • Keep license and consent as separate records for biometric media, and bind a model card’s numbers to their evidence.

The reading has no prerequisites. The first section follows the shape of Data Licensing, a policy as prose plus decisions a program checks, so reading that chapter first helps. The policy is implemented by the scrub in PII scrub with typed placeholders and audit spans in Data Engineering, which runs after deduplication. The second section assumes the vision and speech towers of AI Engineering and the model card from Model and Data Cards. Good preparation is Carlini et al., sections 1 to 5, and the core of the NIST Privacy Framework.

  • Privacy and PII policy: the five kinds of personal data and secrets the system detects, the flows they travel, detectors as classifiers, the Luhn check, and a walkthrough of the reference policy, its machine-readable half, and twelve review cases.
  • Consent and biometric evidence in model cards: consent fields on the ledger, pooled WER per group, digest-bound model cards, and an evidence program that refuses changed or revoked media before inference.

The policy also touches other books. What traces and logs may contain is a concern of Observability in Systems Engineering, and the secrets review and threat model live in Security in Software Engineering.