# Deep Learning with Differential Privacy

Deep networks can be trained with differential privacy at manageable cost

Martín Abadi, Andy Chu, Ian Goodfellow, H. Brendan McMahan, Ilya Mironov, Kunal Talwar and 1 more · arXiv · 2016-7-1

- **Problem** Large networks can leak fine details of their training data. Earlier private methods mostly handled convex models, since deep networks have non-convex objectives.
- **Method** The authors clip each example's gradient to a set norm and add Gaussian noise during SGD, tracking privacy cost with a moments accountant.
- **Results** The private MNIST model reaches 97% test accuracy at (8, 10−5)-differential privacy, with a manageable cost in training efficiency and model quality.

## Why private deep learning has been hard

Large networks have capacity to spare, so their internal representations may encode fine details of some training records. A determined adversary may be able to pull parts of the training data out of a model. The authors also allow for an adversary who controls much of the rest of the training data, which is common with crowdsourced data.

Differential privacy offers a formal guarantee against this kind of leakage. Earlier work got strong results on convex models with few parameters, or handled complex networks at a large privacy loss. Deep networks have non-convex objectives, so the optimization methods built for convex problems don't carry over directly.

One simple idea is to treat training as a black box and add noise only to the final parameters. The trouble is that the link between those parameters and the training data is hard to characterize, so worst-case noise would wreck the model. So the authors instead control each example's influence inside SGD itself.

## Tracking the moments of the privacy loss

The key idea is to compose the moments of the privacy loss rather than the (ε,δ) bound of each step. Log moments add up across steps, and a tail bound then turns the total into an (ε,δ) guarantee. The strong composition theorem can be loose because it ignores the particular noise distribution in use, and the moments accountant does not.

The privacy loss at an outcome \\(o\\) is the log ratio of output probabilities on two neighboring databases. Formally, \\(c(o;\\mathcal{M},aux,d,d')=\\log\\frac{\\Pr\[\\mathcal{M}(aux,d)=o\]}{\\Pr\[\\mathcal{M}(aux,d')=o\]}\\). The λth moment \\(\\alpha\_{\\mathcal{M}}(\\lambda)\\) is the log of the moment generating function of this loss, and the maximum is taken over auxiliary inputs and neighboring pairs.

Composition says \\(\\alpha\_{\\mathcal{M}}(\\lambda)\\le\\sum\_{i=1}^{k}\\alpha\_{\\mathcal{M}\_i}(\\lambda)\\), so the moments of adaptive steps simply add. For a chosen ε, the tail bound gives \\(\\delta=\\min\_\\lambda\\exp(\\alpha\_{\\mathcal{M}}(\\lambda)-\\lambda\\varepsilon)\\). For a Gaussian mechanism with random sampling, the moments come from the mixture \\(\\mu=(1-q)\\mu\_0+q\\mu\_1\\), and the asymptotic form is \\(\\alpha(\\lambda)\\le \\frac{q^2\\lambda(\\lambda+1)}{(1-q)\\sigma^2}+O(q^3/\\sigma^3)\\).

Theorem 1 says that for \\(\\varepsilon\<c\_1q^2T\\), training is (ε,δ)-private when \\(\\sigma\\ge c\_2\\frac{q\\sqrt{T\\log(1/\\delta)}}{\\varepsilon}\\).

Relative to the strong composition theorem, the bound saves a √log(1/δ) factor in the ε term and a Tq factor in the δ term. With q = 0.01, σ = 4 and δ = 10−5, the moments accountant gives ε = 1.26 at 100 epochs, compared to 9.34 from the strong composition theorem. At 400 epochs the moments accountant gives 2.55, and the strong composition theorem gives 24.22.

The gap widens with longer training, so the accountant matters more as the number of epochs grows.

## One training step, from gradient to noisy update

Each step draws a random lot, where every example is picked with probability q = L/N. For each example in the lot, the step computes the gradient \\(g\_t(x\_i)=\\nabla\_{\\theta\_t}L(\\theta\_t,x\_i)\\). Because the update is a sum over all these gradients, one example could move it a lot unless its influence is bounded.

Each gradient is replaced by \\(\\bar g\_t(x\_i)=g\_t(x\_i)/\\max\\left(1,\\frac{\\\|g\_t(x\_i)\\\|\_2}{C}\\right)\\). A gradient with norm at most C passes unchanged, and a larger one is scaled down to norm C. Clipping per example is common in ordinary SGD too, though there it usually suffices to clip after averaging.

The clipped gradients are summed, Gaussian noise with covariance \\(\\sigma^2C^2I\\) is added, and the result is divided by L. The formula is \\(\\tilde g\_t=\\frac{1}{L}\\Big(\\sum\_i\\bar g\_t(x\_i)+\\mathcal N(0,\\sigma^2C^2 I)\\Big)\\). The weights then step against this noisy average: \\(\\theta\_{t+1}=\\theta\_t-\\eta\_t\\tilde g\_t\\). Because the noise scale is σC, a larger clipping threshold forces more noise into every update.

The lot average is an unbiased estimate, and its variance shrinks as the lot grows. The authors use constant C and σ in the reported results, though per-layer and time-varying settings are allowed. An epoch is N/L lots, so the number of epochs fixes how many steps the accountant sees.

## Per-example gradients and the accountant loop

Batched gradients in TensorFlow give only the average, so the implementation needs each example's gradient separately. The per\_example\_gradient operator returns one gradient per example, and the authors report only a modest slowdown even at larger batch sizes. The sanitizer then clips and adds noise, while the privacy\_accountant tracks spending over training.

The operator covers losses where each example is singly connected to the loss, which handles most hidden layers but not convolutional layers. In the training loop the accountant is updated before each gradient step, and training continues while the privacy spending stays within a preset limit. The accountant computes α(λ) numerically over a range of λ, and for these parameters it suffices to go up to \\(\\lambda\\le 32\\).

Rogers et al. warn about risks when privacy parameters are chosen adaptively. The authors pin the iteration count and privacy parameters before training starts, which avoids the attacks and negative results they describe.

The PCA projection is computed with a differentially private step: each example is normalized to unit ℓ2 norm, and Gaussian noise is added to \\(A^{T}A\\) before the principal directions are taken. Each input is then projected onto these directions before it reaches the network, which costs privacy but improves model quality and training time.

Convolutional layers remain hard to handle with per-example gradients, so for CIFAR-10 the authors learn them on public data instead.

## MNIST accuracy and the settings that move it

The private version keeps this architecture and clips each layer's gradient norm at 4. Three noise settings were tried: small (σ = 2, σp = 4), medium (σ = 4, σp = 7) and large (σ = 8, σp = 16).

Under private training the gap between training and test accuracy stays small, while non-private training overfits more as epochs grow. The authors tie this to the argument that differentially private training generalizes well. Because the accountant gives δ for any ε, the authors plot accuracy over pairs of (ε,δ), and 90% accuracy is reached at ε = 0.25 with δ = 0.01.

Reducing the input from 784 to 60 dimensions cuts training time by almost 10×, which the authors credit to PCA. The lot size matters more, and the best lot size was roughly the square root of N, where N is the number of training examples. Learning rates from 0.01 to 0.07 gave stable accuracy, with a peak at 0.05. Adding hidden units did not lower private accuracy, which the authors suggest may reflect larger networks tolerating noise, a point they leave for further analysis.

## CIFAR-10 with pretrained convolutional layers

The CIFAR-10 network has two convolutional layers and two fully connected layers, with 384 units in each fully connected layer. Trained without privacy from scratch, this network gets to about 86% in 500 epochs. Deeper networks with other non-linearities reach about 96.5%, which is the state of the art the authors cite.

The convolutional layers are not trained on the private data; only the softmax layer and the top or both fully connected layers are. Retraining only the fully connected layers on CIFAR-100 for about 250 epochs, with batch size 120, gives approximately 80%, which is the non-private baseline. The private version tries clipping between 3 and 10, and lot sizes of 600, 2,000 and 4,000, with 600 giving poor results.

With σ = 6 and clipping threshold 3, private accuracy was 67%, 70% and 73% for ε = 2, 4 and 8 at δ = 10−5. The lot size was 2,000 for the first setting and 4,000 for the other two. Per-epoch training time rose from about 40 seconds to about 180 seconds with these settings.

## Limitations

The CIFAR-10 drop is about 7%, while the MNIST drop is about 1.3%. The private CIFAR-10 runs train only the softmax and fully connected layers, so the convolutional layers were not trained privately. The authors leave closing this gap as an open test for future research.

Decreasing the noise over training was tried only in early experiments, and it gave no clear improvement. Theorem 1 states its guarantee only for ε below c1q²T. The strong-composition comparison is shown at one sampling ratio, noise level and δ, namely q = 0.01, σ = 4 and δ = 10−5.

The parameters are fixed ahead of time, so training can't adapt its privacy budget to what it sees along the way.

## Paper info

- **Authors**: Martín Abadi, Andy Chu, Ian Goodfellow, H. Brendan McMahan, Ilya Mironov, Kunal Talwar, Li Zhang
- **Venue**: arXiv · Preprint
- **First published**: 2016-7-1
- **Added**: 2026-11-11
- **Updated**: 2016-10-24
- **Version**: v2
- **arXiv**: 1607.00133
- **DOI**: 10.1145/2976749.2978318
- **Category**: stat.ML · cs.CR · cs.LG
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1607.00133v2) · [PDF ↗](https://arxiv.org/pdf/1607.00133v2)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Martín Abadi, Andy Chu, Ian Goodfellow, H. Brendan McMahan, Ilya Mironov, Kunal Talwar, Li Zhang (2016). Deep Learning with Differential Privacy. arXiv:1607.00133v2. https://doi.org/10.1145/2976749.2978318

**BibTeX**

```
@article{abadi2016deep,
  title = {{Deep Learning with Differential Privacy}},
  author = {Martín Abadi and Andy Chu and Ian Goodfellow and H. Brendan McMahan and Ilya Mironov and Kunal Talwar and Li Zhang},
  year = {2016},
  eprint = {1607.00133},
  archivePrefix = {arXiv},
  doi = {10.1145/2976749.2978318},
  url = {https://arxiv.org/abs/1607.00133v2}
}
```

## Other paper commentary

- ["Why Should I Trust You?": Explaining the Predictions of Any Classifier](https://refivu.com/en/papers/856ed702-7f55-4af3-8fa5-45538051a0a4-why-should-i-trust-you-explaining-the-predictions.md)
- [A Survey on Bias and Fairness in Machine Learning](https://refivu.com/en/papers/74d1cfa5-92d6-42d0-bf31-348c21768dc6-a-survey-on-bias-and-fairness-in-machine.md)
- [Artificial Intelligence: the global landscape of ethics guidelines](https://refivu.com/en/papers/d19d6be2-ce31-43ea-b84d-0b4bbe03543f-artificial-intelligence-the-global-landscape-of-ethics.md)
- [Towards A Rigorous Science of Interpretable Machine Learning](https://refivu.com/en/papers/584740f7-6441-4b76-a65b-06c10d825506-towards-a-rigorous-science-of-interpretable-machine-learning.md)
- [Stop Explaining Black Box Machine Learning Models for High Stakes Decisions and Use Interpretable Models Instead](https://refivu.com/en/papers/96d240ca-7c32-4f79-8167-c2beafc2a38f-stop-explaining-black-box-machine-learning-models-for.md)
- [UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction](https://refivu.com/en/papers/44ccc549-6643-4369-889c-f60f3d61cbf4-umap-uniform-manifold-approximation-and-projection-for.md)
- [Dual Attention Network for Scene Segmentation](https://refivu.com/en/papers/849ff02e-2552-4ac6-a139-a8a0f4332d34-dual-attention-network-for-scene-segmentation.md)
- [ADADELTA: An Adaptive Learning Rate Method](https://refivu.com/en/papers/e2abf038-96af-4e19-bbda-5c8262404473-adadelta-an-adaptive-learning-rate-method.md)
- [Dynamic Graph CNN for Learning on Point Clouds](https://refivu.com/en/papers/a7ba9236-fc2d-445b-bae5-b02e11ac4255-dynamic-graph-cnn-for-learning-on-point-clouds.md)
- [Unsupervised Cross-lingual Representation Learning at Scale](https://refivu.com/en/papers/6b2842f9-6ee4-433e-84ed-ae8dc85bdb0a-unsupervised-cross-lingual-representation-learning-at-scale.md)
- [ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design](https://refivu.com/en/papers/d1e3c93e-79dc-4e3d-a949-2f726da0b409-shufflenet-v2-practical-guidelines-for-efficient-cnn.md)
- [Deep Compression: Compressing Deep Neural Networks with Pruning, Trained Quantization and Huffman Coding](https://refivu.com/en/papers/7b8d214e-c983-4cf0-910e-176f0c996770-deep-compression-compressing-deep-neural-networks-with.md)

## Terms in this paper

- [Accuracy](https://refivu.com/en/terms/1995c0cd6282-accuracy)
- [CIFAR-10](https://refivu.com/en/terms/19035a518d0a-cifar-10)
- [sensitivity](https://refivu.com/en/terms/74e665f56f15-sensitivity)
- [TensorFlow](https://refivu.com/en/terms/408a8a74a3dc-tensorflow)
- [moments accountant](https://refivu.com/en/terms/a51c7b4ae0ff-moments-accountant)
- [network architecture](https://refivu.com/en/terms/654ea6c1b7ac-network-architecture)
- [norm clipping](https://refivu.com/en/terms/2bbdbfbca6b9-norm-clipping)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/a0a5e243-9f30-4599-aa16-17cc0c7b4ba8-deep-learning-with-differential-privacy)
