How does DP-SGD (differentially private stochastic gradient descent) bound per-example influence and add noise during training? In a batch of size with clipping threshold and noise multiplier , two per-example gradients have norms and : what are their clipping scale factors, what is the per-coordinate noise standard deviation on the averaged gradient, and why do per-example clipping, subsampling, and larger batches matter?
ML systems and evaluation, Privacy
Level L4 Advanced. Length Medium. Nature Th+Mat Both.
What's being asked
Whether you know the exact DP-SGD (differentially private stochastic gradient descent) update, why clipping must happen per example, and how privacy accounting and batch size govern utility.
Key idea
DP-SGD bounds every training example's influence by clipping each per-example gradient to norm at most before summing, adding isotropic Gaussian noise (where is the identity matrix), and dividing by the batch size . Because sensitivity is capped at per example regardless of parameter count, modern privacy accountants can track cumulative privacy loss across thousands of updates.
Steps
- Write one DP-SGD step on a mini-batch of expected size : compute per-example gradients ; clip each vector as ; sum and noise as ; and divide by to update with learning rate .
- Apply the clipping numbers (): for , the scale factor is , shrinking its norm to . For , the scale factor is , leaving the gradient unchanged at norm .
- Compute the per-coordinate noise standard deviation on the averaged gradient : each coordinate of the summed noise has standard deviation , so dividing by at and yields zero-mean Gaussian noise with standard deviation
- Explain why clipping must be per example: clipping only the batch-averaged gradient lets a single extreme example (say norm ) hijack the batch direction before clipping, so the sensitivity of the update with respect to one record would remain unbounded.
- Explain subsampling amplification and privacy accounting: when each record from a dataset of size is included independently with probability (Poisson subsampling), any single person affects a step only with probability , amplifying privacy. Across many steps, naive sequential composition is far too loose, so DP-SGD uses tighter tools—such as the moments accountant or Rényi DP (Rényi differential privacy) accountants—to accumulate over training, where is the small failure probability.
- Note the accuracy cost and why bigger batches help: clipping biases gradients when is small, while Gaussian noise adds per-coordinate variance . Larger batches shrink the noise standard deviation on the averaged update as at fixed , which typically improves the privacy–accuracy trade-off despite slightly higher sampling rate .
Common mistakes
- Clipping the mini-batch average instead of per-example gradients; batch-level clipping fails to bound an individual example's sensitivity.
- Adding noise of standard deviation after dividing by rather than before, which makes the update times noisier than intended.
- Using batch normalisation inside a DP-SGD model; sharing batch statistics across examples couples records and violates the per-example sensitivity guarantee (use layer or group normalisation instead).
How long your answer should be
3–4 minutes: update equations, worked clipping and noise numbers, per-example rationale, and accounting plus batch-size trade-off.
Read this
Previous in ML systems and evaluation: What is -differential privacy, and why does the Laplace mechanism satisfy it? For a counting query (sensitivity ) released with the Laplace mechanism at , what are the noise scale , variance, standard deviation, and tail probability , and how do privacy and accuracy change across repeated queries?
Next in ML systems and evaluation: For a probabilistic binary classifier issuing discrete forecast values with bin sizes (summing to ), bin observed frequencies and overall base rate , how do you derive Murphy’s three-term decomposition of the Brier score into reliability, resolution and uncertainty, and what does each term measure?