Dong Roth Su 2022 - Noisy SGD Privacy Analysis

Summary

Noisy SGD with clipping , batch size out of , noise multiplier and steps is -DP (Theorem 5.1), and asymptotically -GDP with when (Corollary 5.4). On MNIST, the GDP trade-offs improve on the guarantee derived from the moments accountant.

Overview

SGD is the benchmark for private optimization because its privacy depends on tight composition and amplification by subsampling. Bassily-Smith-Thakurta gave the first asymptotically optimal analysis but with meaningless bounds for realistic datasets, motivating divergence-based relaxations. Those lack subsampling amplification, so Abadi et al. developed the moments accountant, a tool tailored to subsampling followed by Gaussian noise. Here the general -DP tools give a simple and improved analysis.

Main Content

Algorithm 1: NoisySGD

Input: dataset , loss . Parameters: initial , learning rates , batch size , horizon , noise scale , gradient norm bound . For : (3) Subsampling: take a uniformly random of size (). For : (5) ; (6) clip ; (7) Average, perturb and descend: , with the identity matrix. Output: .

Note the noise convention: replace-one neighbors change one clipped gradient by up to in , so the average has sensitivity , and noise standard deviation gives a -GDP step. This differs from Abadi et al.’s add/remove convention (sensitivity on the sum, noise ), so the same nominal is not directly interchangeable between the two papers.

Step 1: one iteration. Let run lines 4-7 and run lines 3-7. Since one of the points affects only one , the sensitivity of is at most and, by Theorem 2.7, is -GDP (the descent step is deterministic post-processing).

Theorem 5.1

Algorithm 1 is -DP. (The mechanism does not release the subsampled indices.)

Proof. is -DP by Theorem 4.2; the trajectory is the -fold composition of so Theorem 3.2 gives the tensor power. The moments accountant applied to this problem is basically equivalent to directly computing , which is numerically cumbersome; the CLTs give an analytic approximation that becomes nearly exact as grows.

Theorem 5.2 (CLT for subsampled mechanisms)

Suppose is a symmetric trade-off function with and , and as . Then uniformly,

with .

The correct scaling between sampling ratio and iterations is .

Lemma 5.3 and Corollary 5.4 (asymptotic GDP for NoisySGD)

. Hence if , NoisySGD is asymptotically -GDP with

With epochs , the assumption is . Deep learning typically has small : AlexNet uses , , , so .

Lemma 5.5 and Corollary 5.6 (Berry-Esseen bound for NoisySGD)

Let and the standard normal density, , . Then , with and given by analogous integrals (Lemma 5.5). With

NoisySGD is -DP with .

This gives sharp, computer-evaluable (not closed-form) guarantees. is set to 0 on so is defined for .

Figure 7: MNIST comparison

All three runs use Algorithm 1 on the whole MNIST dataset, , batch size ; learning rates and clipping respectively; moments-accountant values from the tensorflow/privacy library at .

RunAccuracyEpochsGDP by CLT (Cor. 5.4) by moments accountant
A95.0%151.30.285-GDP
B96.6%601.10.737-GDP
C97.0%450.71.554-GDP

Reading note: the text extraction of the figure scrambled the panel order; the pairing above was checked against the rendered figure (each panel title, red GDP legend and blue MA legend) and against a recomputation of Corollary 5.4 with and : , , . In each panel the blue dashed curve is the piecewise-linear implied by the single moments-accountant pair, and the red GDP curve lies above it (visibly so in panels B and C).

Examples

Converting the GDP bounds to for comparison

Setup: use Corollary 2.13 on the three ‘s above at . Solution (recomputed): (vs 1.19 from the moments accountant); (vs 3.01); (vs 7.1) (using the unrounded from Corollary 5.4; the rounded printed values give 3.08 and 7.36). Interpretation: at the single point the two analyses are numerically close, with the GDP-implied smaller in the first run and about 3% larger in the other two. This is expected because Corollary 5.4 is asymptotic, not a certified bound, while the moments accountant gives a rigorous bound. The paper’s claim is about the whole trade-off curve (Figure 7 plots both on type I/II axes): the red GDP curve sits far above the piecewise-linear curve of the single pair, because one pair is only one corner of the guarantee. Use Corollary 5.6 for a certified f-DP bound with explicit error .

import numpy as np
from scipy.stats import norm
from scipy.optimize import brentq
 
def gdp_eps(mu, delta):
    f = lambda e: norm.cdf(-e/mu + mu/2) - np.exp(e)*norm.cdf(-e/mu - mu/2) - delta
    return brentq(f, 0, 100)
 
def cor_5_4_mu(m, n, epochs, sigma):
    T = epochs * n / m
    c = m * np.sqrt(T) / n
    inner = np.exp(sigma**-2) * norm.cdf(1.5/sigma) + 3*norm.cdf(-0.5/sigma) - 2
    return np.sqrt(2) * c * np.sqrt(inner)
 
for E, s in ((15, 1.3), (60, 1.1), (45, 0.7)):
    mu = cor_5_4_mu(256, 60_000, E, s)
    print(E, s, round(mu, 3), round(gdp_eps(mu, 1e-5), 2))
# 0.285 1.07 | 0.737 3.09 | 1.554 7.35

Connections

See Also