The Distributed Discrete Gaussian Mechanism for Federated Learning with Secure Aggregation
Peter Kairouz, Ziyu Liu, Thomas Steinke
Introduction
Software and service providers rely on increasingly complex data analytics and machine learning models to improve their services. However, training these machine learning models hinges on the availability of large datasets, which are often distributed across user devices and contain sensitive information. The collection of these datasets comes with several privacy risks – can the service provider address issues around consent, transparency, control, breaches, persistence, processing, and release of data? There is thus a strong desire for technologies which systematically address privacy concerns while preserving, to the best extent possible, the utility of the offered services.
To address this need, several privacy-enhancing technologies have been studied and built over the past few years. Prominent examples of such technologies include federated learning (FL) to ensure that raw data never leaves users’ devices [MMRHA17, KM+19], cryptographic secure aggregation (SecAgg) to prevent a server from inspecting individual user updates [BIKMMPRSS17, BBGLR20], and differentially private stochastic gradient descent (DP-SGD) to train models with provably limited information leakage [ACGMMTZ16, TB20]. While these technologies have been extremely well studied in a separate fashion, little work has focused on understanding precisely how they can be combined in a rigorous and principled fashion. Towards this end, we present a comprehensive end-to-end system where each client appropriately discretizes their model update and adds discrete Gaussian noise to it before sending it for modular secure summation using SecAgg. This provides the first concrete step towards building a communication-efficient FL system with distributed DP See “Distributed DP” paragraph in Section 1.2 for a definition of this notion of DP and a literature review. and SecAgg guarantees.
1 Main Results
Privacy is achieved by each client independently adding discrete Gaussian noise [CKS20] to its (appropriately discretized) vector. The sum of independent discrete Gaussians is not a discrete Gaussian, but we show that it is extremely close for the parameter regime of interest. This is the basis of our differential privacy guarantee, and we believe this result to be of independent interest.
Communication and Computation: It is crucial that our algorithms are efficient, especially the client side, which may be running on a mobile device. Computationally, our algorithms run in time that is nearly linear in the dimension. The communication cost is . While we cannot control the dimension , we can minimize the number of bits per coordinate, which is . However, this introduces a tradeoff between communication and accuracy – larger means more communication, but we can reduce the probability of a modular wrap around and pick a finer discretization to reduce the rounding error.
We focus our discussion on the simple task of summing vectors. In a realistic federated learning system, there will be many summing rounds as we iteratively update our model. Each round will be one invocation of our protocol. The privacy loss parameters of the larger system can be controlled using the composition and subsampling properties of differential privacy. That is, we can use standard privacy accounting techniques [DR16, BS16, Mir17, WBK19] to analyse the more complex system, as long as we have differential privacy guarantees for the basic protocol that is used as a subroutine.
We now state the privacy of our algorithm.
Let be the parameters of Algorithm 1 and the number of trustworthy clients. Define
We remark on the parameters of the theorem: To first approximation, . This is because the input vectors are clipped to have norm and then each client adds (discrete) Gaussian noise with variance . The noise added to the sum thus has variance . However, there are two additional effects to account for: First, randomized rounding can increase the norm from to and this becomes the sensitivity bound that we use for the privacy analysis. Second, the sum of discrete Gaussians is not a discrete Gaussian, but it is close; bounds the max divergence between the sum of discrete Gaussians each with scale parameter and one discrete Gaussian with scale parameter .
Note that -concentrated DP [DR16, BS16] is equivalent to satisfying -Rényi DP [Mir17] simultaneously for all . Concentrated DP can be converted to the more standard approximate differential privacy [CKS20]: For any , -concentrated DP implies -DP, where
Next we turn to the accuracy of the algorithm. We provide both an empirical evaluation and theoretical analysis. We give the following asymptotic guarantee; a more precise guarantee with exact constants can be found in Theorem 36.
To interpret Theorem 2, note that mean squared error is, up to constants, exactly the error we would expect to attain for differential privacy in the central model. Our analysis attains reasonably sharp constants (at the expense of many lower order terms that we suppress here in the introduction). However, to truly gauge the practicality of our method, we perform an empirical evaluation.
To investigate the interplay between communication, accuracy, and privacy under our proposed protocol in practice, we empirically evaluate our protocol and compare it to the commonly used centralized continuous Gaussian mechanism on two canonical tasks: distributed mean estimation (DME) and federated learning (FL). For DME, each client holds a vector and the server’s goal is to obtain a differentially private mean estimate of the vectors. We show that 16 bits per coordinate are sufficient to nearly match the utility of the Gaussian baseline for regimes of interest. For FL, we show on Federated EMNIST [CDWLKMST18] and Stack Overflow [Aut19] that our approach gives good performance under tight privacy budgets, despite using generic RDP amplification via sampling [ZW19] for our methods and the precise RDP analysis for the subsampled Gaussian mechanism [MTZ19]. We provide an open-source implementation of our methods in TensorFlow Privacy [ATMR19] and TensorFlow Federated [IO19]. Code: https://github.com/google-research/federated/tree/master/distributed_dp.
2 Related Work
Under FL, a set of clients (e.g., mobile devices or institutions) collaboratively train a model under the orchestration of a central server, while keeping training data decentralized [MMRHA17, Bon+19]. It embodies the principles of focused data collection and minimization, and can mitigate many of the systemic privacy risks and costs resulting from traditional, centralized machine learning and data science approaches. FL performs many rounds of interaction between the server and subsets of online clients; for example, each round may consist of computing and aggregating the gradients of the loss for a given set of model weights, which are then updated using the aggregated gradients for the next round. This allows us to focus on the simple task of computing the sum of vectors (model updates) held by the clients. We refer the reader to [KM+19] for a survey of recent advances and open problems in FL.
While the above features can offer significant practical privacy improvements over centralizing training data, FL offers no formal guarantee of privacy and has to be composed with other privacy technologies to offer strong (worst-case) privacy guarantees. The primary goal of this paper is to show how two such technologies, namely secure aggregation and differential privacy, can be carefully combined with FL to offer strong and quantifiable privacy guarantees.
While SecAgg prevents the server from inspecting individual client updates, the server is still able to learn the sum of the updates, which itself may leak potentially sensitive information [MSDCS19, CLEKS19, SS19, DSSUV15, SS19a, NSTPC21, SSSS17]. To address this issue, differential privacy (DP) [DMNS06], and in particular, DP-SGD can be employed [SCS13, BST14, ACGMMTZ16, TB20]. DP is a rigorous measure of information disclosure about individuals participating in computations over centralized or distributed datasets. Over the last decade, an extensive set of techniques has been developed for differentially private data analysis, particularly under the assumption of a centralized setting, where the raw data is collected by a trusted service provider prior to applying perturbations necessary to achieve privacy. This setting is commonly referred to as the central DP setting. More recently, there has been a great interest in the local model of DP [KLNRS11, ESAG04, War65] where the data is perturbed on the client side before it is collected by a service provider.
Local DP avoids the need for a fully trusted aggregator. However, it is now well-established that local DP usually leads to a steep hit in accuracy [KLNRS11, DJW13, KBR16]. In order to recover some of the utility of central DP, without having to rely on a fully trusted central server, an emerging set of models of DP, often referred to as distributed DP, can be used. Under distributed DP, clients employ a cryptographic protocol (e.g., SecAgg) to simulate some of the benefits of a trusted central party. Clients first compute minimal application-specific reports, perturb these slightly, and then execute the aggregation protocol. The untrusted server then only has access to the aggregated reports, with the aggregated perturbations. The noise added by individual clients is typically insufficient for a meaningful local DP guarantee on its own. However, after aggregation, the aggregated noise is sufficient for a meaningful DP guarantee, under the security assumptions necessary for the cryptographic protocol.
Despite the recent surge of interest in distributed DP, much of the work in this space focuses on the shuffled model of DP where a trusted third party (or a trusted execution environment) shuffles the noisy client updates before forwarding them to the server [EFMRTT19, BEMMRLRKTS17, CSUZZ19]. For more information on the shuffled model of DP, we refer the reader to [GKMP20, GGKPV21, GMPV20, GGKMPV20, IKOS06, BBGN19, BBGN20, BC20, BCJM21, GDDKS20].
The combination of SecAgg and distributed DP in the context of communication-efficient FL is far less studied. For instance, the majority of existing works ignore the finite precision and modular summation arithmetic associated with secure aggregation [GXS13, TBASLZZ19, VA17]. This is especially problematic at low SecAgg bit-widths (e.g., in practical FL settings where communication efficiency is critical).
The closest work to ours is cpSGD [ASYKM18], which also serves as an inspiration for much of our work. cpSGD uses a distributed version of the binomial mechanism [DKMMN06] to achieve distributed DP. When properly scaled, the binomial mechanism can (asymptotically) match the continuous Gaussian mechanism. However, there are several important differences between our work and cpSGD. First, the binomial mechanism does not achieve Rényi or concentrated DP [DR16, BS16, Mir17] and hence we cannot combine it with state-of-the-art composition and subsampling results, which is a significant barrier if we wish to build a larger FL system. The binomial mechanism is analyzed via approximate DP; in other words, the privacy loss for the binomial mechanism can be infinite with a non-zero probability. We avoid this issue by basing our privacy guarantee on the discrete Gaussian mechanism [CKS20], which also matches the performance of the continuous Gaussian and yields clean concentrated DP guarantees that are suitable for sharp composition and subsampling analysis. cpSGD also does not consider the impact of modular arithmetic, which makes it harder to combine with secure aggregation.
Previous attempts at achieving DP using a distributed version of the discrete Gaussian mechanism have either inaccurately glossed over the fact that the sum of discrete Gaussians is not a discrete Gaussian, or assumed that all clients secretly share a seed that is used to generate the same discrete Gaussian instance, which is problematic because a single honest-but-curious client can fully break the privacy guarantees [WJS21]. We provide a careful privacy analysis for sums of discrete Gaussians. Our privacy guarantees degrade gracefully as a function of the fraction of malicious (or dropped out) clients.
Preliminaries
We begin by defining the Rényi divergences, which we use throughout to quantify privacy.
For , we define the Rényi divergence of order of with respect to as
We will abuse this notation by considering the divergence between random variables when we mean the divergence between their respective distributions.
We now state some properties of the Rényi divergences; proofs and further properties can be found in the literature [BS16, BS19].
Let be probability distributions such that is absolutely continuous with respect to and is absolutely continuous with respect to . Then the following hold.
(Quasi)convexity: If is a distribution on the same space as and is a distribution on the same space as and is absolutely continuous with respect to , then
where denotes the convex combination of distributions.
Now we can state the definitions of concentrated differential privacy [DR16, BS16] and Rényi differential privacy [Mir17] and relate these to the standard definition of differential privacy [DMNS06, DKMMN06]. We adopt user-level privacy – i.e., each entry in the input corresponds to all the records associated with a single person [MRTZ18]. Thus the differential privacy distributional similarity guarantee holds with respect to adding or removing all of the data belonging to a single person. This is stronger than the commonly-used notion of item level privacy where, if a user contributes multiple records, only the addition or removal of one record is protected.
We choose to define differential privacy with respect to adding or removing the records of an individual, rather than replacing the records. Since replacement can be achieved by a combination of an addition and a removal, group privacy (a.k.a. the triangle inequality) implies a differential privacy guarantee for replacement; however, the privacy parameter will be doubled. We define to be the set of varying-size inputs from .
Concentrated differential privacy is a version of differential privacy that captures many natural techniques for attaining differential privacy and gives sharp composition results, among other features. We use the definition of[BS16] which is a simplification of the original definition of[DR16]. Specifically, we use what is also known as zero-concentrated differential privacy (zCDP) [BS16], although we drop the “zero” qualifier for brevity, as there is no need to distinguish it from the original version of concentrated differential privacy [DR16]. The two versions are loosely equivalent, but the version we use has cleaner mathematical properties.
A more general relaxation of concentrated differential privacy is Rényi differential privacy, which was defined by[Mir17].
We also use the original version of differential privacy that was defined by\AtNextCite\AtEachCitekey [DMNS06] with (a.k.a. pure or pointwise differential privacy) and with the possibility of (i.e., approximate differential privacy) by\AtNextCite\AtEachCitekey [DKMMN06].
A randomized algorithm satisfies -differential privacy iff, for all differing by the addition or removal of a single user’s records, we have
for all events . We refer to -differential privacy as pure differential privacy or pointwise differential privacy and we refer to -differential privacy with as approximate differential privacy.
We remark that -DP is equivalent to -Rényi DP. Similarly, -concentrated DP is equivalent to satisfying -Rényi DP simultaneously for all .
In addition we have the following conversion lemma [BBGHS20, CKS20, ALCKS20] from concentrated DP to approximate DP.
If satisfies -differential privacy, then it satisfies -concentrated differential privacy. If satisfies -concentrated differential privacy, then, for any , satisfies -differential privacy, where
Distributed Discrete Gaussian
We will use the discrete Gaussian [CKS20] as the basis of our privacy guarantee.
The discrete Gaussian has many of the desirable properties of the continuous Gaussian [CKS20], including the fact that it can be used to provide differential privacy.
Unlike the continuous Gaussian, the sum/convolution of two independent discrete Gaussians is not a discrete Gaussian. However, we show that, for reasonable parameter settings, it is very close to one. The following result is a simpler version of Theorem 4.6 of[GMPW20].
The bound of the theorem is surprisingly strong; if , then the bound is , which should suffice for most applications. Furthermore, closeness in max divergence is the strongest measure of closeness that we could hope for (rather than, say, total variation distance).
Note that this interval is independent of . Here is an appropriate constant.
as long as . ∎
Theorem 11 can easily be extended to sums of more than two discrete Gaussians by induction:
The result now follows by induction; the base case is trivial. ∎
We can now use the triangle inequality to combine our convolution closeness results with the privacy guarantee of a single discrete Gaussian to obtain a privacy guarantee for sums of discrete Gaussians:
That is, an algorithm that adds to a sensitivity- query satisfies -concentrated differential privacy for .
To make the above bound concrete, if and , then .
Finally, we extend Proposition 13 to the multidimensional setting using the composition property:
This follows from Proposition 13 and summing over coordinates. Note that before summing we expand
To obtain the third expression we apply the bound and complete the square again. ∎
Finally, we state a utility bound for the discrete Gaussian.
Theoretical Utility Analysis
We now delve into the accuracy analysis of our algorithm. There are three sources of error that we must account for: (i) discretization via (conditional) randomized rounding, (ii) the noise added for privacy (which depends on the norm of the discretized vector), and (iii) the modular clipping operation. We address these concerns one at a time.
In order to apply discrete noise, we must first round the input vectors to the discrete grid. We must analyze the error (both bias and variance) that this introduces, and also ensure that it doesn’t increase the sensitivity too much. That is, the rounded vector may have larger norm than the original vector, and we must control this.
We begin by defining the randomized rounding operation:
We first look at how randomized rounding impacts the norm. It is easy to show that
for all . This bound may be sufficient for many purposes, but, if we relax the probability 1 requirement, we can do better (by constant factors), as demonstrated by the following lemma.
where . Furthermore, for any , we have
Fix some and . By Hoeffding’s lemma,
Fix some and . Assume, without loss of generality, that . By Hoeffding’s lemma,
Setting and gives
The expectation and high probability bounds of Lemma 17 are only a constant factor better than the worst-case bound (20). Namely, Lemma 17 gives the bound
Nevertheless, constant factor improvements matter in practical systems. However, hopefully, is sufficiently small that the increase in norm from randomized rounding is entirely negligible, even if we apply the worst-case bound.
Lemma 17 shows that, with high probability, randomized rounding will not increase the norm too much. We could use this directly as the basis of a privacy guarantee – the probability of the norm being too large would correspond to some kind of privacy failure probability. Instead what we will do is, if the norm is too large, we simply fix that – namely, by resampling the randomized rounding procedure. That is, instead of accepting a small probability of privacy failing, we accept a small probability of inaccuracy.
Now we give a lemma that bounds the error of conditional randomized rounding.
For an arbitrary random variable and nontrivial event , we have
where and, hence, .
By Hoeffding’s lemma, since and is a product distribution with mean , we have
We summarize the results of this section. First we give a proposition for a single instance of randomized rounding (this combines Lemma 17 and 21).
Now we give a proposition for sums of randomized roundings.
Proposition 23 provides some guidance on how to set the parameter . We have the mean squared error bound (39)
If we set , then the bias and variance terms in the bound are of the same order. Setting too small would needlessly increase the sensitivity . And we see that there is little value in setting . So the theory suggests setting .
However, we emphasize that this is a worst-case upper bound on the error and it is likely that, in practice, the error would likely be considerably less. Thus it is justifiable to set to be considerably larger – e.g., – and simply hope for the best in terms of accuracy.
Proposition 23 covers the error introduced by discretization. Obviously, reducing the granularity will reduce the discretization error. However, this comes at a cost in communication, so the choice of this parameter will need to be carefully made.
In Section 3 we have covered the noise that is injected to preserve privacy and in Section 4.1 we have covered the error introduced by discretizing the data. Now we state a result that combines these.
Let , , and . Let
Then satisfies -concentrated differential privacy. Not that this is with respect to the addition or removal of an element, not replacement. To keep fixed, we would need addition/removal to be defined to simply zero-out the relevant vectors.
2 Flattening
It is possible that the inputs and the sum are very heavily concentrated on one coordinate. This is a bad case, as the modular clipping will create a very large error, unless we use a very large modulus. To avoid this problem we will “flatten” the inputs as a pre-processing step (which is inverted by the server at the end of the protocol).
Specifically, our goal is to pre-process the inputs so that and then at the end we can undo the pre-processing to obtain the original value. Here is the range where modular arithmetic does not cause errors.
The flattening matrix is shared randomness – that is, the server and all the clients must have access to this matrix. Fortunately, the differential privacy guarantee does not depend on this randomness remaining hidden; thus can be published, and we do not need to worry about the privacy adversary having access to it.
There are many possibilities for this flattening transformation. A natural option is for to be a random unitary matrix or rotation matrix. This would attain the desired property:
Instead our approach is to first randomize the signs of the entries of and then multiply by a matrix with small entries. This attains the desired guarantee:
Walsh-Hadamard matrices are ideal for (after scaling appropriately). They attain the optimal and the fast Walsh-Hadamard transform can compute the matrix-vector products in operations. This is what we use in our experiments. Formally, the Walsh-Hadamard matrices are defined recursively as follows:
The only downside of Walsh-Hadamard matrices is that they require the dimension to be a power of . We can pad the input vectors with zeros to ensure this. However, in the worst case, padding may nearly double the dimension , which correspondingly slows down our algorithm. (E.g., if , then we must pad to dimension .)
To avoid or reduce padding, there are several solutions:
Such matrices exist for any dimension and the required matrix-vector products can still be computed in time. However, they attain a slightly suboptimal subgaussian flatness parameter of .
Fortunately, there are explicit constructions of Hadamard matrices of many sizes which also allow efficient matrix-vector computations. By considering sizes other than powers of , we can significantly reduce the required amount of padding.
For example, we can generalize the Kronecker product construction (53) to dimension for integers :
The addition of this construction alone is sufficient to reduce the worst case for padding from a factor of to a factor of – now can be padded to . The other desirable properties of the Hadamard matrices are also retained.
A third solution is to move from the reals to complex numbers and use the discrete Fourier transform. Our real vector of length can be encoded as a complex vector of length (two real entries become the real and imaginary components of one complex entry). Instead of being a diagonal matrix with random signs, the diagonal entries are for a uniformly random . (In fact, it suffices to have uniform. This only requires one bit of shared randomness per coordinate. Note that corresponds to and, in Equation 57, to R_{\theta}\in\left\{\left(\begin{array}[]{cc}1&0\\ 0&1\end{array}\right),\left(\begin{array}[]{cc}0&-1\\ 1&0\end{array}\right),\left(\begin{array}[]{cc}-1&0\\ 0&-1\end{array}\right),\left(\begin{array}[]{cc}0&1\\ -1&0\end{array}\right)\right\}.) Then is the discrete Fourier transform matrix. This gives us a complex vector of length that can be decoded back to a real vector of length . This transformation is unitary and linear and attains the optimal subgaussian flatness constant (i.e., matches the guarantee of a random rotation or unitary matrix from Lemma 28). The only requirement is that the dimension must be even – i.e., we must pad at most one zero.
If we wish to avoid thinking about complex numbers, the complex numbers can be replaced with rotation matrices. That is
Let and . Then and . Note . Thus
The inequality follows from the fact that and for all integers . The last fact can be easily verified by induction: For both sides are equal to . Moving from to multiplies the right side by and the left side by . ∎
We emphasize that the discrete fourier transform (i.e., matrix-vector multiplications with from Equation 56) can be computed in operations for any – not just powers of . Although the exact efficiency (i.e., constants) depends on [Wik21].
3 Modular Clipping
In this section we cover third and final source of error – modular arithmetic. This is introduced by the secure aggregation procedure.
We first define the modular clipping operation in a convenient form for real numbers.
Note that definition 33 does not specify whether or (and likewise for ). Thus our analysis does not depend on how this choice is made.
A key property of the modular operation is that it is homomorphic:
Our goal is to analyze , where is as in Proposition 26. The modular clipping arises from the secure aggregation step, which works over a finite group. Note that discretizes the values (although this is not crucial for this part of the analysis).
We want to ensure that . We have already established that and our goal is now to analyze the modular clipping operation. If , then and we are in good shape; thus our analysis centers on ensuring that this is the case.
We will use the fact that the flattening operation, as well as the randomized rounding and noise addition, result in each coordinate being a centered subgaussian random variable. This allows us to bound the probability of straying outside .
Now we have our bound on the error of modular clipping:
Set to obtain the first part of the result.
Set to obtain the second part of the result. ∎
4 Putting Everything Together
We have now analyzed the three sources of error – randomized rounding, privacy-preserving noise, and modular arithmetic. It remains to combine these results. This yields our main result:
There is a lot to unpack in Theorem 36. Let us work through the parameters:
is the number of individuals and is the dimension of the data.
is the bound on -norm of the individual data vectors.
is the variance of the individual discrete Gaussian noise that we add; the sum will have variance . This determines the privacy; specifically and we attain -concentrated differential privacy.
is a parameter that controls the conditional randomized rounding. yields unconditional randomized rounding, and larger entails more aggressive conditioning. It will be helpful to think of ; although, in practice, slightly larger may be preferable.
measures how good the flattening matrix is (cf. Lemma 29). Think of or at most .
The other parameters – , , , – are not important, as they are determined by the previous parameters. and determine how much the conditional randomized rounding can increase the norm (initially the norm is ). quantifies how far the sum of discrete Gaussians is from just a single discrete Gaussian and how this affects the differential privacy guarantee. The ratio measures how much error the modular clipping contributes. is determined by other parameters, but note that may be a loose upper bound, in which case, the clipping error is less.
Now we look at the error bound. If we assume and , then the guarantee (69) is simply
The first term is roughly the cost of privacy – . The second term, , is the cost of randomized rounding and modular clipping. (We have assumed and are sufficiently small to avoid any additional terms.)
The differential privacy guarantee follows from the postprocessing property of differential privacy and Proposition 26 (which, in turn, applies Proposition 14).
By our assumption on (and independence) we have
Recall . By Proposition 35, for all ,
where and here. Summing over yields
We gave an asymptotic version of Theorem 36 in the introduction.
Finally, we analyse how to set the parameters to obtain this bound. Note that we do not attempt to optimize constants here at all.
Theorem 36 gives the following parameters.
Note that . All we must do is verify that setting the parameters as specified in Theorem 2 yields -concentrated DP and the desired accuracy. First,
Thus the privacy requirement is satisfied as long as and , and . So we can set
We set .
Now we work out the asymptotics of the accuracy guarantee:
Now we wish to set so that – i.e., . However, simply setting , where is our upper bound on , is cyclic, because our bound on depends on . Fortunately, we can resolve this as long as the coefficient in this cycle is . That coefficient is . A sufficient condition for this is
then the mean squared error is , as required. ∎
Experiments
In Figure 2, we additionally investigate the trade-off between quantization errors and modular clipping errors by trying different values of . Here, we use the optimistic norm bound on the vector sum as the general norm bound could be loose (thus would be chosen conservatively such that modular wrap-around rarely happens). At , the effect of modular clipping is now evident (the gap between DDGauss and Gaussian). With increasingly larger (larger ), we incur more quantization errors (thus worse low bit-width performance) but less modular wrapping and can close the utility gap to Gaussian at high bit-widths.
2 Federated Learning
We evaluate on three public FL benchmarks: Federated EMNIST [CATVS17, CDWLKMST18], Stack Overflow Tag Prediction (SO-TP, [Aut19]), and Stack Overflow Next Word Prediction (SO-NWP, [Aut19]).
Federated EMNIST is an image classification dataset containing 671,585 training hand-written digit/letter images over 62 classes grouped into clients by their writer. Stack Overflow is a large-scale text dataset based on the question answering site Stack Overflow. It contains over training sentences extracted from the site grouped by the users, and each sentence has associated metadata such as tags. The task of SO-TP involves predicting the tags of a given sentence, while the task of SO-NWP involves predicting the next words given the preceding words in a sentence. For more details on the datasets and tasks, we refer the reader to [RCZGRKKM20]. We note that these datasets differ from those commonly used in related work (e.g. MNIST [LCB10] and CIFAR-10 [Kri+09]) in that they are substantially larger, more challenging, and involve user-level (instead of example-level) DP with real-world client heterogeneity and label/size imbalance. Obtaining a small on EMNIST is also harder due to the relatively large sampling rate needed for stable convergence under noising.
2.2 Models
For EMNIST, We train a small convolutional net with two 33 conv layers with 32/64 channels followed by two fully connected layers with 128/62 output units; a 22 max pooling layer and two dropout layers with drop rate 0.25/0.5 are added after the first 3 trainable layers, respectively. The total number of parameters is , which is slightly under to avoid excessive zero padding for the Walsh-Hadamard transform. For SO-TP, we follow [RCZGRKKM20] and train a simple logistic regression model for tag prediction. The vocabulary size is limited to for word tokens and 500 for tags, and each sentence is represented as a bag-of-words vector. The resulting model size is , which incurs a significant amount of zero padding. For SO-NWP, we use the LSTM architecture defined in [RCZGRKKM20] directly, which has a model size of parameters (slightly under ).
2.3 Setup
For all benchmarks, we used the standard dataset split provided by TensorFlow. For EMNIST, the dataset is split into training and test set and performance is reported on the test set. For Stack Overflow (SO-TP and SO-NWP), the dataset is split into training, validation, and test sets. Validation accuracies and test accuracies are reported on the validation and test sets respectively. Note that using the dataset splits from TensorFlow is standard practice as in previous work (e.g. [RCZGRKKM20, MRTZ18, ASGXR21]) and it allows our results to be comparable in similar settings. Note also that validation techniques such as -fold validation can incur additional privacy costs.
We adopt most hyperparameters from previous work [RCZGRKKM20, ATMR19, KMSTTX21]. For all tasks, we train with federated averaging with server momentum of 0.9 [MMRHA17, HQB19]. In each round, we uniformly sample clients for EMNIST and SO-NWP following [ATMR19] and clients for SO-TP due to memory limit. We train 1 epoch over clients’ local datasets. Each client’s model updates are weighted uniformly (instead of by their number of samples) to maintain privacy. Clients are sampled without replacement within each round, and with replacement across rounds. For EMNIST, SO-TP, and SO-NWP respectively, we set the number of rounds to 1500, 1500, and 1600, to 0.03, 2.0, and 0.3, client learning rate to 0.032, 316, and 0.5, and client batch size to 20, 100, and 16. Server LR is set to 1 for EMNIST and 0.56 for SO-TP; for SO-NWP, is selected from a small grid {0.3, 1} and the best performance (according to validation accuracy) is reported. Tuning is limited to (to tradeoff between the bias from clipping and the noise from privacy) and (to match the selected and ). For SO-NWP, we limit the max number of examples per client to 256.
The reported privacy guarantees rely on privacy amplification via sampling [KLNRS11, BST14, ACGMMTZ16], which is necessary to obtain reasonable privacy-accuracy tradeoffs in differentially private deep learning. This assumes that the identities of the users sampled in every round are hidden from the adversary. This does not hold for the entity initiating connection with the clients (typically the server running the FL protocol) but is applicable to the analysts that have requested the model. We adopt the tight amplification bound from [MTZ19] for the Gaussian baseline and use the generic upper bound from [ZW19] for DDGauss (we do not explore a precise analysis in this work). The generic amplification upper bound could lead to more noise being added for DDGauss to achieve the same privacy as Gaussian.
2.4 Results
For EMNIST, Figure 4 summarizes the test accuracies across different values of and for , and Figure 4 shows the accuracies during training. For Stack Overflow, Figure 6 summarizes the test performance on SO-TP (recall@5) and SO-NWP (accuracy), and Figure 6 shows the validation accuracies on SO-NWP.
Overall, with more communication bits () and privacy budget (), DDGauss achieves a better utility both relative to the Gaussian baseline and in absolute performance, and it can match the continuous Gaussian as long as is sufficient.
In particular, we can again observe the trade-off between quantization and modular clipping from Figure 4 and 6: a small can be sub-optimal for learning as the cost of modular wrap-around is more pronounced than quantization errors; using a larger allows DDGauss to match the Gaussian baseline at the expense of worse low bit-width performance (as is larger).
Note also that for EMNIST (Figure 4), there is a slight performance gap between Gaussian and DDGauss in the extreme setting with and . We believe this minor mismatch, on top of the errors from rounding and modular clipping, is due to the use of the generic upper bound for privacy amplification via subsampling as discussed earlier in this section.
3 Additional Results
We additionally consider scaling up the SO-NWP experiments to clients per round (similar to production settings described in [HRMRBAEKR18, MRTZ18, RMRB19]), and we show the validation accuracies during training across different noise multipliers where is the equivalent central noise standard deviation (i.e. for DDGauss). The values of are aligned on privacy budgets and thus is in fact slightly larger for DDGauss compared to Gaussian due to effects of rounding, generic amplification, etc. in Figure 7. We set and for and , and we set otherwise. gives a target test accuracy of around 25.2% (e.g. a utility-first approach to limit performance degradation from DP [KMSTTX21]) while and give of around 10 and 234 respectively. The results bear significant practical relevance as they indicate that as long as DDGauss is parameterized properly, it can perform as good as the continuous Gaussian in real-world settings (with large , large model size , and natural client heterogeneity from Stack Overflow).
Recall from Section 4.1 that the hyperparameter controls the growth of the client vector norm from conditional randomized rounding. Here, we are interested to know how and the bias and variance it introduces influence the communication-utility trade-off in practice. Figure 8 shows the results on Federated EMNIST with across and with user-level privacy budget fixed at ; other parameters follow those described earlier. leads to unconditional rounding, in which case we use the worst case bound . We note that when the communication budget is tight (i.e. large and small , where the “room” for larger norm and noise variance is limited), the bounded norm growth from conditional rounding can be pivotal to model learning and convergence. When the communication budget is sufficient (i.e. small and large , where we can afford unconditional rounding), the bias introduced by have insignificant impact on the model utility (e.g. and give similar performance and convergence speed).
Figure 9 shows the privacy degradation as observed by the server if a certain percentage of the clients drops out during aggregation (thus there would be missing local noise shares). Note that for the external analyst, the server can always add the missing shares of noise onto the aggregate to prevent this degradation. Note also that the values of the parameters () does not affect the degradation as they influence each other to arrive at the same initial . The sampling rate is also fixed at 1.0 as subsampling does not apply from the server’s perspective. Results indicate that the privacy guarantees degrade gracefully as clients drop out.
Concluding Remarks
We have presented an complete end-to-end protocol for federated learning with distributed DP and secure aggregation. Our solution relies on efficiently flattening and discretizing the client model updates before adding discrete Gaussian noise and applying secure aggregation. A significant advantage of this approach is that it allows an untrusted server to perform complex learning tasks on decentralized and privacy-sensitive data while achieving the accuracy of a trusted server. Our theoretical guarantees highlight the complex tension between communication, privacy, and accuracy. Our experimental results demonstrate that our solution is essentially able to match the accuracy of central differential privacy with 16 or fewer bits of precision per value.
Acknowledgments
We thank Naman Agarwal and Kallista Bonawitz for helpful discussions and comments on drafts of this paper. We thank Andrea La Mantia for pointing out an error in one of our calculations.