Inferensys

Glossary

Differentially Private Stochastic Gradient Descent (DP-SGD)

A training algorithm that clips per-sample gradients and adds calibrated Gaussian noise to the aggregated gradient during optimization, providing formal differential privacy guarantees for deep learning models.
ML engineer managing model training cluster on laptop, GPU utilization visible, technical deep learning setup.
PRIVACY-PRESERVING DEEP LEARNING

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

DP-SGD is a training algorithm that injects calibrated noise into the optimization process of neural networks to provide formal mathematical guarantees against the leakage of individual training records.

Differentially Private Stochastic Gradient Descent (DP-SGD) is a modification of the standard SGD algorithm that provides formal differential privacy guarantees for deep learning models. It operates by clipping per-sample gradients to a fixed L2 norm threshold and then adding Gaussian noise calibrated to the desired privacy budget (epsilon) to the aggregated gradient before updating model weights.

This mechanism ensures the final model's parameters are statistically indistinguishable from those trained on a dataset that excludes any single record. The privacy accountant tracks cumulative privacy loss across training steps, enabling precise control over the epsilon-delta guarantee. DP-SGD is the foundational algorithm for training neural networks on sensitive data within sovereign AI infrastructure.

MECHANICS

Core Properties of DP-SGD

Differentially Private Stochastic Gradient Descent modifies the standard training loop with two critical operations—per-sample gradient clipping and calibrated noise injection—to provide formal privacy guarantees during deep learning optimization.

01

Per-Sample Gradient Clipping

Before aggregation, the gradient of each individual training example is bounded to a maximum L2 norm C. This prevents any single outlier record from contributing disproportionately to the model update.

  • Clipping ensures the sensitivity of the query is bounded
  • Gradients exceeding C are scaled down while preserving direction
  • Lower C values reduce sensitivity but may discard useful information
  • The clipping threshold is a critical hyperparameter balancing privacy and utility
02

Gaussian Noise Injection

After clipping and aggregating per-sample gradients, isotropic Gaussian noise drawn from N(0, σ²C²I) is added to the summed gradient. The noise scale σ is calibrated to the desired privacy parameter ε.

  • Noise variance scales with the clipping norm squared
  • Higher σ provides stronger privacy at the cost of model accuracy
  • The noise mechanism satisfies (ε, δ)-differential privacy
  • The privacy loss random variable follows a sub-Gaussian distribution
03

Privacy Amplification by Subsampling

When each training step uses a random subset of the data rather than the full batch, privacy guarantees are amplified. An adversary cannot be certain whether a target record was included in any given step.

  • Poisson subsampling provides tighter privacy accounting than uniform sampling
  • Amplification reduces the ε cost per query by approximately the sampling rate q
  • Enables training on large datasets with acceptable total privacy budgets
  • The moments accountant tracks amplified privacy loss across iterations
04

Moments Accountant

A privacy accounting technique that tracks the log moments of the privacy loss random variable across training steps. It provides a tight bound on the total (ε, δ) guarantee compared to basic composition theorems.

  • Computes the moment-generating function of the privacy loss
  • Provides significantly tighter bounds than strong composition
  • Accounts for subsampling amplification automatically
  • Enables training for more iterations under a fixed privacy budget
05

Privacy Budget (ε, δ) Tracking

DP-SGD consumes a quantifiable privacy budget with each training iteration. The total (ε, δ) guarantee is computed by composing the per-step privacy loss across all iterations.

  • ε (epsilon): upper bound on privacy loss, typically 0.1–10 for practical deployments
  • δ (delta): probability of catastrophic privacy failure, usually < 1/|dataset|
  • Budget is exhausted linearly under basic composition, sublinearly under advanced accounting
  • Training must halt when the target budget is reached
06

Trade-off: Privacy vs. Utility

The clipping norm C and noise multiplier σ create a fundamental tension. Tighter privacy requires smaller C and larger σ, which degrades model convergence and final accuracy.

  • Excess clipping introduces bias by distorting gradient directions
  • Large noise variance slows convergence and increases training variance
  • Larger batch sizes reduce noise relative to signal
  • Pre-training on public data can mitigate utility loss under tight budgets
TRAINING ALGORITHM COMPARISON

DP-SGD vs. Standard SGD: Key Differences

A technical comparison of the gradient computation, clipping, and noising mechanisms that distinguish differentially private training from standard optimization.

FeatureStandard SGDDP-SGDDP-SGD with PATE

Per-sample gradient computation

Gradient clipping

Gaussian noise injection

Formal privacy guarantee (ε, δ)

Training throughput

Baseline

2-10x slower

Teacher-dependent

Model utility (relative accuracy)

100%

85-98%

80-95%

Requires disjoint data partitions

Defense against membership inference

DP-SGD EXPLAINED

Frequently Asked Questions

Clear, technically precise answers to the most common questions about the mechanics, guarantees, and implementation trade-offs of Differentially Private Stochastic Gradient Descent.

Differentially Private Stochastic Gradient Descent (DP-SGD) is a training algorithm that modifies the standard SGD optimization process to provide formal mathematical guarantees that the resulting model does not memorize information about any single training example. It works through two primary mechanisms applied during each training step: per-sample gradient clipping and calibrated noise injection. First, the gradient for each individual data point in a mini-batch is computed and its L2 norm is clipped to a fixed threshold C, bounding the influence of any single record. The clipped per-sample gradients are then aggregated into a batch gradient. Before the model weights are updated, random Gaussian noise scaled by the noise multiplier σ and the clipping norm is added to the aggregated gradient. This ensures the final model parameters satisfy (ε, δ)-differential privacy, where ε (the privacy budget) quantifies the maximum privacy loss. The core insight is that by bounding individual contributions and obscuring the aggregate with noise, an adversary cannot reliably determine whether a specific record was included in the training set, even with access to the final model weights.

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.