The Advantage of the Final Iterate: Empirical Auditing and Principled Heuristic Analysis of Differentially Private SGDThe Last Iterate Advantage: Empirical Auditing and Principled Heuristic Analysis of Differentially Private SGD
The authors propose a linear heuristic privacy analysis for DP-SGD when only the final model is released, and state that it upper-bounds the empirical ε of existing attacks in audits on CIFAR-10 and Gemma 2 fine-tuning.
- Standard privacy analysis of DP-SGD assumes the adversary can see all intermediate iterations, whereas in practice the adversary usually only obtains the final model; there is a large gap between the theoretical upper bound and the auditing lower bound, and there is a lack of means to estimate the "true" leakage.
- The authors assume the loss function is linear, and under this assumption give an exact worst-case privacy analysis (Theorem 1) for DP-SGD that publishes only the final iterate, and compare this heuristic with standard composition analysis, a full-batch DP-GD baseline, and several membership inference audit attacks.
- On CIFAR-10 (WideResNet) and Gemma 2 fine-tuning on PersonaChat, the empirical ε of existing gradient-space and input-space attacks is lower than the heuristic value; for example, on CIFAR-10 with batch 4096, empirical ε 1.7, heuristic 6.34, standard analysis 8; the artificial counterexamples constructed by the authors can make true leakage exceed the heuristic.
- The authors acknowledge that the heuristic relies on a linear assumption, and give two types of artificial counterexamples—regularization and malicious dataset—that exceed it; the experiments cover only CIFAR-10 image classification and Gemma 2 fine-tuning on PersonaChat, and language model canary design is left to future work.
- Threat model
- In DP-SGD training, the adversary can only access the final model (last iterate only) and cannot see intermediate iterations; the audit uses membership inference attacks, distinguishing adjacent datasets with and without a canary, and the adversary knows the sampling rate and number of iterations and estimates the noise multiplier.
- Evaluated models
- WideResNetGemma 2
- Benchmarks
- CIFAR-10PersonaChat
- Metrics
- ε (at δ=1e-5 / 1e-6)Empirical εAccuracyPerplexity
The authors propose a heuristic privacy analysis for DP-SGD that releases only the final iterate, and claim it can predict privacy audit results. The method assumes the model has a linear structure; experiments on multiple training pipelines show that its predictions match audit results, and it can roughly estimate the final privacy leakage before training. The authors also use artificial counterexamples to show that the heuristic may underestimate privacy leakage, and point out that standard composition analysis assumes the attacker can access all intermediate iterates, which is often unrealistic in practice. On vision and language tasks, the results of existing privacy audit attacks are constrained by this heuristic analysis. The authors emphasize that it cannot replace rigorous privacy analysis, but reveals the gap between theoretical privacy leakage upper bounds and privacy audit lower bounds.
Paper analysis
What problem does this paper attempt to solve?
When DP-SGD publishes only the final model, the gap between the theoretical upper bound and the auditing lower bound is large, and the authors propose a linear heuristic analysis to estimate the true leakage.
Core question: when the adversary can only access the final model of DP-SGD (rather than all intermediate iterations), can a tighter privacy guarantee than standard composition analysis be obtained.
- Setting and motivation: standard DP-SGD privacy analysis is based on composition and assumes the adversary can see all intermediate iterations, which the authors state is often unrealistic in practice—the adversary usually can only access the final model through API queries or model weights. Under this setting there is a large gap between theoretical upper bounds and audit lower bounds (Section 1.1).
- Shortcomings of existing methods: theoretical upper bound analyses (such as privacy amplification by iteration) rely on strong assumptions such as strong convexity and smoothness, and the authors state there is a lack of understanding of how well they reflect the "true" leakage; privacy audits give lower bounds, and are computationally expensive and error-prone.
- Core observation: existing audit techniques achieve the highest ε when the canary gradient is constant across iterations and independent of the gradients of other samples, and a linear loss satisfies exactly this; on this basis the authors hypothesize that linear structure can capture the settings in which existing attacks are most effective.
- Contributions of the paper: propose a heuristic privacy analysis assuming a linear loss (Theorem 1), computable numerically with an open-source DP accounting library; test its predictive power with audit experiments on CIFAR-10 and language model fine-tuning, and construct artificial counterexamples to probe its limitations.
- Threat model:
- Adversary's goal: distinguish neighboring datasets with/without canary via membership inference, and estimate the privacy parameters ε, δ.
- Adversary's knowledge: knows the sampling rate and number of iterations, and estimates the noise multiplier used by DP-SGD.
- Adversary's capability: can only access the final model parameters (last iterate only), and cannot see intermediate iterations; attacks fall into two categories: gradient space (injecting malicious gradients) and input space (inserting malicious inputs).
- Victim system: a model trained with DP-SGD, in the experiments WideResNet on CIFAR-10 and Gemma 2 fine-tuned on PersonaChat.
What related research exists?
Related work is divided into three groups—theoretical upper bounds, privacy audit lower bounds, and membership inference attacks—and the authors enter from a third perspective, a "principled heuristic".
Theoretical upper bounds (last iterate analysis)
- Feldman et al. (2018), Chourasia et al. (2021), Ye & Shokri (2022), Altschuler & Talwar (2022), Bok et al. (2024)—show that asymptotically the privacy guarantee of the final iteration can be far better than composition analysis, with ε converging to a constant as iterations increase; the paper points out that these analyses rely on strong assumptions such as (strong) convexity and smoothness.
- Standard composition analysis (Bassily et al., 2014; Abadi et al., 2016; Mironov, 2017; Steinke, 2022; Koskela et al., 2020)—applies to the setting where all intermediate iterations are released, and the paper states it is still state of the art in practice.
Privacy auditing and lower bounds
- Jagielski et al. (2020), Ding et al. (2018), Bichsel et al. (2018), Steinke et al. (2023), Tramer et al. (2022), Zanella-Béguelin et al. (2022)—construct neighboring inputs via membership inference attacks and give empirical lower bounds on privacy leakage.
- Nasr et al. (2021; 2023)—in the setting where all intermediate results are released, the audit matches the theoretical analysis (tight); this paper reproduces and modifies their gradient-space attack and audit framework.
- Andrew et al. (2023), Cebere et al. (2024), Annamalai & De Cristofaro (2024)—the paper states that after these works, when only the final parameters are released, there is still a large gap between upper bounds and audit lower bounds.
Membership inference attacks
- Shokri et al. (2017), Homer et al. (2008), Sankararaman et al. (2009), Dwork et al. (2015)—early work on membership inference attacks, the foundation of auditing.
- Carlini et al. (2022), Bertran et al. (2024), Wen et al. (2023), Leino & Fredrikson (2020), Sablayrolles et al. (2019), Zarifzadeh et al. (2023)—stronger membership inference attacks; the paper states that despite these works, the gap in the final-parameter setting remains.
Baselines and benchmarks: the paper compares the heuristic with two baselines (Figure 1): standard composition analysis (computed with Google's open-source DP accounting library) and the full-batch DP-GD approximation (q=1 with rescaled learning rate and noise); the audit experiments are conducted on CIFAR-10 (image classification) and PersonaChat (Gemma 2 fine-tuning).
The authors position this paper as a "third perspective" following theoretical upper bounds and audit lower bounds: a principled heuristic that neither replaces rigorous analysis nor fails to set targets for auditing and theoretical work.
How does the paper address this problem?
Assuming the loss and regularization term are linear, derive an exact worst-case privacy formula for DP-SGD when only the final iterate is published, then test it with auditing experiments.
Overall approach: under the assumption that "both the loss function and the regularization term are linear", give a rigorous, numerically computable worst-case privacy analysis for DP-SGD that publishes only the final iterate (linearized heuristic, Theorem 1), then treat it as an approximation for the nonlinear deep learning setting and use privacy auditing to test its predictive power.
Problem setup and formalization
- The object of analysis is DP-SGD in Algorithm 1: Poisson subsampling (each sample independently enters the batch with probability q), gradient clipping to norm 1, Gaussian noise N (0, σ²I) added at each step, optionally with an unclipped regularization term r; add/remove adjacent datasets are considered.
- Core result: under the linear assumption, the worst case reduces to distinguishing two one-dimensional distributions P := Binomial(T, q) + 𝒩(0, σ2 T) and Q := 𝒩(0, σ2 T), where the Binomial term is the number of times the canary is sampled in T steps.
- From this pair of distributions define δT,q,σ(ε) := max{Heε(P,Q), Heε(Q,P)} (H is the hockey-stick divergence), then solve inversely for ε; this can be computed with existing open-source DP accounting libraries, and Appendix A gives a self-contained efficient algorithm and pseudocode.
Key design choices
- Rationale for the linear assumption: the authors observe that existing auditing attacks are most effective when the canary gradient is constant across iterations and independent of other samples' gradients, and a linear loss satisfies exactly this condition; Appendix B also proves that linear is the worst case for the full-batch (non-subsampled) setting.
- Proof sketch: under linearity the final iterate is just the sum of gradients and noise; it can be reduced to one dimension (the canary gradient direction), ignoring other samples' gradients; tightness is obtained by constructing loss functions matching P and Q (Appendix A).
- Two baselines (Figure 1): standard composition analysis (Google open-source library, which is tight for the intermediate-iteration setting, so ε is always no smaller than the heuristic); full-batch DP-GD approximation (q=1, rescaled by η·q, σ/q), which the authors say usually gives a smaller ε than the heuristic.
Auditing and attack design
- The auditing framework follows the three-party construction of Nasr et al. (2021) (adversarial crafter, trainer, distinguisher), but the distinguisher can only see the final iterate; empirical lower bounds are computed using the PLD method plus Clopper-Pearson confidence intervals.
- Gradient-space attack: directly inject malicious gradients, in two settings—other samples come from real training data, or other samples' gradients are approximately 0 (adversarial dataset); the canary uses a Dirac gradient (only one coordinate nonzero), and the distinguishing statistic is the dot product of the final model with the canary gradient.
- Input-space attack: the adversary can only insert malicious inputs, using a label flip attack, with the loss of the malicious input as the distinguishing statistic; other samples are either normal data or blank images.
- Language model auditing: use tokens in the Gemma 2 tokenizer that do not appear in PersonaChat as canaries, and directly compare the differences in these tokens in the embedding table before and after fine-tuning.
Counterexample constructions (probing limitations)
- Regularization counterexample: use r(m)=∥m∥²/2η to zero the model at each step, making the final iterate equivalent to single-step DP-SGD; and a linear loss plus quadratic regularization r(m)=αm²/2, exactly computing its ε and comparing with the heuristic.
- Malicious dataset attack: construct a nonlinear model and special data that encode the entire training trajectory into the final parameters, making seeing only the final model equivalent to seeing all intermediate iterations (details in Appendix C).
What experiments did the paper conduct?
On CIFAR-10 and Gemma 2 fine-tuning, the empirical ε of existing attacks is lower than the heuristic; artificial counterexamples can make true leakage exceed the heuristic.
Experimental Setup
- Models under test: WideResNet on CIFAR-10 (following the training setup of De et al. (2022), 79% test accuracy, standard analysis (ε=8, δ=1e-5)-DP); for the language task, Gemma 2 fine-tuned on PersonaChat (FP16, JAX implementation).
- Datasets: CIFAR-10 (image classification), PersonaChat (dialogue fine-tuning).
- Baselines: standard composition analysis (Google DP accounting library), full-batch DP-GD approximation (Figure 1).
- Metrics and criteria: report ε at δ=1e-5 (experiments) or 1e-6 (counterexamples); empirical lower bounds use the PLD method plus Clopper-Pearson confidence intervals.
- Sample sizes: for CIFAR-10, each experiment trains 512 models with canary + 512 models without canary (Appendix D writes 1000+1000, the two numbers are inconsistent); the adversarial gradient experiment runs N=100,000 times; for language model fine-tuning, 128 models are trained each.
- Batch size sweep: fix the number of training iterations (60 steps for images, 2 epochs for text), vary the subsampling rate and balance the noise according to the heuristic.
Main Results
According to Table 2 (CIFAR-10) and Table 1 (Gemma 2 fine-tuning):
Swipe horizontally to read the table
Setting Batch size Heuristic ε Standard ε Empirical ε Utility CIFAR-10 4096 6.34 8 1.7 79.5% acc CIFAR-10 512 7.0 12 1.8 79.9% acc CIFAR-10 256 6.7 14 1.6 78.2% acc Gemma 2 / PersonaChat 2048 6.0 8 2.1 24.3 ppl Gemma 2 / PersonaChat 1024 6.1 14 2.1 24.2 ppl Gemma 2 / PersonaChat 512 6.0 26 2.0 24.8 ppl - The authors state that the heuristic upper-bounds the empirical audit results on both modalities and can serve as a pre-training leakage estimate.
- The authors state that batch size has little effect on model performance and on the heuristic/audit ε, but a large effect on the standard analysis, and on this basis question the existing practice that "large batches are more private".
Gradient-space and input-space attacks (Figure 2–4)
- Non-adversarial data + gradient-space attack (Figure 2, q=0.01 and 0.08): with noise and sampling rate fixed and the number of steps varied, the empirical ε is clearly lower than the heuristic and the standard analysis; the authors state this is because previous tight audits relied on intermediate iterations.
- Adversarial gradient dataset (Figure 3, q=0.01 and 0.1, N=100,000 runs): the empirical ε is close to the heuristic, and is lower only when the number of steps is very small; the authors believe the looseness at low step counts comes from statistical variance under a fixed number of trials.
- Input-space attack (Figure 4, two settings: all-zero gradient inputs and CIFAR-10): the input-space attack is tighter than the gradient-space attack, and the blank-image setting attacks more successfully; the authors state this is contrary to previous work, because the input-space attack does not rely on intermediate iterations.
Counterexample experiments (Section 4)
- Linear loss + quadratic regularization (α=0.5): with T=3, q=0.1, σ=1, α=0 is (2.222, 1e-6)-DP and α=1 is (2.182, 1e-6)-DP, whereas α=0.5 does not satisfy (ε, 1e-6)-DP for any ε<2.274; after sweeping (T, q, σ) in Figure 5, the authors report that the heuristic is still larger in most settings, and where it is exceeded the margin is ≤3%.
- Malicious dataset attack (Figure 6, q=0.01 and 0.1): by encoding the entire training trajectory into the final parameters, the audit lower bound reaches the level of the standard composition analysis and exceeds the heuristic; the authors state that this example is highly artificial and unlikely to reflect real scenarios.
- Pathological regularization term (Section 4.3): when a discontinuous regularization term is allowed, the final iteration can be made to contain the entire history, bringing the standard analysis close to tight; the authors mention that concurrent work Annamalai (2024) gives a different construction with a similar conclusion.
Other ablations and analyses
- Figure 1a: with T·q and T·σ² fixed, the heuristic ε varies gently with T, while the standard analysis grows with T.
- Figure 1b: with the standard analysis ε fixed, the heuristic decreases as T increases, and the gap between the two widens at large T.
- Figure 1c: with q=0.01 and δ=0.5 fixed, the heuristic ε is non-monotonic in T—the authors state this motivates the regularization counterexample.
- Computational cost: Appendix D reports that the experiments used about 60,000 GPU hours in total (16×A100 machines).
What are some points that can be further explored?
The authors acknowledge that the heuristic relies on a linear assumption and give a counterexample; the experiments cover only image classification and one language model fine-tuning setting.
Limitations noted by the authors and future directions
- The heuristic cannot replace rigorous theoretical analysis; the authors explicitly give artificial counterexamples showing that it underestimates true leakage (Section 4, Section 6).
- In the regularization counterexample the two effects almost balance; the authors call this counterexample "very delicate", and these constructions are unlikely to appear in real learning scenarios (Section 4 introduction, 4.4).
- The language model experiments leave "designing optimal canaries for modern language models" to future work (Section 3.2).
- The authors propose that the heuristic should be a two-sided target: privacy auditing work should try to exceed it, and theoretical work should try to match it; when theoretical analysis cannot match it, the cause of the gap should be identified (Section 1.2, Section 6).
- The authors state that to exceed the heuristic bound in practical scenarios, an adversary would need to break the linear assumption, which existing attacks against deep learning models can hardly do (Section 5).
Scope of experiments
- There are 2 models under test in total: WideResNet (CIFAR-10) and Gemma 2 (PersonaChat fine-tuning).
- The audit attacks cover gradient space (two settings: real data / adversarial zero gradient) and input space (two settings: normal data / blank images), all reproduced from Nasr et al. (2021; 2023) and modified to look only at the final iteration.
- Sample sizes: for CIFAR-10, 512+512 models per experiment (Appendix D writes 1000+1000, inconsistent between the two places), the adversarial gradient experiment N=100,000 runs, and the language model 128+128.
- The batch size sweep only fixes the number of iterations (60 steps for images, 2 epochs for text) and varies the subsampling rate, with noise balanced according to the heuristic.
- The paper does not report the agreement between the audit attacks and human judgment (the audit is a statistical hypothesis test, with no human review), nor does it report the specific size version of Gemma 2 used in the language experiments.
Summarize the main content of the paper
The linear heuristic gives a privacy estimate for the DP-SGD final-iteration setting, upper-bounds existing audit attacks on two tasks, and exposes the theory-practice gap.
A paper on empirical auditing and heuristic analysis of DP-SGD privacy analysis, published at ICLR 2025.
- Problem: standard DP-SGD privacy analysis assumes the adversary sees all intermediate iterations, whereas in practice the adversary usually only obtains the final model; under this setting the gap between theoretical upper bounds and audit lower bounds is large.
- Method: assuming the loss and regularization term are linear, derive an exact worst-case privacy formula when only the final iteration is released (Theorem 1, reduced to distinguishing Binomial(T,q)+N(0,σ²T) from N(0,σ²T)), computable numerically with an open-source DP accounting library; then test it with a modified membership inference audit.
- Main results: on CIFAR-10 (WideResNet), with batch 4096, empirical ε 1.7, heuristic 6.34, standard analysis 8 (Table 2); for Gemma 2 fine-tuned on PersonaChat with batch 2048, empirical ε 2.1, heuristic 6.0 (Table 1); the empirical ε of existing gradient-space and input-space attacks does not exceed the heuristic.
- Counterexamples: two types of artificial constructions—regularization and malicious dataset—can make true leakage exceed the heuristic (in the quadratic regularization case the margin is ≤3%; the malicious dataset attack can reach the level of the standard analysis), and the authors state that these examples are highly artificial.
- Authors' conclusions: the heuristic can estimate audit results before training (e.g., during hyperparameter selection), saving expensive empirical evaluation; it should set a target "to exceed" for auditing work and a target "to match" for theoretical work; the authors also on this basis question the practice that "large batches are more private", stating that batch size has little effect on the heuristic and audit ε.