CommunicationEfficient Learning of Deep Networks from Decentralized Data
Abstract
Modern mobile devices have access to a wealth of data suitable for learning models, which in turn can greatly improve the user experience on the device. For example, language models can improve speech recognition and text entry, and image models can automatically select good photos. However, this rich data is often privacy sensitive, large in quantity, or both, which may preclude logging to the data center and training there using conventional approaches. We advocate an alternative that leaves the training data distributed on the mobile devices, and learns a shared model by aggregating locallycomputed updates. We term this decentralized approach Federated Learning.
We present a practical method for the federated learning of deep networks based on iterative model averaging, and conduct an extensive empirical evaluation, considering five different model architectures and four datasets. These experiments demonstrate the approach is robust to the unbalanced and nonIID data distributions that are a defining characteristic of this setting. Communication costs are the principal constraint, and we show a reduction in required communication rounds by 10–100 as compared to synchronized stochastic gradient descent.
1 Introduction
Increasingly, phones and tablets are the primary computing devices for many people [Poushter, 2016, Anderson, 2015]. The powerful sensors on these devices (including cameras, microphones, and GPS), combined with the fact they are frequently carried, means they have access to an unprecedented amount of data, much of it private in nature. Models learned on such data hold the promise of greatly improving usability by powering more intelligent applications, but the sensitive nature of the data means there are risks and responsibilities to storing it in a centralized location.
We investigate a learning technique that allows users to collectively reap the benefits of shared models trained from this rich data, without the need to centrally store it. We term our approach Federated Learning, since the learning task is solved by a loose federation of participating devices (which we refer to as clients) which are coordinated by a central server. Each client has a local training dataset which is never uploaded to the server. Instead, each client computes an update to the current global model maintained by the server, and only this update is communicated. This is a direct application of the principle of focused collection or data minimization proposed by the 2012 White House report on privacy of consumer data [White House Report, 2013]. Since these updates are specific to improving the current model, there is no reason to store them once they have been applied.
A principal advantage of this approach is the decoupling of model training from the need for direct access to the raw training data. Clearly, some trust of the server coordinating the training is still required. However, for applications where the training objective can be specified on the basis of data available on each client, federated learning can significantly reduce privacy and security risks by limiting the attack surface to only the device, rather than the device and the cloud.
Our primary contributions are 1) the identification of the problem of training on decentralized data from mobile devices as an important research direction; 2) the selection of a straightforward and practical algorithm that can be applied to this setting; and 3) an extensive empirical evaluation of the proposed approach. More concretely, we introduce the FederatedAveraging algorithm, which combines local stochastic gradient descent (SGD) on each client with a server that performs model averaging. We perform extensive experiments on this algorithm, demonstrating it is robust to unbalanced and nonIID data distributions, and can reduce the rounds of communication needed to train a deep network on decentralized data by orders of magnitude.
Federated Learning
Ideal problems for federated learning have the following properties: 1) Training on realworld data from mobile devices provides a distinct advantage over training on proxy data that is generally available in the data center. 2) This data is privacy sensitive or large in size (compared to the size of the model), so it is preferable not to log it to the data center purely for the purpose of model training (in service of the focused collection principle). 3) For supervised tasks, labels on the data can be inferred naturally from user interaction.
Many models that power intelligent behavior on mobile devices fit the above criteria. As two examples, we consider image classification, for example predicting which photos are most likely to be shared; and language models, which can be used to improve voice recognition and text entry on touchscreen keyboards . The potential training data for both these tasks (all the photos a user takes and everything they type ) can be privacy sensitive. The distributions from which these examples are drawn are also likely to differ substantially from easily available proxy datasets: the use of language in chat and text messages is generally much different than standard language corpora, e.g., Wikipedia and other web documents; the photos people take on their phone are likely quite different than typical Flickr photos. And finally, the labels for these problems are directly available: entered text is selflabeled for learning a language model, and photo labels can be defined by natural user interaction with their photo app (which photos are deleted, shared, or viewed).
Both of these tasks are wellsuited to learning a neural network. For image classification feedforward deep networks, and in particular convolutional networks, are wellknown to provide stateoftheart results [LeCun et al., 1998, Krizhevsky et al., 2012]. For language modeling tasks recurrent neural networks, and in particular LSTMs, have achieved stateoftheart results [Hochreiter and Schmidhuber, 1997, Kim et al., 2015].
Privacy
Federated learning has distinct privacy advantages compared to data center training on persisted data. Holding even an “anonymized” dataset can still put user privacy at risk via joins with other data [Sweeney, 2000]. In contrast, the information transmitted for federated learning is the minimal update necessary to improve a particular model (naturally, the strength of the privacy benefit depends on the content of the updates.^{1}^{1}1 For example, if the update is the total gradient of the loss on all of the local data, and the features are a sparse bagofwords, then the nonzero gradients reveal exactly which words the user has entered on the device. In contrast, the sum of many gradients for a dense model such as a CNN offers a harder target for attackers seeking information about individual training instances (though attacks are still possible).) The updates themselves can (and should) be ephemeral. They will never contain more information than the raw training data (by the data processing inequality), and will generally contain much less. Further, the source of the updates is not needed by the aggregation algorithm, so updates can be transmitted without identifying metadata over a mix network such as Tor [Chaum, 1981] or via a trusted third party. We briefly discuss the possibility of combining federated learning with secure multiparty computation and differential privacy at the end of the paper.
Federated Optimization
We refer to the optimization problem implicit in federated learning as federated optimization, drawing a connection (and contrast) to distributed optimization. Federated optimization has several key properties that differentiate it from a typical distributed optimization problem:

NonIID The training data on a given client is typically based on the usage of the mobile device by a particular user, and hence any particular user’s local dataset will not be representative of the population distribution.

Unbalanced Similarly, some users will make much heavier use of the service or app than others, leading to varying amounts of local training data.

Massively distributed We expect the number of clients participating in an optimization to be much larger than the average number of examples per client.

Limited communication Mobile devices are frequently offline or on slow or expensive connections.
In this work, our emphasis is on the nonIID and unbalanced properties of the optimization, as well as the critical nature of the communication constraints. A deployed federated optimization system must also address a myriad of practical issues: client datasets that change as data is added and deleted; client availability that correlates with the local data distribution in complex ways; and clients that never respond or send corrupted updates.
These issues are beyond the scope of the current work; instead, we use a controlled environment that is suitable for experiments, but still address the key issues of client availability and unbalanced and nonIID data. We assume a synchronous update scheme that proceeds in rounds of communication. There is a fixed set of clients, each with a fixed local dataset. At the beginning of each round, a random fraction of clients is selected, and the server sends the current global algorithm state to each of these clients (e.g., the current model parameters). Each client then performs local computation based on the global state and its local dataset, and sends an update to the server. The server then applies these updates to its global state, and the process repeats.
While we focus on nonconvex neural network objectives, the algorithm we consider is applicable to any finitesum objective of the form
(1) 
For a machine learning problem, we typically take , that is, the loss of the prediction on example made with model parameters . We assume there are clients over which the data is partitioned, with the set of indexes of data points on client , with . Thus, we can rewrite the objective as
If the partition was formed by distributing the training examples over the clients uniformly at random, then we would have , where the expectation is over the set of examples assigned to a fixed client . This is the IID assumption typically made by distributed optimization algorithms; we refer to the case where this does not hold (that is, could be an arbitrarily bad approximation to ) as the nonIID setting.
In data center optimization, communication costs are relatively small, and computational costs dominate, with much of the recent emphasis being on using GPUs to lower these costs. In contrast, in federated optimization communication costs dominate — we will typically be limited by an upload bandwidth of 1 MB/s or less. Further, clients will typically only volunteer to participate in the optimization when they are charged, pluggedin, and on an unmetered wifi connection. Further, we expect each client will only participate in a small number of update rounds per day. On the other hand, since any single ondevice dataset is small compared to the total dataset size, and modern smartphones have relatively fast processors (including GPUs), computation becomes essentially free compared to communication costs for many model types. Thus, our goal is to use additional computation in order to decrease the number of rounds of communication needed to train a model. There are two primary ways we can add computation: 1) increased parallelism, where we use more clients working independently between each communication round; and, 2) increased computation on each client, where rather than performing a simple computation like a gradient calculation, each client performs a more complex calculation between each communication round. We investigate both of these approaches, but the speedups we achieve are due primarily to adding more computation on each client, once a minimum level of parallelism over clients is used.
Related Work
Distributed training by iteratively averaging locally trained models has been studied by McDonald et al. [2010] for the perceptron and Povey et al. [2015] for speech recognition DNNs. Zhang et al. [2015] studies an asynchronous approach with “soft” averaging. These works only consider the cluster / data center setting (at most 16 workers, wallclock time based on fast networks), and do not consider datasets that are unbalanced and nonIID, properties that are essential to the federated learning setting. We adapt this style of algorithm to the federated setting and perform the appropriate empirical evaluation, which asks different questions than those relevant in the data center setting, and requires different methodology.
The work of Shokri and Shmatikov [2015] is related in several ways: they focus on training deep networks, emphasize the importance of privacy, and address communication costs by only sharing a subset of the parameters during each round of communication; however, they also do not consider unbalanced and nonIID data, and the empirical evaluation is limited.
In the convex setting, the problem of distributed optimization and estimation has received significant attention [Balcan et al., 2012, Fercoq et al., 2014, Shamir and Srebro, 2014], and some algorithms do focus specifically on communication efficiency [Shamir et al., 2013, Yang, 2013, Ma et al., 2015, Zhang and Xiao, 2015]. In addition to assuming convexity, this existing work generally requires that the number of clients is much smaller than the number of examples per client, that the data is distributed across the clients in IID fashion, and that each node has an identical number of data points — all of these assumptions are violated in the federated optimization setting. Asynchronous distributed forms of SGD have also been applied to training neural networks, e.g., Dean et al. [2012], but these approaches require a prohibitive number of updates in the federated setting. One endpoint of the (parameterized) algorithm family we consider is simple oneshot averaging, where each client solves for the model that minimizes (possibly regularized) loss on their local data, and these models are averaged to produce the final global model. This approach has been studied extensively in the convex case with IID data, and it is known that in the worstcase, the global model produced is no better than training a model on a single client [Zhang et al., 2012, Arjevani and Shamir, 2015, Zinkevich et al., 2010].
2 The FederatedAveraging Algorithm
The recent multitude of successful applications of deep learning have almost exclusively relied on variants of stochastic gradient descent (SGD) for optimization; in fact, many advances can be understood as adapting the structure of the model (and hence the loss function) to be more amenable to optimization by simple gradientbased methods [Goodfellow et al., 2016]. Thus, it is natural that we build algorithms for federated optimization by starting from SGD.
SGD can be applied naively to the federated optimization problem, where a single batch gradient calculation (say on a randomly selected client) is done per round of communication. This approach is computationally efficient, but requires very large numbers of rounds of training to produce good models (e.g., even using an advanced approach like batch normalization, Ioffe and Szegedy [2015] trained MNIST for 50000 steps on minibatches of size 60). We consider this baseline in our CIFAR10 experiments.
In the federated setting, there is little cost in wallclock time to involving more clients, and so for our baseline we use largebatch synchronous SGD; experiments by Chen et al. [2016] show this approach is stateoftheart in the data center setting, where it outperforms asynchronous approaches. To apply this approach in the federated setting, we select a fraction of clients on each round, and computes the gradient of the loss over all the data held by these clients. Thus, controls the global batch size, with corresponding to fullbatch (nonstochastic) gradient descent.^{2}^{2}2 While the batch selection mechanism is different than selecting a batch by choosing individual examples uniformly at random, the batch gradients computed by FedSGD still satisfy . We refer to this baseline algorithm as FederatedSGD (or FedSGD).
A typical implementation of FedSGD with and a fixed learning rate has each client compute , the average gradient on its local data at the current model , and the central server aggregates these gradients and applies the update since . An equivalent update is given by and then . That is, each client locally takes one step of gradient descent on the current model using its local data, and the server then takes a weighted average of the resulting models. Once the algorithm is written this way, we can add more computation to each client by iterating the local update multiple times before the averaging step. We term this approach FederatedAveraging (or FedAvg). The amount of computation is controlled by three key parameters: , the fraction of clients that perform computation on each round; , then number of training passes each client makes over its local dataset on each round; and , the local minibatch size used for the client updates. We write to indicate that the full local dataset is treated as a single minibatch. Thus, at one endpoint of this algorithm family, we can take and which corresponds exactly to FedSGD. Complete pseudocode is given in Algorithm 1.
For general nonconvex objectives, averaging models in parameter space could produce an arbitrarily bad model. Following the approach of Goodfellow et al. [2015], we see exactly this bad behavior when we average two MNIST digitrecognition models^{3}^{3}3We use the “2NN” multilayer perceptron described in Section 3. trained from different initial conditions (Figure 1, left). For this figure, the parent models and were each trained on nonoverlapping IID samples of 600 examples from the MNIST training set. Training was via SGD with a fixed learning rate of 0.1 for 240 updates on minibatches of size 50 (or passes over the minidatasets). This is approximately the amount of training where the models begin to overfit their local datasets.
Recent work indicates that in practice, the loss surfaces of sufficiently overparameterized NNs are surprisingly wellbehaved and in particular less prone to bad local minima than previously thought [Dauphin et al., 2014, Goodfellow et al., 2015, Choromanska et al., 2015]. And indeed, when we start two models from the same random initialization and then again train each independently on a different subset of the data (as described above), we find that naive parameter averaging works surprisingly well (Figure 1, right): the average of these two models, 1 starts from a random initialization, note a shared starting model is used for each round of FedAvg, and so the same intuition applies. , achieves significantly lower loss on the full MNIST training set than the best model achieved by training on either of the small datasets independently. While Figure
The success of dropout training also provides some intuition for the success of our model averaging scheme; dropout training can be interpreted as averaging models of different architectures which share parameters, and the inferencetime scaling of the model parameters is analogous to the model averaging used in FedAvg [Srivastava et al., 2014].
3 Experimental Results
We are motivated by both image classification and language modeling tasks where good models can greatly enhance the usability of mobile devices. For each of these tasks we first picked a proxy dataset of modest enough size that we could thoroughly investigate the hyperparameters of the FedAvg algorithm. While each individual training run is relatively small, we trained over 2000 individual models for these experiments. We then present results on the benchmark CIFAR10 image classification task. Finally, to demonstrate the effectiveness of FedAvg on a realworld problem with a natural partitioning of the data over clients, we evaluate on a large language modeling task.
Our initial study includes three model families on two datasets. The first two are for the MNIST digit recognition task [LeCun et al., 1998]: 1) A simple multilayerperceptron with 2hidden layers with 200 units each using ReLu activations (199,210 total parameters), which we refer to as the MNIST 2NN. 2) A CNN with two 5x5 convolution layers (the first with 32 channels, the second with 64, each followed with 2x2 max pooling), a fully connected layer with 512 units and ReLu activation, and a final softmax output layer (1,663,370 total parameters). We study two ways of partitioning the MNIST data over clients: IID, where the data is shuffled, and then partitioned into 100 clients each receiving 600 examples, and NonIID, where we first sort the data by digit label, divide it into 200 shards of size 300, and assign each of 100 clients 2 shards. This is a pathological nonIID partition of the data, as most clients will only have examples of two digits. Thus, this lets us explore the degree to which our algorithms will break on highly nonIID data. Both of these partitions are balanced, however.^{4}^{4}4We performed additional experiments on unbalanced versions of these datasets, and found them to in fact be slightly easier for FedAvg.
For language modeling, we built a dataset from The Complete Works of William Shakespeare. We construct a client dataset for each speaking role in each play with at least two lines. This produced a dataset with 1146 clients. For each client, we split the data into a set of training lines (the first 80% of lines for the role), and test lines (the last 20%, rounded up to at least one line). The resulting dataset has 3,564,579 characters in the training set, and 870,014 characters^{5}^{5}5We always use character to refer to a one byte string, and use role to refer to a part in the play. in the test set. This data is substantially unbalanced, with many roles having only a few lines, and a few with a large number of lines. Further, observe the test set is not a random sample of lines, but is temporally separated by the chronology of each play. Using an identical train/test split, we also form a balanced and IID version of the dataset, also with 1146 clients.
On this data we train a stacked characterlevel LSTM language model, which after reading each character in a line, predicts the next character [Kim et al., 2015]. The model takes a series of characters as input and embeds each of these into a learned 8 dimensional space. The embedded characters are then processed through 2 LSTM layers, each with 256 nodes. Finally the output of the second LSTM layer is sent to a softmax output layer with one node per character. The full model has 866,578 parameters, and we trained using an unroll length of 80 characters.
2NN IID  NonIID  

0.0  1455  316  4278  3275  
0.1  1474  87  1796  664  
0.2  1658  77  1528  619  
0.5  —  (—)  75  —  (—)  443  
1.0  —  (—)  70  —  (—)  380  
CNN,  
0.0  387  50  1181  956  
0.1  339  18  1100  206  
0.2  337  18  978  200  
0.5  164  18  1067  261  
1.0  246  16  —  (—)  97 
MNIST CNN, 99% accuracy  
CNN  IID  NonIID  
FedSGD  1  1  626  483  
FedAvg  5  5  179  1000  
FedAvg  1  50  12  65  600  
FedAvg  20  20  234  672  
FedAvg  1  10  60  34  350  
FedAvg  5  50  60  29  334  
FedAvg  20  50  240  32  426  
FedAvg  5  10  300  20  229  
FedAvg  20  10  1200  18  173  
Shakespeare LSTM, 54% accuracy  
LSTM  IID  NonIID  
FedSGD  1  1.0  2488  3906  
FedAvg  1  50  1.5  1635  549  
FedAvg  5  5.0  613  597  
FedAvg  1  10  7.4  460  164  
FedAvg  5  50  7.4  401  152  
FedAvg  5  10  37.1  192  41 
SGD is sensitive to the tuning of the learningrate parameter . The results reported here are based on training over a sufficiently wide grid of learning rates (typically 1113 values for on a multiplicative grid of resolution or ). We checked to ensure the best learning rates were in the middle of our grids, and that there was not a significant difference between the best learning rates. Unless otherwise noted, we plot metrics for the best performing rate selected individually for each axis value. We find that the optimal learning rates do not vary too much as a function of the other parameters.
Increasing parallelism
We first experiment with the client fraction , which controls the amount of multiclient parallelism. Table 1 shows the impact of varying for both MNIST models. We report the number of communication rounds necessary to achieve a target testset accuracy. To compute this, we construct a learning curve for each combination of parameter setting (optimizing as described above), force the curve to be monotonically improving, and then compute the number of rounds where the curve reaches the target, using linear interpolation between the discrete points forming the curve. This is perhaps best understood by reference to Figure 2, where the gray lines show the targets.
With (for MNIST processing all 600 client examples as a single batch per round), there is only a small advantage in increasing the client fraction. Using the smaller batch size shows a significant improvement in using , especially in the nonIID case. Based on these results, for most of the remainder of our experiments we fix , which strikes a good balance between computational efficiency and convergence rate. Comparing the number of rounds for the and columns in Table 1 shows a dramatic speedup, which we investigate next.
Increasing computation per client
In this section, we fix , and add more computation per client on each round, either decreasing , increasing , or both. Figure 2 demonstrates that adding more local SGD updates per round can produce a dramatic decrease in communication costs, and Table 2 quantifies these speedups. The expected number of updates per client per round is , where the expectation is over the draw of a random client . We order the rows in each section of Table 2 by this statistic. We see that increasing by varying both and is effective. As long as is large enough to take full advantage of available parallelism on the client hardware, there is essentially no cost in computation time for lowering it, and so in practice this should be the first parameter tuned.
For the IID partition of the MNIST data, using more computation per client decreases the number of rounds to reach the target accuracy by for the CNN and for the 2NN (see Table 4 in Appendix A for details for the 2NN). The speedups for the pathologically partitioned nonIID data are smaller, but still substantial ( – ). It is impressive that averaging provides any advantage (vs. actually diverging) when we naively average the parameters of models trained on entirely different pairs of digits. Thus, we view this as strong evidence for the robustness of this approach.
The unbalanced and nonIID distribution of the Shakespeare (by role in the play) is much more representative of the kind of data distribution we expect for realworld applications. Encouragingly, for this problem learning on the nonIID and unbalanced data is actually much easier (a speedup vs for the balanced IID data); we conjecture this is largely due to the fact some roles have relatively large local datasets, which makes increased local training particularly valuable.
For all three model classes, FedAvg converges to a higher level of testset accuracy than the baseline FedSGD models. This trend continues even if the lines are extended beyond the plotted ranges. For example, for the CNN the FedSGD model eventually reaches 99.22% accuracy after 1200 rounds (and had not improved further after 6000 rounds), while the FedAvg model reaches an accuracy of 99.44% after 300 rounds. We conjecture that in addition to lowering communication costs, model averaging produces a regularization benefit similar to that achieved by dropout [Srivastava et al., 2014].
We are primarily concerned with generalization performance, but FedAvg is effective at optimizing the training loss as well, even beyond the point where testset accuracy plateaus. We observed similar behavior for all three model classes, and present plots for the MNIST CNN in Figure 6 in Appendix A.
Can we overoptimize on the client datasets?
The current model parameters only influence the optimization performed in each ClientUpdate via initialization. Thus, as , at least for a convex problem eventually the initial conditions should be irrelevant, and the global minimum would be reached regardless of initialization. Even for a nonconvex problem, one might conjecture the algorithm would converge to the same local minimum as long as the initialization was in the same basin. That is, we would expect that while one round of averaging might produce a reasonable model, additional rounds of communication (and averaging) would not produce further improvements.
Figure 3 shows the impact of large during initial training on the Shakespeare LSTM problem. Indeed, for very large numbers of local epochs, FedAvg can plateau or diverge. This result suggests that for some models, especially in the later stages of convergence, it may be useful to decay the amount of local computation per round (moving to smaller or larger ) in the same way decaying learning rates can be useful. Figure 8 in Appendix A gives the analogous experiment for the MNIST CNN. Interestingly, for this model we see no significant degradation in the convergence rate for large values of .
CIFAR experiments
We also ran experiments on the CIFAR10 dataset [Krizhevsky, 2009] to further validate FedAvg. The dataset consists of 10 classes of 32x32 images with three RGB channels. There are 50,000 training examples and 10,000 testing examples, which we partitioned into 100 clients each containing 500 training and 100 testing examples; since there isn’t a natural user partitioning of this data, we considered the balanced and IID setting. The model architecture was taken from the TensorFlow tutorial [TensorFlow team, 2016], which consists of two convolutional layers followed by two fully connected layers and then a linear transformation layer to produce logits, for a total of about parameters. Note that stateoftheart approaches have achieved a test accuracy of 96.5% [Graham, 2014] for CIFAR; nevertheless, the standard model we use is sufficient for our needs, as our goal is to evaluate our optimization method, not achieve the best possible accuracy on this task.
For these experiments, we considered an additional baseline, standard SGD training on the full training set (no user partitioning), using minibatches of size 100. We achieved an 86% test accuracy after 197,500 minibatch updates (each minibatch update requires a communication round in the federated setting). FedAvg achieves a similar test accuracy of 85% after only 2,000 communication rounds. For all algorithms, we tuned a learningrate decay parameter in addition to the initial learning rate. Table 3 gives the number of communication rounds for baseline SGD, FedSGD, and FedAvg to reach three different accuracy targets, and Figure 4 gives learningrate curves for FedAvg versus FedSGD.
By running experiments with minibatches of size for both SGD and FedAvg, we can also look at accuracy as a function of the number of such minibatch gradient calculations. We expect SGD to do better here, because a sequential step is taken after each minibatch computation. However, as Figure 9 in the appendix shows, for modest values of and , FedAvg makes a similar amount of progress per minibatch computation. Further, we see that both standard SGD and FedAvg with only one client per round , demonstrate significant oscillations in accuracy, whereas averaging over more clients smooths this out.
Acc.  80%  82%  85%  

SGD  18000  (—)  31000  (—)  99000  (—) 
FedSGD  3750  (4.8)  6600  (4.7)  n/a  (—) 
FedAvg  280  (64.3)  630  (49.2)  2000  (49.5) 
Largescale LSTM experiments
We ran experiments on a largescale language modeling task to demonstrate the effectiveness of our approach on a realworld problem. Our training dataset consists million public posts from a large social network. We grouped the posts by author, for a total of over 500,000 clients. This dataset is a realistic proxy for the type of text entry data that would be present on a user’s mobile device. We limited each client dataset to at most 5000 words, and report accuracy metrics on a test set of posts from different (nontraining) authors. Our model is a 256 node LSTM on a vocabulary of 10,000 words. The input and output embeddings for each word were of dimension 192, and cotrained with the model; there are 4,950,544 parameters in all. We used an unroll of 10 words.
These experiments required significant computational resources (most experiment runs used 11 worker machines, each with at least 8 cores, training for 12 days), and so we did not explore hyperparameters as thoroughly: all runs trained on 200 clients per round; FedAvg used and . We explored a variety of learning rates for FedAvg and the baseline FedSGD. Figure 5 shows monotonic learning curves for the best learning rates. FedSGD with required 310 rounds to reach 8.1% accuracy,^{6}^{6}6Here, accuracy is the fraction of the test data where the model puts the highest predicted probability on the correct next word, out of 10000 possibilities. while FedAvg with reached an accuracy of 8.5% in only 20 communication rounds ( fewer then FedSGD). Interestingly, we also saw much lower variance in test accuracy for FedAvg; Figure 10 in Appendix A demonstrates this.
4 Conclusions and Future Work
Our experiments show that federated learning can be made practical, as FedAvg trains highquality models using relatively few rounds of communication, as demonstrated by results on a variety of model architectures: a multilayer perceptron, two different convolutional NNs, a twolayer character LSTM, and a largescale wordlevel LSTM.
While federated learning offers many practical privacy benefits, providing stronger guarantees via differential privacy [Dwork and Roth, 2014, Duchi et al., 2014, Abadi et al., 2016], secure multiparty computation [Goryczka et al., 2013], or their combination is an interesting direction for future work. Note that both classes of techniques apply most naturally to synchronous algorithms like FedAvg.
References
 Abadi et al. [2016] Martin Abadi, Andy Chu, Ian Goodfellow, Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In 23rd ACM Conference on Computer and Communications Security (ACM CCS), 2016. URL https://arxiv.org/abs/1607.00133.
 Anderson [2015] Monica Anderson. Technology device ownership: 2015. http://www.pewinternet.org/2015/10/29/technologydeviceownership2015/, 2015.
 Arjevani and Shamir [2015] Yossi Arjevani and Ohad Shamir. Communication complexity of distributed convex learning and optimization. In Advances in Neural Information Processing Systems 28. 2015.
 Balcan et al. [2012] MariaFlorina Balcan, Avrim Blum, Shai Fine, and Yishay Mansour. Distributed learning, communication complexity and privacy. arXiv preprint arXiv:1204.3514, 2012.
 Chaum [1981] David L. Chaum. Untraceable electronic mail, return addresses, and digital pseudonyms. Commun. ACM, 24(2), 1981.
 Chen et al. [2016] Jianmin Chen, Rajat Monga, Samy Bengio, and Rafal Jozefowicz. Revisiting distributed synchronous sgd. In ICLR Workshop Track, 2016.
 Choromanska et al. [2015] Anna Choromanska, Mikael Henaff, Michaël Mathieu, Gérard Ben Arous, and Yann LeCun. The loss surfaces of multilayer networks. In AISTATS, 2015.
 Dauphin et al. [2014] Yann N. Dauphin, Razvan Pascanu, Çaglar Gülçehre, KyungHyun Cho, Surya Ganguli, and Yoshua Bengio. Identifying and attacking the saddle point problem in highdimensional nonconvex optimization. In NIPS, 2014.
 Dean et al. [2012] Jeffrey Dean, Greg S. Corrado, Rajat Monga, Kai Chen, Matthieu Devin, Quoc V. Le, Mark Z. Mao, Marc’Aurelio Ranzato, Andrew Senior, Paul Tucker, Ke Yang, and Andrew Y. Ng. Large scale distributed deep networks. In NIPS, 2012.
 Duchi et al. [2014] John Duchi, Michael I. Jordan, and Martin J. Wainwright. Privacy aware learning. Journal of the Association for Computing Machinery, 2014.
 Dwork and Roth [2014] Cynthia Dwork and Aaron Roth. The Algorithmic Foundations of Differential Privacy. Foundations and Trends in Theoretical Computer Science. Now Publishers, 2014.
 Fercoq et al. [2014] Olivier Fercoq, Zheng Qu, Peter Richtárik, and Martin Takác. Fast distributed coordinate descent for nonstrongly convex losses. In Machine Learning for Signal Processing (MLSP), 2014 IEEE International Workshop on, 2014.
 Goodfellow et al. [2016] Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning. Book in preparation for MIT Press, 2016.
 Goodfellow et al. [2015] Ian J. Goodfellow, Oriol Vinyals, and Andrew M. Saxe. Qualitatively characterizing neural network optimization problems. In ICLR, 2015.
 Goryczka et al. [2013] Slawomir Goryczka, Li Xiong, and Vaidy Sunderam. Secure multiparty aggregation with differential privacy: A comparative study. In Proceedings of the Joint EDBT/ICDT 2013 Workshops, 2013.
 Graham [2014] Benjamin Graham. Fractional maxpooling. CoRR, abs/1412.6071, 2014. URL http://arxiv.org/abs/1412.6071.
 Hochreiter and Schmidhuber [1997] Sepp Hochreiter and Jürgen Schmidhuber. Long shortterm memory. Neural Computation, 9(8), November 1997.
 Ioffe and Szegedy [2015] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015.
 Kim et al. [2015] Yoon Kim, Yacine Jernite, David Sontag, and Alexander M. Rush. Characteraware neural language models. CoRR, abs/1508.06615, 2015.
 Krizhevsky [2009] Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
 Krizhevsky et al. [2012] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS. 2012.
 LeCun et al. [1998] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradientbased learning applied to document recognition. Proceedings of the IEEE, 86(11), 1998.
 Ma et al. [2015] Chenxin Ma, Virginia Smith, Martin Jaggi, Michael I Jordan, Peter Richtárik, and Martin Takáč. Adding vs. averaging in distributed primaldual optimization. In ICML, 2015.
 McDonald et al. [2010] Ryan McDonald, Keith Hall, and Gideon Mann. Distributed training strategies for the structured perceptron. In NAACL HLT, 2010.
 Poushter [2016] Jacob Poushter. Smartphone ownership and internet usage continues to climb in emerging economies. Pew Research Center Report, 2016.
 Povey et al. [2015] Daniel Povey, Xiaohui Zhang, and Sanjeev Khudanpur. Parallel training of deep neural networks with natural gradient and parameter averaging. In ICLR Workshop Track, 2015.
 Shamir and Srebro [2014] Ohad Shamir and Nathan Srebro. Distributed stochastic optimization and learning. In Communication, Control, and Computing (Allerton), 2014.
 Shamir et al. [2013] Ohad Shamir, Nathan Srebro, and Tong Zhang. Communication efficient distributed optimization using an approximate newtontype method. arXiv preprint arXiv:1312.7853, 2013.
 Shokri and Shmatikov [2015] Reza Shokri and Vitaly Shmatikov. Privacypreserving deep learning. In Proceedings of the 22Nd ACM SIGSAC Conference on Computer and Communications Security, CCS ’15, 2015.
 Srivastava et al. [2014] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. 15, 2014.
 Sweeney [2000] Latanya Sweeney. Simple demographics often identify people uniquely. 2000.
 TensorFlow team [2016] TensorFlow team. Tensorflow convolutional neural networks tutorial, 2016. http://www.tensorflow.org/tutorials/deep_cnn.
 White House Report [2013] White House Report. Consumer data privacy in a networked world: A framework for protecting privacy and promoting innovation in the global digital economy. Journal of Privacy and Confidentiality, 2013.
 Yang [2013] Tianbao Yang. Trading computation for communication: Distributed stochastic dual coordinate ascent. In Advances in Neural Information Processing Systems, 2013.
 Zhang et al. [2015] Sixin Zhang, Anna E Choromanska, and Yann LeCun. Deep learning with elastic averaging sgd. In NIPS. 2015.
 Zhang and Xiao [2015] Yuchen Zhang and Lin Xiao. Communicationefficient distributed optimization of selfconcordant empirical loss. arXiv preprint arXiv:1501.00263, 2015.
 Zhang et al. [2012] Yuchen Zhang, Martin J Wainwright, and John C Duchi. Communicationefficient algorithms for statistical optimization. In NIPS, 2012.
 Zinkevich et al. [2010] Martin Zinkevich, Markus Weimer, Lihong Li, and Alex J. Smola. Parallelized stochastic gradient descent. In NIPS. 2010.
Appendix A Supplemental Figures and Tables
MNIST 2NN  IID  NonIID  

FedSGD  1  1  1468  1817  
FedAvg  10  10  156  1100  
FedAvg  1  50  12  144  1183  
FedAvg  20  20  92  957  
FedAvg  1  10  60  92  831  
FedAvg  10  50  120  45  881  
FedAvg  20  50  240  39  835  
FedAvg  10  10  600  34  497  
FedAvg  20  10  1200  32  738 