Inferensys

Glossary

Differentially Private Stochastic Gradient Descent (DP-SGD)

A training algorithm that clips per-sample gradients and adds Gaussian noise to protect the privacy of individual training records during optimization.
ML engineer managing model training cluster on laptop, GPU utilization visible, technical deep learning setup.
PRIVACY-PRESERVING TRAINING ALGORITHM

What is Differentially Private Stochastic Gradient Descent (DP-SGD)?

DP-SGD is the de facto standard algorithm for training deep neural networks with formal differential privacy guarantees, preventing the memorization of individual training records.

Differentially Private Stochastic Gradient Descent (DP-SGD) is a training algorithm that modifies standard SGD by clipping per-sample gradients to a fixed L2 norm bound and injecting calibrated Gaussian noise into the aggregated gradient, providing a provable privacy guarantee that limits what can be inferred about any single training data point from the resulting model parameters.

The algorithm introduces a privacy accountant that tracks the cumulative privacy loss across training steps using the moments accountant method. By bounding the sensitivity of each individual data point's contribution and adding noise proportional to that bound, DP-SGD enforces a strict privacy budget (epsilon, delta) that quantifies the maximum information leakage, enabling organizations to train on sensitive data while providing mathematical assurance against membership inference and model inversion attacks.

THE PRIVACY-PRESERVING OPTIMIZER

Key Features of DP-SGD

Differentially Private Stochastic Gradient Descent (DP-SGD) modifies the standard training loop to provide formal privacy guarantees. It achieves this through two core mechanisms applied during each training step.

01

Per-Sample Gradient Clipping

Before averaging, the L2 norm of each individual gradient is computed. If it exceeds a predefined clipping threshold (C) , the gradient is scaled down to have a norm exactly equal to C. This bounds the sensitivity—the maximum influence any single training example can have on the model update.

02

Calibrated Gaussian Noise Addition

After clipping and averaging the per-sample gradients, random noise drawn from a Gaussian distribution is added to the aggregated gradient. The noise scale is proportional to the clipping threshold and inversely proportional to the target privacy loss (epsilon). This step obscures the contribution of any single individual.

03

The Moments Accountant

A sophisticated privacy accounting technique used to track the total privacy loss (the privacy budget) over many training iterations. Unlike basic composition theorems, the Moments Accountant provides a much tighter bound on the accumulated epsilon and delta values, allowing for more training steps before the budget is exhausted.

04

Privacy-Utility Trade-off

The core tension in DP-SGD is balancing model accuracy against the privacy guarantee. Key levers include:

  • Noise Multiplier (z): Higher noise improves privacy but degrades accuracy.
  • Clipping Threshold (C): Too low destroys signal; too high adds excessive noise.
  • Batch Size: Larger batches can improve signal-to-noise ratio but require careful subsampling analysis.
05

Subsampling Amplification

A critical technique where each training step uses a random subset (mini-batch) of the data rather than the full dataset. The randomness of Poisson subsampling or uniform shuffling amplifies the privacy guarantee, as an adversary cannot be certain if a specific record was included in any given step.

06

Formal (ε, δ)-DP Guarantee

DP-SGD provides a quantifiable, provable privacy guarantee defined by two parameters:

  • Epsilon (ε): The privacy loss budget. A smaller epsilon (e.g., 0.1-8) means stronger privacy.
  • Delta (δ): The probability of a catastrophic privacy failure, typically set to be cryptographically small (e.g., less than 1/N, where N is the dataset size).
DP-SGD EXPLAINED

Frequently Asked Questions

Clear, technical answers to the most common questions about Differentially Private Stochastic Gradient Descent, the foundational algorithm for privacy-preserving deep learning.

Differentially Private Stochastic Gradient Descent (DP-SGD) is a training algorithm that modifies standard stochastic gradient descent to provide formal differential privacy guarantees for individual records in a training dataset. It works by introducing two critical steps into each iteration of training: per-sample gradient clipping and Gaussian noise addition. First, the gradient is computed for each individual data point, and its L2 norm is bounded to a fixed clipping threshold C, limiting the maximum influence any single record can have on the model update. Second, calibrated Gaussian noise drawn from a distribution with variance proportional to C²σ² is added to the sum of these clipped gradients. This noisy, bounded update is then used to adjust the model weights. The result is a model whose parameters, and therefore its outputs, are statistically indistinguishable from a model trained on a dataset that did not include any particular individual's record, quantified by the privacy loss parameter epsilon (ε).

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.