TL;DR
The Gaussian mechanism releases a query's true answer plus random noise drawn from a bell curve. The width of that curve is set by the query's L2 Global Sensitivity, so a query that can move a lot gets more noise. The result is a guarantee called approximate differential privacy, with two numbers and that say how much a single person's data can show.
Builds on: Global Sensitivity, Gaussian (Normal) Distribution · Leads to: Differential Privacy
Where it's used
Training neural networks with privacy. In DP-SGD, a training method from Abadi and colleagues in 2016, each example's Gradient is clipped to a fixed length. The clipped gradients are summed for a batch, and Gaussian noise is added to that sum before the model update. The clip length is the sensitivity, so the noise can be scaled to it.
Releasing statistics about groups. A health or public-policy team may publish averages, counts or histograms of a dataset. Releasing the exact numbers would reveal whether a particular person is in the data, so the team adds Gaussian noise calibrated to how much one record can change each published number.
Analytics on user devices. A product team that wants aggregate usage numbers from many phones can have each phone add its own noise before sending a value, so that the server never sees an exact individual contribution. The noise each device adds is still the Gaussian mechanism, applied locally to its own value.
How it works
Take one count, add noise, and see what the released number looks like.
- Compute the true answer. A query counts how many people in a dataset visited a clinic last week. The true count is .
- Find the sensitivity. Adding or removing one person changes the count by at most 1, so the L2 global sensitivity is . Check: a count can move by 1 when one person is added.
- Choose the noise width. The privacy target fixes a noise standard deviation in proportion to the sensitivity. Suppose the target gives here. Check: a bigger sensitivity means a wider curve.
- Draw the noise. Sample one value from a normal distribution with mean 0 and standard deviation 2. Suppose the draw is . Check: most draws fall within about two standard deviations, so between and .
- Add and release. Publish , not 40.
- Read the result. The released number is close to the truth, and any single person's presence is hidden by the noise width. Check: a neighbouring dataset gives a true count of 41 or 39, and the released value still has a similar spread.
flowchart LR A[Dataset D] --> B[True answer f of D] A --> C[L2 global sensitivity] C --> D[Noise width sigma] D --> E[Draw noise z] B --> F[Add noise] E --> F F --> G[Release]
The math
Definition
Let be a query with L2 global sensitivity . The Gaussian mechanism releases
where is a multivariate normal vector of independent normal values, each with mean 0 and standard deviation , and is the identity matrix that makes the noise independent in each coordinate.
The symbol reads "normal distribution with mean zero and covariance ". A Gaussian is fully set by its mean and variance, and here the variance is .
Step 1 in symbols: the true answer
Compute on the actual dataset. For the count, . This number is what the mechanism hides.
Step 2 in symbols: the sensitivity
The change in the answer for a neighbouring dataset has L2 size at most , as defined in Global Sensitivity. For a scalar count, the L2 size is just the absolute change, so .
Step 3 in symbols: the noise width
The privacy guarantee is stated with two numbers. says how much the output distribution may shift when one record is changed; smaller is more private. is a small probability allowance for rare events where that shift is larger. The standard sufficient condition for -differential privacy, valid when , is
In words: the noise must grow with the sensitivity, and it must shrink as the allowed leakage grows. The term grows slowly as gets smaller.
- sigma = 1
- sigma = 2
Step 4 in symbols: draw and add
Sample from and output . Each coordinate of is an independent normal value. For a scalar count, it is a single normal draw.
Worked examples
The true count is , the sensitivity is , and the chosen noise standard deviation is .
- Draw one noise value from a normal distribution with mean 0 and standard deviation 2.
- Suppose the draw is .
- Release .
- Check the size: the noise was 1.5, which is less than one standard deviation, so the output is a typical draw.
- Conclusion: the released count is 41.5. Repeating the release with a new draw gives a different number each time, which is the point of the mechanism.
Take , and .
- Compute the log term: . Since .
- Double it: , so .
- Take the square root: .
- Divide by and multiply by the sensitivity: .
- Conclusion: a noise standard deviation of about 9.7 gives -differential privacy for this count.
- Compare: halving to 0.25 doubles the required to about 19.4, because is proportional to .
A model is trained on mini-batches. Each example's gradient is clipped so its L2 length is at most . The batch sum is the query, and adding or removing one example changes it by at most in L2, so . Use a noise multiplier of 1.1, so per coordinate. The batch has 4 examples, and the clipped sum is .
- Draw noise from . The draw is an illustration, not a sample from a seeded generator.
- Add it to the sum: .
- Divide by the batch size 4 to get the averaged update direction: .
- Each coordinate of the noisy sum has standard deviation 1.1, so the noise is large compared with the true sum of 0.6 and -0.2. This is the cost of privacy, and it is why batch size matters.
- Conclusion: the update uses noisy but privacy-protected gradients, and every released sum is calibrated to the clip length.
Try it: the clip length is and the noise multiplier is 2. What is the noise standard deviation per coordinate?
Answer: .
Common mistakes and tradeoffs
Mistake 1: using the L1 sensitivity. The difference between the L1 and L2 norms matters here. It is tempting to plug in whichever sensitivity is at hand. In fact the Gaussian mechanism is calibrated to the L2 sensitivity . The L1 size of a change is never smaller than its L2 size, so noise calibrated to L1 is still private, but it is needlessly large. The L1 sensitivity is the natural input for the Laplace mechanism, a different method.
Mistake 2: thinking the guarantee is pure. It is tempting to read as the whole story. In fact the Gaussian mechanism gives approximate privacy, and is a real allowance for rare events where the leakage is worse than . A safe choice makes much smaller than one over the number of records, so that a small group cannot be exposed with high probability.
Mistake 3: forgetting that repeated releases add up. It is tempting to treat each release as private on its own. In fact every release leaks some information, and the privacy costs accumulate across queries and training steps. Systems track a total budget for this reason.
Mistake 4: clipping after noise. It is tempting to add noise first and clip later. In fact the sensitivity bound only holds if each record's contribution is clipped before the sum, so the clip must come first.
Tradeoffs. A larger means less noise and weaker privacy. A smaller costs only a logarithm, so it is cheap to make it small. A tighter analysis of the same mechanism can give less noise for the same guarantee.
When to use it. Use the Gaussian mechanism when the query has a finite L2 sensitivity, and approximate privacy is acceptable. It is the usual choice for high-dimensional outputs such as gradient sums.
When not to use it. When you need pure -privacy with , the Laplace mechanism is the usual alternative for queries with a small L1 sensitivity.
History
Differential privacy was formalised in 2006 by Cynthia Dwork, Frank McSherry, Kobbi Nissim and Adam Smith, who showed that noise calibrated to sensitivity gives a provable guarantee. The version with a small failure probability followed in the same period, and Gaussian noise became a common choice for high-dimensional outputs. Dwork and Aaron Roth's 2014 monograph gives the calibration used in this lesson. In 2016 Abadi and colleagues showed how to train deep networks with Gaussian noise on clipped gradients, which turned the mechanism into a standard tool in machine learning.
Recap
- The Gaussian mechanism adds normal noise to a query's true answer.
- The noise width grows with the L2 Global Sensitivity and shrinks as grows.
- is a small allowance for rare failures, so the guarantee is approximate.
- Clipping makes the sensitivity finite, and repeated releases add up their privacy cost.
- Read next: Differential Privacy, which defines the guarantee these numbers are chosen to meet.
Check yourself
QuestionIn one sentence, what does the Gaussian mechanism add to a query's answer?Show answer
It adds independent normal noise with mean zero, whose standard deviation is set by the query's L2 global sensitivity and the privacy target.
QuestionWith and , the calibrated noise standard deviation is about 9.69 when . What is it, approximately, when ?Show answer
Since is proportional to , halving doubles . The answer is about .
QuestionWhy does the Gaussian mechanism use the L2 sensitivity rather than the L1 sensitivity?Show answer
The calibration theorem for the Gaussian mechanism is stated in terms of the L2 size of the change in the answer. The L2 size is never larger than the L1 size, so calibrating to L1 would still be safe, but it would add more noise than needed.
QuestionA DP-SGD run clips each example's gradient to length 0.5 and uses a noise multiplier of 1.5. A colleague says the noise per coordinate should be 1.5. Is that right?Show answer
No. The noise standard deviation is the noise multiplier times the clip length, so it is per coordinate.