Train models with differential privacy and track epsilon

8 steps · about 3 h · Intermediate

  1. Define neighbouring datasets and the privacy budget (reference, Wikipedia, 20 min)

    Establishes what epsilon and delta guarantee about any single training record's influence.

  2. See why anonymization alone fails on aggregate queries (guide, Programming Differential Privacy, 20 min)

    Motivates formal privacy guarantees with concrete reconstruction and differencing attacks.

  3. Bound sensitivity and calibrate additive noise (guide, Programming Differential Privacy, 25 min)

    Demonstrates how Laplace and Gaussian mechanisms scale noise to the worst-case single-record change.

  4. Track cumulative privacy loss with composition (guide, Programming Differential Privacy, 25 min)

    Explains why repeated queries or training steps spend privacy budget and how moments accounting tightens bounds.

  5. Read the DP-SGD algorithm and clipping step (article, arXiv, 30 min)

    Shows why per-sample gradients must be clipped to a fixed norm before adding Gaussian noise.

  6. Inspect Opacus's privacy-engine architecture (repo, PyTorch Opacus, 15 min)

    Shows how a production library computes per-sample gradients and hooks into standard PyTorch optimizers.

  7. Train a differentially private classifier end to end (tutorial, PyTorch Opacus, 30 min)

    Walks through model validation, PrivacyEngine attachment and logging epsilon at each epoch.

  8. Tune max_grad_norm, noise_multiplier and target_epsilon (reference, PyTorch Opacus, 15 min)

    Documents the exact parameters that govern accuracy versus privacy budget in practice.