D IFFERENTIALLY P RIVATE A DAPTIVE O PTIMIZATION WITH D ELAYED P RECONDITIONERS
Anonymous authors
Paper under double-blind review
A BSTRACT
Privacy costs may negate the benefits of using adaptive optimizers in differentially private model training.
Prior works typically address this issue by using auxiliary information (e.g., public data) to boost the effectiveness of adaptive optimization.
In this work, we explore techniques to estimate and efficiently adapt to gradient geometry in private adaptive optimization without auxiliary data .
Motivated by the observation that adaptive methods can tolerate stale preconditioners, we propose differentially private adaptive training with delayed preconditioners ( DP 2 ), a simple method that constructs delayed but less noisy preconditioners to better realize the benefits of adaptivity.
Theoretically, we provide convergence guarantees for our method for both convex and non-convex problems, and analyze trade-offs between delay and privacy noise reduction.
Empirically, we explore DP 2 across several realworld datasets, demonstrating that it can improve convergence speed by as much as 4 × relative to non-adaptive baselines and match the performance of state-of-the-art optimization methods that require auxiliary data.
I NTRODUCTION
Adaptive optimizers such as AdaGrad (Duchi et al., 2011; McMahan & Streeter, 2010) and RMSProp (Hinton et al., 2012) are commonly used to improve convergence speed in machine learning training.
However, in privacy-sensitive applications, benefits of adaptivity may degrade as a result of noise added to the preconditioners to guarantee differential privacy (Li et al., 2022).
Prior works typically address this issue by using non-sensitive auxiliary data to approximate the underlying structures of private gradients (Asi et al., 2021; Kairouz et al., 2021a; Li et al., 2022).
While this can boost performance, assuming access to informative public data may be unrealistic in many privacy-sensitive applications.
In this work, we instead ask: Can we improve privacy/utility trade-offs in private adaptive optimization without accessing auxiliary data ?
p r e c ond i t
i one
[Figure]
do not change drastically during optimization (IMDB dataset).
A key insight we have in addressing this question is that for many machine learning problems, the gradient geometry may not change drastically during successive steps of optimization (e.g., see Fig.
1, which plots successive distributions of preconditioner values).
This presents an opportunity to estimate the preconditioners used by adaptive optimizers with smaller noise, by averaging across previous iterates.
To this end, we propose DP 2 , a differentially private adaptive method that uses historical gradients to construct delayed preconditioners with reduced noise.
Despite the simplicity of this approach, we find that it can significantly improve performance in practice—improving convergence speed by as much as 4 × relative to non-adaptive baselines, all without the need to access auxiliary data.
To better understand these performance gains, we theoretically and empirically analyze the method to study the effect of using delayed preconditioners, including trade-offs that emerge between the noise reduction and staleness.
Contributions.
We propose DP 2 as a method for differentially private adaptive optimization with delayed preconditioners.
Unlike prior work, DP 2 does not rely on auxiliary data to improve privacy/utility trade-offs in private training.
We provide convergence guarantees for DP 2 in both convex and non-convex settings, and analyze the trade-offs between delay and privacy noise.
We conduct extensive experiments to showcase the effectiveness of DP 2 , which can significantly improve model utility for a given privacy budget across text and recommendation benchmarks.
B ACKGROUND AND R ELATED W ORK
In this section we discuss closely related works and set up some preliminaries.
We start by discussing prior work in differentially private optimization, considering the classic framework of ( ε, δ ) -differential privacy (DP) (Dwork et al., 2006), defined as follows.
Definition 1 (Differential privacy (Dwork et al., 2006)) .
A randomized algorithm M is ( ε, δ ) - differentially private if for all neighboring datasets D, D ′ differing by one element, and every possible subset of outputs O ,
[Equation]
Differentially Private SGD.
Informally, DP in machine learning offers protection by masking the influence of individual examples on the trained model (Abadi et al., 2016; Bassily et al., 2014;
Song et al., 2013).
In this work, we consider the popular subsampled Gaussian mechanism (Dwork et al., 2014; Mironov et al., 2019) to perturb gradients to ensure DP.
As DP mechanisms usually lead to a significant utility drop, extensive research has investigated improving privacy/utility trade-offs for
DP-SGD, including various training techniques (e.g., data augmentation and large-batch training)
(De et al., 2022), leveraging public data (Amid et al., 2022; Zhou et al., 2021), and releasing gradient statistics via tree aggregation to reduce the amount of noise (Chan et al., 2011; Denisov et al., 2022;
Kairouz et al., 2021b).
These prior works are orthogonal to and could be applied in conjunction with our proposed method, which focuses specifically on privacy in the context of adaptive optimization.
Differentially Private Adaptive Optimization.
To reduce privacy cost in iterative DP algorithms, it is natural to consider applying adaptive optimizers (e.g., AdaGrad (Duchi et al., 2011; McMahan &
Streeter, 2010), RMSProp (Hinton et al., 2012), AMSGrad (Reddi et al., 2018), and Yogi (Zaheer et al., 2018)) to speed up convergence.
A straightforward approach is to first privatize mini-batch gradients and then plug in noisy gradients to any adaptive updating rules (Zhou et al., 2020).
However, estimating gradient moments in this way may yield preconditioners with too much noise, resulting in adaptive methods that may not have meaningful improvements over DP-SGD (Li et al., 2022).
As we discuss in Section 1, more recent works suggest the use of non-sensitive public information to estimate the preconditioners (or other gradient structures)
(Asi et al., 2021; Kairouz et al., 2021a; Li et al., 2022), which may not always be available in practice.
In Section 5.3, we empirically benchmark two baselines along this line of work and demonstrate that DP 2 can perform comparably to these state-of-the-art methods, even though it does not require access to auxiliary data.
Finally, we note that previous works have explored the high-level direction of delayed preconditioners, but mainly as a compromise for computational considerations in non-private training (Gupta et al., 2018).
In this work, we instead show that staleness can be leveraged to improve privacy/utility trade-offs in private adaptive optimization, and propose and analyze a novel method for delaying preconditioner computation in the context of private training.
Notation.
In this work, we consider using adaptive optimization methods to solve the classic empirical risk minimization objective, i.e., min w F ( w ) = 1 n (cid:80) ni
=1 f ( x i ; w ) , where w ∈ R d and { f ( x i ; w ) } i ∈
[ n ] are individual loss functions on training sample i ∈ [ n ] .
For vectors u, v ∈ R d , we use u + v for coordinate-wise addition, and uv for coordinate-wise division.
For any vector v , v j denotes the j -th coordinate of v .
For example, g i,tj refers to the j -th coordinate of gradient g i,t .
Finally, | v | ∈ R d denotes taking coordinate-wise absolute values, and ∥ · ∥ M denotes the matrix norm defined as ∥ ·
∥ M := (cid:112) ⟨· , M ·⟩ for a symmetric and positive definite matrix M ∈ R d × d , or a diagonal matrix with non-negative diagonal entries populated by a vector M ∈ R d .
DP 2 : D ELAYED P RECONDITIONERS FOR D IFFERENTIALLY P RIVATE A DAPTIVE O PTIMIZATION
We now introduce our DP 2 framework.
While we discuss DP 2 in the context of a particular adaptive method (RMSProp), we note that the approach is method-agnostic in that it can generally be applied to any private adaptive optimization method where preconditioners are calculated at each iteration.
As an initial step towards understanding the algorithm, we first investigate the effects of delayed preconditioners in non-private training in Section 3.1.
We then explain how to apply this idea to construct less noisy preconditioners from prior gradients in private training in Section 3.2.
3. D ELAYED PRECONDITIONERS IN NON - PRIVATE SETTINGS
Adaptive methods use preconditioners to adapt to gradient geometry, effectively resulting in coordinate-wise learning rates.
This can be advantageous for many applications, especially those with sparse gradients or non-uniform stochastic noise (e.g., Hinton et al., 2012; McMahan & Streeter, 2010; Reddi et al., 2021;
Zhang et al., 2020).
One of the key design choices of DP 2 is to update preconditioners less frequently and use the average of past gradients to reduce noise.
Our observation is that a wide range of learning problems are tolerant to the staleness of preconditioners.
In this subsection, we validate this empirically on the benchmark datasets considered throughout this paper.
There are potentially many ways that one could instantiate the idea of delayed preconditioner computation in adaptive optimization.
Here we consider a specific algorithm, which is the exact non-private version of our proposed DP 2 framework (Algorithm 1) introduced in later sections.
The basic idea is to alternate between s steps of SGD and s steps of an adaptive method (for simplicity we assume RMSProp as the adaptive algorithm), where s is a constant larger than 1.
Each time we switch from SGD to RMSProp, we average s past SGD gradients and use the average to update the preconditioner.
The preconditioner will be used in subsequent RMSProp updates (thus being stale).
As motivation for DP 2 , we empirically show that RMSProp with delayed preconditioners achieves almost the same optimization performance as RMSProp (Figure 2).
[Figure]
test accuracies are presented in Section 5.2.
This observation provides motivation for our proposed DP 2 framework for private training (Section 3.2).
As discussed in Section 2, we note that the idea of delayed preconditioning has been briefly discussed in prior work (Gupta et al., 2018) for the purpose of speeding up the computation of adaptive optimization in non-private training.
Unlike this prior work, we focus on the goal of reducing noise in private training, propose an alternative method for using stale preconditioners that is more amenable to differential privacy, and analyze our method in both convex and non-convex settings.
3. C ONSTRUCTING DELAYED PRECONDITIONERS WITH REDUCED NOISE
Without access to public data or other side information, prior works typically update preconditioners based on noisy gradients at each iteration (Zhou et al., 2020).
For instance, a natural way to privatize
RMSProp is to update the preconditioner v ∈ R d as v ← βv
+ (1 − β )(˜ g ) 2 where β ∈ (0 , 1) is a moving average constant, and ˜ g ∈ R d is the noisy gradient output by some standard privacy mechanism (e.g., the Gaussian mechanism).
However, a drawback to this is that the noise gets accumulated at each iteration, making adaptive methods significantly less effective (Li et al., 2022).
Inspired by the observation that problems can be tolerant to the staleness of preconditioners (Figure 2), we propose to update the preconditioners less frequently to reduce noise.
For instance, we update v every s steps using some aggregate function of s recent private gradients from DP-SGD.
During iterations where v is not updated, we simply apply the most recent (stale) v to precondition the gradients.
In order to mitigate the noise, we average over these s gradients to form a pseudo-gradient g , which can be plugged into arbitrary adaptive optimization algorithms.
Note that the privacy noise variance will be reduced s times if we average s Gaussian random variables (i.e., the DP noise).
DP 2 is summarized in Algorithm 1.
For simplicity of presentation, we assume RMSProp as the adaptive method (denoted as DP 2 -RMSProp) throughout this section.
However, our framework can be generally applied to other common adaptive methods (see Appendices C.2 and D).
The high-level idea is to alternate between s 1 steps of private SGD and s 2 private RMSProp steps, and use averages of s 1 SGD gradients (i.e., average of the accumulator G ∈ R d ) to update the preconditioner v . Next, we discuss some key components of our algorithm. Order of privatization and preconditioning. Given a private preconditioner v , there are generally two choices to perform adaptive optimization over the raw gradients { g i,t } i ∈ B generated from mini-batch B at the t -th iteration.
Input: T , batch size b , noise multiplier σ , clipping thresholds C , initial model w 0 ∈ R d , v = 0 , constant ϵ ∈ R + , learning rate schedule α t , moving average parameter β , SGD cumulative aggregation step s 1 , RMSProp cumulative step s1 for t = 0 , · · · , T − 1 doif t mod ( s 1 + s 2 ) =
then
Reset accumulator G t ← if t mod ( s 1 + s 2 ) =
s 1 then
Update moment estimates as v ← βv
+ (1 − β ) ( G t /s 1 )
Reset accumulator G t ←
Uniformly randomly sample a mini-batch B with size b from private training data
Get individual gradients for sample i ∈ B : g i,t ← ∇ f ( x i ; w t )
Privatize the (preconditioned) gradients using the Gaussian mechanism: ˜ g t ← 1 b (cid:32)(cid:88) i ∈ B clip (cid:18) g
i,t
D t , C (cid:19) + N (cid:0) 0 , σ 2 C 2 (cid:1)(cid:33) where
D t ← (cid:26)if t mod ( s 1 + s 2 ) <
s√ v + ϵ otherwise.
Accumulate the private gradients ˜
g t : G t +1 ← G t + ˜ g t Update model parameters w : w t +1 ← w t − α t ˜ g
t 12 return w T
First privatize gradients (with clipping threshold C ), then precondition noisy gradients with √ v + ϵ where ϵ is a small constant : ˜ g t ← 1 b (cid:32)(cid:88) i ∈ B clip (cid:0) g i,t , C (cid:1) + N (cid:0) 0 , σ [Equation]
(cid:1)(cid:33)
[Equation]
First precondition gradients with √ v + ϵ , then privatize the output:
[Equation]
The difference is that the privacy noise in the first choice may be scaled in an undesired direction, as N ( 0 ,σ 2 C 2 ) √ v + ϵ with a less noisy √ v (zero privacy noise in the extreme case) would amplify the noise
N ( 0 , σ 2 C 2 ) on informative coordinates (i.e., coordinates with smaller preconditioner values), which is consistent with the argument made in Li et al. (2022).
We also empirically compare the two options and show that the latter gives better performance (Section 5.4).
It is critical to average noisy gradients to construct a cleaner estimate of the preconditioner (Lineand 10 in Algorithm 1) and apply it for adaptive optimization (Line 9).
As these two steps access raw gradients twice, we need to privatize them separately.
Unfortunately, the privacy budget would accumulate with each query to the raw training data.
Hence, we use the private SGD gradients for both the model update and the preconditioner estimation.
This results in a hybrid method that alternates between private SGD and private adaptive optimization steps.
While in principle, non-adaptive and adaptive updates can take different numbers of consecutive iterations, in our empirical evaluation, we simply set s
= s 2 , and find that this works reasonably well across all datasets (Section 5).
Privacy guarantees.
From Algorithm 1, we see that at each iteration, we access raw data and pass them through the privacy barrier once (Line 9) to generate private gradients ˜
g t with the same noise multiplier σ and batch size b , and the preconditioner only accumulates already differentially private gradients.
Since the final model is a composition of these private releases (noisy gradients),
Algorithm 1 (or DP 2 in general) achieves the same privacy guarantees as standard DP-SGD training under the same training settings.
For completeness, we formally state the privacy guarantee below.
Theorem 1 (Privacy guarantee of Algorithm 1 (Abadi et al., 2016)) .
There exist constants c 1 and c 2 such that for any ε < c 1 b 2 T/n 2 , Algorithm 1 is ( ε, δ ) -differentially private for any δ > 0 if σ ≥ c 2 b √ T log(1 /δ ) nε .
C ONVERGENCE A NALYSIS
In this section, we analyze Algorithm 1 for both convex and non-convex problems.
We aim to study the convergence properties of DP 2 and investigate the trade-offs between delay and privacy noise.
In doing so, key challenges are introduced by alternating between adaptive and non-adaptive updating and through the staleness of preconditioners.
4. C ONVEX C ASES
For convex functions, we define the optimal model w ∗ as w ∗ ∈ arg min w F ( w ) .
First we state some assumptions (apart from convexity) that are used in the analysis.
Assumption 1.
There exists a constant R such that ∥ w t − w ∗ ∥ 2 ≤ R for any iteration t.
Assumption 2 (Bounded stochastic gradient norm) .
There exists a constant C such that (cid:13)(cid:13)
g i,t (cid:13)(cid:13) 2 ≤ C for any i ∈ [ n ] and iteration t .
Assumption 1 (bounded domain across all iterations) is commonly used in adaptive optimization literature (Asi et al., 2021;
Levy et al., 2018; Li et al., 2022; Reddi et al., 2018).
Assumption 2 aims to bound the L 2 norm of the stochastic gradient, thus helping bound the L 2 sensitivity of the operation of calculating and averaging individual gradients from a mini-batch.
Assuming bounded stochastic gradient norm is standard in prior works on convex and non-convex private optimization (e.g., Kairouz et al., 2021a;
Li et al., 2022; Zhou et al., 2020).
Under this assumption, assume the clipping does not happen, we have ˜ g t ← g t + N (0 , σ 2 C 2 /b 2 ) , where g t := 1 b (cid:80) i ∈
B g i,t .
Without loss of generality, let s
= s 2 in Algorithm 1.
Our main convergence result is stated as follows (assuming t starts from 1).
Theorem 2 (Convergence of Algorithm 1 for convex problems) .
Let Assumptions 1 and 2 hold.
Assume F is a convex function.
Let the learning rate α t be α t
= O (cid:16) 1 √ t (cid:17) .
After running Algorithmfor T iterations with s = υT for a small constant υ ∈ (0 , 1] , we obtain
[Equation]
where T υ denotes the iteration indices where we switch from private RMSProp steps to private SGD steps plus the last iteration, with cardinality | T υ | = ⌈ 12 υ ⌉ , and N t ∼ N ( 0 , σ 2 C 2 /b 2 )
We defer the complete statement and all proofs to Appendix A. At a high level, the first term is due to adaptive optimization using RMSProp, and the second term corresponds to the added privacy noise.
If we do not switch and run adaptive steps at all iterations, the first term reduces to the standard RMSProp rate 1 √ T E (cid:2)
∥ D T ∥ 1 (cid:3) (Mukkamala & Hein, 2017).
Compared with DP-SGD, the added privacy noise would be reduced from 1 T (cid:80) Tt =1 1 √ t E [ ∥ N t ∥ 2 ] to 1 T (cid:80) Tt =1 1 √ t E [ ∥ N t ∥ 2 D t ] when the gradients are sparse (so that ∥ D t ∥ 1 < d in adaptive iterations). Hence, this theorem suggests some constant improvements compared with DP-SGD when we switch a constant number of times.
In terms of convergence rates, our O (cid:16) 1 √ T (cid:17) rate is the same as previous results for SGD (or DP-SGD) in convex cases with delaying learning rates (Bassily et al., 2014; Nemirovski et al., 2009). In terms of utilities, for sample size n , taking σ 2 = O (cid:16) b 2 T n 2 ε 2 (cid:17) and T = O ( n 2 ε 2 ) , previous works on stochastic private adaptive optimization (Asi et al., 2021; Li et al., 2022) often have the noise term being O (cid:16) ∥
C ∥ 1 nϵ (cid:17) where C ∈ R d denotes the diagonal entries of a matrix capturing gradient geometry.
Meanwhile, our noise term is O (cid:16) 1 √ T (cid:80) Tt =1 1 √ t E [ ∥ D t ∥ 1 ] nϵ (cid:17) .
If D t = √ v t + ϵ for all iterations (i.e., running adaptive methods all iterations), the noise term becomes O (cid:16) max t ∈ [ T ] E [ ∥ D t ∥ 1 ] nϵ (cid:17) , which is the same as prior works.
Therefore, we achieve slightly inferior constants due to the updating rule of switching between DP-SGD and private RMSProp to estimate the preconditioner.
However, note that prior results are obtained under assumptions with side information or public data (Asi et al., 2021; Li et al., 2022), whereas the DP 2 rate does not rely on any proxy data.
The complete convergence rate relies on a critical metric h ( s ) which is related to temporal gradient similarity and the amount of staleness s , formally defined as:
[Equation]
[Figure]
[Equation]
[Figure] [Equation] [Figure] where the expectation is taken with respect to all randomness in the algorithm, and G ⌊ ts ⌋ s ∈ R d refers to the latest accumulator that is used to update v (Line 5 in Algorithm 1).
[Figure]
A smaller h ( s ) indicates better convergence.
We see that the denominator of h ( s ) can be decomposed into the average of past raw gradients and the average of random Gaussian noise.
Intuitively, h ( s ) tends to be smaller as gradients across the s iterations in G ⌊ ts ⌋ s are more similar with the current gradient g t in terms of the gradient norm difference.
In
Appendix A.2, we show that an upper bound of h ( s ) can be expressed as c 1 + c 2 s where
c 1 , c 2 are two constants.
We also visualize the value of h ( s ) on the IMDB dataset in Figure 3, and show that (1) the values of h ( s ) are consistently small across all delays, and (2) h ( s ) increases as the s gets larger, which is consistent with the expression of s .
Trade-offs between delay and noise.
Here we discuss how s affects convergence based on our analysis.
Intuitively, larger s (larger delay) results in staler preconditioners, but introduces less noise due to private gradient averaging.
In our convergence bound, there are several terms that depend on s (or υ ).
Although this makes it difficult to derive a closed-form characterization of an optimal s , we can analyze the effects of s in simplified settings.
In particular, examine the first term of the RHS of the convergence bound (in Appendix A), let α =
[Equation]
(where c 3 , c 4 are two constants), and assume (cid:4) 12 υ (cid:5) + (cid:4) [Equation] (cid:5) [Equation]
+ 1+
[Equation]
= 2+
[Equation]
2 υ .
Combined with h ( s ) , the dependence on υ in
R [-
-]2 +
[Equation] ⌋ can be expressed as ( c
[Equation]
This suggests that there exists an optimal υ that achieves the minimal value.
In Section 5.2, we empirically study the effects of s across real-world datasets, and demonstrate that there exist specific ranges of s that provide favorable trade-offs between delay and noise (Figure 6).
4. N ON -C ONVEX C ASES
In non-convex cases, we make the following additional assumptions, which are common in nonconvex convergence analyses.
Assumption 3 (Smoothness) .
Each f ( x i ; w ) ( i ∈ [ n ]) is L -smooth with respect to w ∈ R d .
Assumption 4.
Stochastic gradient variance is bounded, i.e., E [ ∥ g i,t − E [ g i,t ] ∥ 22 ] ≤ τ 2 for all i, t .
Theorem 3 (Convergence of Algorithm 1 for non-convex problems.) .
Let Assumptions 1-4 hold.
Define constant M as M :
=
C 2 + σ 2 C 2 sb 2 .
Under any delay parameter s , after running Algorithmwith constant learning rates α t = α such that Lαϵ ≤ 1 , we have
[Equation]
The proof is deferred to Appendix B. Compared with Theorem 2, here we do not have constraints on s .
Note that to guarantee ( ε, δ ) -DP by running T iterations, we can set σ 2 = O (cid:16) b
[Equation]
α = O (cid:16) 1 √ d (cid:17) , and T = O (cid:16)
[Equation]
, to arrive at a convergence bound O (cid:16) √ dnε [Equation] db (cid:17) .
Under any delay s , our rate (with and without noise) is the same as previous results on DP-SGD and (DP) adaptive methods for non-convex problems (Li et al., 2022; Zaheer et al., 2018).
We note that our non-convex analysis does not directly highlight the benefits of adaptivity or trade-offs around s ; hence the optimal choice of s according to this result is s = T , to maximize the goal of reducing privacy noise.
However, the practical performance can be better than the upper bound derived here, as shown in our experiments (Section 5).
Most of the previous works studying stochastic non-convex adaptive optimization does not prove improvements relative to SGD (e.g., Alacaoglu et al., 2020;
De et al., 2018;
Ward et al., 2020; Zaheer et al., 2018).
It is still an open problem to rigorously characterize the benefits of adaptivity for non-convex problems, which we leave for future work.
E MPIRICAL E VALUATION
In this section we report empirical results on a range of learning tasks.
We first describe datasets and tasks in Section 5.1.
In Section 5.2, we compare DP 2 with the baselines of DP-SGD and vanilla DP adaptive methods across various privacy budgets, and investigate the effects of delay on all datasets.
We additionally compare DP 2 with recent more advanced private adaptive methods in Section 5.3, and conduct ablation studies to validate the effectiveness of different DP 2 components in Section 5.4.
In all experiments, we use R´enyi differential privacy (RDP) accountant for the subsampled Gaussian mechanism (Mironov et al., 2019) for privacy accounting.
We focus on the RMSProp optimizer (Hinton et al., 2012) and provide results relating to other adaptive methods such as AdaGrad (Duchi et al., 2011; Streeter & McMahan, 2010) in Appendix C. Our experiments are implemented in JAX (Bradbury et al., 2018) with Haiku (Hennigan et al., 2020) to auto-vectorize over the per-example operations (e.g. per-example clipping) for substantial speedups (Subramani et al., 2021).
Unless explicitly stated, we report results with the best grid-searched hyperparameters, which include the learning rate, perexample clipping threshold, adaptivity ϵ for preconditioned methods, and the delay parameter s .
Note that for DP 2 we tune the learning rates and clipping thresholds separately for private SGD iterations and private adaptive (RMSProp) iterations.
See Appendix C.1 for hyperparameter details.
We have submitted an anonymized version of our code to facilitate reproducibility.
Tuning s .
In all experiments, we tune the delay parameter ( s ) via grid search.
For convex tasks, we choose s from { 0 . 025 , 0 . 5 , 0 . 1 , 0 . 5 , 1 , 2 } epochs.
For the non-convex model, we choose s from { 0 . 5 , 3 , 10 , 25 } epochs.
We explore the sensitivity of DP 2 to s in Section 5.3, and show that there exist a wide range of s parameters that result in superior performance compared with baseline methods.
5. D ATASETS AND T ASKS
For empirical evaluation, we pick datasets and tasks where adaptivity is crucial (e.g., those involving sparse gradients).
For such types of tasks, adaptive methods have major benefits relative to SGD in normal non-private training, and we expect DP 2 to retain the benefits in private training.
IMDB (Maas et al., 2011) is a binary classification dataset on sentiment analysis for movie reviews that includes 25,000/25,000 training/test samples.
Each sample is a review under a vocabulary size of 10,000.
We train a logistic regression model with 10,001 parameters.
StackOverflow (Kaggle, 2022; TensorFlow Federated, 2022) is a large-scale text dataset containing questions and answers from Stack Overflow.
We focus on the task of classifying the tag(s) of a given sentence described in TensorFlow Federated (2022), though we focus on the usual centralized training setting instead of a federated setting.
We randomly sample 246,092 sentences for training and 61, for testing, where each sentence is described by 10,000 features.
We format the task as a 500-class classification problem, and the resulting model has roughly 5 million parameters.
MovieLens-100k (Harper & Konstan, 2015) is a movie review dataset commonly used for recommendation systems.
It contains 1,000,000 movie ratings from 943 users on 1,682 items ( ≈ 6% non-zero entries).
We study a (non-convex) matrix factorization task with embedding size 100, thus totaling 262,500 parameters.
We treat each non-zero entry as a ‘record’ for differential privacy, and randomly partition them for training and evaluation.
For all datasets, we explore the effects of several noise multiplier ( σ ) values, and set δ = 10 − k where k is the smallest integer that satisfies 10 − k ≤ 1 /n for the training dataset size n .
5. DP 2 COMPARED WITH DP-SGD AND VANILLA DP ADAPTIVE METHODS
We consider two popular baselines: DP-SGD (Abadi et al., 2016) and vanilla DP-RMSProp (Zhou et al., 2020).
In vanilla DP adaptive methods, private gradients are plugged into adaptive updating rules to approximate the preconditioners at each iteration.
Figure 4 compares DP 2 -RMSProp with
DP-SGD and DP-RMSProp.
We observe that across all datasets, DP 2 consistently and substantially outperforms the baselines in terms of both convergence and absolute performance. [Figure] [Figure]
Privacy/utility trade-offs.
Figure 4 reports learning curves under specific privacy budgets determined by the batch size and the number of epochs.
Here, we additionally explore privacy/utility trade-offs across a range of privacy parameters, where ε ranges are consistent with prior works (e.g., Kairouz et al., 2021b).
Results are shown in Figure 5.
We observe that similar to the results in Figure 4, DPsignificantly outperforms DP-SGD and DP-RMSProp under each privacy budget.
For reference, the non-private RMSProp method achieves 87% accuracy, 62% accuracy, and 0.88 mean square error (MSE) on IMDB, StackOverflow, and MovieLens, respectively.
Indeed, with weaker privacy (larger ε ), we expect smaller utility gaps between private and non-private optimization.
In Appendix C.3, we additionally explore how increasing the computational budget may affect the privacy-utility trade-off.
Effects of s .
Finally, we empirically study the effect of the delay parameter s .
Intuitively, there exists a trade-off between the amount of delay and the privacy noise in the preconditioner: averaging over more historical gradients (larger s ) could yield less noisy preconditioners, while introducing more staleness.
In Figure 6, we report test performance versus the delay s across all datasets on the first three subplots.
In the last subplot, we additionally show the convergence behavior under different values of s .
These results suggest that there is a “sweet spot” for s to yield good performance— [Figure] [Figure]
convergence s nearly
[Figure]
small delays are gradually improving over DP-RMSProp; moderate delays perform best in terms of convergence and absolute performance; and large delays may slow down convergence (although it is possible to reach similar performance with sufficient training). These empirical results are consistent with the implications of our convergence analysis discussed in Section 4.1.
5. DP 2 COMPARED WITH RECENT METHODS FOR PRIVATE OPTIMIZATION
As discussed in Section 2, beyond DP-SGD and vanilla DP adaptive methods, another line of work uses auxiliary, public data to improve private (adaptive) optimization.
While not directly comparable to DP 2 since DP 2 does not require any side/public information, we compare DP 2 to two state-ofthe-art methods along this direction 2 : (1) AdadPS (Li et al., 2022) which uses public data or their statistics to estimate gradient geometry, and (2) PDA-DPMD (Amid et al., 2022), which uses the loss on public data as a mirror map to learn the underlying gradient geometry.
Results are reported in
Table 1, which show that DP 2 has comparable performance to state-of-the-art baselines, but without the need to access auxiliary data.
See Appendix C.5 for full details and convergence curves.
[Table]
we find that it achieves comparable performance with these state-of-the-art approaches that require additional public data.
Corresponding convergence plots are presented in Figure 11 in Appendix C.5.
5. A BLATION S TUDIES
[Figure]
Finally, we also study the effectiveness of different components of DP 2 .
Recall that in Algorithm 1, we use noisy gradients from
DP-SGD iterations to update both the model parameters and the preconditioner such that the total privacy cost is identical to that of DP-SGD.
The first variant considers accumulating DP-SGD gradients in the same way, but it runs private adaptive methods using delayed preconditioner in almost all iterations.
This requires us to add independent noise twice at most iterations (when accumulating the preconditioner and when noising the preconditioned update), thus increasing the total privacy budget.
The second variant is identical to DP 2 except that it applies the delayed preconditioner after noising the clean gradient; this is to study the order of preconditioning as discussed in Section 3.
As illustrated in Figure 7, both variants indeed significantly underperform our proposed method on the IMDB dataset, thus validating the design choices of DP 2 .
We defer complete results to Figure 10 and Table 3 in Appendix C.4.
See also Appendix D for the exact algorithms of both variants.
C ONCLUSION AND F UTURE W ORK
In this work, we proposed DP 2 , a private adaptive optimization framework that uses historical gradients to construct delayed but less noisy preconditioners, yielding improved privacy/utility trade-offs without the need to access auxiliary data .
We demonstrated the effectiveness of DP 2 both theoretically and empirically.
In the future, it would be interesting to extend the techniques developed herein to other privacy-sensitive applications such as federated learning (McMahan et al., 2017; Reddi et al., 2021).
It is also worth exploring interplays between DP 2 and private online optimization with tree aggregation, which similarly releases cumulative statistics with reduced noise (Chan et al., 2011). A T HEOREMS AND P ROOFS
Theorem 2 (Convergence of Algorithm 1 for convex problems) Let Assumptions 1 and 2 hold.
Assume F is a convex function. Let the learning rate α t be set as α t ← α ⌊ t 2 s ⌋ + ⌊ t + s 2 s ⌋ +1 √ t . After running Algorithm 1 for T iterations with s = υT for a small constant υ ∈ (0 , 1] , we obtain min t ∈
[ T ] [Equation] where T υ denotes the iteration indices where we switch from private RMSProp steps to private SGD steps plus the last iteration, with cardinality | T υ | = ⌈ 12 υ ⌉ , N t ∼ N ( 0 , σ 2 C 2 /b 2 ) , and [Equation]
(cid:27) where M :
= C 2 + σ 2 Csb 2 .
Lemma 1.
Under Assumption 2, let s
= s
= s in Algorithm 1, we have for any j ∈ [ d ] ,
E [ v j ] ≤ C 2 + σ 2 C 2 sb 2 .
Proof.
Recall that C is the gradient norm bound (Assumption 2).
Let the clipping threshold be C as well.
We have for j ∈ [ d ] ,
[Equation]
where { i 1 , . .
, i s } denotes the indices of s noisy gradients used to obtain G j , and { N i 1 j , . . .
, N i s j } are random zero-mean Gaussian variables with variance σ 2 C 2 bunder noise multiplier σ , clipping threshold C [Equation] and mini-batch size b .
Hence for any j ∈ [ d ] and t ∈ [ T ] ,
[Equation]
A. P ROOF OF T HEOREM
Based on the updating rule
[Equation]
we have
[Equation] [Equation]
Rearranging terms gives
[Equation]
Taking the expectation on both sides conditioned on w t
[Equation]
where we have used the fact that N is a zero-mean Gaussian variable independent of g t [Equation] w t .
Taking the expectation on both sides and using the convexity of F ( · ) :
[Equation]
Applying telescope sum
[Equation]
we have
[Equation]
Hence
[Equation]
we need to bound the RHS:
[Equation]
where the vector D t ∈ R
d satisfies that D t = 1 when running private SGD steps, and D t = √ v
+ ϵ when running private RMSProp steps.
Let the delay parameter to be scheduled as
[Equation]
17) and the learning rate α t be
[Equation]
where α = min (cid:110) ϵ, 1 √ M + ϵ , 1 (cid:111) , and M is the upper bound of E [ v j ] for j ∈ [ d ] , as defined and proved in Lemma 1.
We next consider the T 1 term.
There are four cases.
DP-SGD at the t − 1 -th iteration, and DP-SGD at the t -th iteration :
As D t = D t − 1 there is not much requirement other that the learning rates need to satisfy α t ≤ α t − 1 , which holds for our choice.
Private RMSProp at the t − 1 -th iteration, and private RMSProp at the t -th iteration : Similar to previous case, the learning rates need to satisfy α t ≤ α t − 1 , which holds for our choice.
DP-SGD at the t − 1 -th iteration, and private RMSProp at the t -th iteration : We require
[Equation]
But in this case we must have t % s = 0 .
So this is satisfied by our choice as long as α ≤ ϵ . 4. Private RMSProp at the t − 1 -th iteration, and DP-SGD at the t -th iteration
The first three cases form an updating pattern of DP-SGD → · · · → DP-SGD → DP-RMSProp → · · · → DP-RMSProp, where every pattern takes 2 s iterations, except for the first pattern, because the telescope sum starts from t = 2 .
For the first pattern, we have
[Equation]
where D 2 s = √ v
+ ϵ .
For k ≥ [Equation] we have
[Equation]
where D 2 sk +2 s = √ v + ϵ belong to DP-RMSProp updates.
We look at the second T 2 term, and prove by induction that there exists a constant κ such that
[Equation]
When T = 1 ( α
=
α and D 1 = 1 ), α 2 E [ ∥ g 1 ∥ 2 ] ≤ κdα holds if κ ≥ α 2 C 2 .
At each step t , the goal is to get
[Equation]
[Equation]
DP-SGD at the t − 1 -th iteration, and DP-SGD at the t -th iteration : We require
[Equation]
[Equation]
which would hold for choice of α t as gradients are bounded and κ ≥ α 2 C 2 .
the t and private RMSProp at the t -th
We need
[Equation]
Let
[Equation]
Based on our updating rule
[Equation]
Note that
[Equation]
where we have used the assumption that ∥ g t ∥ ≤ C .
Combining the above two,
[Equation]
This implies the condition holds as long as κ satisfies
[Equation]
DP-SGD at the t − 1 -th iteration, and private RMSProp at the t -th iteration.
We want to prove
[Equation]
[Equation]
As ∥ g t ∥ ≤ C , it holds that
[Equation]
Therefore,
[Equation]
Based on our learning rate set in Eq.
[Equation]
[Equation]
Hence,
Ch ( s )
[Equation] [Equation]
where we require
[Equation]
Private RMSProp at the t − 1 -th iteration, and DP-SGD at the t -th iteration.
We need
[Equation] [Equation]
Plug in E (cid:104) ∥√ v t − 1 ∥
[Equation]
≤ d √ M (Lemma 1) and ∥
g t ∥ 2 ≤ C 2 , we have
[Equation]
Based on our learning rate set in Eq.
(18), for some constant γ ,
[Equation]
46) = ⇒
[Equation]
Therefore α
[Equation]
48) holds as long as κ ≥ α 2 C 2 .
To sum up, the requirement on κ is κ ≥ max
[Equation]
[Equation]
Final convergence results:
[Equation]
where T v denotes the iteration indices where we switch from private RMSProp steps to private SGD steps plus the last iteration, and its cardinality is | T υ | = ⌈ 12 υ ⌉ , and κ ≥ max (cid:110)
α 2 C 2 , Ch ( s ) ϵ √ 1 − β , (cid:111) , α = min (cid:110) ϵ, 1 √ M + ϵ , 1 (cid:111) .
A. A CLOSER LOOK AT h ( s )
We closely examine h ( s ) , defined as
[Equation]
≥ [Equation] [ T ]
[Equation]
Let us assume mini-batch gradients on consecutive time steps are not very different, i.e. ∥ g t − g t − 1 ∥ 1 ≤ M .
This means each gradient norm cannot be too far away from each other, which can be used to s on s .
Denote between the iteration t and the iteration where v gets updated as k , i.e., k :=
t − ⌊ ts ⌋ s .
Hence,
[Equation]
[Equation] Denote a := 1 s (cid:0) N t − k − 1 + · · · + N t − k − s (cid:1) , and b := 1 s (cid:0) g t − k − 1 + · · · + g t − k − s (cid:1) .
Then
[Equation]
In the special case where gradients are sparse, i.e., E [ ∥ b ∥ 1 ] < E [ ∥ a ∥ 1 ] , we have
[Equation]
It is easy to see that the RHS is O ( s ) , and it increases as s .
We can informally express it as c 1 s + c 2 , where c 1 and c 2 are two constants.
B P ROOF OF T HEOREM
First we introduce a result that will be used in this section.
Under the bounded stochastic gradient variance assumption (Assumption 4), we have that conditioned on w t ,
[Equation]
[Equation] where b refers to the mini-batch size to obtain gradient g t , i.e., g t ← 1 b (cid:80) i ∈
B g i,t .
This lemma is proved in Zaheer et al.
The per-coordinate version of this result is that for j ∈ [ d ] ,
[Equation]
61) and (cid:80)
j ∈
[ d ] τ 2 j = τ 2 .
As we assume F ( w ) is L -smooth, at each iteration t ,
[Equation]
Based on the updating rule of Algorithm 1, we have
[Equation] [Equation]
where N ∈ R d and N j ∼ N (cid:16) 0 ,
[Equation]
2 C 2 b [Equation] with noise multiplier σ and clipping threshold C , and D t satisfies that
[Equation]
Take expectation with respect to samples at the t -th iteration and N t ,
[Equation]
where we have used the fact that N t is a zero-mean random variable independent of w t , and D t is independent of samples at time t .
We need to consider two cases.
1. DP-SGD at the t -th iteration
In this case, D t = 1 .
Hence plugging in
[Equation]
67) we have
[Equation]
[Equation]
Under constant learning rate, let α t = α ≤ 1 L ,
[Equation]
Taking expectation on both sides gives
[Equation]
We have
[Equation]
Plugging in E t (cid:2) ( g tj ) 2 (cid:3) ≤ τ 2 j b + ( ∇ j F ( w t )) 2 results in
E t [Equation] [Equation]
[Equation]
Taking expectation on both sides yields
[Equation]
We need to lower bound (cid:80) j
[Equation] E (cid:20) [ [Equation] √
[Equation] tj [Equation] (cid:21) .
We know from Holder’s inequality that
E [ ⟨ u, v ⟩ ] ≤ E [ ∥ u ∥ 1 ] E
[ ∥ v ∥ ∞ ] .
Now note that
[Equation]
Hence (cid:88)
[Equation]
and
[Equation]
Let α t = α ≤ ϵL
[Equation]
we obtain
[Equation]
Combining the two cases, for any t , we have
[Equation]
Taking a telescope sum results in
[Equation]
where M :=
C 2 + σ 2 C 2 sb 2 .
C E XPERIMENTAL D ETAILS AND A DDITIONAL R ESULTS C. H YPERPARAMETERS
Unless otherwise stated we fix the following hyperparameters in our experiments: for
IMDB/StackOverflow/MovieLens respectively we train for 100/50/50 epochs with batch size 64 and privacy δ = 10 − 5 / 10 − 6 / 10 − 6 .
We then perform a grid search on other hyperparameters:
• Learning rates : We grid search over { 0.03, 0.1, 0.3, 1, 3, 5 } for SGD / AdaGrad update rules and from { 0.001, 0.003, 0.01, 0.03, 0.1, 0.3, 1, 3 } for the RMSProp update rule.
• Per-example clipping thresholds : We grid search over { 0.1, 0.25, 0.5, 1 } when performing per- example clipping on clean gradients without preconditioning (e.g. for DP-SGD updates), and over { 0.5, 1, 2, 3, 5 } when clipping preconditioned clean gradients (e.g. for DP 2 updates in adaptive iterations).
The rationale is that, in general, the preconditioned gradient norms are usually larger than those without preconditioning (recall from Section 3.2 that we apply preconditioning before privatization in DP 2 ).
• Delay parameter s :
For all datasets, s (i.e., the number of optimization steps) is chosen heuristically as a function of the number of steps in an epoch.
When reporting the best results (e.g. Figure 4, Figure 5), we search over s ∈ { 195, 390, 780 } (roughly 0.5, 1, 2 epochs respectively) for IMDB (390 steps/epoch); s ∈ { 100, 300, 1000, 3000 } for StackOverflow (3845 steps/epoch); and s ∈ { 1250, 15625, 31250, 50000 } for MovieLens (1250 steps/epoch).
• Adaptivity ϵ :
In our settings, the adaptivity parameter ϵ
for RMSProp/AdaGrad (in the denominator
D t = √ v + ϵ ) would affect the amount of adaptivity as well as the norms of preconditioned gradients, which may in turn influence the privacy-utility trade-off under per-example clipping.
We tune ϵ over a small grid of { 10 − 3 , 10 − 5 , 10 − 7 } .
All reported results use the best hyperparameter configurations, which are selected using training set metrics (as overfitting generally does not occur under strong DP noise).
We summarize the tuned hyperparameters in Table 2 below to facilitate reproducibility
[Table]
C. R ESULTS FOR DP 2 -A DA G RAD
The DP 2 framework can be applied to a range of adaptive methods beyond RMSProp mostly discussed in the main text.
We extend DP 2 to the AdaGrad update rule (with only one line of code change, see
Section D), and benchmark its convergence and privacy-utility trade-offs.
In Figure 8 and Figure 9, the results indicate that DP 2 -AdaGrad, like DP 2 -RMSProp, can consistently and substantially improve over the baselines in terms of both convergence and absolution performance, demonstrating the generality of DP 2 to other adaptive optimizers.
C. E FFECTS OF I NCREASING C OMPUTATIONAL B UDGETS
When differential privacy introduces a large utility gap between private and non-private training, one approach to improving the privacy-utility trade-off is to increase computational costs by using larger batch sizes under fixed numbers of steps.
The noise multiplier needs to increase to achieve the same privacy target, while the overall privacy noise may still be reduced due to the larger batch size.
This technique may be adopted in practice when we want to prioritize the utility of private optimization under fixed privacy budgets.
In Figure 9 (right), we explore the effect of such increased computation on StackOverflow.
With a 4x factor increase in computational cost (4x larger batch sizes with the
[Figure]
[Figure]
t a cc
[Figure]
same number of training iterations), we observe that the privacy/utility trade-off of all methods can be substantially improved, narrowing the utility gap to non-private training.
In particular, observe that the absolute performance improvement of DP 2 over the vanilla DP baselines remains similar.
C. A DDITIONAL R ESULTS FOR A BLATION S TUDIES
Table 3 summarizes the results for ablation studies on IMDB, StackOverflow, and MovieLens, and
Figure 10 reports test accuracies on IMDB and StackOverflow during optimization.
The variants are discussed in Section 5.4 and complete algorithms are presented in Appendix D.
We observe that DP 2 indeed consistently outperforms the two (weaker) variants on all datasets, thus verifying our design choices for DP 2 .
In particular, note that the utility drop of variant 2 (adding noise before preconditioning) on StackOverflow is more significant compared to that on IMDB; we argue that this is due to StackOverflow being a high-dimensional learning task (roughly 5 million model parameters) and thus the detrimental effect of preconditioning per-coordinate noise is larger.
[Table]
C. A DDITIONAL R ESULTS FOR C OMPARISON WITH P UBLIC D ATA -A SSISTED M ETHODS
Figure 11 extends the results in Section 5.3 with convergence plots on IMDB and StackOverflow.
On IMDB, we observe that despite not using any auxiliary information, the convergence of DP 2RMSProp is comparable with that of AdaDPS-RMSProp (Li et al., 2022) which uses 1% of training [Figure] [Figure] data as the public data (250 examples) to approximate the preconditioner.
On StackOverflow where the same public split of 1% corresponds to 2460 examples, we observe that AdaDPS-RMSProp can outperform DP 2 .
On the other hand, the extra public data do not help PDA-DPMD outperform DP 2 .
[Figure]
In Figure 12, we additionally implement a private AdaGrad method proposed in Kairouz et al.
(2021a) that also leverages public data.
Specifically, in each iteration, the algorithm clips and adds independent noise to both the clean gradients and the preconditioner estimated using clean gradients; it then uses public data to estimate a gradient subspace onto which to project the clipped/noised preconditioner in order to reduce the effect of noise; finally, it preconditions the noisy gradient with the noisy preconditioner and takes an update step.
Our implementation differs from Kairouz et al
(2021a) in that we the diagonal form of the preconditioner instead of the matrix form.
To estimate the gradient subspace, we follow the approach described in Zhou et al.
where the projection matrix V ∈ R d × k where d is the number of parameters and k is the dimension of the subspace is obtained by taking the top- k eigenspace of M t with
[Equation]
where X pub is the set of public examples.
Unfortunately, we have not obtained a satisfactory result for this noisy AdaGrad algorithm.
We remark that since the method is extremely computationally expensive (involves computing the eigendecomposition of a d × d matrix with d = 10001 at every iteration), further hyperparameter tuning may help improve the performance.
However, our ablation studies (Section 5.4 and Appendix C.4) may shed light on the current observations since this method privatizes gradients before preconditioning.
D A LGORITHMS
For completeness, we present all algorithms mentioned in the main text in detail.
• Non-private version of DP 2 : only changing Line 9 in Algorithm 1 to
[Equation]
• DP 2 with the AdaGrad update rule ( DP 2 -AdaGrad) : only changing Line 5 in Algorithm 1 to
[Equation]
• DP 2 with Yogi’s additive update rule ( DP 2 -Yogi) : only changing Line 5 in Algorithm 1 to
[Equation]
• Ablation variant 1 (extra query) with delayed preconditioners : see Algorithm 2.
Observe that the clean batch gradients { g i,t } i ∈ B get privatized twice in most iterations (when ( t − 1) mod s ̸ = 0 ), increasing the total privacy cost.
• Ablation variant 2 (noise before preconditioning) with delayed preconditioners : in Line 9 of Figure 1, privatize the batch gradients
with the following replacement:
[Equation]
Input: T , batch size b , noise multiplier σ , clipping thresholds C 1 , C 2 , initial model w 0 ∈ R d , v = 0 , constant ϵ ∈ R + , learning rate schedule α t , moving average parameters β , delay steps s 1 Set accumulator G 0 ←2 for t = 1 , · · · , T do
Uniformly randomly sample a mini-batch B with size b from private training data
Get individual gradients for sample i ∈ B : g i,t ← ∇ f ( x i ; w t − 1 )
Privatize the gradients using the Gaussian mechanism: ˜ g t ← 1 b (cid:32)(cid:88) i ∈ B clip (cid:0) g i,t , C 1 (cid:1) + N (cid:0) 0 , σ 2 C 21 (cid:1)(cid:33)
Accumulate the private gradients ˜
g t : G t ← G t − 1 + ˜ g t if ( s then
Update moment estimates: v βv − β
( G t /s
Reset accumulator: G
←
Set final gradient : ¯ g t ← ˜ g t else
Privatize the clean, preconditioned gradients using the Gaussian mechanism: ˆ g t ← 1 b (cid:32)(cid:88) i ∈ B clip (cid:18) g
i,t √ v + ϵ, C(cid:19)
+ N (cid:0) 0 , σ 2 C 22 (cid:1)(cid:33)
Set final gradient : ¯ g t ← ˆ g t
Update model parameters w : w t ← w t − 1 − α t ¯ g t 13 return w T