A DAPTIVE C LIENT S AMPLING IN F EDERATED L EARNING VIA O NLINE L EARNING WITH B ANDIT F EEDBACK
Anonymous authors
Paper under double-blind review
A BSTRACT
Due to the high cost of communication, federated learning (FL) systems need to sample a subset of clients that are involved in each round of training.
As a result, client sampling plays an important role in FL systems as it affects the convergence rate of optimization algorithms used to train machine learning models.
Despite its importance, there is limited work on how to sample clients effectively.
In this paper, we cast client sampling as an online learning task with bandit feedback, which we solve with an online stochastic mirror descent (OSMD) algorithm designed to minimize the sampling variance.
We then theoretically show how our sampling method can improve the convergence speed of optimization algorithms.
To handle the tuning parameters in OSMD that depend on the unknown problem parameters, we use the online ensemble method and doubling trick.
We prove a dynamic regret bound relative to any sampling sequence.
The regret bound depends on the total variation of the comparator sequence, which naturally captures the intrinsic difficulty of the problem.
To the best of our knowledge, these theoretical contributions are new and the proof technique is of independent interest.
Through both synthetic and real data experiments, we illustrate advantages of the proposed client sampling algorithm over the widely used uniform sampling and existing online learning based sampling strategies.
The proposed adaptive sampling procedure is applicable beyond the FL problem studied here and can be used to improve the performance of stochastic optimization procedures such as stochastic gradient descent and stochastic coordinate descent.
I NTRODUCTION
Modern edge devices, such as personal mobile phones, wearable devices, and sensor systems in vehicles, collect large amounts of data that are valuable for training of machine learning models.
If each device only uses its local data to train a model, the resulting generalization performance will be limited due to the number of available samples on each device.
Traditional approaches where data are transferred to a central server, which trains a model based on all available data, have fallen out of fashion due to privacy concerns and high communication costs.
Federated Learning (FL) has emerged as a paradigm that allows for collaboration between different devices (clients) to train a global model while keeping data locally and only exchanging model updates (McMahan et al., 2017).
In a typical FL process, we have clients that contain data and a central server that orchestrates the training process (Kairouz et al., 2021).
The following process is repeated until the model is trained: (i) the server selects a subset of available clients; (ii) the server broadcasts the current model parameters and sometimes also a training program (e.g., a Tensorflow graph (Abadi et al., 2016)); (iii) the selected clients make updates to the model parameters based on their local data; (iv) the local model updates are uploaded to the server; (v) the server aggregates the local updates and makes a global update of the shared model.
In this paper, we focus on the first step and develop a practical strategy for selecting clients with provable guarantees.
To train a machine learning model in a FL setting with M clients, we would like to minimize the following objective:
[Equation]
where ϕ ( w ; D m ) is the loss function used to assess the quality of a machine learning model parameterized by the vector w based on the local data D m on the client m ∈
[ M ] .
The parameter λ m denotes the weight for client m .
Typically, we have λ m = n m /n , where n m =
|D m | is the number of samples on the client m , and the total number of samples is n = (cid:80)
Mm =1 n m .
At the beginning of the t -th communication round, the server uses the sampling distribution p t =
( p t 1 , . .
. , p tM )
⊤ to choose K clients by sampling with replacement from [ M ] 2 .
Let S t ⊆
[ M ] denote the set of chosen clients with | S t | =
K .
The server transmits the current model parameter vector w t to each client m ∈ S t .
The client m computes the local update g tm and sends it back to the server.
3 After receiving local updates from clients in S t , the server constructs a stochastic estimate of the global gradient as
[Equation]
and makes the global update of the parameter w t using g t .
For example, w t +1 =
w t − µ t g t , if the server is using stochastic gradient descent (SGD) with the stepsize sequence { µ t } t ≥ 1 (Bottou et al., 2018).
However, the global update can be obtained using other procedures as well.
The sampling distribution in FL is typically uniform over clients, p t = p unif = (1 /M, . . .
, 1 /M )
⊤ .
However, nonuniform sampling (also called importance sampling) can lead to faster convergence, both in theory and practice, as has been illustrated in stochastic optimization (Zhao & Zhang, 2015;
Needell et al., 2016).
While the sampling distribution can be designed based on prior knowledge (Zhao & Zhang, 2015; Johnson & Guestrin, 2018; Needell et al., 2016; Stich et al., 2017), we cast the problem of choosing the sampling distribution as an online learning task and need no prior knowledge about equation 1.
Existing approaches to designing a sampling distribution using online learning focus on estimation of the best sampling distribution under the assumption that it does not change during the training process.
However, the best sampling distribution changes with iterations during the training process, and the target stationary distribution does not capture the best sampling distribution in each round.
In the existing literature, the best fixed distribution in hindsight is used as the comparator to measure the performance of the algorithm used to design the sampling distribution.
Here, we focus on measuring the performance of the proposed algorithm against the best dynamic sampling distribution.
We use an online stochastic mirror descent (OSMD) algorithm to generate a sequence of sampling distributions and prove a regret bound relative to any dynamic comparators that involve a total variation term that characterizes the intrinsic difficulty of the problem.
To the best of our knowledge, this is the first bound on the dynamic regret with intrinsic difficulty characterization in importance sampling.
Moreover, we theoretically show how our sampling method improves the convergence guarantee of optimization method by reducing the dependency on the heterogeneity of the problem.
1. C ONTRIBUTIONS
We develop an algorithm based on OSMD that generates a sequence of sampling distributions { p t } t ≥ 1 based on the partial feedback available to the server from the sampled clients.
We prove a bound on regret relative to the any dynamic comparators, which allows us to consider the best sequence of sampling distributions as they change over iterations.
The bound includes a total variation this term that characterizes the intrinsic difficulty of the problem by capturing the difficulty of following the best sequence of distributions.
Such a characterization of problem difficulty is novel.
Besides, our theoretical result can recover the results in previous research as special cases and is thus strictly more general.
Moreover, we theoretically improve the convergence guarantee of optimization algorithm by using our sampling scheme over uniform sampling.
We show that adaptive sampling can help reduce the dependency on the heterogeneity level of the problem.
We also mkae contributions in experiments and practical parameter tuning strategy.
See Appendix A.1 for more detailed discussion of our contributions.
1. R ELATED WORK
Our paper is related to client sampling in FL, importance sampling in stochastic optimization, and online convex optimization.
We summarize only the most relevant literature, without attempting to provide an extensive survey.
Due to space limit, we only summarize the first direction here, and leave the discussion about importance sampling in stochastic optimization and online convex optimization in Appendix B.
For client sampling, Chen et al.
(2020) proposed to use the theoretically optimal sampling distribution to choose clients.
However, their method requires all clients to compute local updates in each round, which is impractical due to stragglers.
Ribero & Vikalo (2020) modelled the parameters of the model during training by an Ornstein-Uhlenbeck process, which was then used to derive an optimal sampling distribution.
Cho et al.
(2020b) developed a biased client selection strategy and analyzed its convergence property.
As a result, the algorithm has a non-vanishing bias and is not guaranteed to converge to optimum.
Moreover, it needs to involve more clients than our method and is thus communication and computational more expensive.
Kim et al.
Cho et al.
(2020a);
Yang et al.
(2020) considered client sampling as a multi-armed bandit problem, but provided only limited theoretical results.
Wang et al.
(2020) used reinforcement learning for client sampling with the objective of maximizing accuracy, while minimizing the number of communication rounds.
1. N OTATION
Let R M
+
=
[0 , ∞ )
M and R M ++ = (0 , ∞ ) M .
For M ∈ N + , let P M − 1 :=
{ x ∈ R M : (cid:80) Mi
=1 x i = 1 } be the ( M − 1) -dimensional
probability simplex.
We use p =
( p 1 , . . .
, p M ) ⊤ to denote a sampling distribution with support on [ M ] := { 1 , . . .
, M } .
We use p 1: T to denote a sequence of sampling distributions { p t } Tt =1 .
Let Φ : D ⊆ R M (cid:55)→ R be a differentiable convex function defined on D , where D is a convex open set, and we use ¯ D to denote the closure of D .
The Bregman divergence between any x, y ∈ D with respect to the function Φ is given as D Φ ( x ∥ y ) =
Φ( x ) − Φ( y ) − ⟨∇
Φ( y ) , x − y ⟩ .
The unnormalized negative entropy is denoted as Φ e ( x ) = (cid:80)
Mm =1 x m log x m − (cid:80)
Mm =1 x m , x = ( x 1 , . . .
, x M ) ⊤ ∈ D
= R M
+ , with 0 log 0 defined as 0 .
We use ∥ · ∥ p to denote the L p -norm for 1 ≤ p ≤ ∞ .
For x ∈ R n , we have ∥ x
∥ p = ( (cid:80) n i =1 x p i ) 1 /p
when 1 < p < ∞ , ∥ x ∥ 1 = (cid:80) ni
=1 | x i | , and ∥ x ∥ ∞ = max 1 ≤ i ≤ n | x i | .
Given any L p -norm ∥ · ∥ , we define its dual norm as ∥ z ∥ ⋆ := sup { z ⊤ x : ∥ x ∥ ≤ 1 } .
For two sequences { a n } and { b n } , we use a n = O ( b n ) or a n ≲ b n if there exists C > 0 such that | a n /b n | ≤ C for all n large enough; a n = Θ( b n ) if a n = O ( b n ) and b n =
O ( a n ) simultaneously.
Similarly, a n = ˜ O ( b n ) if a n = O ( b n log k b n ) for some k ≥ 0 ; a n = ˜Θ( b n ) if a n = ˜
O ( b n ) and b n = ˜ O ( a n ) simultaneously.
1. O RGANIZATION OF THE PAPER
We motivate importance sampling in FL, introduce an adaptive client sampling algorithm, and establish a bound on the dynamic regret in Section 2.
We derive optimization guarantee of mini-batch
SGD using our sampling scheme in Section 3.
Due to space limit, we leave additional contents in appendix.
More specifically, we give additional related work summary in Appendix B. In Appendix C.3 and Appendix C.4, we design two extensions to the sampling algorithm that make it adaptive to the unknown problem parameters.
We leave detailed algorithm descriptions and theoretical properties of adaptive methods in Appendix C.
We provide the experimental results on synthetic data in Appendix F and real-world data in Appendix G.
Sampling without replacement is discussed in Appendix C.5 and Appendix F.4.
Finally, we give conclusions and discussions about future directions in Appendix H.
A DAPTIVE CLIENT SAMPLING
We show how to cast the client sampling problem as an online learning task.
Subsequently, we solve the online learning problem using OSMD algorithm and provide a regret analysis for it.
2. C LIENT SAMPLING AS AN ONLINE LEARNING PROBLEM
Recall that at the beginning of the t -th communication round, the server uses a sampling distribution p t to choose a set of clients S t , by sampling with replacement K clients from [ M ] , to update the parameter vector w t .
For a chosen client m ∈ S t , the local update is denoted as g tm .
For example, the local update g tm = ∇ ϕ ( w t ; D m ) may be the full gradient; when mini-batch SGD/FedSGD is used, then g tm = (1 /B ) (cid:80)
Bb =1 ∇ ϕ ( w t ; ξ tm,b ) , where ξ tm,b i.i.d.
∼ D m and B is the batch size; when FedAvg is used, then g tm = ( w tm,B − w t ) /η local , where w tm,b = w tm,b − 1 − η local ∇ f (cid:16) w t m,b − 1 ; ξ t m,b − 1 (cid:17) , b ∈ [ B ] , w tm, 0 = w t , ξ tm,b i.i.d.
∼ D m , and η local is the local stepsize.
We define the aggregated oracle update at the t -th communication round as
[Equation]
The oracle update J t is constructed only for theoretical purposes and is not computed in practice.
The stochastic estimate g t , defined in equation 2, is an unbiased estimate of J t , that is, E S t [ g t ] =
J t .
Note that we only consider the randomness of S t and treat g tm as given.
4 The variance of g t is
[Equation]
Our goal is to design the sampling distribution p t , used to sample S t , so to minimize the variance in equation 3.
In doing so, we can ignore the second term as it is independent of p t .
Let a tm = λ 2 m ∥ g tm ∥ 2 .
For any sampling distribution q = ( q 1 , . . .
, q M ) ⊤ , the variance reduction loss 5 is defined as
[Equation]
Given a sequence of sampling distributions q 1: T , the cumulative variance reduction loss is defined as L ( q 1: T ) :
= (cid:80) Tt =
1 l t ( q t ) .
When the choice of q 1: T is random, the expected cumulative variance reduction loss is defined as ¯ L ( q 1: T ) :
= E (cid:2) L ( q 1: T ) (cid:3) .
The variance reduction loss appears in the bound on the sub-optimality of a stochastic optimization algorithm.
As a motivating example, suppose F ( · ) in equation 1 is σ -strongly convex.
Furthermore, suppose the local update g tm = ∇ ϕ ( w t ; D m ) is the full gradient of the local loss and the global update is made by SGD with stepsize µ t
= 2 / ( σt ) .
Theorem 3 of Salehi et al.
(2017) then states that for any T ≥ 1 :
[Equation]
where w ⋆ is the minimizer of the objective in equation 1.
Therefore, by choosing the sequence of sampling distributions p 1: T to make the ¯ L ( p 1: T ) small, one can achieve faster convergence.
This observation holds in other stochastic optimization problems as well.
We develop an algorithm that creates a sequence of sampling distributions p 1: T to minimize ¯ L ( p 1: T ) using only the norm of local updates, and without imposing assumptions on the loss functions or how the local and global updates are made.
As a result, the algorithm can be applied to design sampling distributions for essentially any stochastic optimization procedure.
In Section 3, we show how our sampling method improves the upper bound of mini-batch SGD of non-convex objectives.
Suppose that at the beginning of the t -th communication round we know all { a tm } Mm =1 .
Then the optimal sampling distribution
[Equation]
is obtained as p t⋆,m =
(cid:112) a tm / ( (cid:80) Mm =1 (cid:112) a tm ) .
Computing the distribution p t⋆ is impractical as it requires local updates of all clients, which eradicates the need for client sampling.
From the form of p t⋆ , we observe that clients with a large a tm are more “important” and should have a higher probability of being selected.
Since we do not know { a tm } Mm =1 , we will need to explore the environment to learn about the importance of clients before we can exploit the best strategy.
Finally, we note that the relative importance of clients will change over time, which makes the environment dynamic and challenging.
Based on the above discussion, we cast the problem of creating a sequence of sampling distributions as an online learning task with bandit feedback, where a game is played between the server and environment.
Let p 1 be the initial sampling distribution.
At the beginning of iteration t , the server samples with replacement K clients from [ M ] , denoted S t , using p t .
The environment reveals { a tm } m ∈ S t to the server, where a tm =
[Equation]
The environment also computes l t ( p t ) ; however, this loss is not revealed to the server.
The server then updates p t +1 based on the feedback {{ a um } m ∈ S u } tu =1 and sampling distributions { p u } tu =1 .
Note that in this game, the server only gets information about the chosen clients and, based on this partial information, or bandit feedback, needs to update the sampling distribution.
On the other hand, we would like to be competitive with an oracle that can calculate the cumulative variance reduction loss.
We will design p t in a way that is agnostic to the generation mechanism of { a t } t ≥ 1 , and will treat the environment as deterministic, with randomness coming only from { S t } t ≥ 1 .
We describe an OSMD-based approach to solve this online learning problem.
2. OSMD S AMPLER
The variance-reduction loss function l t is a convex function on P M − 1 and
[Equation]
for all q = ( q 1 , . . .
, q M ) ⊤ ∈ R M
++ .
Since we do not observe a t , we cannot compute l t ( · ) or ∇ l t ( · ) .
Instead, we can construct unbiased estimates of them.
For any q ∈ P M − 1 , let ˆ l t ( q ; p t ) be an estimate of l t ( q ) defined as
[Equation]
and ∇ ˆ l t ( q ; p t )
∈
R M has the m -th entry defined as
[Equation]
The set S t is sampled with replacement from [ M ] using p t and N { m ∈ S t } denote the number of times that a client m is chosen in S t .
Thus, 0 ≤ N { m ∈ S t } ≤ K .
Given q and p t , ˆ l t ( q ; p t ) and ∇ ˆ l t ( q ; p t ) are random variables in R and R M that satisfy
[Equation]
When S t and p t ∈ R M ++ are given, ˆ l t ( q ; p t ) is a convex function with respect to q on R M ++ and satisfies ˆ l t ( q ; p t ) − ˆ l t ( q ′ ; p t ) ≤ ⟨∇
ˆ l t ( q ; p t ) , q − q ′ ⟩ , for q, q ′ ∈ R M ++ .
The constructed estimates ˆ l t ( q ; p t ) and ∇ ˆ l t ( q ; p t ) are crucial for designing updates to the sampling distribution.
To the best of our knowledge, while similar estimators as ˆ l t ( q ; p t ) in equation 6 was used in previous literature (Borsos et al., 2018), we are the first one to propose ∇ ˆ l t ( q ; p t ) in equation 7 and use it for updating sampling distribution.
OSMD Sampler is an online stochastic mirror descent algorithm for updating the sampling distribution, detailed in Algorithm 1.
The sampling distribution is restricted to lie in the space
A = P M − 1 ∩ [ α/M, ∞ ) M , α ∈ (0 , 1] , to prevent the server from assigning small probabilities to devices.
Let Φ : D ⊆ R M (cid:55)→ R be a continuously differentiable convex function defined on D , with A ⊆ ¯ D .
The learning rates { η t } t ≥ 1 are positive and nonincreasing.
6 Line 7 of Algorithmprovides an update to the sampling distribution using the mirror descent update.
The available feedback is used to construct an estimate of the loss, while the Bregman divergence between the current and next sampling distribution is used as a regularizer, ensuring that the updated sampling distribution does not change too much.
The update only uses the most recent information, while forgetting the history, which results in nonstationarity of the sequence of sampling distributions.
In Line 5 of
Algorithm 1, we choose S t by sampling with replacement.
In Section C.5, we discuss how to extend the results to sampling without replacement.
The mirror descent update in Line 7 is not available in a closed form in general and an iterative solver may be needed.
However, when Φ( · ) is chosen as the negative entropy Φ e ( · ) (we use this as our default choice), a closed-form efficient solution can be obtained.
An efficient implementation is shown in Algorithm 2 in Appendix C.1.
The main cost comes from sorting the sequence { ˜ p t +1 m } Mm =1 , which can be done with the computational complexity of O ( M log M ) .
However, note that we only update a few entries of p t to get ˜ p t +1 and p t is sorted.
Therefore, most entries of ˜ p t +1 are also sorted.
Using this observation, we can usually achieve a much faster running time, for example, by using an adaptive sorting algorithm
(Estivill-Castro & Wood, 1992).
Next, we provide a bound on the dynamic regret for OSMD Sampler.
2. D YNAMIC REGRET OF OSMD S AMPLER
We first describe the dynamic regret used to measure the performance of an online algorithm that generates a sequence of sampling distributions { ˆ p } t ≥ 1 in a non-stationary environment.
Given any comparator sequence q 1: T ∈ P TM − 1 , the dynamic regret is defined as
[Equation]
In contrast, the static regret measures the performance of an algorithm relative to the best fixed sampling distribution, that is, it restricts q 1 = · · · = q T (Namkoong et al., 2017; Salehi et al., 2017;
Borsos et al., 2018; 2019).
When using a fixed comparator q 1 = · · · = q T
=
q , we write the regret as D-Regret T ( q ) ; besides, we write D-Regret T to denote D-Regret T ( p 1: T ⋆ ) .
The following quantity describes the dynamic complexity of a comparator sequence and will appear in the regret bound below.
Definition 2.1 (Total Variation) .
The total variation of a comparator sequence q 1: T with respect to the norm ∥ · ∥ on R M is TV (cid:0) q 1: T (cid:1)
=
(cid:80) T − 1 t =1 ∥ q t +1 − q t ∥ .
The total variation measures how variable a sequence is.
The larger the total variation TV ( q 1: T ) , the more variable q 1: T is, and such a comparator sequence is harder to match.
To give an upper bound on the dynamic regret of OSMD Sampler, we need the following assumptions.
Assumption 1.
The function Φ( · ) is ρ -strongly convex, ρ > 0 with respect to ∥ · ∥ :
[Equation]
Assumption 2.
There exist positive functions H ( M, α ) , { Q t ( M, α ) } t ≥ 1 , and D max ( M, α ) , such that ∥∇ Φ( p ) ∥
⋆ ≤ H ( M, α ) , ∥∇ ˆ l t ( p ; q ) ∥
⋆ ≤ Q t ( M, α ) almost surely, and D Φ ( q ∥ p unif ) ≤
D max ( M, α ) for all p, q ∈ A .
These assumptions are standard in the literature (Hall & Willett, 2015).
When we choose Φ = Φ e and ∥ · ∥ = ∥ · ∥ 1 , these assumptions hold (See Appendix D.3).
Under Assumption 1, we have
D Φ ( x ∥ y ) ≥ ( ρ 2 / 2) ∥ x − y ∥ 2 .
To simplify the notation, we will omit M and α from H , { Q t } t ≥ 1 , and D max .
We also need the following quantities that quantify how far q t is from A .
Given q t ∈
P M − 1 and α ∈ (0 , 1] , let
[Equation]
α ) :=
[Equation]
We will use these quantities to characterize the projection error in the following theorem, which is the main result of this section.
Theorem 1.
Suppose Assumptions 1-2 hold and we use ∥ · ∥ = ∥ · ∥ 1 to define the total variation.
Assume that { η t } t ≥ 1 is a nonincreasing sequence.
Let ˆ p 1: T be a sequence generated by Algorithm 1.
For any comparator sequence q 1: T , where q t is allowed to be deterministic or random, we have
D
[Equation]
Error .
Proof.
The major challenge of the proof is to construct a projection of the comparator sequence q 1: T onto A T and bound the projection error.
To the best of our knowledge, this bound on the projection error of a dynamic sequence is novel.
Another challenge is to deal with the dynamic comparator, which requires us to connect the cumulative regret with the total variation of the comparator sequence.
See Appendix D.2 for more details.
From Theorem 1, we see that the bound on the dynamic regret consists of two parts.
The first part is the intrinsic regret, quantifying the difficulty of tracking a comparator sequence in A T ; the second part is the projection error, arising from projecting the comparator sequence onto A T .
Note that the intrinsic regret depends on α through D max , H , and { Q t } t ≥ 1 .
As shown in Appendix D.2, we have 0 ≤ ω ( q t , α ) ≤ 1 for all α ∈ [0 , 1] , which implies that ϕ ( q t , α ) ≤ M/α .
Furthermore, ψ ( q t , α ) ≤ (cid:80)
Mm =1 ( α/M ) 1 { q tm < ( α/M ) } ≤ α.
Therefore, the projection error can be upper bounded by (8 Hα ) /η
T +( M/α ) (cid:80) Tt =
1 l t ( q t ) .
More importantly, when q tm ∈ A , we have ψ ( q t , α ) = ω ( q t , α ) =
ϕ ( q t , α ) = 0 .
Thus, when the comparator sequence belongs to A T , the projection error vanishes and we only have the intrinsic regret.
As α decreases from one to zero, the intrinsic regret gets larger (it often tends to infinity as shown in Corollary 3), while we are allowing a larger class of comparator sequences; on the other hand, the projection error decreases to zero, since the gap between A and
P M − 1 vanishes with α .
An optimal choice of α balances the two sources of regret.
When ∥ · ∥ = ∥ · ∥ 1 and Φ is the unnormalized negative entropy, the Step 7 of Algorithm 1 has a closed-form solution (see Proposition 1).
By Pinsker’s inequality, the unnormalized negative entropy Φ e ( x ) is 1 -strongly convex on P M − 1 with respect to ∥ · ∥ 1 .
When q 1: T is a deterministic sequence, we have E (cid:2) TV
[Equation]
= TV
[Equation] [Equation]
With Theorem 1, we have the following corollary.
Corollary 1.
Suppose conditions of Theorem 1 hold and let ˆ p 1: T be the sequence generated by
Algorithm 1.
For any comparator sequence q 1: T , we choose α such that q t ∈ A for all t ∈
[ T ] .
Let
[Equation]
Then
[Equation]
where ¯ a t := max 1 ≤ m ≤ M λ 2 m ∥ g tm ∥ 2 = max 1 ≤ m ≤ M a tm for all t ∈
[ T ] .
Proof.
The proof follows directly from Corollary 3 in Appendix D.3.
Note that as the training proceeds, the norms of local updates are decreasing, thus { ¯ a t } Tt =1 is typically a decreasing sequence.
Thus, a naive upper bound is (cid:80) Tt =1 E
[(¯ a t ) 2 ]
= O ( T ) .
However, in Appendix F.6, we empirically show that ¯ a t decreases fast and the cumulative square sum of this sequence will converge to a constant, that is, (cid:80)
Tt =1 E
[(¯ a t ) 2 ]
= O (1) .
This result further implies that the static regret with respect to the best fixed sampling distribution in hindsight (where
TV ( q 1: T ) = 0 ) is empirically O (1) , which is much better than the rates in previous research (Salehi et al., 2017; Borsos et al., 2018).
Besides, our regret analysis also allows for sampling distributions that change over time (where TV ( q 1: T ) > 0 ), and thus is more general than previous results.
The choice of learning rate in equation 10 depends on unknown quantities prior to training, and is thus impractical.
In Appendix C.3 and Appendix C.4, we introduce practical automatic parameter tuning strategies with the help of online ensemble method and doubling trick.
C ONVERGENCE A NALYSIS OF M INI - BATCH SGD WITH OSMD S AMPLER
We illustrate how OSMD Sampler can be used to provably improve the convergence rate of the minibatch SGD.
The detailed algorithm is given in Algorithm 3 in Appendix C.2.
We use mini-batch
SGD as a motivating example to show how adaptive sampling improves the convergence guarantee of an optimization algorithm.
The analysis in this section can be extended to other optimization algorithms as well.
To simplify the notation, we denote F m ( w ) :
= ϕ ( w ; D m ) and let λ m = 1 /M for all m ∈
[ M ] .
We assume that w ∈ W ⊂ R d , where W is a compact set.
Besides, we assume that client objectives are differentiable and L -smooth functions.
Assumption 3.
For all m ∈ [ M ] , F m ( · ) is differentiable and L -smooth, that is,
[Equation]
Note that we allow F m ( · ) to be non-convex.
We also assume that the objective function F ( · ) is lower-bounded, that is, we assume that F ⋆ := inf w ∈W F ( w ) >
−∞ .
In addition, we make the following assumption about the local stochastic gradient.
Assumption 4.
For all w ∈ W and m ∈ [ M ] , we have E ξ ∼D m [ ∇ ϕ ( w ; ξ )]
= ∇ F m ( w ) and
E
[Equation]
Next
[Equation]
we introduce quantities that characterize heterogeneity of the optimization problem.
Specifically, heterogeneity characterizes how objective functions of different clients differ from each other
[Equation]
In a federated learning problem
[Equation]
heterogeneity can be large and it is important to understand its effect on the convergence of algorithms.
The following three quantities characterize the heterogeneity:
[Equation]
By Jensen’s inequality we have that ζ 0 ≥ ζ 1 ≥ ζ
and we assume that ζ 0 < ∞ .
The quantity ζ 0 has been commonly used to quantify first-order heterogeneity (Karimireddy et al., 2020a;b), while ζand ζ 2 are variants of ζ 0 corresponding to different sampling schemes.
More specifically, when we use q ⋆ and p 1: T ⋆ to sample clients, we will have the heterogeneity level to be ζ 1 and ζ 2 respectively, where q ⋆ = arg min p ∈P M − 1 sup w ∈W (cid:80) Mm =1 (1 /p m ) ∥∇ F m ( w ) ∥ 2 is the best fixed sampling distribution.
Finally, the following quantities are useful in stating the convergence guarantee.
Recall that
B is the local batch size in Algorithm 3 and K = | S t | .
Let D F :=
F ( w 0 ) − F ⋆ ,
[Equation]
We are now ready to give the convergence guarantee of Algorithm 3.
Theorem 2.
Assume Assumption 3 and Assumption 4 hold.
Let µ t = µ ,
t ∈
[ T ] , where µ is given in equation 33 in Appendix.
Let { w 0 , . . .
, w T − 1 } be the sequence of iterates generated by
Algorithm 3 and let w R denote an element of that sequence chosen uniformly at random.
When q ⋆ ∈
A , we have E (cid:104)(cid:13)(cid:13) ∇ F ( w R ) (cid:13)(cid:13) 2 (cid:105) ≲ R 1 ; when p t⋆ ∈ A for all t ∈ [ T ] , we have E (cid:104)(cid:13)(cid:13) ∇ F ( w R ) (cid:13)(cid:13) 2 (cid:105)
≲
R 2 ; when q ⋆ ∈ A and p t
⋆ ∈
A both hold, we have E (cid:104) (cid:13)(cid:13) ∇ F ( w R ) (cid:13)(cid:13)
[Equation]
See proof in Appendix D.6.
We derive different convergence rates R 1 and R 2 in Theorem 2 by choosing different comparators.
More specifically, R 1 is derived by comparing against q ⋆ and Ris derived by comparing against p 1: T ⋆ .
The different notions of heterogeneity reveal the fact that different sampling schemes can change the convergence speed of optimization algorithms through the change of heterogeneity level.
Note that R 0 is the rate of mini-batch SGD under uniform sampling (Ghadimi & Lan, 2013).
OSMD
Sampler can obtain tighter rates than uniform sampling when R 1 or R 2 are smaller than R 0 .
To have R 1 ≲ R 0 , we need ( σ/ √ KB )
(1 / √ α − 1) + (cid:112) D-Regret T ( q ⋆ ) /T
≲ (1 / √ K )( ζ 0 − ζ 1 ) .
By
Corollary 1, we have a worst-case upper bound of D-Regret T ( q ⋆ ) as O ( √ T ) ; empirical evidence in
Appendix F.6 suggests tighter rates O (1) .
With either rates, we always have D-Regret T ( q ⋆ ) /T
=
o (1) .
Thus, to have R 1 ≲ R 0 , we only need ( σ/ √ B )(1 / √ α − 1) ≪ ζ 0 − ζ 1 asymptotically.
That is, we want the gap between the heterogeneity under best fixed sampling distribution and uniform sampling to be large, compared to ( σ/ √ B )(1 / √ α − 1) , which is always true when we use full local gradient, i.e., when σ = 0 .
Similar arguments apply to when R 2 ≲ R 0 .
See a more detailed discussion in Appendix A.2.
A M ORE DISCUSSIONS
In this section, we include additional discussions that is omitted from the main text due to space limit.
A. D ETAILED DISCUSSION ABOUT CONTRIBUTIONS
We develop an algorithm based on OSMD that generates a sequence of sampling distributions { p t } t ≥ 1 based on the partial feedback available to the server from the sampled clients.
We prove a bound on regret relative to the any dynamic comparators, which allows us to consider the best sequence of sampling distributions as they change over iterations.
The bound includes a total variation term that characterizes the intrinsic difficulty of the problem by capturing the difficulty of following the best sequence of distributions.
Such a characterization of problem difficulty is novel.
Besides, our theoretical result can recover the results in previous research as special cases and is thus strictly more general.
Moreover, we theoretically improve the convergence guarantee of optimization algorithm by using our sampling scheme over uniform sampling.
We show that adaptive sampling can help reduce the dependency on the heterogeneity level of the problem.
We demonstrate the empirical superiority of the proposed algorithm through synthetic and real data experiments.
In addition to client sampling in FL, our proposed algorithm will have a broad impact on stochastic optimization.
Adapting our algorithm to any stochastic optimization procedure that chooses samples, such as SGD, or coordinates, such as Stochastic Coordinate Descent, may improve their performance.
For example, Zhao et al.
(2022) illustrated the practical benefits of our algorithm to speed up L-SVRG and L-Katyusha.
The learning rate of the proposed algorithm depends on the total variation of the comparator sequence, which is generally unknown.
Furthermore, it also depends on the total number of iterations that can also be unknown.
In appendix, we make the algorithm practical by addressing a few technical challenges.
In particular, we adapt the follow-the-regularized-leader algorithm and doubling trick to automatically choose the learning rate that performs as well as the best learning rate asymptotically.
A. D ETAILED DISCUSSION ABOUT T HEOREM
We derive different convergence rates R 1 and R 2 in Theorem 2 by choosing different comparators, which rates can be applied shall depend on the tuning parameter α (or equivalently the space A ).
More specifically, R 1 is derived by comparing against q ⋆ and R 2 is derived by comparing against p 1: T ⋆ .
The different notions of heterogeneity reveals the fact that different sampling schemes can change the convergence speed of optimization algorithms through the change of heterogeneity level.
It is worth noting that one can always choose other comparator sequences besides these two and derived new upper bounds.
When choosing a more flexible comparator, one can obtain a smaller heterogeneity, but risk requiring higher regret and larger space A (which will require smaller α ).
A good choice of comparator should keep a trade-off between these two concerns.
We leave how to choose the optimal comparator sequence as a future research direction.
Note that R 0 is the rate of mini-batch SGD under uniform sampling (Ghadimi & Lan, 2013).
To see when OSMD Sampler can obtain tighter rates than uniform sampling, we only need R 1 or R 2 to be smaller than R 0 .
When will R 1 ≪ R 0 .
To have R 1 ≲ R 0 , we need ( σ/ √ KB )
(1 / √ α − 1)+ (cid:112) D-Regret T ( q ⋆ ) /T
≲ (1 / √ K )( ζ 0 − ζ 1 ) .
By Corollary 1, we have a worst-case upper bound of D-Regret T ( q ⋆ ) as O ( √ T ) ; empirical evidence in Appendix F.6 suggests tighter rates O (1) .
With either rates, we always have
D-Regret T ( q ⋆ ) /T
=
o (1) .
Thus, to have R 1 ≲ R 0 , we only need ( σ/ √ B )(1 / √ α − 1) ≪ ζ 0 − ζ 1 asymptotically.
That is, we want the gap between the heterogeneity under best fixed sampling distribution and uniform sampling be large, compared to ( σ/ √ B )(1 / √ α − 1) .
When σ = 0 , that is, if we use full local gradient, then this is always true.
When will R 2 ≪ R 0 .
Similarly, to have R 2 ≪ R 0 , we need ( σ/ √ KB )(1 / √ α − 1) + (cid:112)
[Table]
based on Corollary 1 is O ( T ) ; however, as shown in Appendix F.6, the empirical evidence suggests that we may have D-Regret T ( p 1: T ⋆ ) to be O ( √ T ) or even O (1) , which then implies that
D-Regret T ( p 1: T ⋆ ) /T
=
o (1) .
Given this is true, to have R 1 ≲ R 0 , we need ( σ/ √ B )(1 / √ α − 1) ≪ ζ 0 − ζ 1 asymptotically.
That is, we want the gap between the heterogeneity under best dynamic sampling distribution and uniform sampling be large, compared to ( σ/ √ B )(1 / √ α − 1) .
When σ = 0 , that is, if we use full local gradient, then this is always true.
New characterization of heterogeneity.
Let ∆ ζ i = ζ 0 − ζ i for i = 1 , 2 .
Based on the previous analysis, we see that ∆ ζ i , i = 1 , 2 , can also help measure the dissimilarity of the different clients.
Compared with ζ 0 , the new characterization reflects how much gain we can have by using nonuniform sampling, where ∆ ζ 1 measures the advantage gained by fixed sampling distribution, and ∆ ζ 2 measures the advantage gained by dynamic sampling distribution.
B M ORE RELATED WORK
Our paper is also closely related to importance sampling in stochastic optimization.
Zhao & Zhang (2015); Needell et al.
(2016) illustrated that by sampling observations from a nonuniform distribution when using a gradient-based stochastic optimization method, one can achieve faster convergence.
They designed a fixed sampling distribution using prior knowledge on the upper bounds of gradient norms.
Csiba & Richt ´ arik (2018) extended the importance sampling to mini-batches.
Stich et al.
; Johnson & Guestrin (2018); Gopal (2016) developed adaptive sampling strategies that allow the sampling distribution to change over time.
Nesterov (2012); Perekrestenko et al.
Zhu et al.
; Salehi et al.
(2018) discussed importance sampling in stochastic coordinate descent methods.
Namkoong et al.
; Salehi et al.
; Borsos et al.
(2018; 2019); Hanchi & Stephens (2020) illustrated how to design the sampling distribution by solving an online learning task with bandit feedback.
Namkoong et al.
; Salehi et al.
(2017) designed the sampling distribution by solving a multi-armed bandit problem with the EXP3 algorithm (Lattimore & Szepesv ´ ari, 2020, Chapter 11).
Borsos et al.
(2018) used the follow-the-regularized-leader algorithm (Lattimore & Szepesv ´ ari, 2020, Chapter 28) to solve an online convex optimization problem and make updates to the sampling distribution.
Borsos et al.
(2019) restricted the sampling distribution to be a linear combination of distributions in a predefined set and used an online Newton step to make updates to the mixture weights.
The above approaches estimate a stationary distribution, while the best distribution is changing with iterations and, therefore, is intrinsically dynamic.
In addition to having suboptimal empirical performance, these papers provide theoretical results that only establish a regret relative to a fixed sampling distribution in hindsight.
To address this problem, Hanchi &
Stephens (2020) took a non-stationary approach where the most recent information for each client was kept.
A decreasing stepsize sequence is required to establish a regret bound.
Furthermore, the regret bound does not capture the intrinsic difficulty of the problem.
In comparison, we establish a regret bound relative to a dynamic comparator—a sequence of sampling distributions—without imposing assumptions on the stepsize sequence, and this bound includes the dependence on the total variation term characterizing the intrinsic difficulty of the problem.
Our paper also contributes to the literature on online convex optimization.
We cast the client sampling problem as an online learning problem (Hazan, 2016) and adapt algorithms from the dynamic online convex optimization literature to solve it.
Hall & Willett (2015); Yang et al. (2016); Daniely et al. (2015) proposed methods that achieve sublinear dynamic regret relative to dynamic comparator sequences.
In particular, Hall & Willett (2015) used a dynamic mirror descent algorithm to achieve sublinear dynamic regret with total variation characterizing the intrinsic difficulty of the environment.
However, the optimal tuning parameters depend on the unknown total variation.
On the other hand, van Erven & Koolen (2016); Zhang et al.
(2018) proposed different online ensemble approaches to automatically choose the tuning parameters for online gradient descent.
Compared with the problem settings in the above studies, there are two key new challenges that we need to address.
First, we only have partial information—bandit feedback—instead of the full information about the loss functions.
Second, the loss functions in our case are unbounded, which violates the common boundedness assumption in the online learning literature.
To overcome the first difficulty, we construct an unbiased estimator of the loss function and its gradient, which are then used to make an update to the sampling distribution.
We address the second challenge by first bounding the regret of our algorithm when the sampling distributions in the comparator sequence lie in a region of the simplex for which the loss is bounded, and subsequently analyze the additional regret introduced by projecting the elements of the comparator sequence to this region.
C A DDITIONAL ALGORITHMS C. A LGORITHM TO SOLVE S TEP 7 OF A LGORITHM 1 WHEN Φ IS UNNORMALIZED NEGATIVE ENTROPY
When Φ( · ) is chosen as the negative entropy Φ e ( · ) , a closed-form efficient solution can be obtained as shown in Proposition 1.
Proposition 1.
Suppose Φ = Φ e is the unnormalized negative entropy in Algorithm 1.
Let
[Equation]
Let π : [ M ] (cid:55)→ [ M ] be a permutation such that ˜ p t +1 π (1) ≤ ˜ p t +1 π (2) ≤ · · · ≤ ˜ p t +1 π ( M ) .
Let m t⋆ be the smallest integer m such that
[Equation]
Then ˆ
[Equation]
)˜ p t +
[Equation]
(cid:1)
[Equation]
(cid:16)(cid:80) Mj
= m t⋆ ˜ p t +1 π ( j ) (cid:17) otherwise .
Proof.
See Appendix D.1.
An efficient implementation is shown in Algorithm 2.
Algorithm 2 Solver of Step 7 of Algorithm 1 when Φ is unnormalized negative entropy
1: Input: ˆ p t , S t , { a tm } m ∈ S t , and
A =
P M − 1 ∩ [ α/M, ∞ ) M . 2: Output: ˆ p t +1 .
3: Let ˜ p t +1 m =
p tm exp (cid:8) N { m ∈ S t } η t a tm / ( K 2 ( p tm ) 3 ) (cid:9) for m ∈ [ M ] .
4: Sort { ˜ p t +1 m } Mm =1 in a non-decreasing order: ˜ p t +1 π (1) ≤ ˜ p t +1 π (2) ≤ · · · ≤ ˜ p t +1 π ( M ) .
5: Let v m = ˜
p t +1 π ( m ) (cid:0) 1 − m − 1 M α (cid:1) for m ∈ [ M ] .
6: Let u m = αM (cid:80) Mj
= m ˜ p t +1 π ( j ) for m ∈ [ M ] .
7: Find the smallest m such that v m > u m , denoted as m t ⋆ . 8: Let ˆ p t
+1 m = (cid:40) α/M if π ( m ) < m t⋆ (cid:0) (1 − (( m t⋆ − 1) /M )
α )
˜ p t +1 m (cid:1) / (cid:16)(cid:80)
Mj
= m t⋆ ˜ p t +1 π ( j ) (cid:17) otherwise .
C. M IN - BATCH SGD WITH OSMD S AMPLER
In this section, we describe the Min-batch SGD with OSMD Sampler in Algorithm 3.
Compared to classical min-batch SGD, the key ingredient of Algorithm 3 is Line 13, where the server updates the sampling distribution by OSMD Sampler, and Line 5, where the server samples the local mini-batch from a non-uniform sampling distribution.
C. A DAPTIVE -OSMD S AMPLER
The choice of the sequence of learning rates { η t } t ≥ 1 has a large effect on the performance of OSMD
Sampler.
Similar to Corollary 1, we can have the following Corollary.
g
K m λ m ˆ tm g tm
Server makes update of the model parameter w t
1 ← w t − µ t g t .
Server obtains updated sampling distribution ˆ p t
1 by Algorithm 1.
14: end for
Corollary 2.
Suppose conditions of Theorem 1 hold and let ˆ p 1: T be the sequence generated by
Algorithm 1.
We choose α such that p t⋆ ∈ A for all t ∈
[ T ] .
Let
[Equation]
Then
D-
[Equation]
where ¯ a t := max 1 ≤ m ≤ M a tm = max 1 ≤ m ≤ M λ 2 m ∥ g tm ∥ 2 .
The choice in equation 11 still depends on unknown quantities such as E [¯ a 1 ] , E [ TV ( p 1: T ⋆ )] , and T .
To get E [¯ a 1 ] , we can add a pre-training phase where we broadcast the initial model parameter wto all devices before the start of the training, and collect the returned ∥ g 0 m ∥ 2 from all responsive devices, which we denote as S 0 .
Then ˆ¯ a 1 := max m ∈ S 0 λ m ∥ g 0 m ∥ 2 .
On the other hand, E [ TV ( p 1: T ⋆ )] and T are hard to estimate in advance of the training.
We discuss how to use an online ensemble method to choose the learning rate without the knowledge of E [ TV ( p 1: T ⋆ )] , and how to get rid of the dependence on T using the doubling trick.
The main idea is to run a set of expert algorithms, each with a different learning rate for Algorithm 1.
We then use a prediction-with-expert-advice algorithm to track the best performing expert algorithm.
7 More specifically, we define the set of expert learning rates as
[Equation]
where
[Equation]
Then for each η e ∈ E , Adaptive-OSMD Sampler algorithm runs an expert algorithm to generate a sequence of sampling distributions
ˆ p 1: T e .
Meanwhile, it also runs a meta-algorithm that uses
[Equation]
te
= p ∈A e
∇
[Equation]
e
[Equation] [Equation]
exponentially-weighted-average strategy to aggregate { ˆ p 1: T e } Ee =1 into a single output ˆ p 1: T , which achieves performance close to the best expert.
Algorithm 4 details Adaptive-OSMD Sampler.
Note that since we can compute ˆ l t (ˆ p te ; ˆ p t ) and ∇ ˆ l t (ˆ p te ; ˆ p t ) directly, there is no need to use a surrogate loss as in van Erven & Koolen (2016) and
Zhang et al.
From the computational perspective, the major cost comes from solving step 9 of Algorithm 4, which needs to be run for a total number of T |E| =
T ⌊ log 2 T ⌋ times.
Compared with Algorithm 1, the computational complexity only increases by a log( T ) factor.
We have the following result on
Algorithm 4.
Theorem 3.
Let Φ =
Φ e
and we use ∥ · ∥ = ∥ · ∥ 1 to define total variation.
Let α be small enough such that p t⋆ ∈ A for all t ∈
[ T ] .
Let ˆ p 1: T be the output of Algorithm 4 with γ = αM (cid:113) 8 K T E [¯ a 1 ] , p init =
p unif and E as in equation 13.
Then
D-
[Equation]
Proof.
See Appendix D.4.
Since the additional regret term is ˜ O
(( M/α ) (cid:112) T/K ) , which is no larger than the first term asymptotically, the bound on the regret is of the same order as in equation 12.
However, we do not need to know the total variation E [ TV ( p 1: T ⋆ )] to set the learning rate.
Based on Theorem 3, the choice of α relies on prior knowledge about { p t⋆ } t ≥ 1 .
Specifically, we need α to be small enough so that p t⋆ ∈ A for all t ∈ [ T ] .
While this prior knowledge is not generally available, in Section F.3 we experimentally show that the proposed algorithm is robust to the choice of α .
As long as the chosen α is not too small or too large, we obtain a reasonable solution.
We always set α = 0 .
4 in experiments.
C. A DAPTIVE -OSMD S AMPLER WITH D OUBLING T RICK (A DAPTIVE -D OUBLING -OSMD)
Algorithm 4 requires the total number of iterations T as input, which is not always available in practice.
In those cases, we use doubling trick (Cesa-Bianchi & Lugosi, 2006, Section 2.3) to avoid this requirement.
The basic idea is to restart Adaptive-OSMD Sampler at exponentially increasing time points T b
= 2 b − 1 , b ≥ 1 .
The learning rates of experts in Algorithm 4 are reset at the beginning of each time interval, and the meta-algorithm learning rate γ is chosen optimally for the interval length.
We set ¯ a T b at the beginning of each time interval using the maximum environment feedback from the previous interval.
More specifically, at the time point T b , we let
[Equation]
15) where
E b =
[Equation]
(16) and γ b = αM (cid:113) 8 K 2 b − 1 ˆ a b , b ≥ 1 .
We set ˆ ¯ a T b = max m ∈ S
Tb − 1 a T b − 1 m .
In a practical implementation, at the time point t = T b , instead of initializing all expert algorithms using uniform distribution, we can initialize them with the output of the meta-algorithm for t =
T b − 1 .
To get a 0 , the server uses a pre-training phase where the initial model parameter w 0 is broadcast to all devices before the start of the training.
Subsequently, the server collects the returned ∥ g 0 m ∥ 2 from all responsive devices, which are denoted as S 0 .
Then ˆ¯ a 1 := max m ∈ S 0 a 0 m where a 0 m = λ m ∥ g 0 m ∥ 2 .
Adaptive-Doubling-OSMD
Sampler is detailed in Algorithm 5.
From the computational perspective, by the proof of Theorem 4, Algorithm 5 needs to run Step 9 of
Algorithm 4 for a total number of O
( T |E| 2 )
=
O ( T ⌊ log 2 T ⌋ ) times.
Therefore, the computational complexity of Adaptive-Doubling-OSMD Sampler is asymptotically the same as that of AdaptiveOSMD Sampler, while it increases by only a log( T ) factor compared to OSMD Sampler.
The following theorem provides a bound on the dynamic regret for Adaptive-Doubling-OSMD Sampler.
Theorem 4.
Let Φ =
Φ e
and we use ∥·∥ = ∥·∥ 1 to define the total variation.
Let α be small enough constant
so that p 1: T ⋆ ∈
A T and the training is stopped after T iterations.
Suppose that there exists a constant C > 1 such that ˆ¯ a T b ≤ C ¯ a T b for all b = 1 , 2 , . . .
, B , where B =
⌊ log 2 ( T + 1) ⌋ .
Let ˆ p 1: T be the output of Algorithm 5, where p unif is used in Step 8.
Then
D-Regret T
[Equation]
Proof.
See Appendix D.5.
From Theorem 4 we observe that the asymptotic regret bound has the same order as that of OSMD
Sampler and Adaptive-OSMD Sampler.
However, Adaptive-Doubling-OSMD Sampler does not need to know E (cid:2) TV ( p 1: T ⋆ ) (cid:3) or T in advance.
C. A DAPTIVE SAMPLING WITHOUT REPLACEMENT
In the discussion so far, we have assumed that the set S t is obtained by sampling with replacement from p t .
However, when K is relatively large compared to M and p t is far from uniform distribution, sampling without replacement can be more efficient than sampling with replacement.
However, when sampling without replacement using p t , the variance reduction loss does not have a clean form as in equation 4.
As a result, an online design of the sampling distribution is more challenging.
In this section, we discuss how to use the sampling distribution obtained by Adaptive-OSMD Sampler to sample clients without replacement, following the approach taken in Hanchi & Stephens (2020).
5: while do 6:
Set E b in equation 15.
Let γ b = αM (cid:113) 8 K 2 b − 1 ˆ¯ a b .
Obtain { ˆ p t } 2 b − 1 t =2 b − 1 from Algorithm 4 with parameters: γ b , E b , α , the number of iterations 2 b − 1 , and the initial distribution p unif or ˆ p 2 b
1 − 1 ( b > 1 ).
9: if
Converged then 10:
Break.
11: end if 12:
Let b ← b + 1 .
Let ˆ¯ a b = max m ∈
[ M ] a T b m .
14: end while
1: Input: w 1 and ˆ p 1 .
2: for t = 1 , 2 , . . .
, T − 1 do 3:
Let ˆ p t (1) =
ˆ p t and sample m t 1 from [ M ] by ˆ p t (1) .
4: for k = 2 , · · · , K do 5: /* Design the sampling distribution for sampling the k -th client in the t -th round */ 6:
Construct ˆ p t ( k ) by letting ˆ p t ( k ) ,m = (cid:40) (cid:16) 1 − (cid:80) k − 1 l =1 ˆ p tm tl (cid:17) − 1 ˆ p tm if m ∈ [ M ] \{ m t 1 , . . .
, m tk − 1 } otherwise.
* Sample the k -th client */ 8:
Sample m tk from [ M ] \{ m t 1 , . . .
, m tk − 1 } by ˆ p t ( k ) .
9: end for 10:
Let S t = { m t 1 , · · · , m tK } .
The server broadcasts the model parameter w t to clients in S t .
The clients in S t compute and upload the set of local gradients (cid:110) g tm t 1 , · · · , g tm tK (cid:111) .
13: /* Construct global gradient estimate */ 14:
Let g t (1) =
λ t m t 1 g t m t 1 / ˆ p t (1) ,m t 1 .
15: for k = 2 , · · · , K do 16:
Let g t ( k ) =
λ tm tk
g tm tk / ˆ p t ( k ) ,m tk + (cid:80)
k − 1 l =1 λ tm tl g tm tl .
17: end for 18:
Let ˜ g
t =
K − 1 (cid:80)
Kk =1 g t ( k ) .
19: /* Update the model weight based on the global gradient estimate */ 20:
Obtain the updated model parameter w t +1 using w t and ˜ g t .
21: /* Update sampling distribution */ 22:
Let a tm = λ 2 m ∥ g tm ∥ 2 for m ∈ S t .
Input
24: end for
The detailed sampling procedure is described in Algorithm 6.
We still use Adaptive-OSMD Sampler to update the sampling distribution.
However, we use the designed sampling distribution in a way that no client is chosen twice.
Furthermore, Step 18 of Algorithm 6 constructs the gradient estimate with the following properties.
Proposition 2 (Proposition 3 of Hanchi & Stephens (2020)) .
Let ˆ p t = p and let ˜ g t be as in Stepof Algorithm 6.
Note that ˜ g t = ˜
g t ( p ) depends on p .
Recall that J t
=
(cid:80) Mm =
λ m g tm .
We have
E S t (cid:2) ˜
g t (cid:3) =
J t and
[Equation]
where l t ( · ) is defined in equation 4 and the expectation is taken over S t .
From Proposition 2, we see that ˜ g t is an unbiased stochastic gradient.
Furthermore, the variance of ˜ g t is minimized by the same sampling distribution that minimizes the variance reduction loss in equation 4.
Therefore, it is reasonable to use the sampling distribution generated by AdaptiveOSMD Sampler to design ˜ g t .
D T ECHNICAL PROOFS D. P ROOF OF P ROPOSITION
First, we show that the solution ˆ p t +1 in Step 7 of Algorithm 1 can be found as
[Equation]
The optimality condition for ˜ p t +1 implies that
[Equation]
By Lemma 1, the optimality condition for ˆ p t +1 implies that
[Equation]
A
[Equation]
Combining the last two displays, we have
[Equation]
ˆ p
[Equation]
+
[Equation]
p
[Equation]
for all p ∈ A .
By Lemma 1, this is the optimality condition for ˆ p t +1 to be the solution in Step 7 of Algorithm 1.
Note that equation 17 implies that
[Equation]
Therefore,
[Equation]
and the final result follows from Lemma 4.
D. P ROOF OF T HEOREM
We first state a proposition that will be used to prove Theorem 1.
The key difference between
Theorem 1 and Proposition 3 is that in Proposition 3 the comparator sequence lies in A , and, as a result, there is no projection error.
Proposition 3.
Suppose the conditions of Theorem 1 hold.
For any comparator sequence q 1: T with q t ∈ A , t ∈ [ T ] , we have
[Equation]
Proof.
By Lemma 1 and the definition of ˆ p t +1 in Step 7 of Algorithm 1, we have
[Equation]
By the convexity of ˆ l t ( · ; ˆ p t ) , we have
[Equation]
Then, by equation
[Equation]
we further have
[Equation]
From the definition of D , we have
[Equation]
Then
[Equation]
We bound the second term in equation 19 as
[Equation]
where (a) follows from the convexity of Φ( · ) , (b) follows from the definition of the dual norm
[Equation]
and (c) follows from the definition of H .
Since Φ( · ) is ρ -strongly convex
[Equation]
we can bound the third and fourth term in equation 19 as −
[Equation]
Since ab ≤ a 2 / (2 ϵ ) + b 2 ϵ/ 2 , a, b, ϵ >
[Equation]
we further have
[Equation]
[Equation]
Combining equation 19-equation
[Equation]
we have
[Equation]
This implies that
[Equation]
since ˆ p 1 is the uniform distribution.
Finally, note that
[Equation]
The conclusion follows by taking expectation on both sides of equation 22.
We are now ready to prove Theorem
[Equation]
Proof of Theorem 1.
For any comparator sequence q 1: T with q t ∈ P M − 1 , t ∈ [ T ] , we have
[Equation]
By Proposition
[Equation]
we further have that
[Equation] [Equation]
Therefore, to prove Theorem 1, we design a suitable sequence ˜ q 1: T , where ˜ q t ∈ A , and bound the terms (cid:80) Tt =
1 l t (˜ q t ) − (cid:80)
Tt =
1 l t ( q t ) and TV (cid:0) ˜ q 1: T (cid:1) − TV (cid:0) q 1: T (cid:1) .
We define ˜ q t as
[Equation]
where ω ( q t , α ) is defined in equation 9.
We now show that ˜ q t ∈ A , t ∈ [ T ] , by showing that ˜ q tm ≥ α/M , m ∈
[ M ] , and (cid:80) m ∈
[ M ] ˜ q tm = 1 .
For m ∈ [ M ] such that q tm < α/M , we have from equation 25 that ˜ q tm = α/M . For m ∈ [ M ] such that q tm ≥ α/M , by equation 25, we have ˜ q tm − α/M =
(1 − ω ( q t , α ))
( q tm − α/M ) .
Thus, we proceed to show that ω ( q t , α ) ≤ 1 .
Since 1 =
[Equation]
we have
[Equation]
Therefore, 0 ≤ ω ( q t , α ) ≤ 1 .
Furthermore, ω ( q t , 0) =
1 and ω ( q t , 1) = 1 .
Finally, we show that (cid:80)
Mm =1 ˜ q tm = 1 .
By equation 25 and the definition of ω ( q t , α ) in equation 9, we have
M
[Equation]
Therefore, ˜ q t ∈ A for any t ∈ [ T ] .
We now bound (cid:80) Tt =
1 l t (˜ q t ) − (cid:80)
Tt =
1 l t ( q t ) .
When q tm < α/M , then 1 / ˜ q tm − 1 /q tm < 0 ; and when q tm ≥ α/M , then
[Equation]
tm = q tm ·   1 − ω ( q t , α ) (cid:16) 1 − αMq tm (cid:17) −  = 1 q tm · ω ( q t , α ) (cid:16) 1 − αMq tm (cid:17) 1 − ω ( q t , α ) (cid:16) 1 − αMq tm (cid:17) .
Since ω ( q t , α ) (cid:18) 1 − α
Mq tm (cid:19) ≤ ω ( q t , α ) and 1 − ω ( q t , α ) (cid:18) 1 − α
Mq tm (cid:19) ≥ 1 − ω ( q t , α )+ ω ( q t , α ) α M as q tm ≤ 1 , we have ˜ q tm − q tm ≤ q tm · ω ( q t , α ) 1 − ω ( q t , α ) (cid:0) 1 − αM (cid:1)
=
ϕ ( q t , α ) q tm .
Thus,
T (cid:88) t = l t (˜ q t ) − T (cid:88) t = l t ( q t ) =
T (cid:88) t =
M (cid:88) m
= a tm (cid:18)˜ q tm − q tm (cid:19) ≤
T (cid:88) t =
M (cid:88) m
= a tm (cid:18)˜ q tm − q tm (cid:19) 1 (cid:110) q tm ≥ α
M (cid:111) ≤
T (cid:88) t = ϕ ( q t , α )
M (cid:88) m
= a tm q tm(cid:110) q tm ≥ α M (cid:111) ≤
T (cid:88)
[Equation]
Next, we bound TV (cid:0) ˜ q
[Equation]
T
[Equation]
TV
[Equation]
T
[Equation]
Note that
[Equation]
We now upper bound (cid:80) Tt =1 ∥ ˜ q t − q t ∥ 1 .
If q tm < α/M , then | ˜ q tm − q tm | = α/M − q tm .
If q tm ≥ α/M , by equation 25, we have | ˜ q tm − q tm | = ω ( q t , α ) ( q tm − α/M ) .
Therefore, recalling the definition of ψ ( q t , α ) in equation 9, we have
[Equation]
and
[Equation]
Combining equation 23, equation 24, equation 26, and equation 27, and taking expectation on both sides, we obtain the result.
D. C OROLLARY 3 AND ITS PROOF
Corollary 3.
Suppose conditions of Theorem 1 hold and Φ =
Φ e .
Then for any comparator sequence { q 1: T } , we have
D
[Equation]
where ¯ a t :=
max
[Equation]
≤
[Equation]
∥
[Equation]
Proof.
When Φ = Φ e , we have ρ = 1 from Pinsker’s inequality.
Furthermore, ∥ · ∥ ⋆ = ∥ · ∥ ∞ , ∇ Φ e ( p ) =
(log p 1 , . . .
, log p M ) ⊤ , and ˆ p t ∈
A =
P M − 1 ∩ [ α/M, ∞ ) M , t ∈ [ T ] .
Then
Q t =
M 3 ¯ a t / ( K 2 α 3 ) and H = log( M/α ) follows by checking the definition.
Finally, to show that
D Φ e ( q ∥ p unif ) ≤ log M for all q ∈ A , we note that D Φ e ( q ∥ p unif ) =
log M + (cid:80) M m =1 q m log q m ≤ log M .
D. P ROOF OF T HEOREM
The proof proceeds in two steps.
First, we show that there exists an expert learning rate η e ∈ E such that the regret bound for ˆ p 1: T e is close to equation 12.
That is, we show that there exists η e ∈ E such that
[Equation]
Note that S t ∼ ˆ p t .
Second, we show that the output of meta-algorithm can track the best expert with small regret.
That is, we show that
[Equation]
The theorem follows by combining equation 28 and equation
[Equation]
We first prove equation 28.
Since 0 ≤ E [ TV (cid:0) p 1: T ⋆ (cid:1) ] ≤ 2( T − 1) , we have
[Equation]
where η ⋆ is defined as in equation 11.
Thus
[Equation]
there exists η e ∈ E , such that η e ≤ η ⋆ ≤ 2 η e .
Repeating the proof of equation 22 and proof of Corollary 3, we show that
[Equation]
which then implies that
[Equation]
Since η ⋆ / 2 ≤ η e ≤ η ⋆
[Equation]
we further have
[Equation] [Equation]
Now, equation 28 follows, since
[Equation]
We prove equation 29 next.
Let
[Equation]
Recall the update for θ te in Step 11 of Alg 4.
We have
[Equation]
Let Θ t =
[Equation]
Then
[Equation]
and, for t ≥ 2 ,
[Equation]
have
[Equation]
t
[Equation] [Equation]
(Jensen’s inequality) and log (Θ T ) = log
[Equation]
Combining the last two displays, we have
[Equation]
which implies that
T (cid:88)
[Equation]
Taking expectation on both sides, we then have
[Equation]
Since θ 1 e ≥ 1 E 2 , log 1 /θ 1 e ≤ 2 log E .
Let γ = (cid:112)
Kα 2 / ( TM 2 E [¯ a 1 ]) to minimize the right hand side of the above inequality with log 1 /θ 1 e substituted by 1.
Then
E (cid:34) T (cid:88) t
= ˆ l t (ˆ p t ; ˆ p t ) − ˆ L eT (cid:35) =
E (cid:34) T (cid:88) t
= ˆ l t (ˆ p t ; ˆ p t ) −
T (cid:88) t
= ˆ l t (ˆ p te ; ˆ p t ) (cid:35) ≤ M α (cid:114) T E [¯ a 1 ] 8 K (1 + 2 log E ) , e ∈
[ E ] .
D. P ROOF OF T HEOREM
Recall that T b = 2 b − 1 and ˆ p T b is reinitialized as the uniform distribution.
Let
D-Regret b = E 
[Equation]
T b +1 − 1 (cid:88) t =
T b l t (ˆ p t ) −
T b +1 − 1 (cid:88) t =
T b l t ( p t⋆ )   .
Similar to the proof of equation 28 and equation 29, we have
D-Regret b
[Equation]
where E is defined in equation 14.
Since B = ⌊ log 2 ( T + 1) ⌋ , we have T B ≤ T ≤ T B +1 − 1 , which implies that 1 ≤ T − T B + 1 ≤ T B +1 − T B = 2 B .
Thus, we can similarly obtain
E
[Equation]
B
[Equation]
The result follows combing the last two displays.
D. P ROOF OF T HEOREM
Our proof follows the similar technique used in the proof of Theorem 2.1 of Ghadimi & Lan (2013).
Our key novel technique is the construction of a ghost subset that is drawn from [ M ] from the comparator sampling distribution.
The ghost subset is only constructed for theoretical purpose and does not need to be computed in practice.
We only show the proof of R 1 , R 0 and R 2 can be then derived in a similar fashion.
Let δ t =
g t − ∇ F ( w t )
[Equation]
Under Assumption
[Equation]
by (1.6) of Ghadimi & Lan (2013)
[Equation]
we have
[Equation]
Note that E [ g t | w t , ˆ p t ] = ∇ F ( w t ) , thus we have E [ δ t | w t , ˆ p t ] = 0 , and
[Equation]
On the other hand, we can assume that there is a ghost subset of clients ˜ S t with | ˜ S t | = K , which is drawn from [ M ] with sampling distribution
q ⋆ .
Besides, we let
[Equation]
Then we have
[Equation]
Since
E (cid:104)(cid:13)(cid:13) ˜
g t
[Equation]
F ( w t ) (cid:13)(cid:13)
[Equation]
| w t
[Equation]
ˆ p t (cid:105) =
E   (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) 1 MK (cid:88) m
[Equation]
˜ S t g
[Equation]
⋆m −
[Equation]
F ( w t ) (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)
[Equation]
| w t , ˆ p t 

[Equation]
  (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) 1 MK (cid:88) m
[Equation]
˜ S t g
[Equation]
MK (cid:88) m ∈ ˜
S t ∇ F m ( w t ) q
⋆m
cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) | w t , ˆ p t 

[Equation]
E
[Equation]
 (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) 1 MK (cid:88) m
[Equation]
˜ S t ∇ F m ( w t )
[Equation]
[Equation]
t ) (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13)
[Equation]
ˆ
[Equation]
t
[Equation]
 =
[Equation]
m
[Equation]
[Equation] [Equation]
ˆ
[Equation]

[Equation]
m =
[Equation]
∥∇ F m ( w t ) ∥
[Equation]
where the penultimate line follows that E (cid:104) ∥ g tm − ∇ F m ( w t ) ∥ 2 (cid:105) ≤ σ 2 /B and the definition of ζ 1 , and the last line follows that q ⋆m ≥ α/M .
Thus, we have
[Equation]
which implies that
[Equation]
Combine equation 30, equation 31 and equation 32, we have
[Equation]
Since µ ≤ 1 /L , thus ( µ − L 2 µ 2 ) = µ (1 − L 2 µ ) ≥ µ/ 2 , thus
[Equation]
t =
[Equation]
Finally
[Equation]
let µ = min
[Equation]
33) then we have
[Equation]
T .
E U SEFUL LEMMAS
Lemma 1.
Suppose that f is a differentiable convex function defined on dom f , and X ⊆ dom f is a closed convex set.
Then x is the minimizer of f on X if and only if ∇ f ( x ) ⊤ ( y − x ) ≥ 0 for all y ∈ X .
Proof.
See Section 4.2.3 of Boyd et al.
Lemma 2.
For q ∈ P M − 1 we have D Φ ( q ∥ p unif ) ≤ log M , where Φ is the unnormalized negative entropy.
Proof.
Since Φ( q ) = (cid:80) M m =1 q m (log q m − 1) ≤ 0 , Φ( p unif ) = − log M , and ⟨∇ Φ( p unif ) , q − p unif ⟩ =
M (cid:88) m = ( q m − 1 M ) log 1 M = 0 , we have D Φ (
q ∥ p ) ≤ log M .
Lemma 3 (Hoeffding’s Inequality) .
Let X be a random variable with a ≤ X ≤ b for a, b ∈ R .
Then for all s ∈ R , we have
[Equation]
Proof.
See Section 2 of Wainwright (2019).
Lemma 4 (Based on Exercise 26.12 of Lattimore & Szepesv´ari (2020)) .
Let α ∈ [0 , 1] , A =
P M − 1 ∩ [ α/M, 1] M , D = [0 , ∞ ) M , and Φ =
Φ e is the unnormalised entropy on D .
For y ∈ [0 , ∞ ) M , let x = arg min v ∈A D
Φ ( v ∥ y ) .
Suppose y 1 ≤ y 2 ≤ · · · ≤ y M .
Let m ⋆ be the smallest value such that
[Equation]
Then
[Equation]
Proof.
Consider the following constrained optimization problem:
[Equation]
Since x is the solution to this problem, by the optimality condition, there exists λ, ν 1 , . .
ν M ∈ R such that
[Equation]
By equation 34, we have x m =
y m exp( − 1 + λ + ν m ) .
By equation 37 and equation 38, when x m = α/M , we have x m = y m exp( − 1 + λ + ν m ) ≥ y m exp( − 1 + λ ) ; when x m > α/M , we have x m =
y m exp( − 1 + λ ) .
Assume that x 1 = · · · = x m ⋆ − 1 = α/M < x m ⋆ ≤ · · · ≤ x M .
Then
[Equation]
which implies that
[Equation]
Thus, we have
[Equation]
which implies that
[Equation]
To complete the proof
[Equation]
we then only need to show that
[Equation]
for all 1 ≤ m ′ ≤ m ⋆ − 1 .
The result then follows from equation 40 and equation 41.
To proveequation 41, recall that for any 1 ≤ m ′ ≤ m ⋆ − 1 , we have α/M = y m ′ exp( − 1 + λ + ν m ′ )
[Equation]
and because y 1 ≤ · · · ≤ y M , we have ν 1 ≥ · · · ≥ ν m ⋆ − 1 .
This way, we have
[Equation]
On the other hand
[Equation]
by equation
[Equation]
we have
[Equation]
Combining equation 42 and equation 43, we have
[Equation]
which then implies equation 41.
F S YNTHETIC EXPERIMENTS
In this section, we use synthetic data to demonstrate the performance of Adaptive-OSMD Sampler.
We compare our method against uniform sampling in Section F.1 and compare against other bandit feedback online learning samplers in Section F.2.
In addition, we examine the robustness of
Adaptive-OSMD Sampler to the choice of α in Section F.3, while in Section F.4, we compare it with the sampling without replacement variant discussed in Section C.5.
Finally, in Section F.6, we show some empirical observation for regret analysis.
We generate data as follows.
We set the number of clients as M = 100 , and each client has n m = 100 samples, m ∈
[ M ] .
Samples on each client are generated as
[Equation]
where the coefficient vector w ⋆ ∈ R d has elements generated as i.i.d.
N (10 , 3) , and the feature vector x m,i ∈
R
d is generated as x m,i ∼ N (0 , Σ m ) , where Σ m =
s m · Σ , Σ is a diagonal matrix with Σ jj
= κ ( j − 1) / ( d − 1) − 1 and κ > 0 is the condition number of Σ .
We generate { s m } M m = i.i.d.
from e N (0 ,σ 2 ) and rescale them as s m ← ( s m / max m ∈
[ M ] s m ) × 10 so that s m ≤ 10 for all m ∈
[ M ] .
In this setting, κ controls the difficulty of each problem when solved separately, while σ controls the level of heterogeneity across clients.
In all experiments, we fix κ = 25 , which corresponds to a hard problem, and change σ to simulate different heterogeneity levels.
We expect that uniform sampling suffers when the heterogeneity level is high.
The dimension d of the problem is set as d = 10 .
The results are averaged over runs.
We use the mean squared error loss defined as
[Equation]
where
[Equation]
We use the stochastic gradient descent to make global updates.
At each round t , we choose a subset of K = 5 clients, denoted as S t .
For each client m ∈ S t , we choose a mini-batch of samples, B tm , of size ¯ B = 10 , and compute the mini-batch stochastic gradient.
The parameter w is updated as
[Equation]
where µ SGD is the learning rate, set as µ SGD = 0 . 1 in simulations.
In all experiments, we set α in Adaptive-OSMD Sampler as α = 0 . 4 .
The tuning parameters for
MABS, VRB and Avare are set as in their original papers.
Computational resources and amount of compute.
All the computation was done on a personal laptop.
The synthetic data experiments are computed by CPU (Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz 2.59 GHz).
Each run of all experiments in this section took less than 10 minutes.
[Figure]
The results of the training process and the cumulative regret are shown in Figure 1.
For the training loss, we see that when the heterogeneity level is low ( σ = 1 . 0 ), the uniform sampling performs as well as Adaptive-OSMD Sampler and theoretically optimal sampling; however, as the heterogeneity level increases, the performance of uniform sampling gradually suffers; when σ = 10 . 0 , uniform sampling performs poorly.
On the other hand, Adaptive-OSMD Sampler performs well across all levels of heterogeneity and is very close to the theoretically optimal sampling.
Similarly, for the cumulative regret, when the heterogeneity level is low, the cumulative regret of uniform sampling is close to Adaptive-OSMD Sampler; however, when the heterogeneity level increases, the cumulative regret of uniform sampling gets much larger than Adaptive-OSMD Sampler.
Based on the above results, we can conclude that while the widely used choice of uniform sampling may be reasonable when heterogeneity is low, our proposed sampling strategy is robust across different levels of heterogeneity, and thus should be considered as the default option.
F. A DAPTIVE -OSMD S AMPLER VS MABS VS VRB VS A VARE
We compare Adaptive-OSMD Sampler to other bandit feedback online learning samplers:
MABS (Salehi et al., 2017), VRB (Borsos et al., 2018) and Avare (Hanchi & Stephens, 2020).
Training loss and cumulative regret are shown in Figure 2.
We see that while VRB and Avare perform better when the heterogeneity level is low and MABS performs better when the heterogeneity level is high, Adaptive-OSMD Sampler always achieves the best in both training loss and cumulative regret across all different levels of heterogeneity.
Thus, we conclude that Adaptive-OSMD is a better choice than other online learning samplers.
F. R OBUSTNESS OF A DAPTIVE -OSMD S AMPLER TO THE CHOICE OF α
We examine the robustness of Adaptive-OSMD Sampler to the choice of α .
We run AdaptiveOSMD Sampler separately for each α ∈ { 0 . 01 , 0 . 1 , 0 . 4 , 0 . 7 , 0 . 9 , 1 . 0 } .
Note that when α = 1 . 0 , the Adaptive-OSMD Sampler outputs a uniform distribution.
Training loss and cumulative regret are shown in Figure 3.
We observe that Adaptive-OSMD Sampler is robust to the choice of α , and performs well as long as α is not too close to zero or too close to one.
F. E XPERIMENTS ON SAMPLING WITH REPLACEMENT VS WITHOUT REPLACEMENT
We compare sampling with replacement and sampling without replacement when used together with
Adaptive-OSMD sampler.
Sampling without replacement is described in Section C.5.
Training loss and cumulative regret are shown in Figure 4.
We observe that using sampling with replacement results in a slightly smaller cumulative regret and a slightly better training loss.
However, these differences are not significant.
F. D YNAMIC SAMPLING DISTRIBUTION V . S . FIXED SAMPLING DISTRIBUTION
In this paper, we allow both our sampling distribution and competitor sampling distribution to change over time, while previous studies either use fixed sampling distribution (Zhao & Zhang, 2015; Needell et al., 2016) or they compare against fixed sampling distribution (Namkoong et al., 2017; Salehi et al., 2017; Borsos et al., 2018; 2019).
In this section, we show that under certain settings, dynamic sampling distribution can achieve significant advantage over fixed sampling distribution.
More specifically, we compare Adaptive-OSMD Sampler with the Lipschitz constant based importance sampling distribution proposed by Zhao & Zhang (2015);
Needell et al.
(2016), which we denote as p IS .
We still use the same model as in equation 44 to generate data.
but we generate w ⋆ and x m,i differently.
Motivated by Zhao et al.
for each m ∈
[ M ] , we choose uniformly at random one dimension among R d , denoted as supp ( m ) ∈
[ d ] , as the support of x m,i for all i ∈ [ n m ] , while the remaining dimensions of x m,i are set to be zero.
The nonzero dimension of x m,i is generated from N (1 . 0 , 0 .
The entries of w ⋆ are generated i.i.d.
from e N (0 ,ν 2 ) .
Therefore, ν controls the variance of entries of w ⋆ .
Besides, we choose the optimal stepsize from the set { 1 . 0 , 0 . 5 , 0 . 1 , 0 . 05 , 0 . 01 } for each method separately.
The final result is shown in Figure 5.
We see that Adaptive-OSMD Sampler performs better than p IS across all levels of ν .
Note that in practice, in order to implement p IS , we need prior information about Lipschitz constants of L m ( · ) ’s, while Adaptive-OSMD Sampler does not need prior information.
This way, our proposed method does not only have better practical performance, but also requires less prior information.
F. E MPIRICAL OBSERVATION OF REGRET
In Corollary 1, we see that the upper bound for the regret of OSMD sampler with respect to any comparator sequence q 1: T depends on two important quantities: (cid:80)
Tt =1 (¯ a t ) 2 and TV ( q 1: T ) .
In this section, we first empirically show how ¯ a t and (cid:80) tl
=1 (¯ a l ) 2 grow with t in practice.
Then, we use p 1: T ⋆ as the comparator and show how TV ( p 1: t ⋆ ) grow with t empirically.
Finally, we also empirically show how the regret D-Regret T ( p 1: T ⋆ ) grows.
The experimental setting of this section is the same as
Section F.
In Figure 6, we plot both ¯ a t and (cid:80) tl =1 (¯ a l ) 2 over t .
We see that ¯ a t drops to zero fastly.
As a result (cid:80) tl =1 (¯ a l ) 2 converges to a constant as t → ∞ .
This way, we empirically have (cid:80) tl
=1 (¯ a l ) 2 =
O (1) .
In Figure 7, we show how TV ( p 1: t ⋆ ) grows with t .
We see that TV ( p 1: t ⋆ )
=
O ( t ) empirically, which is consistent with the worst-case upper bound.
Based on this result, the best upper bound of
D-Regret T ( p 1: T ⋆ ) we can hope in practice is O ( √ T ) .
However, as shown in Figure 8, in practice, we have D-Regret T ( p 1: T ⋆ ) converge to constant.
This observation indicates that the upper bound we obtained might still be loose compared to practical result.
G R EAL DATA EXPERIMENT
We compare Adaptive-OSMD Sampler with uniform sampling and other online learning samplers including MABS (Salehi et al., 2017), VRB (Borsos et al., 2018) and Avare (Hanchi & Stephens, 2020) on real data.
We use three commonly used computer vision data sets: MNIST (LeCun &
Cortes, 2010) 8 , KMINIST (Clanuwat et al., 2018) 9 , and FMINST (Xiao et al., 2017) 10 .
We set the number of devices to be M = 500 .
To better simulate the situation where our method brings significant convergence speed improvement, we create a highly skewed sample size distribution of the training set among clients: 65 % of clients have only one training sample, 20 % of clients have 5 training samples, 10 % of clients have 30 training samples, and 5 % of clients have 100 training samples.
This setting tries to illustrate a real-life situation where most of the data come from a small fraction of users, while most of the users have only a small number of samples.
The skewed sample size distribution is common in other FL data sets, such as LEAF (Caldas et al., 2018).
The sample size distribution in the training set is shown in Figure 9.
In addition, each client has 10 validation samples used to measure the prediction accuracy of the model over the training process.
We use a multi-class logistic regression model.
For a given gray scale picture with the label y ∈ { 1 , 2 , . . .
, C } , we unroll its pixel matrix into a vector x ∈ R p .
Given a parameter matrix W ∈ R C × p , the training loss function defined in equation 1 is
[Equation]
, where ς ( · ) : R C → R C is the softmax function defined as [
[Equation]
, for all x ∈ R C , and l CE ( x ; y ) = (cid:80) Ci =1 1 ( y = i ) log x i , x ∈ R C , y ∈ { 1 , . . .
, C } , is the cross-entropy function.
We use the same algorithms and tuning parameters as in Section F. Learning rate in SGD is set to 0 .
075 for MNIST and KMNIST, and is set to 0 .
03 for FMNIST.
The total number of communication rounds is to 1 , 000 .
In each round of communication, we choose K = 10 clients to participate ( 2 % of total number of clients).
For a chosen client m , we compute its local mini-batch gradient with the batch size equal to min { 5 , n m } , where n m is the training sample size on the client m .
Figure 10 shows both the training loss and validation accuracy.
Each figure shows the average performance over 5 independent runs.
We use the same random seed for both Adaptive-OSMD Sampler and competitors, and change random seeds across different runs.
The main focus is on minimizing the training loss, and the validation accuracy is only included for completeness.
We observe that
Adaptive-OSMD Sampler performs better than uniform sampling and other online learning samplers across all data sets.
Given the cheap computational cost and the significant practical advantage, we recommend using Adaptive-OSMD Sampler as the default option in practice.
Besides, for the completeness of the paper, we also include the results under homogeneous setting where the sample sizes are balanced across different clients.
The result is shown in Figure 11, where we see that all methods perform similarly.
Computational resources and amount of compute.
All the computation was done on a personal laptop.
The real data experiments are computed by GPU (NVIDIA GeForce RTX 2070 with Max-Q
Design).
Each run of all experiments in this section took less than 15 minutes.
H D ISCUSSION
We studied the client sampling problem in FL.
We proposed an online learning with bandit feedback approach to tackle client sampling.
We used online stochastic mirror descent to solve the online learning problem and applied the online ensemble method with doubling trick to choose the tuning parameters.
We established an upper bound on the dynamic regret relative to the theoretically optimal sequence of sampling distributions.
The total variation of the comparator is explicitly included in the upper bound as a measure of the difficulty of the problem.
Extensive numerical experiments demonstrated the benefits of our approach over both widely used uniform sampling and other competitors.
In this paper, we have focused on sampling with replacement.
However, sampling without replacement would ideally be a more efficient approach.
In Section C.5, we discussed a natural extension of Adaptive-OSMD Sampler to a setting where sampling without replacement is used.
However, this approach does not directly minimize the variance of the gradient g t .
When sampling without replacement is used, the variance function becomes more complicated and the design of an algorithm to directly minimize the variance is an interesting future direction.
Besides, in federated learning, privacy is a major concern.
In this paper, the non-uniform sampling distribution may make the protection of clients’ privacy more challenging than uniform sampling.
One possible solution is to add noise to the gradient feedback and protect the clients’ privacy under the Differential Privacy (DP) concept (Dwork, 2008).
However, the added noise may hurt the performance of our sampling design and increase the regret.
Studying the trade-off between privacy protection and regret is an important direction for addressing societal concerns in real-world application.
Other fruitful future directions include the design of sampling algorithms for minimizing personalized FL objectives and sampling with physical constraint in FL system, which we discuss next.
H. C LIENT SAMPLING WITH PERSONALIZED FL OBJECTIVE
Data distributions across clients are often heterogeneous.
Personalized FL has emerged as one effective way to handle such heterogeneity (Kulkarni et al., 2020).
Hanzely et al.
(2021) illustrated how many existing approaches to personalization can be studied through a unified framework, and, in this section, we discuss a natural extension of Adaptive-OSMD Sampler to this personalized objective.
Specifically, we study the following optimization problem
[Equation]
where w ∈ R d 0 corresponds to the shared parameter and β = ( β 1 , . .
. , β M ) with β m ∈ R
d m corresponds to the local parameters.
The objective in equation 45 coves a wide range of personalized federated learning problems (Hanzely et al., 2021).
We further generalize the approach and study the following bilevel optimization problem:
[Equation]
subject to
[Equation]
When D m = ¯ D m , then equation 46 recovers equation 45.
When ¯ D m ̸
= D m , we then optimize the shared and local parameters on different datasets, which may prevent overfitting.
The formulation in equation 46 is closely related to the implicit MAML (Rajeswaran et al., 2019).
In the following, we use ∇ w to denote a partial derivative with respect to w with β m fixed, ∇ β m to denote a partial derivative with respect to β m with w fixed, and ∇ to denote a derivative with respect to w where β m ( w ) is treated as a function of w .
Let ∇ 2 β m β m G m ( w, β m ) ∈ R
d m × d m be the Hessian matrix of G m with respect to β m where w is fixed, and ∇ 2 wβ m G m ( w, β m )
∈ R d 0 ×
d m be the Hessian matrix of G m with respect to w and β m , that is,
[Equation]
for [Equation]
for
[Equation]
i
[Equation]
[Equation] j [Equation]
[Equation]
By the implicit function theorem, we have
[Equation]
where
[Equation]
There are two parts to ∇ h ( w t ) and, therefore, instead of choosing a single subset of clients for computing both parts, we decouple S t into two subsets S t 1 and S t 2 , S t =
S t 1 ∪ S t 2 .
We use clients in S t 1 to compute local updates of the first part, and clients in S t 2 to compute the local updates of the second part.
To get an estimate of ∇ h ( w ) , we can estimate ∇ 1 h ( w ) and ∇ 2 h ( w ) separably and then combine.
Assume that g t 1 ,m is an estimate of ∇ 1 F m ( w, ˆ β m ( w )) and g t 2 ,m is an estimate of ∇ 2 F m ( w, ˆ β m ( w )) , we can then construct estimates of ∇ 1 h ( w ) and ∇ 2 h ( w ) as
[Equation]
where K 1 = | S t 1 | and K 2 = | S t 2 | .
Then g t =
g t 1 + g t 2 is an estimate of ∇ h ( w ) .
We design p t 1 and p t 2 to choose S t 1 and S t 2 by minimizing the variance of the gradients.
Note that [Table]
[Equation]
[Table]
so that the decomposition allows us to better minimize the variance.
We term this approach as doubly variance reduction for personalized Federated Learning .
The first part minimizes the variance of updates to the shared global parameter, when the best local parameters are fixed; and the second part minimizes the variance of updates to local parameters, when the global part is fixed.
While these two parts are related, any given machine will have different contributions to these two tasks.
Adaptive-OSMD Sampler can be used to minimize the variance for both parts of the gradient.
We note that this is a heuristic approach to solving the client sampling problem when minimizing a personalized FL objective.
Personalized FL objectives have additional structures that should be used to design more efficient sampling strategies.
Furthermore, designing sampling strategies that improve the statistical performance of trained models, rather than improving computational speed, is important in the heterogeneous setting.
Addressing these questions is an important area for future research.
H. S AMPLING WITH PHYSICAL CONSTRAINT IN FL SYSTEM
In this paper, we assume that all clients are available in each round.
However, in practical FL applications, a subset of the clients may be inactive due to physical constraints, thus we have to assign zero probabilities to them.
In this section, we propose a simple extension of our proposed sampling method to such case.
Specifically, denote the subset of clients that are active at the beginning of round t as I t ⊆
[ M ] .
If we have | I t | ≤ K , we can then use all clients in I t to make updates in round t ; otherwise, we would like to choose a smaller subset S t ⊆
I t to participate.
This can be achieved by rescaling the output sampling distribution of any of our proposed methods, which we denote as ˆ p t .
We let ˜ p tm = ˆ p tm / ( (cid:80) i ∈ I
t ˆ p ti ) and ˜ p tm = 0 for
all m / ∈
I t .
We can then use ˜ p tm to choose S t from I t .
However, analyzing such a method in terms of convergence and regret guarantee is highly nontrivial.
Typically, for general active clients sequence { I t } Tt =1 , the optimization algorithms are not guaranteed to converge even if we involve all clients in I t in each round.
This can happen, for example, if a client is active for only once in the whole training process.
Thus, to ensure convergence, we need additional assumptions about { I t } Tt =1 .
Moreover, deriving regret bound is also very challenging, as assigning zero probability to any client will make the variance-reduction loss unbounded and thus the regret can be arbitrarily large.
To achieve such theoretical result, one may need to appropriately redefine the regret concept.
Such an analysis is beyond the scope of this paper and we leave it for future research.