Analyzing Leakage of Personally Identifiable Information in Language Models

Nils Lukas, Ahmed Salem, Robert Sim, Shruti Tople, Lukas Wutschitz +1 more
2/1/2023
466 citations
cs.LG

Official code: microsoft/analysing_pii_leakage (108 stars, Python, MIT, last commit 2024-08-13). 1 more implementation below.

Abstract

Language Models (LMs) have been shown to leak information about training data through sentence-level membership inference and reconstruction attacks. Understanding the risk of LMs leaking Personally Identifiable Information (PII) has received less attention, which can be attributed to the false assumption that dataset curation techniques such as scrubbing are sufficient to prevent PII leakage.

Show full abstract

Scrubbing techniques reduce but do not prevent the risk of PII leakage: in practice scrubbing is imperfect and must balance the trade-off between minimizing disclosure and preserving the utility of the dataset. On the other hand, it is unclear to which extent algorithmic defenses such as differential privacy, designed to guarantee sentence- or user-level privacy, prevent PII disclosure. In this work, we introduce rigorous game-based definitions for three types of PII leakage via black-box extraction, inference, and reconstruction attacks with only API access to an LM. We empirically evaluate the attacks against GPT-2 models fine-tuned with and without defenses in three domains: case law, health care, and e-mails. Our main contributions are (i) novel attacks that can extract up to 10$\times$ more PII sequences than existing attacks, (ii) showing that sentence-level differential privacy reduces the risk of PII disclosure but still leaks about 3% of PII sequences, and (iii) a subtle connection between record-level membership inference and PII reconstruction. Code to reproduce all experiments in the paper is available at https://github.com/microsoft/analysing_pii_leakage.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
microsoft/analysing_pii_leakageOfficial108PythonMIT2024-08-13
DanielVAppel/pii-leakage-demoCommunity0Python–2025-10-13
MIT

The repository contains the code for analysing the leakage of personally identifiable (PII) information from the output of next word prediction language models.

10827PythonFeb 16, 20232 years agoMIT

Demo inspired by “Analyzing Leakage of Personally Identifiable Information in Language Models” and Microsoft’s reference repo. This code re-implements a simplified reconstruction and a tiny extractability estimator for classroom use.

00PythonOct 13, 20251 years ago

Similar Papers

Cite this paper

@article{lukas2023analyzing,
  title  = {Analyzing Leakage of Personally Identifiable Information in Language Models},
  author = {Nils Lukas and Ahmed Salem and Robert Sim and Shruti Tople and Lukas Wutschitz and Santiago Zanella-Béguelin},
  year   = {2023},
  eprint = {2302.00539},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2302.00539v4}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2302.00539.svg)](https://codeofpaper.com/paper/2302.00539)

Discussion