A team holds six fictional customer support messages and wants to train a text model on them. Having the messages settles none of the first questions. Is this use permitted, does deleting the names protect the customers, and could the trained model give away what it saw? This lesson separates permission, identifiability and disclosure, states exactly what differential privacy guarantees and how a privacy budget adds up, and keeps privacy apart from defenses against deliberate manipulation. All policies and records here are invented for teaching, and real permissions depend on the agreements and rules that actually apply.
Key terms
Dataset license
Definition A dataset license is the set of terms under which a party holding rights in a dataset allows others to use it. It states which operations are permitted, such as copying, modifying, redistributing, commercial use or training models, and on which conditions, such as attribution, sharing derived data under the same terms or deleting copies on request. A license can grant only rights that its issuer holds, so material the source had no authority over is not covered, and the provenance of the data has to be checked. A license is one part of data permission, the question of whether a given party may carry out a given operation on given data. When the data concern people, permission also depends on the basis for using them, which in some settings is consent with a stated scope that can be withdrawn, and on purpose limitation, the principle that data collected for one purpose are not reused for an incompatible purpose without a new basis. Being able to download a file from a public page gives access to it, not any of these permissions.
In plain words Before asking whether data are useful, ask whether this particular use of them is allowed. The answer comes from the actual terms, the source’s authority and the purpose the data were collected for, not from how easy the file was to get.
Example A fictional policy lets the team train on a support message only when three conditions hold together. The message carries a training permission, it is at most 30 days old, and the permission has not been withdrawn.
| Record | Age (days) | Training permitted | Withdrawn |
|---|---|---|---|
| A | yes | no | |
| B | yes | no | |
| C | no, support only | no | |
| D | yes | yes | |
| E | yes | no | |
| F | yes | no |
Record B fails the age limit, C was collected only for resolving support tickets, and D’s permission was withdrawn. The eligible records are A, E and F, three of the six. Permission to use messages for resolving tickets does not by itself cover keeping them to train a general text generator, and calling the project research does not change the policy. Three records are also far too few for a useful model, so passing the permission check makes the experiment allowed, not statistically meaningful.
Personal data
Definition Personal data is information that relates to an identified or identifiable person. A person is identifiable when they can be singled out or recognized, either directly through an identifier such as a name, an email address or an account number, or indirectly through a combination of other facts together with information an observer could reasonably obtain elsewhere. Fields that identify someone only in combination, such as a region, an age band and a job, are called quasi-identifiers. Personal data can sit in structured fields and inside free text, for example an address or a distinctive description written into a message. Pseudonymous data, in which names are replaced by codes, can still be linked back to people by whoever holds the mapping or by matching other fields. Whether data identify someone depends on what is released, to whom and alongside what else. Legal definitions differ between jurisdictions, and this page describes the idea rather than any particular law.
In plain words Removing the name column closes one route to a person, not all of them. A few ordinary fields together can point to one individual, and a message can name its writer in its own text.
Example After the names are removed, the six fictional records keep a region, an age band and a job.
| Record | Region | Age band | Job |
|---|---|---|---|
| A | North | 20s | teacher |
| B | North | 20s | teacher |
| C | South | 30s | driver |
| D | South | 40s | nurse |
| E | East | 30s | artist |
| F | West | 50s | chef |
Four of the six records, a fraction of , have a combination that occurs only once in this sample. Uniqueness in a sample is not the probability that a person can be identified in the wider population, which depends on who else shares the combination and on what an observer already knows. A shared combination does not prove anonymity either. Once B is excluded by the policy above, A is unique among the training records A, E and F, so the data actually used can be more identifying than the full table suggests.
Memorization and membership inference
Definition Memorization is the retention, in a fitted model, of information specific to individual training examples rather than to patterns shared by many of them. In its strongest form the model, or its outputs, reproduce distinctive content of a training example word for word, such as a rare passage of text. Some models memorize by construction, since a fitted k-nearest neighbors model stores its training rows and sharing the model shares the data. Membership inference is the task of deciding, from access to a model or its outputs, whether a given record was in the training data. The observer already holds the record and asks only about its inclusion, which can be sensitive in itself, for example when the training set consists of the patients of one clinic. Repeated records, high model capacity and detailed output access are reasons to test for these risks, but none of them proves that a particular model will disclose a particular record, and a small gap between training and test error does not show that membership inference fails.
In plain words A model can remember individual examples, not only general patterns. Its outputs can then repeat a training record or reveal that a record was used, even when its average accuracy looks fine.
Example The numbers here are constructed. An observer who knows each record’s label and can see the model’s predicted probabilities computes the model’s loss on four training records, , , and , and on four records that were not used for training, , , and . Both groups have average loss , so the gap between training and test loss is zero. The rule that answers “member” when the loss is below still flags three of the four members and none of the nonmembers, so it is right about of the records. The attack exploits the few records the model fits unusually well, which the averages hide.
Differential privacy
Definition Let be a randomized mechanism that takes a dataset and releases a random output, and fix a neighboring relation between datasets. On this page two datasets are neighbors when one is obtained from the other by adding or removing everything one person contributes, so the relation is symmetric. For and , the mechanism is -differentially private if for every pair of neighboring datasets and and every measurable set of outputs
The probabilities come only from the randomness inside , with both datasets held fixed. The case is called pure differential privacy, and a smaller gives a tighter bound. The additive term is usually chosen far below for a dataset of people, because a mechanism that publishes each person’s full record independently with probability satisfies the definition with . For a real-valued query , the sensitivity
taken over neighboring pairs and assumed finite, is the most one person can change . For and the Laplace mechanism releases , where has the Laplace density with scale ,
It is -differentially private. With and , the triangle inequality gives at every output , so the two output densities differ by at most a factor at every point, and integrating over gives the inequality. Noise added without this calibration to the sensitivity carries no guarantee. Differential privacy limits what a release reveals about one person’s participation. It does not stop inferences about a person drawn from patterns in other people’s data, and it does not make an unauthorized use permitted.
In plain words Adding or removing one person’s data can multiply the probability of any set of outcomes by at most , apart from an additive allowance of . This limits how well anyone, even an observer who knows everyone else’s data, can test whether this person took part. A test that says “included” whenever the output lands in has a true positive rate of at most times its false positive rate, plus , and the smaller and are, the closer the best such test comes to random guessing.
Example A count to which each person contributes at most one has sensitivity under adding or removing a person. With the Laplace scale is . Take neighboring datasets with true counts and and the event that the released value is at least . With true count this needs , which has probability . With true count it needs , which has probability
The ratio of the two probabilities is
exactly the bound , so this event meets the bound with equality. One event only illustrates the bound, and the density argument above proves it for every event.
Privacy budget
Definition A privacy budget is a declared total that bounds the privacy loss of everything released from a protected dataset, under one stated neighboring relation and one stated accounting method. Two results do the accounting at the basic level. Basic sequential composition says the following. Suppose mechanisms are applied to the same dataset, each is -differentially private under that relation, and each uses fresh randomness independent of the others, where may be chosen after seeing earlier outputs as long as it is -differentially private for every possible value of them. Then releasing all outputs together is -differentially private with
Post-processing says that any function of a differentially private output that does not access the private data again, even a randomized function using independent randomness, keeps the same . Refined accounting methods can give smaller totals in suitable settings. Every release counts, including repeated training runs, model selection and diagnostics computed from the protected data. A budget is not a number of people who may safely be exposed, and a calculation for one count does not certify a trained model as private, which needs a mechanism designed for training and a full accounting.
In plain words Each release from the same people spends part of a declared allowance, and under basic accounting the parts add up. Rounding or plotting a private result costs nothing more, but going back to the raw data, even only to choose which result to publish, is a new use that has to be counted.
Example Three counts are each released with , and fresh independent Laplace noise, all from the same people. Basic composition gives for the three releases together, so the guarantee allows a probability ratio up to when one person is added or removed, against for a single release. Reporting for the whole set because each release used would be wrong. Rounding each released count to a whole number is post-processing and keeps the total at . Rerunning a count until the result looks reasonable and publishing that run is not post-processing, because every run reads the private data. If that takes four runs, basic composition charges for that count alone.
Data poisoning and adversarial input
Definition Data poisoning is the deliberate insertion or alteration of training data, labels or other learning inputs, such as fine-tuning sets or user feedback, by someone who wants to change the fitted model, either its behavior overall or its behavior on inputs the attacker chooses. An adversarial input is an input crafted at prediction time, when the model is already fixed, to make it produce an unwanted output, often through a change that looks small or irrelevant to a person. Poisoning acts on learning and adversarial inputs act on prediction, so they call for different controls. Against poisoning these include tracking the provenance of data, restricting who can write training data and labels, validating changes and inspecting unusual shifts in values or labels. Against adversarial inputs they include validating the structure of inputs, testing the model against relevant manipulations and routing doubtful cases to a fallback or to human review. Neither ordinary noise nor a differential privacy guarantee replaces these controls. Privacy limits what a release reveals about participation, while integrity concerns how manipulation changes behavior, and a workflow can satisfy one and fail the other.
In plain words Poisoning corrupts what the model learns from, and an adversarial input tricks the finished model. A system can protect privacy well and still be easy to manipulate, so each property needs its own evidence.
Example Both cases are constructed. A model predicts a delivery time as the mean of its training durations, and nine genuine records of 18, 19, 20, 20, 21, 22, 20, 19 and 21 minutes give 20 minutes. One inserted record of 120 minutes moves the mean of the ten records to 30 minutes, while their median stays at 20. A range check would catch this record, but poisoned records are usually built to look ordinary. At prediction time, take a linear classifier that predicts class 1 when , with weights . The input scores and gets class 1. Changing each feature by at most changes the score by at most , so no change with can flip the class. Moving each feature by against the sign of its weight gives , which scores and gets class 0.
Check yourself
- A count can change by at most when one person is added or removed. Find the Laplace scale that gives . Then find the basic composition total for two pure differentially private releases from the same people, with and and independent noise.
Show the answer
The scale is the sensitivity divided by the privacy parameter, so .
Basic composition adds the parameters, so releasing both outputs is -differentially private, since and both releases have . The total is not , the larger of the two, because both releases read the same people’s data.
- A team says that a dataset of customer messages found on a public website needs no license review, and that deleting the name column made the messages anonymous. What does each claim miss?
Show the answer
Public access is not permission. The team has to read the actual terms and check that they cover the intended operations, such as training, commercial use or redistribution, and their conditions. It also has to check that the source had authority over the material it published. Because the messages concern people, the basis for using them and the purpose they were collected for matter as well.
Deleting names removes one direct identifier. Combinations of other fields, such as a region, an age band and a job, can single a person out, messages can contain addresses or distinctive descriptions in their text, and pseudonymous codes can be linked back. Whether someone can be identified depends on what else an observer knows, so the team should inspect the remaining fields and text and the release context instead of declaring the data anonymous. Even a careful check of the table says nothing about what a model trained on it might memorize.
- A dashboard publishes the number of support messages that mention a delay, with Laplace noise of scale added, and the team reports per customer. A customer can send up to such messages. Is the claim right? Give two ways to repair it.
Show the answer
Not at the customer level. If neighbors differ by one message, the count has sensitivity and scale gives , but that protects single messages. Adding or removing a customer can change the count by up to , so the customer-level sensitivity is and scale gives only . The bound is reached, since for true counts and the event that the release is at least has probabilities and , a ratio of instead of .
One repair keeps the count and raises the scale to , which gives per customer. The other changes the query so that each customer contributes at most one, for example by counting customers who mentioned a delay, which has sensitivity , so scale gives per customer. In both cases every further release of the dashboard adds to the budget.