Membership Inference

Membership inference is an attack that tries to determine whether a specific piece of data – a patient record, a photo, a passage from a book – was used to train a machine-learning model. It matters for privacy, because merely being in a dataset can be sensitive, and for copyright, because it can help show what a model was trained on.

How it works

Models tend to behave differently on examples they have seen: they are more confident, make smaller errors and assign the text a higher probability, especially when they overfit. An attacker compares a model’s response to a candidate record with how it responds to similar records known to be outside the training set. In 2017 Reza Shokri and colleagues showed the attack against machine-learning services offered by Google and Amazon, training “shadow models” to learn what membership looks like. In 2022 Nicholas Carlini and colleagues argued that attacks should be judged by how reliably they identify members at very low false-alarm rates, and proposed a stronger method on that basis.

The idea predates modern AI. In 2008 Nils Homer and colleagues showed that, given a person’s genotype, it was possible to tell whether they had taken part in a genetic study from its published summary statistics. The US National Institutes of Health and the Wellcome Trust responded by removing such aggregate data from open access.

Large language models

For large language models trained on vast amounts of text, the evidence is mixed. A 2024 study by Michael Duan and colleagues found that common membership inference attacks barely beat random guessing on open models trained on the Pile dataset, partly because each text is seen only once or twice and the boundary between seen and unseen text is blurry. Other methods do better when they aggregate many signals: “dataset inference” (Pratyush Maini and colleagues, 2024) tests whether a whole collection, such as an author’s books, was used, which is useful in copyright disputes (see Training Data and Data Provenance). Where a model reproduces text word for word, that is strong evidence the text was in its training data (see Memorization).

Law and defenses

The European Data Protection Board, which groups the EU’s data protection authorities, counts resistance to such attacks among the tests of whether a model is anonymous: in December 2024 it said that an AI model trained on personal data can only be considered anonymous if the likelihood of extracting or inferring that data is insignificant (see GDPR). The defense with the strongest formal guarantees is differential privacy, which limits how much any single record can influence a model, at some cost to accuracy.

Why it matters

Membership inference turns the abstract question “what does a model know about me?” into a measurable test – for privacy regulators, for authors and for the companies that train models.

Written with Claude, made by Anthropic, which trains on large datasets, settled a book authors’ copyright class action for $1.5 billion in 2025 and still faces music publishers’ lawsuits; the 2017 attacks targeted services of investors Google and Amazon; Nicholas Carlini, lead author of the 2022 study, then at Google, has worked at Anthropic since 2025.

Related

Model Inversion · Model Extraction · Memorization · Differential Privacy · Adversarial Machine Learning · Data Leakage

Sources: Reza Shokri et al.: Membership Inference Attacks against Machine Learning Models (arXiv) (2017) · Nicholas Carlini et al.: Membership Inference Attacks From First Principles (arXiv) (2022) · Nils Homer et al.: Resolving Individuals Contributing Trace Amounts of DNA to Highly Complex Mixtures Using High-Density SNP Genotyping Microarrays (PLoS Genetics) (2008) · Michael Duan et al.: Do Membership Inference Attacks Work on Large Language Models? (arXiv) (2024) · Pratyush Maini et al.: LLM Dataset Inference (arXiv) (2024) · European Data Protection Board: Opinion 28/2024 on certain data protection aspects related to AI models (December 17, 2024) · Nicholas Carlini: Career Update (March 2025)

Leave a Reply

Your email address will not be published. Required fields are marked *