TL;DR
A query is a Function that takes a whole dataset and returns an answer, such as a count or a total. Global sensitivity measures how much that answer can move when one record is added or removed, and it takes the worst case over every possible dataset, not just the one you hold. The result is a single non-negative number, the largest possible change measured with a norm when the answer is a vector.
Builds on: Function, Vector Norm, Supremum · Leads to: Differential Privacy, Gaussian Mechanism
Where it's used
Private statistics on phone data. A company wants to publish how many users opened an app each day without revealing whether any one person was in the count. Before it can add random noise that hides a single person, it must know the largest change one person could cause in the published number. For a count that change is 1, so a small amount of noise is enough.
Census and health tables. A statistics office publishes totals such as the sum of household incomes in a region. One household can change that total by a lot, so the office first caps each income at a fixed ceiling. The cap is what makes the largest possible change finite, and the global sensitivity is the size of that cap.
Training models with privacy. A learning algorithm that takes an average of per-person gradients or a sum of clipped values must add noise scaled to how much one person can move that sum. Practical systems compute this bound for every query they release, then pick the noise level from it.
How it works
Take a tiny dataset and one query, then find the worst change any single record can cause.
- Start with a dataset. Let be three numbers, each between 0 and 1. The query is the sum: .
- Make a neighbour by adding one record. Let be with the number appended. Then . The answer moved by . Check: the new record is 1.0, and the sum grew by exactly that record.
- Try a different added record. Append instead. Now , so the answer did not move at all. Check: adding 0 changes no sum.
- Remove a record. Taking away gives a sum of , a change of . Removing is the same pair of datasets read backwards, so it cannot make a bigger change than adding.
- Look at every possible record. Every value lies between 0 and 1, so the change from any single record is at most 1. The change of exactly 1 is reached by adding a record whose value is 1.
- Take the worst case. The largest change over all datasets and all neighbours is 1. That number is the global sensitivity of the sum for values in . Check: this number does not depend on which dataset you started from.
flowchart LR A[Dataset D] --> B[Add or remove one record] B --> C[Neighbour D'] A --> D[Compute f on D] C --> E[Compute f on D'] D --> F[Size of the difference] E --> F F --> G[Largest difference over all D and D']
The math
Definition
Two datasets and are neighbours if is with exactly one record added or removed. For a query whose answer is a vector, the global sensitivity in the norm is
where means " and are neighbours", is the norm of the difference, and is the Supremum over all such pairs. When this is written , and when it is .
A record is one person's row in the dataset. A query is any function from datasets to numbers or vectors. The norm is the length of the difference. The norm adds absolute values, and the norm is the Euclidean length.
Step 1 in symbols: choose a neighbour
Pick any dataset and any record . The neighbour is when adding, or when removing. The set brackets name the collection of records and are not part of any formula you will compute.
Step 2 in symbols: the difference
The change in the answer is . For the sum query, , so adding gives
Here is the sum over the records and is the value of the one new record.
Step 3 in symbols: bound the change
If every record is clipped to lie in , then . Removing a record gives the change , so its size is also at most . Therefore
The bound is reached by choosing , so the supremum equals :
Step 4 in symbols: a vector query
Let . Adding one record with value in changes the answer by . Its norms are
Both grow as grows on , so the supremum is reached at :
- l1 change (x, 1)
- l2 change (x, 1)
Worked examples
A query returns the number of records in the dataset. A dataset holds three people, so .
- Add one new person to get with four records. Then .
- The change is .
- Remove a person instead: goes from 3 to 2, a change of , size 1.
- Every neighbour changes the count by exactly one record, so the largest change is 1.
- Conclusion: for any counting query, whatever the dataset looks like.
Each value is clipped to . The query is sum of the clipped values. Take , so .
- Add the value 10 to get . The sum is .
- The change is .
- Add the value 0 instead. The sum stays , so the change is 0.
- Any added value is between 0 and 10, so the change is between 0 and 10. Removing a value changes the sum by an amount between and 0, so its size is also at most 10.
- The largest size is 10, reached by adding a 10.
- Conclusion: . The same argument works for every starting dataset, so the answer does not depend on .
A sleep survey clips each person's reported hours to . The query returns the pair (total hours, number of respondents). Take a dataset and add one respondent who reports 12 hours. The change in the answer is .
- The size of the change is .
- The size of the change is .
- Compute : since , the root is just above 12, about .
- Any respondent with hours in gives a change with smaller norms, so the worst case is .
- Conclusion: and .
Try it: the same survey with hours clipped to . What are and ?
Answer: , and .
Common mistakes and tradeoffs
Mistake 1: confusing global sensitivity with the change on your data. It is tempting to measure how much the answer moves for the dataset you actually have. In fact the local change can be small for some datasets and large for others, and reporting it leaks information. Global sensitivity takes the worst case over all datasets, because the privacy guarantee has to hold for any dataset an attacker might guess.
Mistake 2: assuming an unbounded sum has a finite sensitivity. It is tempting to think a sum of salaries has a sensible worst case. In fact if values are unbounded, one record can change the sum by an arbitrarily large amount, so is infinite. This is why systems clip each value to a range first. Clipping is a real tradeoff: it adds a small bias to the answer in exchange for a finite sensitivity.
Mistake 3: treating all norms as interchangeable. It is tempting to pick whichever norm is convenient. In fact and differ, as Example 3 showed. The noise mechanisms in later lessons are calibrated to a particular norm, so using the wrong one either adds too little noise or more than needed.
When to use it. Use global sensitivity when the query's output is bounded or clipped and you need a guarantee that holds for every dataset. It is the standard input for Differential Privacy mechanisms.
When not to use it. When the output is unbounded and cannot be clipped, a global bound does not exist, and you need a different tool. Also, when the data are public and no privacy is needed, the sensitivity bound is unnecessary.
Alternatives. A tighter bound from a smarter query design gives less noise. Local sensitivity can be useful for analysis, but it is not a privacy guarantee on its own.
History
In the early 2000s, researchers working on private statistical databases knew that answers leak information about individuals, but they lacked a clean way to say how much noise was enough. In 2006 Cynthia Dwork, Frank McSherry, Kobbi Nissim and Adam Smith proposed calibrating noise to the sensitivity of the query, and introduced the idea that the amount of noise should depend on how much one record can change the answer. That paper made sensitivity the central quantity in the field. Dwork and Aaron Roth later gathered the theory in a monograph, which is the standard reference for the definition used here.
Recap
- A query maps a dataset to an answer, and a neighbour is a dataset with one record added or removed.
- The change in the answer is a vector, and its size is measured with a norm, such as or .
- Global sensitivity is the supremum of that size over all neighbouring pairs, so it holds for every dataset.
- Clipping makes sensitivity finite. Different norms give different bounds for the same query.
- Read next: Differential Privacy, which uses the sensitivity to decide how much noise to add, and Gaussian Mechanism, which calibrates Gaussian noise in the norm.
Check yourself
QuestionIn one sentence, what is a neighbouring pair of datasets?Show answer
Two datasets are neighbours when one is obtained from the other by adding or removing exactly one record. Everything else stays the same.
QuestionA sum query clips each value to . Dataset has values , so . If one record with value 6 is added, what is the change in the answer?Show answer
The new sum is , so the change is . The change equals the value of the added record, which is 6.
QuestionWhy does the definition take the worst case over all datasets instead of using the change on the dataset you have?Show answer
A privacy guarantee must hold for every dataset, including ones an attacker can guess. The change on your actual data can be small even when some other dataset would show a large change, and that gap would leak information about the people in the data. The supremum closes that gap.
QuestionA query returns (sum of hours, count) with hours clipped to . What is its global sensitivity?Show answer
The worst added record has 4 hours, giving a change . Its size is , so .