arXiv(opens in a new tab)Computer ScienceOct 2016Cited by 25 papers on PaperVantageClassic Paper

Manuscript Offprint

arXiv:1610.05492

Federated Learning: Strategies for Improving Communication Efficiency

Jakub Konecný, H. B. McMahan, Felix X. Yu, Peter Richtárik, A. Suresh, D. Bacon

Abstract

Federated Learning is a machine learning setting where the goal is to train a high-quality centralized model while training data remains distributed over a large number of clients each with unreliable and relatively slow network connections. We consider learning algorithms for this setting where on each round, each client independently computes an update to the current model based on its local data, and communicates this update to a central server, where the client-side updates are aggregated to compute a new global model. The typical clients in this setting are mobile phones, and communication efficiency is of the utmost importance.

In this paper, we propose two ways to reduce the uplink communication costs: structured updates, where we directly learn an update from a restricted space parametrized using a smaller number of variables, e.g. either low-rank or a random mask; and sketched updates, where we learn a full model update and then compress it using a combination of quantization, random rotations, and subsampling before sending it to the server. Experiments on both convolutional and recurrent networks show that the proposed methods can reduce the communication cost by two orders of magnitude.

1 Introduction

As datasets grow larger and models more complex, training machine learning models increasingly requires distributing the optimization of model parameters over multiple machines. Existing machine learning algorithms are designed for highly controlled environments (such as data centers) where the data is distributed among machines in a balanced and i.i.d. fashion, and high-throughput networks are available.

Recently, Federated Learning (and related decentralized approaches) (McMahan & Ramage, 2017; Konečný et al., 2016; McMahan et al., 2017; Shokri & Shmatikov, 2015) have been proposed as an alternative setting: a shared global model is trained under the coordination of a central server, from a federation of participating devices. The participating devices (clients) are typically large in number and have slow or unstable internet connections. A principal motivating example for Federated Learning arises when the training data comes from users’ interaction with mobile applications. Federated Learning enables mobile phones to collaboratively learn a shared prediction model while keeping all the training data on device, decoupling the ability to do machine learning from the need to store the data in the cloud. The training data is kept locally on users’ mobile devices, and the devices are used as nodes performing computation on their local data in order to update a global model. This goes beyond the use of local models that make predictions on mobile devices, by bringing model training to the device as well. The above framework differs from conventional distributed machine learning (Reddi et al., 2016; Ma et al., 2017; Shamir et al., 2014; Zhang & Lin, 2015; Dean et al., 2012; Chilimbi et al., 2014) due to the very large number of clients, highly unbalanced and non-i.i.d. data available on each client, and relatively poor network connections. In this work, our focus is on the last constraint, since these unreliable and asymmetric connections pose a particular challenge to practical Federated Learning.

For simplicity, we consider synchronized algorithms for Federated Learning where a typical round consists of the following steps:

  1. A subset of existing clients is selected, each of which downloads the current model.
  2. Each client in the subset computes an updated model based on their local data.
  3. The model updates are sent from the selected clients to the sever.
  4. The server aggregates these models (typically by averaging) to construct an improved global model.

A naive implementation of the above framework requires that each client sends a full model (or a full model update) back to the server in each round. For large models, this step is likely to be the bottleneck of Federated Learning due to multiple factors. One factor is the asymmetric property of internet connection speeds: the uplink is typically much slower than downlink. The US average broadband speed was 55.0Mbps download vs. 18.9Mbps upload, with some internet service providers being significantly more asymmetric, e.g., Xfinity at 125Mbps down vs. 15Mbps up (speedtest.net, 2016). Additionally, existing model compressions schemes such as Han et al. (2015) can reduce the bandwidth necessary to download the current model, and cryptographic protocols put in place to ensure no individual client’s update can be inspected before averaging with hundreds or thousands of other updates (Bonawitz et al., 2017) further increase the amount of bits that need to be uploaded.

It is therefore important to investigate methods which can reduce the uplink communication cost. In this paper, we study two general approaches:

  • Structured updates, where we directly learn an update from a restricted space that can be parametrized using a smaller number of variables.
  • Sketched updates, where we learn a full model update, then compress it before sending to the server.

These approaches, explained in detail in Sections 2 and 3, can be combined, e.g., first learning a structured update and sketching it; we do not experiment with this combination in this work though.

In the following, we formally describe the problem. The goal of Federated Learning is to learn a model with parameters embodied in a real matrix W∈Rd1×d2\mathbf{W}\in\mathbb{R}^{d_{1}\times d_{2}} from data stored across a large number of clients. We first provide a communication-naive version of the Federated Learning. In round t≥0t\geq 0, the server distributes the current model Wt\mathbf{W}_{t} to a subset StS_{t} of ntn_{t} clients. These clients independently update the model based on their local data. Let the updated local models be Wt1,Wt2,…,Wtnt\mathbf{W}^{1}_{t},\mathbf{W}^{2}_{t},\dots,\mathbf{W}^{n_{t}}_{t}, so the update of client ii can be written as Hti:=Wti−Wt\mathbf{H}^{i}_{t}:=\mathbf{W}^{i}_{t}-\mathbf{W}_{t}, for i∈Sti\in S_{t}. These updates could be a single gradient computed on the client, but typically will be the result of a more complex calculation, for example, multiple steps of stochastic gradient descent (SGD) taken on the client’s local dataset. In any case, each selected client then sends the update back to the sever, where the global update is computed by aggregating all the client-side updates:

Wt+1=Wt+ηtHt,Ht:=1nt∑i∈StHti.\mathbf{W}_{t+1}=\mathbf{W}_{t}+\eta_{t}\mathbf{H}_{t},\qquad\mathbf{H}_{t}:=\tfrac{1}{n_{t}}\textstyle\sum_{i\in S_{t}}\mathbf{H}^{i}_{t}.

The sever chooses the learning rate ηt\eta_{t}. For simplicity, we choose ηt=1\eta_{t}=1.

In Section 4, we describe Federated Learning for neural networks, where we use a separate 2D matrix W\mathbf{W} to represent the parameters of each layer. We suppose that W\mathbf{W} gets right-multiplied, i.e., d1d_{1} and d2d_{2} represent the output and input dimensions respectively. Note that the parameters of a fully connected layer are naturally represented as 2D matrices. However, the kernel of a convolutional layer is a 4D tensor of the shape #input×width×height×#output\#\text{input}\times\text{width}\times\text{height}\times\#\text{output}. In such a case, W\mathbf{W} is reshaped from the kernel to the shape (#input×width×height)×#output(\#\text{input}\times\text{width}\times\text{height})\times\#\text{output}.

Outline and summary. The goal of increasing communication efficiency of Federated Learning is to reduce the cost of sending Hti\mathbf{H}^{i}_{t} to the server, while learning from data stored across large number of devices with limited internet connection and availability for computation. We propose two general classes of approaches, structured updates and sketched updates. In the Experiments section, we evaluate the effect of these methods in training deep neural networks.

In simulated experiments on CIFAR data, we investigate the effect of these techniques on the convergence of the Federated Averaging algorithm (McMahan et al., 2017). With only a slight degradation in convergence speed, we are able to reduce the total amount of data communicated by two orders of magnitude. This lets us obtain a good prediction accuracy with an all-convolutional model, while in total communicating less information than the size of the original CIFAR data. In a larger realistic experiment on user-partitioned text data, we show that we are able to efficiently train a recurrent neural network for next word prediction, before even using the data of every user once. Finally, we note that we achieve the best results including the preprocessing of updates with structured random rotations. Practical utility of this step is unique to our setting, as the cost of applying the random rotations would be dominant in typical parallel implementations of SGD, but is negligible, compared to the local training in Federated Learning.

References (40)

Cited by (25)