Personalized Federated Learning: A Meta-Learning Approach

Alireza Fallah, Aryan Mokhtari, Asuman Ozdaglar

Introduction

In particular, consider a supervised learning setting, where fif_{i} represents expected loss over the data distribution of user ii, i.e.,

where li(w;x,y)l_{i}(w;x,y) measures the error of model ww in predicting the true label y∈Yiy\in\mathcal{Y}_{i} given the input x∈Xix\in\mathcal{X}_{i}, and pip_{i} is the distribution over Xi×Yi\mathcal{X}_{i}\times\mathcal{Y}_{i}. The focus of this paper is on a data heterogeneous setting where the probability distribution pip_{i} of users are not identical. To illustrate this formulation, consider the example of training a Natural Language Processing (NLP) model over the devices of a set of users. In this problem, pip_{i} represents the empirical distribution of words and expressions used by user ii. Hence, fi(w)f_{i}(w) can be expressed as fi(w)=∑(x,y)∈Sipi(x,y)li(w;x,y)f_{i}(w)=\sum_{(x,y)\in\mathcal{S}_{i}}p_{i}(x,y)l_{i}(w;x,y), where Si\mathcal{S}_{i} is the data set corresponding to user ii and pi(x,y)p_{i}(x,y) is the probability that user ii assigns to a specific word which is proportional to the frequency of using this word by user ii.

Indeed, each user can solve its local problem defined in (2) without any exchange of information with other users; however, the resulted model may not generalize well to new samples as it has been trained over a small number of samples. If users cooperate and exploit the data available at all users, then their local models could obtain stronger generalization guarantees. A conventional approach for achieving this goal is minimizing the aggregate of local functions defined in (1). However, this scheme only develops a common output for all the users, and therefore, it does not adapt the model to each user. In particular, in the heterogeneous settings where the underlying data distribution of users are not identical, the resulted global model obtained by minimizing the average loss could perform arbitrarily poorly once applied to the local dataset of each user. In other words, the solution of problem (1) is not personalized for each user. To highlight this point, recall the NLP example, where although the distribution over the words and expressions varies from one person to another, the solution to problem (1) provides a shared answer for all users, and, therefore, it is not fully capable of achieving a user-specific model.

In this paper, we overcome this issue by considering a modified formulation of the federated learning problem which incorporates personalization (Section 2). Building on the Model-Agnostic Meta-Learning (MAML) problem formulation introduced in , the goal of this new formulation is to find an initial point shared between all users which performs well after each user updates it with respect to its own loss function, potentially by performing a few steps of a gradient-based method. This way, while the initial model is derived in a distributed manner over all users, the final model implemented by each user differs from other ones based on her or his own data. We study a Personalized variant of the FedAvg algorithm, called Per-FedAvg, designed for solving the proposed personalized FL problem (Section 3). In particular, we elaborate on its connections with the original FedAvg algorithm , and also, discuss a number of considerations that one needs to take into account for implementing Per-FedAvg. We also establish the convergence properties of the proposed Per-FedAvg algorithm for minimizing non-convex loss functions (Section 4). In particular, we characterize the role of data heterogeneity and closeness of data distribution of different users, measured by distribution distances, such as Total Variation (TV) or 1-Wasserstein, on the convergence of Per-FedAvg.

Related Work. Recently we have witnessed significant progress in developing novel methods that address different challenges in FL; see . In particular, there have been several works on various aspects of FL, including preserving the privacy of users and lowering communication cost . Several work develop algorithms for the homogeneous setting, where the data points of all users are sampled from the same probability distribution . More related to our paper, there are several works that study statistical heterogeneity of users’ data points in FL , but they do not attempt to find a personalized solution for each user.

The centralized version of model-agnostic meta-learning (MAML) problem was first proposed in and followed by a number of papers studying its empirical characteristics as well as its convergence properties . In this work, we focus on the convergence of MAML methods for the FL setting that is more challenging as nodes perform multiple local updates before sending their updates to the server, which is not considered in previous theoretical works on meta-learning.

Recently, the idea of personalization in FL and its connections with MAML has gained a lot of attention. In particular, considers a formulation and algorithm similar to our paper, and elaborates on the empirical success of this framework. Also, recently, there has been a number of other papers that have studied different combinations of MAML-type methods with FL architecture from an empirical point of view . However, our main focus is on developing a theoretical understating regarding this formulation, where we characterize the convergence of the Per-FedAvg, and the role of this algorithm’s parameters on its performance. Besides, in our numerical experiment section, we show how the method studied in may not perform well in some cases, and propose another algorithm which addresses this issue. In addition, an independent and concurrent work studies a similar formulation theoretically for the case of strongly convex functions. The results in are completely different from ours, as they study the case that the functions are strongly convex and exact gradients are available, while we study nonconvex functions, and also address gradient stochasticity.

Using meta-learning and multi-task learning to achieve personalization is not limited to MAML framework. In particular, proposes ARUBA, a meta-learning algorithm inspired by online convex optimization, and shows that applying it to FedAvg improves its performance. A similar idea is later used in to design differentially private algorithms with application in FL. Also in , the authors use multi-task learning framework and propose a new method, MOCHA, to address the statistical and systems challenges, including data heterogeneity and communication efficiency. Their proposed multi-task learning scheme also leads to a set of solutions that are more user-specific. A detailed survey on the connections of FL and multi-task and meta-learning can be found in . Also, in , the authors consider a framework for training a mixture of a single global model and local models, leading to a personalized solution for each user. A similar idea has been studied in , where the authors propose an adaptive federated learning algorithm that learns a mixture of local and global models as the personalized model.

Personalized Federated Learning via Model-Agnostic Meta-Learning

As we stated in Section 1, our goal in this section is to show how the fundamental idea behind the Model-Agnostic Meta-Learning (MAML) framework in can be exploited to design a personalized variant of the FL problem. To do so, let us first briefly recap the MAML formulation. Given a set of tasks drawn from an underlying distribution, in MAML, in contrast to the traditional supervised learning setting, the goal is not finding a model which performs well on all the tasks in expectation. Instead, in MAML, we assume we have a limited computational budget to update our model after a new task arrives, and in this new setting, we look for an initialization which performs well after it is updated with respect to this new task, possibly by one or a few steps of gradient descent. In particular, if we assume each user takes the initial point and updates it using one step of gradient descent with respect to its own loss function, then problem (1) changes to

where α≥0\alpha\geq 0 is the stepsize. The strength of this formulation is that, not only it allows us to maintain the advantages of FL, but also it captures the difference between users as either existing or new users can take the solution of this new problem as an initial point and slightly update it with respect to their own data. Going back to the NLP example, this means that the users could take this resulting initialization and update it by going over their own data Si\mathcal{S}_{i} and performing just one or few steps of gradient descent to obtain a model that works well for their own dataset.

As mentioned earlier, for the considered heterogeneous model of data distribution, solving problem (1) is not the ideal choice as it returns a single model that even after a few steps of local gradient may not quickly adjust to each users local data. On the other hand, by solving (3) we find an initial model (Meta-model) which is trained in a way that after one step of local gradient leads to a good model for each individual user. This formulation can also be extended to the case that users run a few steps of gradient update, but to simplify our notation we focus on the single gradient update case. We would like to mention that the problem formulation in (3) for FL was has been proposed independently in another work and studied numerically. In this work, we focus on the theoretical aspect of this problem and seek a provably convergent method for the case that the functions fif_{i} are nonconvex.

Personalized FedAvg

In this section, we present the Personalized FedAvg (Per-FedAvg) method to solve (3). This algorithm is inspired by FedAvg, but it is designed to find the optimal solution of (3) instead of (1). In FedAvg, at each round, the server chooses a fraction of users with size rnrn (r∈(0,1]r\in(0,1]) and sends its current model to these users. Each selected user ii updates the received model based on its own loss function fif_{i} and by running τ≥1\tau\geq 1 steps of stochastic gradient descent. Then, the active users return their updated models to the server. Finally, the server updates the global model by computing the average of the models received from these selected users, and then the next round follows. Per-FedAvg follows the same principles. First, note that function FF in (3) can be written as the average of meta-functions F1,…,FnF_{1},\dots,F_{n} where the meta-function FiF_{i} associated with user ii is defined as

To follow a similar scheme as FedAvg for solving problem (3), the first step is to compute the gradient of local functions, which in this case, the gradient ∇Fi\nabla F_{i}, that is given by

At round kk of Per-FedAvg, similar to FedAvg, first the server sends the current global model wkw_{k} to a fraction of users Ak\mathcal{A}_{k} chosen uniformly at random with size rnrn. Each user i∈Aki\in\mathcal{A}_{k} performs τ\tau steps of stochastic gradient descent locally and with respect to FiF_{i}. In particular, these local updates generate a local sequence {wk+1,ti}t=0τ\{w_{k+1,t}^{i}\}_{t=0}^{\tau} where wk+1,0i=wkw_{k+1,0}^{i}=w_{k} and, for τ≥t≥1\tau\geq t\geq 1,

Once, the local updates wk+1,τiw_{k+1,\tau}^{i} are evaluated, users send them to the server, and the server updates its global model by averaging over the received models, i.e., wk+1=1rn∑i∈Akwk+1,τiw_{k+1}=\frac{1}{rn}\sum_{i\in\mathcal{A}_{k}}w_{k+1,\tau}^{i} .

Theoretical Results

In this section, we study the convergence properties of the Personalized FedAvg (Per-FedAvg) method. We focus on nonconvex settings, and characterize the overall communication rounds between server and users to find an ϵ\epsilon-approximate first-order stationary point, where its formal definition follows.

Next, we formally state the assumptions required for proving our main results.

For every i∈{1,…,n}i\in\{1,\dots,n\}, fif_{i} is twice continuously differentiable and LiL_{i}-smooth, and also, its gradient is bounded by a nonnegative constant BiB_{i}, i.e.,

As we discussed in Section 3, the second-order derivative of all functions appears in the update rule of Per-FedAvg Algorithm. Hence, in the next Assumption, we impose a regularity condition on the Hessian of each fif_{i} which is also a customary assumption in the analysis of second-order methods.

For every i∈{1,…,n}i\in\{1,\dots,n\}, the Hessian of function fif_{i} is ρi\rho_{i}-Lipschitz continuous, i.e.,

To simplify the analysis, in the rest of the paper, we define B:=max⁡iBiB:=\max_{i}B_{i}, L:=max⁡iLiL:=\max_{i}L_{i}, and ρ:=max⁡iρi\rho:=\max_{i}\rho_{i} which can be, respectively, considered as a bound on the norm of gradient of fif_{i}, smoothness parameter of fif_{i}, and Lipschitz continuity parameter of Hessian ∇2fi\nabla^{2}f_{i}, for i=1,…,ni=1,\dots,n.

Our next assumption provides upper bounds on the variances of gradient and Hessian estimations.

Finally, we state our last assumption which characterizes the similarity between the tasks of users.

Assumption 5 captures the diversity between the gradients and Hessians of users. Note that under Assumption 2, the conditions in Assumption 5 are automatically satisfied for γG=2B\gamma_{G}=2B and γH=2L\gamma_{H}=2L. However, we state this assumption separately to highlight the role of similarity of functions corresponding to different users in convergence analysis of Per-FedAvg. In particular, in the following subsection, we highlight the connections between this assumption and the similarity of distributions pip_{i} for the case of supervised learning (2) under two different distribution distances.

This simple derivation shows that γG\gamma_{G} and γH\gamma_{H} exactly capture the difference between the probability distributions of the users in a heterogeneous setting.

Then, Assumption 5 holds with (check Appendix B)

This derivation does not require Assumption 2 and holds when (15) are satisfied. Finally, consider a special case where the data distributions are homogeneous, and each pip_{i} is an empirical distribution drawn from a distribution pup_{u} with sample size mm. In this case, we have W1(pi,pu)=O(1/m)W_{1}(p_{i},p_{u})=\mathcal{O}(1/\sqrt{m}) . Hence, since W1W_{1} is a distance, it is easy to verify that γG,γH=O(1/m)\gamma_{G},\gamma_{H}=\mathcal{O}(1/\sqrt{m})While our focus here is to elaborate on the dependence of Wasserstein distance on the number of samples, it is worth noting that one drawback of this bound is that the convergence speed of Wasserstein distance in dimension is exponentially slow..

2 Convergence Analysis of Per-FedAvg Algorithm

In this subsection, we derive the overall complexity of Per-FedAvg for achieving an ϵ\epsilon-first-order stationary point. To do so, we first prove the following intermediate result which shows that under Assumptions 2 and 3, the local meta-functions Fi(w)F_{i}(w) defined in (4) and their average function F(w)=(1/n)∑i=1nFi(w)F(w)=(1/n)\sum_{i=1}^{n}F_{i}(w) are smooth.

Recall the definition of Fi(w)F_{i}(w) in (4) with α∈[0,1/L]\alpha\in[0,1/L]. If Assumptions 2 and 3 hold, then FiF_{i} is smooth with parameter LF:=4L+αρBL_{F}:=4L+\alpha\rho B. As a consequence, the average function F(w)=(1/n)∑i=1nFi(w)F(w)=(1/n)\sum_{i=1}^{n}F_{i}(w) is also smooth with parameter LFL_{F}.

Assumption 4 provides upper bounds on the variances of gradient and Hessian estimation for functions fif_{i}. To analyze the convergence of Per-FedAvg, however, we require upper bounds on the bias and variance of gradient estimation of FiF_{i}. We derive these bounds in the following lemma.

To measure the tightness of this result, we consider two special cases. First, if the exact gradients and Hessians are available, i.e., σG=σH=0\sigma_{G}=\sigma_{H}=0, then σF=0\sigma_{F}=0 as well which is expected as we can compute exact ∇Fi\nabla F_{i}. Second, for the classic federated learning problem, i.e., α=0\alpha=0 and Fi=fiF_{i}=f_{i}, we have σF=O(1)σG2/D′\sigma_{F}=\mathcal{O}(1){\sigma_{G}^{2}}/{D^{\prime}} which is tight up to constants.

Next, we use the similarity conditions for the functions fif_{i} in Assumption 5 to study the similarity between gradients of the functions FiF_{i}.

To check the tightness of this result, we focus on two special cases as we did for Lemma 4.3 . First, if ∇fi\nabla f_{i} are all equal, i.e., γG=γH=0\gamma_{G}=\gamma_{H}=0, then γF=0\gamma_{F}=0. This is indeed expected as all ∇Fi\nabla F_{i} are equal to each other in this case. Second, for the classic federated learning problem, i.e., α=0\alpha=0 and Fi=fiF_{i}=f_{i}, we have γF=O(1)γG\gamma_{F}=\mathcal{O}(1)\gamma_{G} that is optimal up to a constant factor given the conditions in Assumption 5.

Consider the objective function FF defined in (3) for the case that α∈(0,1/L]\alpha\in(0,{1}/{L}]. Suppose that the conditions in Assumptions 1-4 are satisfied, and recall the definitions of LFL_{F}, σF\sigma_{F}, and ηF\eta_{F} from Lemmas 4.2-4.4. Consider running Algorithm 1 for KK rounds with τ\tau local updates in each round and with β≤1/(10τLF)\beta\leq 1/(10\tau L_{F}). Then, the following first-order stationary condition holds

where wˉk+1,t\bar{w}_{k+1,t} is the average of iterates of users in Ak\mathcal{A}_{k} at time tt, i.e., wˉk+1,t=1rn∑i∈Akwk+1,ti\bar{w}_{k+1,t}=\frac{1}{rn}\sum_{i\in\mathcal{A}_{k}}w_{k+1,t}^{i}, and in particular, wˉk+1,0=wk\bar{w}_{k+1,0}=w_{k} and wˉk+1,τ=wk+1\bar{w}_{k+1,\tau}=w_{k+1}.

Next, we characterize the choices of τ\tau, KK, and β\beta in terms of the required accuracy ϵ\epsilon to obtain the best possible complexity bound for the result in Theorem 4.5.

Suppose the conditions in Theorem 4.5 are satisfied. If we set the number of local updates as τ=O(ϵ−1/2)\tau=\mathcal{O}(\epsilon^{-1/2}), number of communication rounds with the server as K=O(ϵ−3/2)K=\mathcal{O}(\epsilon^{-3/2}), and stepsize of Per-FedAvg as β=ϵ\beta=\epsilon, then we find an O(ϵ+α2σG2D)\mathcal{O}(\epsilon+\frac{\alpha^{2}\sigma^{2}_{G}}{D})-first-order stationary point of FF.

The result in Corollary 4.6 shows that to achieve an O(ϵ+α2σG2D)\mathcal{O}(\epsilon+\frac{\alpha^{2}\sigma^{2}_{G}}{D})-first-order stationary point of FF the Per-FedAvg algorithm requires K=O(ϵ−3/2)K=\mathcal{O}(\epsilon^{-3/2}) rounds of communication between users and the server. Indeed, by setting D=O(ϵ−1)D=\mathcal{O}(\epsilon^{-1}) or setting the meta-step stepsize as α=O(ϵ1/2)\alpha=\mathcal{O}(\epsilon^{1/2}) Per-FedAvg can find an ϵ\epsilon-first-order stationary point of FF for any arbitrary ϵ>0\epsilon>0.

The result of Theorem 4.5 and Corollary 4.6 provide an upper bound on the average of E[∥∇F(wˉk+1,t)∥2]E\left[\|\nabla F(\bar{w}_{k+1,t})\|^{2}\right] for all k∈{0,1,...,K−1}k\in\{0,1,...,K-1\} and t∈{0,1,...,τ−1}t\in\{0,1,...,\tau-1\}. However, one concern here is that due to the structure of Algorithm 1, for any kk, we only have access to wˉk+1,t\bar{w}_{k+1,t} for t=0t=0. To address this issue, at any iteration kk, the center can choose tk∈{0,1...,τ−1}t_{k}\in\{0,1...,\tau-1\} uniformly at random, and ask all the users in Ak\mathcal{A}_{k} to send wk+1,tkiw_{k+1,t_{k}}^{i} back to the server, in addition to wk+1,τiw_{k+1,\tau}^{i}. By following this scheme we can ensure that the same upper bound also hods for the expected average models at the server, i.e., 1K∑k=0K−1E[∥∇F(wˉk+1,tk)∥2]\frac{1}{K}\sum_{k=0}^{K-1}E\left[\|\nabla F(\bar{w}_{k+1,t_{k}})\|^{2}\right].

It is worth noting that it is possible to achieve the same complexity bound using a diminishing stepsize. We will further discuss this at the end of Appendix G.

Numerical Experiments

In this section, we numerically study the role of personalization when the data distributions are heterogeneous. In particular, we consider the multi-class classification problem over MNIST and CIFAR-10 datasets and distribute the training data between nn users as follows: (i) Half of the users, each have aa images of each of the first five classes; (ii) The rest, each have a/2a/2 images from only one of the first five classes and 2a2a images from only one of the other five classes (see Appendix I for an illustration). We set the parameter aa as a=196a=196 and a=68a=68 for MNIST and CIFAR-10 datasets, respectively. This way, we create an example where the distribution of images over all the users are different. Similarly, we divide the test data over the nodes with the same distribution as the one for the training data. Note that for this particular example in which the user’s distributions are significantly different, our goal is not to achieve state-of-the-art accuracy. Rather, we aim to provide an example to compare the various approaches for obtaining personalization in the heterogenous setting. Indeed, by using more complex neural networks the results for all the considered algorithms would improve; however, their relative performance would stay the same.

We focus on three algorithms: The first method that we consider is the FedAvg method, and, to do a fair comparison, we take the output of the FedAvg method, and update it with one step of stochastic gradient descent with respect to the test data, and then evaluate its performance. The second and third algorithms that we consider are two different efficient approximations of Per-FedAvg. Similarly, we evaluate the performance of these methods for the case that one step of local stochastic gradient descent is performed during test time. To formally explain these two approximate versions of Per-FedAvg, note that the implementation of Per-FedAvg requires access to second-order information which is computationally costly. To address this issue, we consider two different approximations:

(ii) Second, we use the idea of the HF-MAML, proposed in , in which the Hessian-vector product in the MAML update is replaced by difference of gradients using the following approximation: ∇2ϕ(w)u≈(∇ϕ(u+δv)−∇ϕ(u−δv))/δ\nabla^{2}\phi(w)u\approx(\nabla\phi(u+\delta v)-\nabla\phi(u-\delta v))/\delta. We refer to this algorithm as Per-FedAvg (HF).

As shown in , for small stepsize at test time α\alpha both FO-MAML and HF-MAML perform well, but as α\alpha becomes large, HF-MAML outperforms FO-MAML in the centralized setting. A more detailed discussion on Per-FedAvg (FO) and Per-FedAvg (HF) is provided in Appendix H. Moreover, there we discuss how our analysis can be extended to these two methods. Note that the model obtained by any of these three methods is later updated using one step of stochastic gradient descent at the test time, and hence they have the same budget at the test time.

We use a neural network with two hidden layers with sizes 80 and 60, and we use Exponential Linear Unit (ELU) activation function. We take n=50n=50 users in the network, and run all three algorithms for K=1000K=1000 rounds. At each round, we assume rnrn agents with r=0.2r=0.2 are chosen to run τ\tau local updates. The batch sizes are D=D′=40D=D^{\prime}=40 and the learning rate is β=0.001\beta=0.001. Part of the code is adopted from . Note that the reported results for all the considered methods corresponds to the average test accuracy among all users, after running one step of local stochastic gradient descent.

The test accuracy results along with the 95% confidence intervals are reported in Table 1. For MNIST dataset, both Per-FedAvg methods achieve a marginal gain compared to FedAvg. However, the achieved gain from using Per-FedAvg (HF) compared to FedAvg is more significant for CIFAR-10 dataset. In particular, we have three main observations here: (i) For α=0.001\alpha=0.001 and τ=10\tau=10, Per-FedAvg (FO) and Per-FedAvg (HF) perform almost similarly, and better than FedAvg. In addition, decreasing τ\tau leads to a decrease in the performance of all three algorithms, which is expected as the total number of iterations decreases. (ii) Next, we study the role of α\alpha. By increasing α\alpha from 0.0010.001 to 0.010.01, for τ=4\tau=4, the performance of Per-FedAvg (HF) improves, which could be due to the fact that model adapts better with user data at test time. However, as discussed above, for larger α\alpha, Per-FedAvg (FO) performance drops significantly. (iii) Third, we examine the effect of changing the level of data heterogeneity. To do so, we change the data distribution of half of the users that have a/2a/2 images from one of the first five classes by removing these images from their dataset. As the last line of Table 1 shows, Per-FedAvg (HF) performs significantly better that FedAvg under these new distributions, while Per-FedAvg (FO) still suffers from the issue we discussed in (ii). In summary, the more accurate implementation of Per-FedAvg, i.e., Per-FedAvg (HF), outperforms FedAvg in all cases and leads to a more personalized solution.

Conclusion

We considered the Federated Learning (FL) problem in the heterogeneous case, and studied a personalized variant of the classic FL formulation in which our goal is to find a proper initialization model for the users that can be quickly adapted to the local data of each user after the training phase. We highlighted the connections of this formulation with Model-Agnostic Meta-Learning (MAML), and showed how the decentralized implementation of MAML, which we called Per-FedAvg, can be used to solve the proposed personalized FL problem. We also characterized the overall complexity of Per-FedAvg for achieving first-order optimality in nonconvex settings. Finally, we provided a set of numerical experiments to illustrate the performance of two different first-order approximations of Per-FedAvg and their comparison with the FedAvg method, and showed that the solution obtained by Per-FedAvg leads to a more personalized solution compared to the solution of FedAvg.

Acknowledgment

Research was sponsored by the United States Air Force Research Laboratory and was accomplished under Cooperative Agreement Number FA8750-19-2-1000. The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of the United States Air Force or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for Government purposes notwithstanding any copyright notation herein. Alireza Fallah acknowledges support from MathWorks Engineering Fellowship. The research of Aryan Mokhtari is supported by NSF Award CCF-2007668.

References

Appendix A Intermediate Notes

Appendix B Proofs of results in Subsection 4.1

where the second inequality holds due to the assumption that ∥∇wl(z;w)∥≤B\|\nabla_{w}l(z;w)\|\leq B for any ww and zz. Plugging (18) in 1n∑i=1n∥∇fi(w)−∇f(w)∥2\frac{1}{n}\sum_{i=1}^{n}\|\nabla f_{i}(w)-\nabla f(w)\|^{2}, gives us the desired result. The other result on Hessians can be proved similarly.

B.2 1-Wasserstein Distance

which will immediately give us one of the two results. To show this, first, note that

Next, note that since pip_{i} and pp both have bounded support, by Kantorovich-Rubinstein Duality , we have

Using this result, to show (20), it suffices to show g(z)=v⊤∇l(z;w)g(z)=v^{\top}\nabla l(z;w) is LZL_{\mathcal{Z}}-Lipschitz. Note that Cauchy-Schwarz inequality implies

where the last inequality is obtained using ∥v∥≤1\|v\|\leq 1 along with (15).

Finally, note that we can similarly show the result for γH\gamma_{H} by considering the fact that

and taking the functions g(z)=v⊤∇2l(z;w)vg(z)=v^{\top}\nabla^{2}l(z;w)v and g(z)=−v⊤∇2l(z;w)vg(z)=-v^{\top}\nabla^{2}l(z;w)v along with using Kantorovich-Rubinstein Duality Theorem again.

Appendix C Proof of Lemma 4.2

where (24) is obtained by adding and subtracting (I−α∇2fi(w1))∇fi(w2−α∇fi(w2))\left(I-\alpha\nabla^{2}f_{i}(w_{1})\right)\nabla f_{i}(w_{2}-\alpha\nabla f_{i}(w_{2})) and the last inequality follows from the triangle inequality and the definition of matrix norm. Now, we bound two terms of (25) separately.

First, note that by (17a), ∥I−α∇2fi(w1)∥≤1+αL\left\|I-\alpha\nabla^{2}f_{i}(w_{1})\right\|\leq 1+\alpha L. Using this along with smoothness of fif_{i}, we have

where we used smoothness of fif_{i} along with α≤1/L\alpha\leq 1/L.

For the second term, Using (9) in Assumption 2 along with Assumption 3 implies

Putting (26) and (27) together, we obtain the desired result.

Appendix D Proof of Lemma 4.3

Note that in the above expression e1e_{1} and e2e_{2} are given by

Based on Assumption 4, it can be easily shown that

Next, we proceed to bound the first and second moments of e2e_{2}. To do so, first note that e2e_{2} can also be written as

Note that, conditioning on D\mathcal{D}, the first term is zero mean and the second term is deterministic. Therefore,

where (32) is obtained using smoothness of fif_{i}. The last inequality is also obtained using

where (36) follows from (34), and (35) is obtained using smoothness of fif_{i} along with the fact that

Next, note that, by comparing (29) and (5), along with the fact that e1e_{1} and e2e_{2} are independent, and e1e_{1} is zero-mean (30a), we have

Hence, by taking the norm of both sides, we obtain

where the last inequality follows from the definition of matrix norm. Now, using (33) along with the fact that ∥I−α∇2fi(w)∥≤1+αL≤2\|I-\alpha\nabla^{2}f_{i}(w)\|\leq 1+\alpha L\leq 2 gives us the first result in Lemma 4.3.

To show the other result, note that, by comparing (29) and (5), along with the matrix norm definition, we have

As a result, by the Cauchy-Schwarz inequality (a+b+c)2≤3(a2+b2+c2)(a+b+c)^{2}\leq 3(a^{2}+b^{2}+c^{2}) for a,b,c≥0a,b,c\geq 0, we have

By taking expectation, and using the fact that ∥I−α∇2fi(w)∥≤1+αL≤2\|I-\alpha\nabla^{2}f_{i}(w)\|\leq 1+\alpha L\leq 2 and

where we also used the fact that e1e_{1} and e2e_{2} are independent as D′′\mathcal{D}^{\prime\prime} is independent from D\mathcal{D} and D′\mathcal{D}^{\prime}. Plugging (30b) and (36) in (41), we obtain

Appendix E Proof of Lemma 4.4

First, note that, by Assumption 5, we have

where the last inequality is obtained using (9) in Assumption 2. Now, by using (a+b)2≤2(a2+b2)(a+b)^{2}\leq 2(a^{2}+b^{2}), we have

where the second inequality follows from Assumption 5 and the last inequality is obtained using αL≤1\alpha L\leq 1. Next, recall that the goal is to bound the variance of ∇Fi(w)\nabla F_{i}(w) when ii is drawn from a uniform distribution. We know that by subtracting a constant from a random variable, its variance does not change. Thus, variance of ∇Fi(w)\nabla F_{i}(w) is equal to variance of ∇Fi(w)−(I−α∇2f(w))∇f(w−α∇f(w))\nabla F_{i}(w)-\left(I-\alpha\nabla^{2}f(w)\right)\nabla f(w-\alpha\nabla f(w)). Also, the variance of the latter is bounded by its second moment, and hence,

Therefore, using ∥∇f(w−α∇f(w))∥≤B\left\|\nabla f(w-\alpha\nabla f(w))\right\|\leq B along with ∥I−α∇2f(w)∥≤1+αL\left\|I-\alpha\nabla^{2}f(w)\right\|\leq 1+\alpha L and Cauchy-Schwarz inequality (a+b+c)2≤3(a2+b2+c2)(a+b+c)^{2}\leq 3(a^{2}+b^{2}+c^{2}) for a,b,c≥0a,b,c\geq 0, we obtain

where the last inequality is obtained using αL≤1\alpha L\leq 1 along with ∥Eiri∥≤∥Ei∥∥ri∥\|E_{i}r_{i}\|\leq\|E_{i}\|\|r_{i}\| which comes from the definition of matrix norm. Finally, to complete the proof, notice that we have

where (53) follows from (49) and the last line is obtained using αL≤1\alpha L\leq 1 along with the fact that ∥∇2fi(w)∥≤L\|\nabla^{2}f_{i}(w)\|\leq L, and thus,

Plugging (53) in (51) along with (46) and (49), we obtain the desired result.

Appendix F An Intermediate Result

Recall from Section 3 that at any round k≥1k\geq 1, and for any agent i∈{1,..,n}i\in\{1,..,n\}, we can define a sequence of local updates {wk,ti}t=0τ\{w_{k,t}^{i}\}_{t=0}^{\tau} where wk,0i=wk−1w_{k,0}^{i}=w_{k-1} and, for τ≥t≥1\tau\geq t\geq 1,

We further define the average of these local updates at round kk and time tt as wk,t=1/n∑i=1nwk,tiw_{k,t}={1}/{n}\sum_{i=1}^{n}w_{k,t}^{i}. Suppose that the conditions in Assumptions 2-4 are satisfied. Then, for any α∈[0,1/L]\alpha\in[0,1/L] and any t≥0t\geq 0, we have

where ϕ>0\phi>0 is an arbitrary positive constant and LFL_{F}, σF\sigma_{F}, and γF\gamma_{F} are given in Lemmas 4.2, 4.3, and 4.4, respectively.

Before stating the proof, note that an immediate consequence of this result is the following corollary:

Under the same assumptions as Proposition F.1, and for any β≤1/(10τLF)\beta\leq 1/(10\tau L_{F}), we have

where S0=0S_{0}=0 since wk,0i=wk−1w_{k,0}^{i}=w_{k-1} for any ii. Note that

Note that the first term in (60) is in fact StS_{t} and the second one can be upper bounded as follows

where the last inequality is obtained using Lemma 4.3. By substituting this in (60), we obtain

If we define ηi:=∇Fi(wk,ti)−∇Fi(wk,t)\eta_{i}:=\nabla F_{i}(w_{k,t}^{i})-\nabla F_{i}(w_{k,t}), using (61), we obtain

where the last inequality is obtained using Lemma 4.4. Using (65) recursively, we obtain

which completes the proof of (57a). To prove (57b), let

where (68) is obtained using ∥a+b∥2≤(1+ϕ)∥a∥2+(1+1/ϕ)∥b∥2\|a+b\|^{2}\leq(1+\phi)\|a\|^{2}+(1+1/\phi)\|b\|^{2} for any arbitrary positive real number ϕ\phi. To bound the second term in (69), note that

Now, we bound the second term in (70). Using Cauchy-Schwarz inequality

where the last inequality is obtained using Lemma 4.3. Plugging (72) in (70) and using (69), we obtain

Now, it remains to bound the last term in (F). Recall ηi=∇Fi(wk,ti)−∇Fi(wk,t)\eta_{i}=\nabla F_{i}(w_{k,t}^{i})-\nabla F_{i}(w_{k,t}). First, note that, using ∥a+b∥2≤2∥a∥2+2∥b∥2\|a+b\|^{2}\leq 2\|a\|^{2}+2\|b\|^{2}, we have

Substituting this bound in (F) and using Lemma 4.4 yields

Note that, using Cauchy-Schwarz inequality (71) with a1=ηi,b1=1a_{1}=\eta_{i},b_{1}=1 and al=1/nηl−1,bl=1/na_{l}=1/\sqrt{n}\eta_{l-1},b_{l}=1/\sqrt{n} for l=2,...,n+1l=2,...,n+1, implies

where the last inequality is obtained using Lemma 4.2 which states

Finally, to show (58), first note that for any nn, we know

Using this, along with the assumption β≤1/(10LFτ)\beta\leq 1/(10L_{F}\tau) and the fact that e0.2≤2e^{0.2}\leq 2, we immediately obtain (58a). To show the other one (58b), we use (57b) with ϕ=1/(2τ)\phi=1/(2\tau):

where the first inequality follows from the assumption β≤1/(10LFτ)\beta\leq 1/(10L_{F}\tau) and the last inequality is obtained using the trivial bound 1+2τ≤3τ1+2\tau\leq 3\tau. Finally, using (81) along with (80) completes the proof. ∎

Appendix G Proof of Theorem 4.5

Although we only ask a fraction of agents to compute their local updates in Algorithm 1, here, and just for the sake of analysis, we assume all agents perform local updates. This is just for our analysis and we will not use all agents’ updates in computing wk+1w_{k+1}. Also, from Proposition F.1, recall that wk,t=1/n∑i=1nwk,tiw_{k,t}={1}/{n}\sum_{i=1}^{n}w_{k,t}^{i}.

Let Fk+1t\mathcal{F}_{k+1}^{t} denote the σ\sigma-field generated by {wk+1,ti}i=1n\{w_{k+1,t}^{i}\}_{i=1}^{n}. Note that, by Lemma 4.2, we know FF is smooth with gradient Lipschitz parameter LFL_{F}, and thus, by (17b), we have

where the last inequality is obtained using the fact that

Taking expectation from both sides of (G) yields

We next bound the moments of XX, YY, and ZZ, condition on Fk+1t\mathcal{F}_{k+1}^{t}. First, recall the Cauchy-Schwarz inequality

and hence, by using Lemma 4.3 along with the tower rule, we have

Regarding YY, note that by using Cauchy-Schwarz inequality (similar to what we did above) along with smoothness of FiF_{i}, we obtain

Again, taking expectation and using the fact that Ak\mathcal{A}_{k} is chosen uniformly at random, implies

where the last step follows from (58b) in Corollary F.2 along with the fact that t≤τ−1t\leq\tau-1.

Regarding ZZ, first recall that if we have nn numbers a1,...,ana_{1},...,a_{n} with mean μ=1/n∑i=1nai\mu=1/n\sum_{i=1}^{n}a_{i} and variance σ2=1/n∑i=1n∣ai−μ∣2\sigma^{2}=1/n\sum_{i=1}^{n}|a_{i}-\mu|^{2} , and we take a subset of them {ai}i∈A\{a_{i}\}_{i\in\mathcal{A}} with size ∣A∣=rn|\mathcal{A}|=rn by sampling without replacement, then we have

and hence, by taking expectation from both sides and using the tower rule along with (58b) in Corollary F.2, we obtain

Next, note that by using Cauchy-Schwarz inequality (88), with ai=(∇Fi(wk+1,t)−∇Fi(wˉk+1,t))/rna_{i}=\left(\nabla F_{i}(w_{k+1,t})-\nabla F_{i}(\bar{w}_{k+1,t})\right)/\sqrt{rn} and bi=1/rnb_{i}=1/\sqrt{rn}, we have

where the last inequality is obtained using smoothness of FiF_{i} (Lemma 4.2). Now, taking expectation from both sides and using (95) yields

Now, getting back to (G), we first lower bound the term

where the last inequality is obtained using the fact that

Now, we bound terms in (98) separately. First, note that by tower rule we have

where the last equality is obtained using the fact that Ak\mathcal{A}_{k} is chosen uniformly at random, and thus,

where the last inequality follows from Lemma 4.3. Third, note that by Cauchy-Schwarz inequality,

where second inequality is obtained using (92) and (97). Plugging (99), (100), and (101) in (98) implies

Next, we characterize an upper bound for the other term in (G):

and thus, by (101) along with (90), we have

the last inequality is obtained using β≤1/(10τLF)\beta\leq 1/(10\tau L_{F}). Summing up (G) for all t=0,...,τ−1t=0,...,\tau-1, we obtain

where we used the fact that wˉk+1,τ=wk+1\bar{w}_{k+1,\tau}=w_{k+1}. Finally, summing up (109) for k=0,...,K−1k=0,...,K-1 implies

As stated in Remark 4.8, we could easily extend our analysis to the case with diminishing stepsize. In particular, by using βk\beta_{k} as the stepsize at iteration kk, the descent result (109) holds with β=βk\beta=\beta_{k}. Hence, summing up this equation for k=0,...,K−1k=0,...,K-1, we recover the same complexity bounds using βk=O(1/τk)\beta_{k}=\mathcal{O}(1/\sqrt{\tau k}).

Appendix H On First-Order Approximations of Per-FedAvg

As we stated previously, the Per-FedAvg method, same as MAML, requires computing Hessian-vector product which is computationally costly in some applications. As a result, one may consider using the first-order approximation of the update rule for the Per-FedAvg algorithm. The main goal of this section is to show how our analysis can be extended to the case that we either drop the second-order term or approximate the Hessian-vector product using first-order techniques.

This approach is known as First-Order MAML (FO-MAML), and it has been shown that it performs relatively well in many cases . In particular, characterized the convergence properties of FO-MAML for the centralized MAML problem. Next, we characterize the mean and variance of this gradient approximation.

where the first term follows from (33) in the proof of Lemma 4.3 in Appendix D, and the second term is obtained using

where the first inequality follows from the matrix norm definition and the last inequality is obtained using Assumption 2.

We bound these two terms separately. Note that we have already bounded the first term in Appendix D (see (36)), and we have

Plugging (118) and (116) into (117), we obtain the desired result. ∎

∙\bullet Estimating Hessian-vector product using gradient differences: In the context of MAML problem, it has been shown that the update of FO-MAML leads to an additive error that does not vanish as time progresses. To resolve this matter, introduced another variant of MAML, called HF-MAML, which approximates the Hessian-vector product by gradient differences. More formally, the idea behind their method is that for any function gg, the product of the Hessian ∇2g(w)\nabla^{2}g(w) by any vector vv can be approximated by

For this approximation, we have the following result, which shows that we have an additional degree of freedom (δ\delta) to control the error term that does not decreased with increasing batch sizes.

We again bound both terms separately. To simplify the notation, let us define

First, note that, using (a+b+c)2≤3(a2+b2+c2)(a+b+c)^{2}\leq 3(a^{2}+b^{2}+c^{2}) for a,b,c≥0a,b,c\geq 0, we have

Taking expectation from both sides, along with using (118), we have

where (127) is obtained using the fact that D′′\mathcal{D}^{\prime\prime} is independent from D\mathcal{D} and D′\mathcal{D}^{\prime} which implies

Plugging this bound into (127) and using (117) implies

where the last inequality is obtained using αL≤1\alpha L\leq 1.

Bounding the second term in (124) is more straightforward as we have

Plugging (128) and (129) into (124) gives us the desired result. ∎

Appendix I More on Numerical Experiments

In this section, we discuss our further results on numerical experiments. We thank the anonymous reviewers for their suggestions on adding this results, and we are looking forward to further explore our method from numerical point of view in future works.

First, in Table 2. we provide an illustration of the numerical setting in Section 5.

Second, in Figure 1(a), we illustrate the average test accuracy of all studied algorithms with respect to time. As this figure shows, Per-FedAvg (HF) achieves higher level of accuracy compared to the regular Fed-Avg with local updates within the same computation time.

Third, we also compare our method with ARUBA . To do so, we also report the output of FedAvg+ARUBA after refinement for each user. In particular, we consider τ=4\tau=4 and K=1000K=1000, and also tune hyper-parameters of ARUBA for a fair comparison. The final accuracy of all algorithms is as follows: Per-FedAvg(FO): 34.04±0.0834.04\pm 0.08, Fed-Avg+ARUBA (with refinement): 36.74±0.136.74\pm 0.1, Per-FedAvg(HF): 43.73±0.1143.73\pm 0.11. In Figure 1(b), we have also depicted one realization of training path, just to provide intuition on the convergence speed of these methods.