A DAPTIVE F EDERATED O PTIMIZATION
Sashank J. Reddi Zachary Charles Manzil Zaheer Zachary Garrett
Keith Rush Jakub Koneˇcný Sanjiv Kumar H
Brendan McMahan
Google Research {sashank, zachcharles, manzilzaheer, zachgarrett, krush, konkey, sanjivk, mcmahan}@google com
A BSTRACT
Federated learning is a distributed machine learning paradigm in which a large number of clients coordinate with a central server to learn a model without sharing their own training data.
Standard federated optimization methods such as Federated Averaging (F ED A VG ) are often difﬁcult to tune and exhibit unfavorable convergence behavior.
In non-federated settings, adaptive optimization methods have had notable success in combating such issues.
In this work, we propose federated versions of adaptive optimizers, including A DAGRAD , A DAM , and Y OGI , and analyze their convergence in the presence of heterogeneous data for general nonconvex settings
Our results highlight the interplay between client heterogeneity and communication efﬁciency
We also perform extensive experiments on these methods and show that the use of adaptive optimizers can signiﬁcantly improve the performance of federated learning.
I NTRODUCTION
Federated learning (FL) is a machine learning paradigm in which multiple clients cooperate to learn a model under the orchestration of a central server (McMahan et al., 2017).
In FL, raw client data is never shared with the server or other clients.
This distinguishes FL from traditional distributed optimization, and requires contending with heterogeneous data.
FL has two primary settings, crosssilo (eg.
FL between large institutions) and cross-device (eg.
FL across edge devices) (Kairouz et al., 2019, Table 1).
In cross-silo FL, most clients participate in every round and can maintain state between rounds.
In the more challenging cross-device FL, our primary focus, only a small fraction of clients participate in each round, and clients cannot maintain state across rounds.
For a more in-depth discussion of FL and the challenges involved, we defer to Kairouz et al.
and Li et al. (2019a).
Standard optimization methods, such as distributed S GD , are often unsuitable in FL and can incur high communication costs.
To remedy this, many federated optimization methods use local client updates , in which clients update their models multiple times before communicating with the server.
This can greatly reduce the amount of communication required to train a model.
One such method is
F ED A VG (McMahan et al., 2017), in which clients perform multiple epochs of S GD on their local datasets.
The clients communicate their models to the server, which averages them to form a new global model.
While F ED A VG has seen great success, recent works have highlighted its convergence issues in some settings (Karimireddy et al., 2019; Hsu et al., 2019).
This is due to a variety of factors including (1) client drift (Karimireddy et al., 2019), where local client models move away from globally optimal models, and (2) a lack of adaptivity .
F ED A VG is similar in spirit to S GD , and may be unsuitable for settings with heavy-tail stochastic gradient noise distributions, which often arise when training language models (Zhang et al., 2019a).
Such settings beneﬁt from adaptive learning rates, which incorporate knowledge of past iterations to perform more informed optimization.
In this paper, we focus on the second issue and present a simple framework for incorporating adaptivity in FL.
In particular, we propose a general optimization framework in which (1) clients perform multiple epochs of training using a client optimizer to minimize loss on their local data and (2) server updates its global model by applying a gradient-based server optimizer to the average of the clients’ model updates .
We show that F ED A VG is the special case where S GD is used as both client and server optimizer and server learning rate is 1 .
This framework can also seamlessly incorporate adaptivity by using adaptive optimizers as client or server optimizers.
Building upon this, we develop novel adaptive optimization techniques for FL by using per-coordinate methods as server optimizers.
By focusing on adaptive server optimization, we enable use of adaptive learning rates without increase in client storage or communication costs, and ensure compatibility with cross-device FL.
Main contributions In light of the above, we highlight the main contributions of the paper.
• We study a general framework for federated optimization using server and client optimizers.
This framework generalizes many existing federated optimization methods, including F ED A VG .
• We use this framework to design novel, cross-device compatible, adaptive federated optimization methods, and provide convergence analysis in general nonconvex settings.
To the best of our knowledge, these are the ﬁrst methods for FL using adaptive server optimization .
We show an important interplay between the number of local steps and the heterogeneity among clients.
• We introduce comprehensive and reproducible empirical benchmarks for comparing federated optimization methods.
These benchmarks consist of seven diverse and representative FL tasks involving both image and text data, with varying amounts of heterogeneity and numbers of clients.
• We demonstrate strong empirical performance of our adaptive optimizers throughout, improving upon commonly used baselines.
Our results show that our methods can be easier to tune, and highlight their utility in cross-device settings.
Related work F ED A VG was ﬁrst introduced by McMahan et al.
(2017), who showed it can dramatically reduce communication costs.
Many variants have since been proposed to tackle issues such as convergence and client drift.
Examples include adding a regularization term in the client objectives towards the broadcast model (Li et al., 2018), and server momentum (Hsu et al., 2019).
When clients are homogeneous, F ED A VG reduces to local S GD (Zinkevich et al., 2010), which has been analyzed by many works (Stich, 2019; Yu et al., 2019; Wang & Joshi, 2018; Stich & Karimireddy, 2019; Basu et al., 2019).
In order to analyze F ED A VG in heterogeneous settings, many works derive convergence rates depending on the amount of heterogeneity (Li et al., 2018; Wang et al., 2019; Khaled et al., 2019;
Li et al., 2019b).
Typically, the convergence rate of F ED A VG gets worse with client heterogeneity.
By using control variates to reduce client drift, the SCAFFOLD method (Karimireddy et al., 2019) achieves convergence rates that are independent of the amount of heterogeneity.
While effective in cross-silo FL, the method is incompatible with cross-device FL as it requires clients to maintain state across rounds.
For more detailed comparisons, we defer to Kairouz et al.
Adaptive methods have been the subject of signiﬁcant theoretical and empirical study, in both convex (McMahan & Streeter, 2010b; Duchi et al., 2011; Kingma & Ba, 2015) and non-convex settings (Li & Orabona, 2018;
Ward et al., 2018; Wu et al., 2019).
Reddi et al.
Zaheer et al.
(2018) study convergence failures of A DAM in certain non-convex settings, and develop an adaptive optimizer, Y OGI , designed to improve convergence.
While most work on adaptive methods focuses on non-FL settings, Xie et al.
(2019) propose A DA A LTER , a method for FL using adaptive client optimization.
Conceptually, our approach is also related to the L OOKAHEAD optimizer (Zhang et al., 2019b), which was designed for non-FL settings.
Similar to A DA A LTER , an adaptive FL variant of
L OOKAHEAD entails adaptive client optimization (see Appendix B.3 for more details).
We note that both A DA A LTER and L OOKAHEAD are, in fact, special cases of our framework (see Algorithm 1) and the primary novelty of our work comes in focusing on adaptive server optimization .
This allows us to avoid aggregating optimizer states across clients, making our methods require at most half as much communication and client memory usage per round (see Appendix B.3 for details).
Notation For a, b ∈ R d , we let √ a, a 2 and a/b denote the element-wise square root, square, and division of the vectors.
For θ i ∈ R d , we use both θ i,j and [ θ i ] j to denote its j th coordinate.
F EDERATED L EARNING AND F ED A VG
In federated learning, we solve an optimization problem of the form:
[Equation]
where F i ( x ) =
E z
∼D
i
[ f i ( x, z )] , is the loss function of the i th client, z ∈ Z , and D i is the data distribution for the i th client.
For i (cid:54) =
j , D i and D j may be very different.
The functions F i (and therefore f ) may be nonconvex.
For each i and x , we assume access to an unbiased stochastic gradient g i ( x ) of the client’s true gradient ∇ F i ( x ) .
In addition, we make the following assumptions.
Assumption 1 (Lipschitz Gradient) .
The function F i is L -smooth for all i ∈ [ m ] i.e., (cid:107)∇ F i ( x ) − ∇ F i ( y ) (cid:107) ≤
L (cid:107) x − y (cid:107) , for all x, y ∈ R d .
Assumption 2 (Bounded Variance) .
The function F i have σ l -bounded (local) variance i.e., E
[ (cid:107)∇ [ f i ( x, z )]
j − [ ∇ F i ( x )]
j (cid:107) 2 ] =
σ 2 l,j for all x ∈ R d , j ∈
[ d ] and i ∈ [ m ] .
Furthermore, we assume the (global) variance is bounded, ( 1 / m ) (cid:80) mi =1 (cid:107)∇ [ F i ( x )] j − [ ∇ f ( x )] j (cid:107) 2 ≤ σ 2 g,j for all x ∈ R d and j ∈ [ d ] .
Assumption 3 (Bounded Gradients) .
The function f i ( x, z ) have G -bounded gradients i.e., for any i ∈ [ m ] , x ∈ R d and z ∈
Z we have | [ ∇ f i ( x, z )]
j | ≤ G for all j ∈ [ d ] .
With a slight abuse of notation, we use σ 2 l and σ 2 g to denote (cid:80) dj
=1 σ 2 l,j and (cid:80) dj
=1 σ 2 g,j .
Assumptionsand 3 are fairly standard in nonconvex optimization literature (Reddi et al., 2016; Ward et al., 2018;
Zaheer et al., 2018).
We make no further assumptions regarding the similarity of clients datasets.
Assumption 2 is a form of bounded variance, but between the client objective functions and the overall objective function.
This assumption has been used throughout various works on federated optimization (Li et al., 2018;
Wang et al., 2019).
Intuitively, the parameter σ g quantiﬁes similarity of client objective functions.
Note σ g = 0 corresponds to the i.i.d.
setting.
A common approach to solving (1) in federated settings is F ED A VG (McMahan et al., 2017).
At each round of F ED A VG , a subset of clients are selected (typically randomly) and the server broadcasts its global model to each client.
In parallel, the clients run S GD on their own loss function, and send the resulting model to the server.
The server then updates its global model as the average of these local models.
See Algorithm 3 in the appendix for more details.
Suppose that at round t , the server has model x t and samples a set S of clients.
Let x ti denote the model of each client i ∈ S after local training.
We rewrite F ED A VG ’s update as
[Equation]
Let ∆ ti := x ti − x t and ∆ t :=
( 1 / | S | ) (cid:80) i ∈S ∆ ti .
Then the server update in F ED A VG is equivalent to applying S GD to the “pseudo-gradient” − ∆ t with learning rate η = 1 .
This formulation makes it clear that other choices of η are possible.
One could also utilize optimizers other than S GD on the clients, or use an alternative update rule on the server.
This family of algorithms, which we refer to collectively as F ED O PT , is formalized in Algorithm 1. 1: Input:
C
S ERVER O 2: for do 3:
Sample a subset S of clients 4: x [-ti, 
-]parallel do 6: for
− 1 do 7:
Compute an unbiased estimate g ti,k of ∇ F i ( x ti,k ) 8: x {+ti,k +
+} =
C LIENT
O PT ( x ti,k , g ti,k , η l , t ) 9: ∆ ti = x ti,K − x t 10: ∆ t = 1 |S| (cid:80) i ∈S ∆ ti 11: x t +1 =
S ERVER O PT ( x t , − ∆ t , η, t )
In Algorithm 1, C LIENT O PT and S ERVER O PT are gradient-based optimizers with learning rates η l and η respectively.
Intuitively, C LIENT
O PT aims to minimize (1) based on each client’s local data while S ERVER O PT optimizes from a global perspective.
F ED O PT naturally allows the use of adaptive optimizers (eg.
A DAM , Y OGI , etc.), as well as techniques such as server-side momentum (leading to F ED A VG M, proposed by Hsu et al.
In its most general form, F ED O PT uses a
C LIENT O PT whose updates can depend on globally aggregated statistics (e.g. server updates in the previous iterations).
We also allow η and η l to depend on the round t in order to encompass learning rate schedules.
While we focus on speciﬁc adaptive optimizers in this work, we can in principle use any adaptive optimizer (e.g. AMSG RAD (Reddi et al., 2019), A DA B OUND (Luo et al., 2019)).
While F ED O PT has intuitive beneﬁts over F ED A VG , it also raises a fundamental question:
Can the negative of the average model difference ∆ t be used as a pseudo-gradient in general server optimizer updates?
In this paper, we provide an afﬁrmative answer to this question by establishing a theoretical basis for F ED O PT .
We will show that the use of the term S ERVER O PT is justiﬁed, as we can guarantee convergence across a wide variety of server optimizers, including A DAGRAD , A DAM , and Y OGI , thus developing principled adaptive optimizers for FL based on our framework.
A DAPTIVE F EDERATED O PTIMIZATION
In this section, we specialize F ED O PT to settings where S ERVER O PT is an adaptive optimization method (one of A DAGRAD , Y OGI or A DAM ) and C LIENT
O PT is S GD .
By using adaptive methods (which generally require maintaining state) on the server and S GD on the clients, we ensure our methods have the same communication cost as F ED A VG and work in cross-device settings.
Algorithm 2 provides pseudo-code for our methods.
An alternate version using batched data and example-based weighting (as opposed to uniform weighting) of clients is given in Algorithm 5.
The parameter τ controls the algorithms’ degree of adaptivity , with smaller values of τ representing higher degrees of adaptivity.
Note that the server updates of our methods are invariant to ﬁxed multiplicative changes to the client learning rate η l for appropriately chosen τ , though as we shall see shortly, we will require η l to be sufﬁciently small in our analysis.
Algorithm
[Table] , and F ED A DAM F ED A DAM F ED A DAM 1: Initialization: x 0 , v − 1 ≥ τ 2 , decay parameters β 1 , β 2 ∈ [0 , 1) 2: for t = 0 , · · · , T − 1 do 3:
{+Sample subset S of clients 4: x ti, 
 = x t 5: for each client i ∈ S in parallel do 6: for k = 0 , · · · , K − 1 do 7:+}
Compute an unbiased estimate g ti,k of ∇ F i ( x ti,k ) 8: x [Equation]
,k 9: ∆
[Equation]
[-Sample clients 4: do 6: do 7: Compute ti,k +
-]10: ∆ [Equation] 11: v
[Equation] [Equation] [Equation] DAGRAD ) 12: v t = v
[Equation]
− (1 − β 2 )∆ 2 t sign( v t − 1 − ∆ 2 t ) ( F ED Y OGI ) ( F ED Y OGI ) ( F ED Y OGI ) 13: v t = β 2 v t − 1 + (1 − β 2 )∆ 2 t ( F ED A DAM ) ( F ED A DAM ) ( F ED A DAM ) 14: x t +1 = x t + η ∆ t √ v t + τ
We provide convergence analyses of these methods in general nonconvex settings, assuming full participation , i.e. S =
[ m ] .
For expository purposes, we assume β 1 = 0 , though our analysis can be directly extended to β 1 > 0 .
Our analysis can also be extended to partial participation (i.e. |S| < m , see Appendix A.2.1 for details).
Furthermore, non-uniform weighted averaging typically used in
F ED A VG (McMahan et al., 2017) can also be incorporated into our analysis fairly easily.
Theorem 1.
Let Assumptions 1 to 3 hold, and let L, G, σ l , σ g be as deﬁned therein.
Let σ 2 =
σ 2 l + 6 Kσ 2 g .
Consider the following conditions for η l : [Equation] Condition I
[Equation]
Condition II)
[Equation]
Then the iterates of Algorithm 2 for F ED A DAGRAD satisfy under Condition I only,
[Equation]
under both Condition I & II,
[Equation]
Here, we deﬁne
[Equation]
All proofs are relegated to Appendix A due to space constraints.
When η l satisﬁes the condition in the second part the above result, we obtain a convergence rate depending on min { Ψ var , (cid:101) Ψ var } .
To obtain an explicit dependence on T and K , we simplify the above result for a speciﬁc choice of η, η l and τ .
Corollary 1.
Suppose η l is such that the conditions in Theorem 1 are satisﬁed and η l = Θ( 1 / ( KL √ T ) .
Also suppose η = Θ( √ Km ) and τ = G / L .
Then, for sufﬁciently large T , the iterates of Algorithmfor
F ED
A DAGRAD satisfy
[Equation]
We defer a detailed discussion about our analysis and its implication to the end of the section.
Analysis of F ED A DAM Next, we provide the convergence analysis of F ED A DAM .
The proof of
F ED Y OGI is very similar and hence, we omit the details of F ED Y OGI ’s analysis.
Theorem 2.
Let Assumptions 1 to 3 hold, and L, G, σ l , σ g be as deﬁned therein.
Let σ 2 = σ 2 l +6 Kσ 2 g .
Suppose the client learning rate satisﬁes η l ≤ 1 / 16 LK and
[Equation]
Then the iterates of Algorithm 2 for F ED A DAM satisfy
[Equation]
where
[Equation]
Similar to the F ED A DAGRAD case, we restate the above result for a speciﬁc choice of η l , η and τ in order to highlight the dependence of K and T [Equation]
Corollary 2.
Suppose η l is chosen such that the conditions in Theorem 2 are satisﬁed and that η l = Θ( 1 / ( KL √ T ) ) .
Also, suppose η = Θ( √ Km ) and τ = G / L .
Then, for sufﬁciently large T , the iterates of Algorithm 2 for F ED A DAM satisfy
[Equation]
Remark 1.
The server learning rate η = 1 typically used in F ED A VG does not necessarily minimize the upper bound in Theorems 1 & 2.
The effect of σ g , a measure of client heterogeneity, on convergence can be reduced by choosing sufﬁciently η l and a reasonably large η (e.g. see Corollary 1).
Thus, the effect of client heterogeneity can be reduced by carefully choosing client and server learning rates, but not removed entirely.
Our empirical analysis (eg. Figure 1) supports this conclusion.
Discussion.
We brieﬂy discuss our theoretical analysis and its implications in the FL setting.
The convergence rates for F ED A DAGRAD and F ED A DAM are similar, so our discussion applies to all the adaptive federated optimization algorithms (including F ED Y OGI ) proposed in the paper.
(i)
Comparison of convergence rates.
When T is sufﬁciently large compared to K , O ( 1 / √ mKT ) is the dominant term in Corollary 1 & 2.
Thus, we effectively obtain a convergence rate of O ( 1 / √ mKT ) , which matches the best known rate for the general non-convex setting of our interest (e.g. see (Karimireddy et al., 2019)).
We also note that in the
i
i.d setting considered in (Wang & Joshi, 2018), which corresponds to σ g = 0 , we match their convergence rates.
Similar to the centralized setting, it is possible to obtain convergence rates with better dependence on constants for federated adaptive methods, compared to F ED A VG , by incorporating non-uniform bounds on gradients across coordinates (Zaheer et al., 2018).
(ii) Learning rates & their decay.
The client learning rate of 1 / √ T in our analysis requires knowledge of the number of rounds T a priori; however, it is easy to generalize our analysis to the case where η l is decayed at a rate of 1 / √ t .
Observe that one must decay η l , not the server learning rate η , to obtain convergence.
This is because the client drift introduced by the local updates does not vanish as T → ∞ when η l is constant.
As we show in Appendix E.6, learning rate decay can improve empirical performance.
Also, note the inverse relationship between η l and η in Corollary 1 & 2, which we observe in our empirical analysis (see Appendix E.4).
(iii) Communication efﬁciency & local steps.
The total communication cost of the algorithms depends on the number of communication rounds T .
From Corollary 1 & 2, it is clear that a larger K leads to fewer rounds of communication as long as K
= O
( Tσ 2 l /σ 2 g ) .
Thus, the number of local iterations can be large when either the ratio σ 2 l /σ 2 g or T is large.
In the i i.d setting where σ g = 0 , unsurprisingly, K can be very large.
(iv) Client heterogeneity.
While careful selection of client and server learning rates can reduce the effect of client heterogeneity (see Remark 1), it does not completely remove it.
In highly heterogeneous settings, it may be necessary to use mechanisms such as control variates (Karimireddy et al., 2019).
However, our empirical analysis suggest that for moderate, naturally arising heterogeneity, adaptive optimizers are quite effective, especially in cross-device settings (see Figure 1).
Furthermore, our algorithms can be directly combined with such mechanisms.
As mentioned earlier, for the sake of simplicity, our analysis assumes full-participation ( S =
[ m ] ).
Our analysis can be directly generalized to limited participation at the cost of an additional variance term in our rates that depends on |S| /m , the fraction of clients sampled (see Section A.2.1 for details).
E XPERIMENTAL E VALUATION : D ATASETS , T ASKS , AND M ETHODS
We evaluate our algorithms on what we believe is the most extensive and representative suite of federated datasets and modeling tasks to date.
We wish to understand how server adaptivity can help improve convergence, especially in cross-device settings.
To accomplish this, we conduct simulations on seven diverse and representative learning tasks across ﬁve datasets.
Notably, three of the ﬁve have a naturally-arising client partitioning, highly representative of real-world FL problems.
Datasets, models, and tasks We use ﬁve datasets: CIFAR-10, CIFAR-100 (Krizhevsky & Hinton, 2009), EMNIST (Cohen et al., 2017), Shakespeare (McMahan et al., 2017), and Stack Overﬂow (Authors, 2019).
The ﬁrst three are image datasets, the last two are text datasets.
For CIFAR-10 and
CIFAR-100, we train ResNet-18 (replacing batch norm with group norm (Hsieh et al., 2019)).
For
EMNIST, we train a CNN for character recognition (EMNIST CR) and a bottleneck autoencoder (EMNIST AE).
For Shakespeare, we train an RNN for next-character-prediction.
For Stack Overﬂow, we perform tag prediction using logistic regression on bag-of-words vectors (SO LR) and train an
RNN to do next-word-prediction (SO NWP).
For full details of the datasets, see Appendix C.
Implementation We implement all algorithms in TensorFlow Federated (Ingerman & Ostrowski, 2019).
Clients are sampled uniformly at random, without replacement in a given round, but with replacement across rounds.
Our implementation has two important characteristics.
First, instead of doing K training steps per client, we do E epochs of training over each client’s dataset.
Second, to account for varying numbers of gradient steps per client, we weight the average of the client outputs ∆ ti by each client’s number of training samples.
This follows the approach of (McMahan et al., 2017), and can often outperform uniform weighting (Zaheer et al., 2018).
For full descriptions of the algorithms used, see Appendix B.
Optimizers and hyperparameters We compare F ED A DAGRAD , F ED A DAM , and F ED Y OGI (with adaptivity τ ) to F ED O PT where C LIENT O PT and S ERVER O PT are S GD with learning rates η l and η .
For the server, we use a momentum parameter of 0 (F ED A VG ), and 0.9 (F ED A VG M).
We ﬁx the client batch size on a per-task level (see Appendix D.3).
For F ED A DAM and F ED Y OGI , we ﬁx a momentum parameter β 1 = 0 .
9 and a second moment parameter β 2 = 0 .
We also compare to
SCAFFOLD (see Appendix B.2 for implementation details).
For SO NWP, we sample 50 clients per round, while for all other tasks we sample 10.
We use E = 1 local epochs throughout.
We select η l , η , and τ by grid-search tuning.
While this is often done using validation data in centralized settings, such data is often inaccessible in FL, especially cross-device FL.
Therefore, we tune by selecting the parameters that minimize the average training loss over the last 100 rounds of training .
We run 1500 rounds of training on the EMNIST CR, Shakespeare, and Stack Overﬂow tasks, 3000 rounds for EMNIST AE, and 4000 rounds for the CIFAR tasks.
For more details and a record of the best hyperparameters, see Appendix D.
Validation metrics For all tasks, we measure the performance on a validation set throughout training.
For Stack Overﬂow tasks, the validation set contains 10,000 randomly sampled test examples (due to the size of the test dataset, see Table 2).
For all other tasks, we use the entire test set.
Since all algorithms exchange equal-sized objects between server and clients, we use the number of communication rounds as a proxy for wall-clock training time.
E XPERIMENTAL E VALUATION : R ESULTS 5. C OMPARISONS BETWEEN METHODS
We compare the convergence of our adaptive methods to non-adaptive methods: F ED A VG , F ED A VG M and SCAFFOLD.
Plots of validation performances for each task/optimizer are in Figure
[Table]
and
Table 1 summarizes the last-100-round validation performance.
Due to space constraints, results for
EMNIST CR are in Appendix E. [Table] and full test set results for Stack Overﬂow are in Appendix E.2.
[Table]
Sparse-gradient tasks
Text data often produces long-tailed feature distributions, leading to approximately-sparse gradients which adaptive optimizers can capitalize on (Zhang et al., 2019a).
Both Stack Overﬂow tasks exhibit such behavior, though they are otherwise dramatically different— in feature representation (bag-of-words vs. variable-length token sequence), model architecture (GLM vs deep network), and optimization landscape (convex vs nonconvex).
In both tasks, words that do not appear in a client’s dataset produce nearzero client updates.
Thus, the accumulators v t,j in Algorithm 2 remain small for parameters tied to rare words, allowing large updates to be made when they do occur.
This intuition is born out in Figure 1, where adaptive optimizers dramatically outperform non-adaptive ones.
For the non-convex NWP task, momentum is also critical, whereas it slightly hinders performance for the convex LR task.
Dense-gradient tasks CIFAR-10/100, EMNIST AE/CR, and Shakespeare lack a sparse-gradient structure.
Shakespeare is relatively easy—most optimizers perform well after enough rounds once suitably tuned , though F ED A DAGRAD converges faster.
For CIFAR-10/100 and EMNIST AE, adaptivity and momentum offer substantial improvements over F ED A VG .
Moreover, F ED Y OGI and F ED A DAM have faster initial convergence than F ED A VG M on these tasks.
Notably, F ED A DAM and F ED Y OGI perform comparably to or better than non-adaptive optimizers throughout, and close to or better than
[Figure]
F ED A DAGRAD throughout.
As we discuss below, F ED A DAM and F ED Y OGI actually enable easier learning rate tuning than F ED A VG M in many tasks.
Comparison to SCAFFOLD On all tasks, SCAFFOLD performs comparably to or worse than
F ED A VG and our adaptive methods.
On Stack Overﬂow, SCAFFOLD and F ED A VG are nearly identical.
This is because the number of clients (342,477) makes it unlikely we sample any client more than once.
Intuitively, SCAFFOLD does not have a chance to use its client control variates.
In other tasks, SCAFFOLD performs worse than other methods.
We present two possible explanations:
First, we only sample a small fraction of clients at each round, so most users are sampled infrequently.
Intuitively, the client control variates can become stale, and may consequently degrade the performance.
Second, SCAFFOLD is similar to variance reduction methods such as SVRG (Johnson & Zhang, 2013).
While theoretically performant, such methods often perform worse than S GD in practice (Defazio & Bottou, 2018).
As shown by Defazio et al.
(2014), variance reduction often only accelerates convergence when close to a critical point.
In cross-device settings (where the number of communication rounds are limited), SCAFFOLD may actually reduce empirical performance. 5. E ASE OF TUNING [Figure] r v
[Figure]
r
[Figure] a r [Figure] i
[Figure]
r n i n g R a t e ( l o
[Figure]
Obtaining optimal performance involves tuning η l , η , and for the adaptive methods, τ .
To quantify how easy it is to tune various methods, we plot their validation performance as a function of η l and η .
Figure 2 gives results for F ED A DAM , F ED Y OGI , and F ED A VG M on Stack Overﬂow NWP.
Plots for all other optimizers and tasks are in Appendix E.3.
For F ED A VG M, there are only a few good values of η l for each η , while for F ED A DAM and F ED Y OGI , there are many good values of η l for a range of [Figure] η .
Thus [Figure] F ED A DAM and F ED Y OGI are arguably easier to tune in this setting.
Similar results hold for other tasks and optimizers (Figures 5 to 11) [Figure]
This leads to a natural question: Is the reduction in the need to tune η l and η offset by the need to tune the adaptivity τ ?
In fact, while we tune τ in Figure 1, our results are relatively robust to τ .
To demonstrate, we plot the best validation performance for various τ in Figure 3.
For nearly all tasks and optimizers, τ = 10 − 3 works almost as well all other values.
This aligns with work by Zaheer et al.
(2018), who show that moderately large τ yield better performance for centralized adaptive optimizers.
F ED A DAM and F ED Y OGI see only small differences in performance among τ on all tasks except Stack Overﬂow LR (for which F ED A DAGRAD is the best optimizer, and is robust to τ ).
We present additional empirical analyses in Appendix E. These include EMNIST CR results (Appendix E.1), Stack Overﬂow results on the full test dataset (Appendix E.2), client/server learning rate heat maps for all optimizers and tasks (Appendix E.3), an analysis of the relationship between η and η l (Appendix E.4), and experiments with learning rate decay (Appendix E.6).
C ONCLUSION
In this paper, we demonstrated that adaptive optimizers can be powerful tools in improving the convergence of FL.
By using a simple client/server optimizer framework, we can incorporate adaptivity into
FL in a principled, intuitive, and theoretically-justiﬁed manner.
We also developed comprehensive benchmarks for comparing federated optimization algorithms.
To encourage reproducibility and breadth of comparison, we have attempted to describe our experiments as rigorously as possible, and have created an open-source framework with all models, datasets, and code.
We believe our work raises many important questions about how best to perform federated optimization.
Example directions for future research include understanding how the use of adaptivity affects differential privacy and fairness.
A P ROOF OF RESULTS A. M AIN C HALLENGES
We ﬁrst recap some of the central challenges to our analysis.
Theoretical analyses of optimization methods for federated learning are much different than analyses for centralized settings.
The key factors complicating the analysis are:
Clients performing multiple local updates.
Data heterogeneity.
Understanding the communication complexity.
As a result of (1), the updates from the clients to the server are not gradients, or even unbiased estimates of gradients, they are pseudo-gradients (see Section 2).
These pseudo-gradients are challenging to analyze as they can have both high bias (their expectation is not the gradient of the empirical loss function) and high variance (due to compounding variance across client updates) and are therefore challenging to bound.
This is exacerbated by (2), which we quantify by the parameter σ g in Section 2.
Things are further complicated by (3), as we must obtain a good trade-off between the number of client updates taken per round ( K in Algorithms 1 and 2) and the number of communication rounds
T .
Such trade-offs do not exist in centralized optimization.
A. P ROOF OF T HEOREM
Proof of Theorem 1.
Recall that the server update of F ED A DAGRAD is the following
[Equation]
for all i ∈ [ d ] .
Since the function f is L -smooth, we have the following:
[Equation]
The second step follows simply from F ED A DAGRAD ’s update.
We take the expectation of f ( x t +1 )
(over randomness at time step t ) in the above inequality:
E
[Equation]
[Equation]
[Equation]
x
[Equation]
[Equation]
[Equation]
(cid:125)
[Equation]
We will ﬁrst bound T 2 in the following manner:
T
[Equation]
(cid:28)
[Equation]
=
[Equation]
[Equation]
(cid:21) and recalling v t = v t − 1 + ∆ 2 t so − ∆ 2 t,j = ( √ v t − 1 ,j − √ v t,j )( √ v t − 1 ,j + √ v t,j ))
we have, =
E t d (cid:88) j
=
[Equation]
[Equation]
≤ E
[Equation]
(cid:88)
j =
[Equation]
≤
[Equation]
t d (cid:88)
j
[Equation]
[Equation]
since v t − 1 ,j ≥ τ 2 .
Here v t − 1 ,j ≥ τ since v − 1 ≥ τ (see the initialization of Algorithm 2) and v t,j is increasing in t .
The above bound can be further upper bounded in the following manner:
[Equation]
since [ ∇ f ( x t )]
i ≤ G and ∆ t,i ≤ η l KG
[Equation]
since √ v t − 1 ,j ≥
[Equation] [Equation]
Bounding T
We now turn our attention to bounding the term T 1 , which we need to be sufﬁciently negative.
We observe the following:
[Equation]
In order to bound T 1 , we use the following upper bound on T 3 (which captures the difference between the actual update ∆ t and an appropriate scaling of −∇ f ( x t ) ):
[Equation]
Here we used the fact that ∇ f ( x t )
= 1 m (cid:80) mi =1 ∇ F i ( x t ) and g ti,k is an unbiased estimator of the gradient at x ti,k , we further bound T 3 as follows using a simple application of the fact that ab ≤ ( a 2 + b 2 ) / 2 . : [Equation] [Table] [Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
using Assumption 1 and v t − 1 ≥ 0 .
[Equation]
The second inequality follows from Lemma 6.
The last inequality follows from L -Lipschitz nature of the gradient (Assumption 1).
We now prove a lemma that bounds the “drift” of the x ti,k from x t :
Lemma 3.
For any step-size satisfying η l ≤ 1 8 LK , we can bound the drift for any k ∈ { 0 , · · · , K − 1 } as
[Equation]
Proof.
The result trivially holds for k = 1 since x ti, 0 = x t for all i ∈ [ m ] .
We now turn our attention to the case where k ≥ 1 .
To prove the above result [Equation] we observe that for any client i ∈ [ m ] and k ∈ [ K ] , [Equation]
[Figure]
[Equation]
The ﬁrst inequality uses the fact that g tk − 1 ,i is an unbiased estimator of ∇ F i ( x ti,k − 1 ) and Lemma
[Equation]
The above quantity can be further bounded by the following:
[Equation]
Here
[Equation]
the ﬁrst inequality follows from Assumption 1 and 2.
Averaging over the clients i , we obtain the following:
[Equation]
From the above
[Equation]
we get the following inequality:
[Equation]
Unrolling the recursion
[Equation]
we obtain the following:
[Equation]
concluding the proof of Lemma 3.
The last inequality uses the fact that (1 + 1 K − 1 ) K ≤ 5 for
K > 1 .
Using the above lemma in Equation 6 and Condition I
[Equation]
we can bound T 3 in the following manner:
[Equation]
Here we used the fact that √ v t − 1 ,j ≤ η l KG √ T and Condition I in Theorem 1.
Using the above bound in Equation 5, we get
[Equation]
Putting the pieces together Substituting in Equation (3), bounds T 1 in Equation (8) and bound Tin Equation (4), we obtain
[Equation] [ f
[Equation]
Rearranging the above inequality and summing it from t = 0 to T − 1 , we get
T −
[Equation]
The ﬁrst inequality uses simple telescoping sum.
For completing the proof, we need the following result.
Lemma 4.
The following upper bound holds for Algorithm 2 ( F ED A DAGRAD ):
[Equation]
Proof.
We bound the desired quantity in the following manner:
[Equation]
An alternate way of the bounding this quantity is as follows:
[Equation]
The ﬁrst quantity in the above bound can be further bounded as follows:
[Equation]
,k − η l ∇ F i ( x ti,k ) + η l ∇ F i ( x ti,k ) − η l ∇ F i ( x t ) + η l ∇ F i ( x t ) (cid:1) − η l K ∇ f ( x t ) (cid:33)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) 2   = 2 η 2 l m
T − 1 (cid:88) t =
E   (cid:13)(cid:13) (cid:13)(cid:13) (cid:13) m (cid:88) i =
K − 1 (cid:88) k
=  τ · (cid:0) g t i,k − ∇ F i ( x t i,k ) + ∇ F i ( x t i,k ) − ∇ F i ( x t ) (cid:1)(cid:13)(cid:13) (cid:13)(cid:13) (cid:13) 2   ≤ 4 η 2 l m
T − 1 (cid:88) t =
E   (cid:13)(cid:13)(cid:13)(cid:13)(cid:13) m (cid:88) i =
K − 1 (cid:88) k
=  τ · (cid:0) g ti,k − ∇ F i ( x ti,k ) (cid:1)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)
+ (cid:13)(cid:13)(cid:13)(cid:13)(cid:13) m (cid:88) i =
K − 1 (cid:88) k
=  τ · (cid:0) ∇ F i ( x ti,k ) − ∇ F i ( x t ) (cid:1)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) 2   ≤ 4 η 2 l KT m d (cid:88) [Equation] = [Equation]
m
[Equation] m (cid:88) i = K − [Equation]
(cid:88) k
=
T − 1 (cid:88) t = (cid:13)(cid:13)(cid:13)(cid:13)τ · (cid:0) ∇ F i ( x ti,k ) − ∇ F i ( x t ) (cid:1)(cid:13)(cid:13)(cid:13)(cid:13) ≤ 4 η 2 l KT m
[Equation]
(cid:88) [Equation] i = K −
[Equation]
(cid:88) k
= T − 1 (cid:88) t = (cid:13)(cid:13)(cid:13)(cid:13) L τ · (cid:0)
[Equation]
ti,k
[Equation]
x t (cid:1)(cid:13)(cid:13)(cid:13)(cid:13) (by Assumptions 1 and 2) ≤ [Equation] l
[Equation]
(by Lemma 3) .
Here, the ﬁrst inequality follows from simple application of the fact that ab ≤ ( a 2 + b 2 ) / 2 .
The result follows.
Substituting the above bound in Equation (10), we obtain:
[Equation]
We observe the following:
[Equation]
The second part of Theorem 1 follows from using the above inequality in Equation (12).
Note that the ﬁrst part of Theorem 1 is obtain from the part of Lemma 4.
A.2. L IMITED P ARTICIPATION
For limited participation, the main changed in the proof is in Equation (11).
The rest of the proof is similar so we mainly focus on Equation (11) here.
Let S be the sampled set at the t th iteration such that |S| = s .
In partial participation, we assume that the set S is sampled uniformly from all subsets of [ m ] with size s .
In this case, for the ﬁrst term in Equation (11), we have
[Equation]
[Equation] i ∈S
K − 1 (cid:88) k
=  τ · (cid:0) g ti,k − ∇ F i ( x ti,k ) (cid:1)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)
+ (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:88)
i ∈S
K − 1 (cid:88) k
=  τ · (cid:0) ∇ F i ( x ti,k ) − ∇ F i ( x t ) (cid:1)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)
+ K(cid:13) (cid:13)(cid:13)(cid:13)(cid:13) 1 τ · (cid:32) (cid:88) i ∈S
F i ( x t ) − s ∇ f ( x t ) (cid:33)(cid:13) (cid:13)(cid:13)(cid:13)(cid:13) 2 (cid:35)
[Table]
s d (cid:88)
j
= σ 2 l,j τ 2 + 6 η 2 l K s
E (cid:88)
i ∈S
K − 1 (cid:88) k
=
T − 1 (cid:88) t = (cid:13)(cid:13)(cid:13)(cid:13)τ · (cid:0) ∇ F i ( x ti,k ) − ∇ F i ( x t ) (cid:1)(cid:13)(cid:13)(cid:13)(cid:13) + 6 η 2 l K 2 Tσ 2 g τ(cid:16) 1 − s m (cid:17)
[Table]
s
[Table]
σ
[Table]
,j
[Equation]
≤
[Equation]
m
[Equation]
Note that the expectation here also includes S .
The ﬁrst inequality is obtained from the fact that ( a + b + c ) 2 ≤ 3( a 2 + b 2 + c 2 ) .
The second inequality is obtained from the fact that set S is uniformly sampled from all subsets of [ m ] with size s .
The third and fourth inequalities are similar to the one used in proof of Theorem 1.
Substituting the above bound in Equation (10) gives the desired convergence rate.
A. P ROOF OF T HEOREM
Proof of Theorem 2.
The proof strategy is similar to that of F ED A DAGRAD except that we need to handle the exponential moving average in F ED A DAM .
We note that the update of F ED A DAM is the following
[Equation]
for all i ∈ [ d ] .
Using the L -smooth nature of function f and the above update rule, we have the following:
[Equation]
The second step follows simply from F ED A DAM ’s update.
We take the expectation of f ( x t +1 )
(over randomness at time step t ) and rewrite the above inequality as:
[Equation]
(cid:34)
[Equation]
(cid:112) [Equation]
[Equation]
(cid:35)(cid:43) (cid:124) (cid:123)(cid:122) (cid:125)
[Equation]
j
[Equation]
[Equation]
Bounding R 2 .
We observe the following about R 2 :
[Equation]
Bounding R 1 .
The term R 1 can be bounded as follows:
[Equation]
Bounding R 3 .
The term R 3 can be bounded in exactly the same way as term T 3 in proof of
Theorem 1:
[Equation]
Substituting the above inequality in Equation (15)
[Equation]
we get
[Equation]
Here we used the fact that √ v t − 1 ,j ≤ η l KG and conditions in Theorem 2.
Using Lemma 3, we obtain the following bound on R 1 :
[Equation]
Putting pieces together.
Substituting bounds R 1 and R 2 in Equation (14)
[Equation]
we have
[Equation]
Summing over t = 0 to T − 1 and using telescoping sum, we have
[Equation]
To bound this term further
[Equation]
we need the following result.
Lemma 5.
The following upper bound holds for Algorithm 2 ( F ED A DAM ):
[Equation]
Proof.
[Equation]
The rest of the proof follows along the lines of proof of Lemma 4.
Using the same argument, we get
[Equation]
which is the desired result.
Substituting the bound obtained from above lemma in Equation (17) and using a similar argument for bounding
[Equation]
we obtain
[Equation]

The above inequality is obtained due to the fact that:
[Equation]
The above condition follows from the condition on η l in Theorem 2.
We also observe the following:
[Equation]
Substituting this bound in the above equation yields the desired result
[Equation]
A. A UXILIARY L EMMATTA
Lemma 6.
For random variables z 1 , . . .
, z r , we have
[Equation]
Lemma 7.
For independent
[Equation]
mean 0 random variables z 1 , . . .
, z r , we have
[Equation]
B F EDERATED A LGORITHMS : I MPLEMENTATIONS AND P RACTICAL C ONSIDERATIONS B. F ED A VG AND F ED O PT
In Algorithm 3, we give a simpliﬁed version of the F ED A VG algorithm by McMahan et al.
(2017), that applies to the setup given in Section 2.
We write S GD K ( x t , η l , f i ) to denote K steps of S GD using gradients ∇
f i ( x, z ) for z ∼ D i with (local) learning rate η l , starting from x t .
As noted in Section 2,
Algorithm 3 is the special case of Algorithm 1 where C LIENT O PT is S GD , and S ERVER O PT is S GD with learning rate 1.
While Algorithms 1, 2, and 3 are useful for understanding relations between federated optimization methods, we are also interested in practical versions of these algorithms.
In particular, Algorithms 1, 2, and 3 are stated in terms of a kind of ‘gradient oracle’, where we compute unbiased estimates Algorithm
F
Input: xfor t = 0 , · · · , T − 1 do
Sample a subset S of clients x ti = x t for each client i ∈ S in parallel do x ti =
S GD K ( x t , η l , f i ) for i ∈ S (in parallel) x t +1 = 1 |S| (cid:80) i ∈S x ti of the client’s gradient.
In practical scenarios, we often only have access to ﬁnite data samples, the number of which may vary between clients.
Instead, we assume that in (1), each client distribution D i is the uniform distribution over some ﬁnite set D i of size n i .
The n i may vary signiﬁcantly between clients, requiring extra care when implementing federated optimization methods.
We assume the set D
i is partitioned into a collection of batches B i , each of size B .
For b ∈ B i , we let f i ( x ; b ) denote the average loss on this batch at x with corresponding gradient ∇ f i ( x ; b ) .
Thus, if b is sampled uniformly at random from B i , ∇ f i ( x ; b ) is an unbiased estimate of ∇ F i ( x ) .
When training, instead of uniformly using K gradient steps, as in Algorithm 1, we will instead perform E epochs of training over each client’s dataset.
Additionally, we will take a weighted average of the client updates, where we weight according to the number of examples n i in each client’s dataset.
This leads to a batched data version of F ED O PT in Algorithm 4, and a batched data version of F ED A DAGRAD , F ED A DAM , and F ED Y OGI given in Algorithm 5.
Input: x 0 , C LIENT O PT , S ERVER O PT for t = 0 , · · · , T − 1 do
Sample a subset S of clients x ti = x t for each client i ∈ S in parallel do for e = 1 , . . . , E do for b ∈ B i do g ti = ∇ f i ( x ti ; b ) x ti = C LIENT O PT ( x ti , g ti , η l , t ) ∆ ti = x
{+ti − x t n = (cid:80) i ∈S n i , ∆ t = (cid:80) i ∈S n i n ∆ ti x t +
+}
= S ERVER O PT ( x t , − ∆ t , η, t ) In Section 5, we use Algorithm 4 when implementing F ED A VG and F ED A VG M.
In particular,
F ED A VG and F ED A VG M correspond to Algorithm 4 where C LIENT O PT and S ERVER O PT are S GD .
F ED A VG uses vanilla S GD on the server, while F ED A VG M uses S GD with a momentum parameter of 0.9.
In both methods, we tune both client learning rate η l and server learning rate η .
This means that the version of F ED A VG used in all experiments is strictly more general than that in (McMahan et al., 2017), which corresponds to F ED O PT where C LIENT O PT and S ERVER O PT are S GD , and
S ERVER O PT has a learning rate of 1.
We use Algorithm 5 for all implementations F ED A DAGRAD , F ED A DAM , and F ED Y OGI in Section 5.
For F ED A DAGRAD , we set β 1 = β 2 = 0 (as typical versions of A DAGRAD do not use momentum).
For F ED A DAM and F ED Y OGI we set β 1 = 0 .
9 , β 2 = 0 .
While these parameters are generally good choices (Zaheer et al., 2018), we emphasize that better results may be obtainable by tuning these parameters.
B. SCAFFOLD
As discussed in Section 5, we compare all ﬁve optimizers above to SCAFFOLD (Karimireddy et al., 2019) on our various tasks.
There are a few important notes about the validity of this comparison.
Input: x 0 , v − 1 ≥ τ 2 , optional β 1 , β 2 ∈ [0 , 1) for F ED Y OGI and F ED A DAM for t = 0 , · · · , T − 1 do
Sample a subset S of clients x ti = x t for each client i ∈ S in parallel do for e = 1 , . . .
, E do for b ∈ B i do x ti = x ti − η l ∇
f
i ( x ti ; b ) ∆ ti = x
ti − x t n = (cid:80) i ∈S n i , ∆ t = (cid:80) i ∈S n i n ∆ ti ∆ t = β 1 ∆ t − 1 + (1 − β 1 )∆ t v t = v t − 1 + ∆ 2 t ( F ED A DAGRAD )
( F ED A DAGRAD )
( F ED A DAGRAD ) v t = v t − 1 − (1 − β 2 )∆ 2 t sign( v t − 1 − ∆ 2 t ) ( F ED Y OGI ) ( F ED Y OGI ) ( F ED Y OGI ) v t =
β 2 v t − 1 + (1 − β 2 )∆ 2 t ( F ED A DAM )
( F ED A DAM ) ( F ED A DAM ) x t +1 = x t + η ∆ t √ v t + τ 1.
In cross-device settings, this is not a fair comparison.
In particular, SCAFFOLD does not work in settings where clients cannot maintain state across rounds, as may be the case for federated learning systems on edge devices, such as cell phones.
SCAFFOLD has two variants described by Karimireddy et al.
In Option I, the control variate of a client is updated using a full gradient computation.
This effectively requires performing an extra pass over each client’s dataset, as compared to Algorithm 1.
In order to normalize the amount of client work, we instead use Option II, in which the clients’ control variates are updated using the difference between the server model and the client’s learned model.
This requires the same amount of client work as F ED A VG and Algorithm 2.
For practical reasons, we implement a version of SCAFFOLD mirroring Algorithm 4, in which we perform E epochs over the client’s dataset, and perform weighted averaging of client models.
For posterity, we give the full pseudo-code of the version of SCAFFOLD used in our experiments in
Algorithm 6.
This is a simple adaptiation of Option II of the SCAFFOLD algorithm in (Karimireddy et al., 2019) to the same setting as Algorithm 4.
In particular, we let n i denote the number of examples in client i ’s local dataset.
Input: x 0 , c , η l , η for t = 0 , · · · , T − 1 do
Sample a subset S of clients x ti = x t for each client i ∈ S in parallel do for e = 1 , . . .
, E do for b ∈ B i do g ti = ∇
f i ( x ti ; b ) x ti = x ti − η l
( g ti − c
i + c ) c
+ i =
c i − c
+ ( E |B i | η l ) − 1 ( x ti − x i )
∆ x i = x
ti − x t , ∆ c i =
c
+ i − c
i c i
=
c
+ i n = (cid:80) i ∈S n i , ∆ x
= (cid:80) i ∈S n i n ∆ x i , ∆ c = (cid:80) i ∈S n i n ∆ c i x
t +1 = x t + η ∆ x, c = c + |S| N ∆ c
In this algorithm, c i is the control variate of client i , and c is the running average of these control variates.
In practice, we must initialize the control variates c i in some way when sampling a client i for the ﬁrst time.
In our implementation, we set c
i
=
c the ﬁrst time we sample a client i .
This has the advantage of exactly recovering F ED A VG when each client is sampled at most once.
To initialize c , we use the all zeros vector.
We compare this version of SCAFFOLD to F ED A DAGRAD , F ED A DAM , F ED Y OGI , F ED A VG M, and F ED A VG on our tasks, tuning the learning rates in the same way (using the same grids as in
Appendix D.2).
In particular, η l , η are tuned to obtain the best training performance over the lastcommunication rounds.
We use the same federated hyperparameters for SCAFFOLD as discussed in
Section 4.
Namely, we set E = 1 , and sample 10 clients per round for all tasks except Stack Overﬂow
NWP, where we sample 50.
The results are given in Figure 1 in Section 5.
B. L OOKAHEAD , A DA A LTER , AND CLIENT ADAPTIVITY
The L OOKAHEAD optimizer (Zhang et al., 2019b) is primarily designed for non-FL settings.
L OOKAHEAD uses a generic optimizer in the inner loop and updates its parameters using a “outer” learning rate.
Thus, unlike F ED O PT , L OOKAHEAD uses a single generic optimizer and is thus conceptually different.
In fact, L OOKAHEAD can be seen as a special case of F ED O PT in non-FL settings which uses a generic optimizer C LIENT O PT as a client optimizer, and S GD as the server optimizer.
While there are multiple ways L OOKAHEAD could be generalized to a federated setting, one straightforward version would simply use an adaptive method as the C LIENT O PT .
On the other hand, A DA A LTER (Xie et al., 2019) is designed speciﬁcally for distributed settings.
In A DA A LTER , clients use a local optimizer similar to A DAGRAD (McMahan & Streeter, 2010a; Duchi et al., 2011) to perform multiple epochs of training on their local datasets.
Both L OOKAHEAD and A DA A LTER use client adaptivity, which is fundamentally different from the adaptive server optimizers proposed in Algorithm 2.
To illustrate the differences, consider the client-to-server communication in A DA A LTER .
This requires communicating both the model weights and the client accumulators (used to perform the adaptive optimization, analogous to v t in Algorithm 2).
In the case of A DA A LTER , the client accumulator is the same size as the model’s trainable weights.
Thus, the client-to-server communication doubles for this method, relative to F ED A VG .
In A DA A LTER , the server averages the client accumulators and broadcasts the average to the next set of clients, who use this to initialize their adaptive optimizers.
This means that the server-to-client communication also doubles relative to F ED A VG .
The same would occur for any adaptive client optimizer in the distributed version of L OOKAHEAD described above.
For similar reasons, we see that client adaptive methods also increase the amount of memory needed on the client (as they must store the current accumulator).
By contrast, our adaptive server methods (Algorithm 2) do not require extra communication or client memory relative to F ED A VG .
Thus, we see that server-side adaptive optimization beneﬁts from lower per-round communication and client memory requirements, which are of paramount importance for FL applications (Bonawitz et al., 2019).
C D ATASET & M ODELS
Here we provide detailed description of the datasets and models used in the paper.
We use federated versions of vision datasets EMNIST (Cohen et al., 2017), CIFAR-10 (Krizhevsky & Hinton, 2009), and CIFAR-100 (Krizhevsky & Hinton, 2009), and language modeling datasets Shakespeare (McMahan et al., 2017) and StackOverﬂow (Authors, 2019).
Statistics for the training datasets can be found in Table 2.
We give descriptions of the datasets, models, and tasks below.
Statistics on the number of clients and examples in both the training and test splits of the datasets are given in Table 2.
[Table]
C. CIFAR-10/CIFAR-
We create a federated version of CIFAR-10 by randomly partitioning the training data amongclients, with each client receiving 100 examples.
We use the same approach as Hsu et al.
(2019), where we apply latent Dirichlet allocation (LDA) over the labels of CIFAR-10 to create a federated dataset.
Each client has an associated multinomial distribution over labels from which its examples are drawn.
The multinomial is drawn from a symmetric Dirichlet distribution with parameter 0 .
For CIFAR-100, we perform a similar partitioning of 100 examples to 500 clients, but using a more sophisticated approach.
We use a two step LDA process over the coarse and ﬁne labels.
We randomly partition the data to reﬂect the "coarse" and "ﬁne" label structure of CIFAR-100 by using the Pachinko
Allocation Method (PAM) (Li & McCallum, 2006).
This creates more realistic client datasets, whose label distributions better resemble practical heterogeneous client datasets.
We have made publicly available the speciﬁc federated version of CIFAR-100 we used for all experiments, though we avoid giving a link in this work in order to avoid de-anonymization.
For complete details on how the dataset was created, see Appendix F.
We train a modiﬁed ResNet-18 on both datasets, where the batch normalization layers are replaced by group normalization layers (Wu & He, 2018).
We use two groups in each group normalization layer.
As shown by Hsieh et al.
(2019), group normalization can lead to signiﬁcant gains in accuracy over batch normalization in federated settings.
Preprocessing CIFAR-10 and CIFAR-100 consist of images with 3 channels of 32 × 32 pixels each.
Each pixel is represented by an unsigned int8.
As is standard with CIFAR datasets, we perform preprocessing on both training and test images.
For training images, we perform a random crop to shape (24 , 24 , 3) , followed by a random horizontal ﬂip.
For testing images, we centrally crop the image to (24 , 24 , 3) .
For both training and testing images, we then normalize the pixel values according to their mean and standard deviation.
Namely, given an image x , we compute ( x − µ ) /σ where µ is the average of the pixel values in x , and σ is the standard deviation.
C. EMNIST
EMNIST consists of images of digits and upper and lower case English characters, with 62 total classes.
The federated version of EMNIST (Caldas et al., 2018) partitions the digits by their author.
The dataset has natural heterogeneity stemming from the writing style of each person.
We perform two distinct tasks on EMNIST, autoencoder training (EMNIST AE) and character recognition (EMNIST
CR).
For EMNIST AE, we train the “MNIST” autoencoder (Zaheer et al., 2018).
This is a densely connected autoencoder with layers of size (28 × 28) − 1000 − 500 − 250 − 30 and a symmetric decoder.
A full description of the model is in Table 3.
For EMNIST CR, we use a convolutional network.
The network has two convolutional layers (with 3 × 3 kernels), max pooling, and dropout, followed by a 128 unit dense layer.
A full description of the model is in Table 4.
[Table] [Table]
C. S HAKESPEARE
Shakespeare is a language modeling dataset built from the collective works of William Shakespeare.
In this dataset, each client corresponds to a speaking role with at least two lines.
The dataset consists of 715 clients.
Each client’s lines are partitioned into training and test sets.
Here, the task is to do next character prediction.
We use an RNN that ﬁrst takes a series of characters as input and embeds each of them into a learned 8-dimensional space.
The embedded characters are then passed through 2 LSTM layers, each with 256 nodes, followed by a densely connected softmax output layer.
We split the lines of each speaking role into into sequences of 80 characters, padding if necessary.
We use a vocabulary size of 90; 86 for the characters contained in the Shakespeare dataset
[Table]
and 4 extra characters for padding, out-of-vocabulary, beginning of line and end of line tokens.
We train our model to take a sequence of 80 characters
[Table]
and predict a sequence of 80 characters formed by shifting the input sequence by one (so that its last character is the new character we are actually trying to predict).
Therefore, our output dimension is 80 × 90 .
A full description of the model is in Table
[Table] [Table]
C. S TACK O VERFLOW
Stack Overﬂow is a language modeling dataset consisting of question and answers from the question and answer site, Stack Overﬂow.
The questions and answers also have associated metadata, including tags.
The dataset contains 342,477 unique users which we use as clients.
We perform two tasks on this dataset: tag prediction via logistic regression (Stack Overﬂow LR, SO LR for short), and next-word prediction (Stack Overﬂow NWP, SO NWP for short).
For both tasks, we restrict to the 10,000 most frequently used words.
For Stack Overﬂow LR, we restrict to the 500 most frequent tags and adopt a one-versus-rest classiﬁcation strategy, where each question/answer is represented as a bag-of-words vector (normalized to have sum 1).
For Stack Overﬂow NWP, we restrict each client to the ﬁrst 1000 sentences in their dataset (if they contain this many, otherwise we use the full dataset).
We also perform padding and truncation to ensure that sentences have 20 words.
We then represent the sentence as a sequence of indices corresponding to the 10,000 frequently used words, as well as indices representing padding, out-ofvocabulary words, beginning of sentence, and end of sentence.
We perform next-word-prediction on these sequences using an RNN that embeds each word in a sentence into a learned 96-dimensional space.
It then feeds the embedded words into a single LSTM layer of hidden dimension 670, followed by a densely connected softmax output layer.
A full description of the model is in Table 6.
The metric used in the main body is the top-1 accuracy over the proper 10,000-word vocabulary; it does not include padding, out-of-vocab, or beginning or end of sentence tokens when computing the accuracy.klkjlkj
[Table]
D E XPERIMENT H YPERPARAMETERS D. H YPERPARAMETER TUNING
Throughout our experiments, we compare the performance of different instantiations of Algorithmthat use different server optimizers.
We use S GD , S GD with momentum (denoted S GDM ), A DAGRAD ,
A DAM , and Y OGI .
For the client optimizer, we use mini-batch S GD throughout.
For all tasks, we tune the client learning rate η l and server learning rate η by using a large grid search.
Full descriptions of the per-task server and client learning rate grids are given in Appendix D.2.
We use the version of F ED A DAGRAD , F ED A DAM , and F ED Y OGI in Algorithm 5.
We let β 1 =for F ED A DAGRAD , and we let β 1 = 0 .
9 , β 2 = 0 .
99 for F ED A DAM , and F ED Y OGI .
For F ED A VG and F ED A VG M, we use Algorithm 4, where C LIENT O PT , S ERVER O PT are S GD .
For F ED A VG M, the server S GD optimizer uses a momentum parameter of 0 .
For F ED A DAGRAD , F ED A DAM , and
F ED Y OGI , we tune the parameter τ in Algorithm 5.
When tuning parameters, we select the best hyperparameters ( η l , η, τ ) based on the average training loss over the last 100 communication rounds.
Note that at each round, we only see a fraction of the total users (10 for each task except Stack Overﬂow NWP, which uses 50).
Thus, the training loss at a given round is a noisy estimate of the population-level training loss, which is why we averave over a window of communication rounds.
D. H YPERPARAMETER GRIDS
Below, we give the client learning rate ( η l in Algorithm 1) and server learning rate ( η in Algorithm 1) grids used for each task.
These grids were chosen based on an initial evaluation over the grids
[Equation]
These grids were then reﬁned for Stack Overﬂow LR and EMNIST AE in an attempt to ensure that the best client/server learning rate combinations for each optimizer was contained in the interior of the learning rate grids.
We generally found that these two tasks required searching larger learning rates than the other two tasks.
The ﬁnal grids were as follows:
CIFAR-10 : η l ∈ { 10 − 3 , 10 − 2 .
5 } η ∈ { 10 − 3 , 10 − 2 .
. , 10 1 } CIFAR-100 : η l ∈ { 10 − 3 , 10 − 2 .
5 } η ∈ { 10 − 3 , 10 − 2 .
EMNIST AE : η l ∈ { 10 − 1 .
5 , 10 − 1 , . .
, 10 2 } η ∈ { 10 − 2 , 10 − 1 . 5 , . . .
EMNIST CR : η l ∈ { 10 − 3 , 10 − 2 .
5 } η ∈ { 10 − 3 , 10 − 2 .
Shakespeare : η l ∈ { 10 − 3 , 10 − 2 .
5 } η ∈ { 10 − 3 , 10 − 2 .
StackOverﬂow LR : η l ∈ { 10 − 1 , 10 − 0 .
. , 10 3 } η ∈ { 10 − 2 , 10 − 1 . 5 , . .
StackOverﬂow NWP : η l ∈ { 10 − 3 , 10 − 2 .
5 } η ∈ { 10 − 3 , 10 − 2 .
For all tasks, we tune τ over the grid: τ ∈ { 10 − 5 , . . .
, 10 − 1 } .
D. P ER - TASK BATCH SIZES
Given the large number of hyperparameters to tune, and to avoid conﬂating variables, we ﬁx the batch size at a per-task level.
When comparing centralized training to federated training in Section 5, we use the same batch size in both federated and centralized training.
A full summary of the batch sizes is given in Table 7.
[Table]
D. B EST PERFORMING HYPERPARAMETERS
In this section, we present, for each optimizer, the best client and server learning rates and values of τ found for the tasks discussed in Section 5.
Speciﬁcally, these are the hyperparameters used in
Figure Figure 1 and table Table 1.
The validation metrics in Table 1 are obtained using the learning rates in Table 8 and the values of τ in Table 9.
As discussed in Section 4, we choose η, η l and τ to be the parameters that minimizer the average training loss over the last 100 communication rounds. [Table] [Table] S
[Table]
LR - - -
S
[Table]
NWP - - -
[Figure]
[Table]
[Table]
[Table]
E A DDITIONAL E XPERIMENTAL R ESULTS E. R ESULTS ON EMNIST CR
We plot the validation accuracy of F ED A DAGRAD , F ED A DAM , F ED Y OGI , F ED A VG M, F ED A VG , and SCAFFOLD on EMNIST CR.
As in Figure 1, we tune the learning rates η l , η and adaptivity τ by selecting the parameters obtaining the smallest training loss, averaged over the last 100 training rounds.
The results are given in Figure 4.
We see that all methods are roughly comparably throughout the duration of training.
This reﬂects the fact that the dataset is quite simple, and most clients have all classes in their local datasets, reducing any heterogeneity among classes.
Note that SCAFFOLD performs slightly worse than F ED A VG and all other methods here.
As discussed in Section 5, this may be due to the presence of stale client control variates, and the communication-limited regime of our experiments.
E.
S TACK O VERFLOW TEST SET PERFORMANCE
As discussed in Section 5, in order to compute a measure of performance for the Stack Overﬂow tasks as training progresses, we use a subsampled version of the test dataset, due to its prohibitively large number of clients and examples.
In particular, at each round of training, we sample 10, random test samples, and use this as a measure of performance over time.
However, once training is completed, we also evaluate on the full test dataset.
For the Stack Overﬂow experiments described in
Section 5, the ﬁnal test accuracy is given in Table 10.
E. L EARNING RATE ROBUSTNESS
In this section, we showcase what combinations of client learning rate η l and server learning rate η performed well for each optimizer and task.
As in Figure 2, we plot, for each optimizer, task, and pair ( η l , η ) , the validation set performance (averaged over the last 100 rounds).
As in Section 5, we ﬁx τ = 10 − 3 throughout.
The results, for the CIFAR-10, CIFAR-100, EMNIST AE, EMNIST CR,
Shakespeare, Stack Overﬂow LR, and Stack Overﬂow NWP tasks are given in Figures 5, 6, 7, 8, 9, [Figure] and 11, respectively.
While the general trends depend on the optimizer and task [Figure] we see that in many cases
[Figure]
the adaptive methods have rectangular regions that perform well.
This implies a kind of robustness to ﬁxing one of η, η l
[Figure]
and varying the other.
On the other hand
[Figure]
F ED A VG M and F ED A VG often have triangular regions that perform well, suggesting that η and η l should be tuned simultaneously.
[Figure]
[Table]
n i n
[Table]
o
[Table]
[Figure] [Figure]
[Figure]
-2.0 S e r v e r L e a r n i n g R a t e ( l {+o g 10 ) 3.0 2.9 2.9 2.9 2.8 2.7 2.9 2.8 2.9 2.
+}
[Table] [Table]
[Table] [Table]
[Table]
EMNIST AE, FedYogi 0.
[Table]
a n
Sq u a r e d
E rr o r
( × 100 )
[Table]
[Figure]
[Table]
[Figure]
n
[Figure]
n
[Figure]
[Table]
[Figure]
[Table]
[Table]
[Figure]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
n
[Figure]
n
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Figure] [Table] [Figure] [Table]
[Figure] [Table] [Figure] [Table]
[Figure] [Table] [Figure] [Table]
[Figure]
[Table] [Figure] [Figure] [Figure]
[Table]
[Figure] [Table] [Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
E. O N THE RELATION BETWEEN CLIENT AND SERVER LEARNING RATES
In order to better understand the results in Appendix E.
[Figure]
we plot the relation between optimal choices of client and server learning rates.
For each optimizer, task
[Figure]
and client learning rate η l , we ﬁnd the best corresponding server learning rate η among the grids listed in Appendix D.2.
Throughout
[Figure]
we ﬁx τ = 10 − 3 for the adaptive methods.
We omit any points for which the ﬁnal validation loss is within 10% of the worst-recorded validation loss over all hyperparameters.
Essentially, we omit client learning rates that did not lead to any training of the model.
The results are given in Figure
[Figure]
In virtually all tasks, we see a clear inverse relationship between client learning rate η l and server learning rate η for F ED A VG and
F ED A VG M.
As discussed in Section 5, this supports the observation that for the non-adaptive methods, η l and η must in some sense be tuned simultaneously.
On the other hand, for adaptive optimizers on most tasks we see much more stability in the best server learning rate η as the client learning rate η l varies.
This supports our observation in Section 5 that for adaptive methods, tuning the client learning rate is more important.
Notably, we see a clear exception to this on the Stack Overﬂow LR task, where there is a deﬁnitive inverse relationship between learning rates among all optimizers.
The EMNIST AE task also displays somewhat different behavior.
While there are still noticeable inverse relationships between learning rates for F ED A VG and F ED A VG M, the range of good client learning rates is relatively small.
We emphasize that this task is fundamentally different than the remaining tasks.
As noted by Zaheer et al.
(2018), the primary obstacle in training bottleneck autoencoders is escaping saddle points, not in converging to critical points.
Thus, we expect there to be qualitative differences between EMNIST
AE and other tasks, even EMNIST CR (which uses the same dataset).
E. R OBUSTNESS OF THE ADAPTIVITY PARAMETER
As discussed in Section
[Figure]
we plot, for each adaptive optimizer and task
[Figure]
the validation accuracy as a function of the adaptivity parameter τ .
In particular, for each value of τ (which we vary over { 10 − 5 , . . .
, 10 − 1 }
[Figure]
see Appendix D)
[Figure]
we plot the best possible last-100-rounds validation set performance.
Speciﬁcally
[Figure]
we plot the average validation performance over the last 100 rounds using the best a posteriori values of client and server learning rates.
The results are given in Figure
[Figure]
η l E. I MPROVING PERFORMANCE WITH LEARNING RATE DECAY
Despite the success of adaptive methods, it is natural to ask if there is still more to be gained.
To test this, we trained the EMNIST CR model in a centralized fashion on a shufﬂed version of the dataset.
We trained for 100 epochs and used tuned learning rates for each (centralized) optimizer, achieving an accuracy of 88% (see Table 11, C ENTRALIZED row), signiﬁcantly above the best EMNIST CR results from Table 1.
The theoretical results in Section 3 point to a partial explanation, as they only hold when the client learning rate is small or is decayed over time.
To validate this, we ran the same hyperparameter grids on the federated EMNIST CR task, but using a client learning rate schedule.
We use a “staircase” exponential decay schedule (E XP D ECAY ) where the client learning rate η l is decreased by a factor of 0.1 every 500 rounds.
This is analogous in some sense to standard staircase learning rate schedules in centralized optimization (Goyal et al., 2017).
Table 11 gives the results.
E XP D ECAY improves the accuracy of all optimizers, and allows most to get close to the best centralized accuracy.
While we do not close the gap with centralized optimization entirely, we suspect that further tuning of the amount and frequency of decay may lead to even better accuracies.
However, this may also require performing signiﬁcantly more communication rounds, as the theoretical results in Section 3 are primarily asymptotic.
In communication-limited settings, the added beneﬁt of learning rate decay seems to be modest.
[Table]
F C REATING A F EDERATED CIFAROverview
We use the Pachinko Allocation Method (PAM) (Li & McCallum, 2006) to create a federated CIFAR-100.
PAM is a topic modeling method in which the correlations between individual words in a vocabulary are represented by a rooted directed acyclic graph (DAG) whose leaves are the vocabulary words.
The interior nodes are topics with Dirichlet distributions over their child nodes.
To generate a document, we sample multinomial distributions from each interior node’s Dirichlet distribution.
To sample a word from the document, we begin at the root, and draw a child node its multinomial distribution, and continue doing this until we reach a leaf node.
To partition CIFAR-100 across clients, we use the label structure of CIFAR-100.
Each image in the dataset has a ﬁne label (often referred to as its label) which is a member of a coarse label .
For example, the ﬁne label “seal” is a member of the coarse label “aquatic mammals”.
There arecoarse labels in CIFAR-100, each with 5 ﬁne labels.
We represent this structure as a DAG G , with a root whose children are the coarse labels.
Each coarse label is an interior node whose child nodes are its ﬁne labels.
The root node has a symmetric Dirichlet distribution with parameter α over the coarse labels, and each coarse label has a symmetric Dirichlet distribution with parameter β .
We associate each client to a document.
That is, we draw a multinomial distribution from the Dirichlet prior at the root ( Dir ( α )) and a multinomial distribution from the Dirichlet prior at each coarse label ( Dir ( β )) .
To create the client dataset, we draw leaf nodes from this DAG using Pachinko allocation, randomly sample an example with the given ﬁne label, and assign it to the client’s dataset.
We do this 100 times for each of 500 distinct training clients.
While more complex than LDA, this approach creates more realistic heterogeneity among client datasets by creating correlations between label frequencies for ﬁne labels within the same coarse label set.
Intuitively, if a client’s dataset has many images of dolphins, they are likely to also have pictures of whales.
By using a small α at the root, client datasets become more likely to focus on a few coarse labels.
By using a larger β for the coarse-to-ﬁne label distributions, clients are more likely to have multiple ﬁne labels from the same coarse label.
One important note: Once we sample a ﬁne label, we randomly select an element with that label without replacement .
This ensures no two clients have overlapping examples.
In more detail, suppose we have sample a ﬁne label y with coarse label c for client m , and there is only one remaining such example ( x, c, y ) .
We assign ( x, c, y ) to client m ’s dataset, and remove the leaf node y from the DAG
G .
We also remove y from the multinomial distribution θ c that client m has associated to coarse label c , which we refer to as renormalization with respect to y (Algorithm 8).
If i has no remaining children after pruning node j , we also remove node i from G and re-normalize the root multinomial θ r with respect to c .
For all subsequent clients, we draw multinomials from this pruned G according to symmetric Dirichlet distributions with the same parameters as before, but with one fewer category.
Notation and method
Let C denote the set of coarse labels and Y the set of ﬁne labels, and let S denote the CIFAR-100 dataset.
This consists of examples ( x, c, y ) where x is an image vector, c ∈ C is a coarse label set, and y ∈ Y is a ﬁne label with y ∈ c .
For c ∈ C , y ∈ Y , we let S c and S y denote the set of examples in S with coarse label c and ﬁne label y .
For v ∈ G we let | G [ v ] | denote the set of children of v in G .
For γ ∈ R , let Dir ( γ, k ) denote the symmetric Dirichlet distribution with k categories.
Algorithm 7 Creating a federated CIFARInput: N, M ∈ Z > 0 , α, β ∈ R ≥for m = 1 , · · · , M do
Sample θ r ∼ Dir ( α, | G [ r ] | ) for c ∈ C ∩ G [ r ] do
Sample θ c ∼ Dir ( β, | G [ c ] | )
D m = ∅ for n = 1 , · · · N do
Sample c ∼ Multinomial ( θ r )
Sample y ∼ Multinomial ( θ c )
Select ( x, c
, y ) ∈ S uniformly at random
D m =
D m ∪ { ( x, c, y ) }
S =
S\{ ( x, c, y ) } if S y = ∅ then
G =
G \{ y } θ c = R ENORMALIZE ( θ c , y )
if S c = ∅ then
G =
G \{ c } θ r = R ENORMALIZE ( θ r , c )
Algorithm 8 R ENORMALIZE
Initialization: θ = ( p 1 , . .
. , p K ) , i ∈
[ K ] a = (cid:80) k (cid:54) =
i p k for k ∈ [ K ] , k (cid:54)
=
i do p (cid:48) k
= p
k
/a
Return θ (cid:48)
= ( p (cid:48) 1 , · · · p (cid:48)
i − 1 , p (cid:48)
i +1 , · · · , p (cid:48) K )
Let M denote the number of clients, N the number of examples per client, and D m the dataset for client m ∈ { 1 , · · · , M } .
A full description of our method is given in Algorithm 7.
For our experiments, we use N = 100 , M = 500 , α = 0 .
1 , β = 10 .
In Figure 14, we plot the distribution of unique labels among the 500 training clients.
Each client has only a fraction of the overall labels in the distribution.
Moreover, there is variance in the number of unique labels, with most clients having between 20 and 30, and some having over 40.
Some client datasets have very few unique labels.
While this is primarily an artifact of performing without replacement sampling, this helps increase the heterogeneity of the dataset in a way that can reﬂect practical concerns, as in many settings, clients may only have a few types of labels in their dataset.
[Figure]