A H IERARCHICAL B AYESIAN A PPROACH TO F EDERATED L EARNING
Anonymous authors
Paper under double-blind review
A BSTRACT
We propose a novel hierarchical Bayesian approach to Federated Learning FL) where our model reasonably describes the generative process of clients’ local data via hierarchical Bayesian modeling: constituting random variables of local models for clients that are governed by a higher
-level global variate. Interestingly , the variational inference in our Bayesian model leads to an optimisation problem whose block-coordinate descent solution becomes a distributed algorithm that is separable over clients and allows them not to reveal their own private data at all , thus fully compatible with FL.
We also highlight that our block-coordinate algorithm has particular forms that subsume the well known FL algorithms including Fed -Avg and Fed Prox as special cases. That is, we not only justify the previous
Fed -Avg and Fed -Prox algorithms whose learning protocols look intuitive but theoretically less underpinned, but also generalise them even further via principled Bayesian approaches.
Beyond introducing novel modeling and derivations, we also offer convergence analysis showing that our block -coordinate FL algorithm converges to an (local) optimum of the objective at the rate of O (1 / √ t )
, the same rate as regular (centralised)
SGD as well as the generalisation error analysis where we prove that the test error of our model on unseen data is guaranteed to vanish as we increase the training data size , thus asymptotically optimal.
I NTRODUCTION
Federated Learning (FL) aims to enable a set of clients to collaboratively train a model in a privacy preserving manner, without sharing data with each other or a central server.
Compared to conventional centralised optimisation problems, FL comes with a host of statistical and systems challenges – such as communication bottlenecks and sporadic participation.
The key statistical challenge is non-i.i.d.
data distributions across clients, each of which has a different data collection bias and potentially a different data annotation policy/labeling function – for example, in the case of any user preference learning.
The classic and most popularly deployed FL algorithms are Fed-Avg (McMahan et al., 2017) and Fed-Prox (Li et al., 2018), however, even when a global model can be learned, it often underperforms on each client’s local data distribution in scenarios of high heterogeneity (Li et al., 2019; Karimireddy et al., 2019; Wang et al., 2020).
Studies have attempted to alleviate this by personalising learning at each client, allowing each local model to deviate from the shared global model Sun et al.
However, this remains challenging given that each client may have a limited amount of local data for personalised learning.
These challenges have motivated several attempts to model the FL problem from a Bayesian perspective.
Introducing distributions on model parameters θ has enabled various schemes for estimating a global model posterior p ( θ | D 1: N ) from clients’ local posteriors p ( θ | D i ) , or to regularise the learning of local models given a prior defined by the global model Zhang et al.
; Al-Shedivat et al.
; Chen & Chao (2021).
However, these methods are not complete and principled solutions – having not yet have provided full Bayesian descriptions of the FL problem, and having had resort to ad-hoc treatments to achieve tractable learning.
The key difference is that they fundamentally treat network weights θ as a random variable shared across all clients.
We introduce a hierarchical
Bayesian model that assigns each client
it’s own random variable for model weights θ i , and these are linked via a higher level random variable ϕ as p ( θ 1: N , ϕ )
= p ( ϕ ) (cid:81)
Ni =1 p ( θ i | ϕ ) .
This has several crucial benefits: Firstly, given this hierarchy, variational inference in our framework decomposes into separable optimisation problems over θ i s and ϕ , enabling a practical Bayesian learning algorithm
[Figure]
to be derived that is fully compatible with FL constraints, without resorting to ad-hoc treatments or strong assumptions.
Secondly, this framework can be instantiated with different assumptions on p ( θ i | ϕ ) to deal elegantly and robustly with different kinds of statistical heterogeneity, as well as for principled and effective model personalisation.
Our resulting algorithm, termed Federated Hierarchical Bayes (FedHB) is empirically effective, as we demonstrate in a wide range of experiments on established benchmarks.
More importantly, it benefits from rigorous theoretical support.
In particular, we provide convergence guarantees showing that FedHB has the same O (1 / √ T ) convergence rate as centralised SGD algorithms, which are not provided by related prior art Zhang et al.
; Chen & Chao (2021).
We also provide a generalisation bound showing that FedHB is asymptotically optimal, which has not been shown by prior work such as Al-Shedivat et al.
Furthermore we show that FedHB subsumes classic methods FedAvg McMahan et al.
(2017) and FedProx Li et al.
as special cases, and ultimately provides additional justification and explanation for these seminal methods.
B AYESIAN FL: G ENERAL F RAMEWORK
We introduce two types of latent random variables, ϕ and { θ i } Ni =1 .
Each θ i is deployed as the network weights for client
i ’s backbone.
The variable ϕ can be viewed as a globally shared variable that is responsible for linking the individual client parameters θ i .
We assume conditionally independent and identical priors, p ( θ 1: N | ϕ ) =
(cid:81)
Ni =1 p ( θ i | ϕ ) .
Thus the prior for the latent variables ( ϕ, { θ i } Ni =1 ) is formed in a hierarchical manner as (1).
The local data for client i , denoted by D i , is generated 1 by θ i , (Prior) p ( ϕ, θ 1: N ) = p ( ϕ )
N (cid:89) i = p ( θ i | ϕ ) (Likelihood) p
( D i | θ i ) =
(cid:89) (
x,y ) ∈
D i p ( y | x, θ i ) , (1) where p ( y | x, θ i ) is a conventional neural network model (e.g., softmax link for classification tasks).
See the graphical model in Fig.
1(a) where the iid clients are governed by a single random variable ϕ .
Given the data D 1 , . . .
, D N , we infer the posterior, p ( ϕ, θ 1: N | D 1: N ) ∝ p ( ϕ ) (cid:81) N i =1 p ( θ i | ϕ ) p
( D i | θ i ) , which is intractable in general, and we adopt the variational inference to approximate it:
[Equation]
where the variational parameters L consists of L 0 (parameters for q ( ϕ ) ) and { L i } Ni =1 ’s (parameters for q i ( θ i ) ’s from individual clients).
Note that although θ i ’s are independent across clients under (2), they are differently modeled (emphasised by the subscript i in notation q i ), reflecting different posterior beliefs originating from heterogeneity of local data D i ’s.
2. F ROM V ARIATIONAL I NFERENCE TO F EDERATED L EARNING A LGORITHM
Using the standard variational inference techniques (Blei et al., 2017; Kingma & Welling, 2014), we can derive the ELBO objective function (details in Appendix A).
We denote the negative ELBO by L (to be minimised over L ) as follows:
[Equation]
where we drop the dependency on L in notation for simplicity.
Instead of optimizing (3) over the parameters
L jointly as usual practice, we consider block-wise optimisation, also known as blockcoordinate optimisation (Wright, 2015), specifically alternating two steps: (i) updating/optimizing all
L i ’s i
= 1 , . .
, N while fixing L 0 , and (ii) updating L 0 with all L i ’s fixed.
That is,
• Optimisation over L 1 , . . .
L N ( L 0 fixed)
[Equation]
As (4) is completely separable over i , and we can optimise each summand independently as:
[Equation]
So (5) constitutes local update/optimisation for client i .
Note that each client i needs to access its private data D i only without data from others, thus fully compatible with FL.
• Optimisation over L 0 ( L 1 , . . . ,
L N fixed).
[Equation]
This constitutes server update criteria while the latest q i ( θ i ; L i ) ’s from local clients being fixed.
Remarkably, the server needs not access any local data at all, suitable for FL.
This nice property originates from the independence assumption in our approximate posterior (2).
Interpretation.
First, server’s loss function (6) tells us that the server needs to update q ( ϕ ; L 0 ) in such a way that (i) it puts mass on those ϕ that have high compatibility scores log p ( θ i | ϕ ) with the current local models θ i ∼ q
i
θ i ) , thus aiming to be aligned with local models, and (ii) it does not deviate from the prior p ( ϕ ) .
Clients’ loss function (5) indicates that each client i needs to minimise the class prediction error on its own data D i (first term), and at the same time, to stay close to the current global standard ϕ ∼ q ( ϕ ) by reducing the KL divergence from p ( θ i | ϕ )
(second term).
2. F ORMALISATION OF G LOBAL P REDICTION AND P ERSONALISATION T ASKS
Two important tasks in FL are: global prediction and personalisation .
The former evaluates the trained model on novel test data sampled from a distribution possibly different from training data.
Personalisation is the task of adapting the trained model on a new dataset called personalised data.
In our Bayesian model, these two tasks can be formally defined as Bayesian inference problems.
Global prediction.
The task is to predict the class label of a novel test input x ∗ which may or may not come from the same distributions as the training data D 1 , . . .
D N .
Under our Bayesian model, it can be turned into a probabilistic inference problem p
( y ∗ | x ∗ , D 1: N ) .
Let θ be the local model that generates the output y ∗ given x ∗ .
Exploiting conditional independence from Fig.
1(c),
[Equation]
where in (8) we use p ( ϕ | D 1: N ) ≈ q ( ϕ ) .
The inner integral (in parentheses) in (8) either admits a closed form (Sec. 3.1) or can be approximated (e.g., Monte-Carlo estimation).
Personalisation.
It formally refers to the task of learning a prediction model ˆ p ( y | x ) given an unseen (personal) training dataset D p that comes from some unknown distribution p p ( x, y ) , so that the personalised model ˆ p performs well on novel (in-distribution) test points ( x p , y p ) ∼ p p ( x, y ) .
Evidently we need to exploit (and benefit from) the trained model from the FL training stage.
To this end many existing approaches simply resort to finetuning , that is, training on D p warm-starting with the FL-trained model.
However, a potential issue is the lack of a solid principle on how to balance the initial FL-trained model and personal data fitting to avoid underfitting and overfitting.
In our Bayesian framework, the personalisation can be seen as another posterior inference problem with additional evidence of the personal training data D p .
Prediction on a test point x p amounts to inferring:
[Equation]
[Equation] So, it boils down to the task of posterior inference p ( θ | D p , D 1: N ) given both the personal data D p and the FL training data D 1: N .
Under our hierarchical model, by exploiting conditional independence from graphical model (Fig. 1(d)), we can link the posterior to our FL-trained q ( ϕ ) as follows:
[Equation]
where we disregard the impact of D p on the higher-level ϕ given the joint evidence, p ( ϕ | D p , D 1: N ) ≈ p ( ϕ | D 1: N ) due to the dominance of D 1: N compared to smaller D p .
The last part of (10) makes approximation using the mode ϕ ∗ of q ( ϕ ) , which is reasonable for our two modeling choices for q ( ϕ ) to be discussed in Sec.
3.1 and Sec. 3.2.
Since dealing with p ( θ | D p , ϕ ∗ ) involves difficult marginalisation p ( D p | ϕ ∗ )
= (cid:82) p ( D p | θ ) p ( θ | ϕ ∗ ) dθ , we adopt variational inference, introducing a tractable variational distribution v ( θ )
≈ p
( θ | D p , ϕ ∗ ) .
Following the usual variational inference derivations, we have the negative ELBO objective (for personalisation):
[Equation]
Once we have the optimised model v , our predictive distribution becomes: [Equation] θ
[Equation]
∼
[Equation] [Equation] [Equation] 12) which simply requires feed-forwarding test input x p through the sampled networks θ ( s ) and averaging.
Thus far, we have discussed a general framework, deriving how the variational inference for our
Bayesian model fits gracefully in the FL problem.
In the next section, we define specific density families for the prior ( p ( ϕ ) , p ( θ i | ϕ ) ) and posterior ( q ( ϕ ) , q i ( θ i ) ) as our proposed concrete models.
B AYESIAN FL: T WO C ONCRETE M ODELS
We propose two different model choices that we find the most interesting: Normal-Inverse-Wishart (Sec. 3.1) and Mixture (Sec. 3.2).
To avoid distraction, we make this section concise putting only the final results and discussions, and leaving all mathematical details in Appendix B and C.
3. N ORMAL -I NVERSE -W ISHART (NIW) M ODEL
We define the prior as a conjugate form of Gaussian and Normal-Inverse-Wishart.
With ϕ = ( µ, Σ) ,
[Equation]
where Λ = { µ 0 , Σ 0 , λ 0 , ν 0 } is the parameters of the NIW.
Although Λ can be learned via data marginal likelihood maximisation (e.g., empirical Bayes), but for simplicity we leave it fixed as 2 : µ 0 = 0 , Σ
=
I , λ 0 = 1 , and ν 0 =
d + 2 where d is the number of parameters in θ i or µ .
Next, our choice of the variational density family for q ( ϕ ) is the NIW, not just because it is the most popular parametric family for a pair of mean vector and covariance matrix ϕ
= ( µ, Σ) , but it can also admit closed-form expressions in the ELBO function due to the conjugacy as we derive in Sec.
B.1.
[Equation]
Although the scalar parameters l 0 , n 0 can be optimised together with m 0 , V 0 , their impact is less influential and we find that they make the ELBO optimisation a little bit cumbersome.
So we fix l 0 , n 0 with some near-optimal values by exploiting the conjugacy of the NIW under Gaussian likelihood (details in Appendix B), and regard m 0 , V 0 as variational parameters, L 0 = { m 0 , V 0 } .
We restrict Vto be diagonal for computational tractability.
The density family for q i ( θ i ) ’s can be a Gaussian, but we find that it is computationally more attractive and numerically more stable to adopt the mixture of two spiky Gaussians that leads to the MC-Dropout (Gal & Ghahramani, 2016).
That is,
[Equation]
where (i) m
i is the only variational parameters ( L i = { m i } ), (ii) · [ l ] indicates a column/layer in neural network parameters where l goes over layers and columns of weight matrices, (iii) p is the (user-specified) hyperparameter where 1 − p corresponds to the dropout probability, and (iv) ϵ is small constant (e.g., 10 − 4 ) that makes two Gaussians spiky, close to the delta functions.
Client update.
We apply the general client update optimisation (5) to the NIW model.
Following the approximation of (Gal & Ghahramani, 2016) for the KL divergence between a mixture of Gaussians (16) and a Gaussian (14), we have the client local optimisation (details in Appendix B):
[Equation]
where ˜ m
i is the dropout version of m i , i.e., a reparametrised sample from (16).
Note that m 0 and Vare fixed during the optimisation.
Interestingly (17) generalises Fed-Avg (McMahan et al., 2017) and
Fed-Prox (Li et al., 2018):
With p = 1 (i.e., no dropout) and setting V 0 = αI , (17) reduces to the client update formula for Fed-Prox where constant α controls the impact of the proximal term.
Server update.
The general server optimisation (6) admits the closed-form solution (Appendix B): m [Equation] =
[Equation]
where ρ ( m 0 , m i , p )
=
pm i m ⊤
i − pm 0 m ⊤ i − pm i m ⊤ 0 + m 0 m ⊤ 0 .
Note that m i ’s are fixed from clients’ latest variational parameters.
It is interesting to see that m ∗ 0 in (18) generalises the well-known aggregation step of averaging local models in Fed-Avg (McMahan et al., 2017) and related methods: when p = 1 (no dropout), it almost 3 equals client model averaging.
Also, since ρ ( m ∗ 0 , m i , p = 1)
=
( m i − m ∗ 0 ) ( m i − m ∗ 0 )
⊤ when p = 1 , V ∗ 0 essentially estimates the sample scatter matrix with ( N + 1) samples, namely clients’ m i ’s and server’s prior µ 0 = 0 , measuring how much they deviate from the center m ∗ 0 .
The dropout is known to help regularise the model and lead to better generalisation (Gal & Ghahramani, 2016), and with p <
1 our (18) forms a principled optimal solution.
Global prediction.
The inner integral of (8) becomes the multivariate Student- t distribution.
Then the predictive distribution for a new test input x ∗ can be estimated as 4 :
[Equation]
, where θ [Equation]
where t ν ( a, B ) is the multivariate Student- t with location a , scale matrix B , and d.o.f.
ν .
Personalisation.
With the given personalisation training data D p , we follow the general framework in (11) to find v ( θ )
≈ p
( θ | D p , ϕ ∗ ) in a variational way, where ϕ ∗ obtained from (34).
We adopt the same spiky mixture form (16) for v ( θ ) , which leads to the learning objective similar to (17).
3. M IXTURE M ODEL
Our motivation for mixture is to make the prior p ( θ, ϕ ) more flexible by having multiple different prototypes, diverse enough to cover the heterogeneity in data distributions across clients.
We consider:
[Equation]
where ϕ
= { µ 1 , . . .
, µ K } contains K networks (prototypes) that can broadly cover the clients data distributions, and
σ is the hyperparameter that captures perturbation scale, chosen by users or learned from data.
Note that we put equal mixing proportions 1 /K due to the symmetry, a priori.
That is, each client can take any of µ j ’s equally likely a priori.
For the variational densities, we define:
[Equation]
where { r j } Kj =1 ( L 0 ) and
m i
( L i ) are the variational parameters, and ϵ is small constant (e.g., 10 − 4 ).
Client update.
For our model choice, the general client update (5) reduces to (details in Appendix C):
[Equation]
It is interesting to see that (22) can be seen as generalisation of Fed-Prox (Li et al., 2018), where the proximal regularisation term in Fed-Prox is extended to multiple global models r j ’s, penalizing the local model ( m i ) straying away from these prototypes.
And if we use a single prototype ( K = 1 ), the optimisation (22) exactly reduces to the local update objective of Fed-Prox.
Since log-sum-exp is approximately equal to max , the regularisation term in (22) effectively focuses on the closest global prototype r j from the current local model
m i , which is intuitively well aligned with our motivation.
Server update.
The general form (6) can be approximately turned into (Appendix C for derivations):
[Equation]
Interestingly, (23) generalises the well-known aggregation step of averaging local models in Fed-Avg and related methods: Especially when K = 1 , (23) reduces to quadratic optimisation, admitting the optimal solution r ∗ 1 = 1 N
[Equation]
Ni =
m i .
The extra term σ 2 can be explained by incorporating an extra zero local model originating from the prior (interpreted as a neutral model) with the discounted weight σ 2 rather than 1 .
Although (23) for K > 1 can be solved by standard gradient descent, we apply the Expectation-Maximisation (EM) algorithm 5 (Dempster et al., 1977) instead:
[Equation]
The M-step (server update) has intuitive meaning that the new prototype r j becomes the weighted average of the local models
m i ’s where the weights c ( j | i ) are determined by the proximity between m i and r j
(i.e., those m i ’s that are closer to r
j have more contribution, and vice versa).
This can be seen as an extension of the aggregation step in Fed-Avg to the multiple prototype case.
Global prediction.
We slightly modify our general approach to make individual client data dominantly explained by the most relevant model r j , by introducing a gating function from the mixture of experts (Jacobs et al., 1991; Jordan & Jacobs, 1994).
See Appendix C for details.
Personalisation.
With v ( θ ) of the same form as q i ( θ i ) , the VI learning becomes similar to (22).
T HEORETICAL A NALYSIS
We provide two theoretical results for our Bayesian FL algorithm:
( Convergence analysis )
As a special block-coordinate optimisation algorithm, we show that it converges to an (local) optimum of the training objective (3); ( Generalisation error bound )
We theoretically show how well this optimal model trained on empirical data performs on unseen test data points.
Due to space limit, full details and proofs are described in Appendix D,E, and we only state the theorems and remarks here.
Theorem 4.1 (Convergence analysis) .
We denote the objective function in (3) by f ( x ) where x = [ x 0 , x 1 , . . .
, x N ] corresponding to the variational parameters x 0 :
=
L 0 , x 1 :=
L 1 , ... , x N :=
L N .
Let η t =
L + √ t for some constant L , and x T = 1 T (cid:80)
Tt =1 x t , where t is the batch iteration counter, x t is the iterate at t by following our FL algorithm, and N f ( ≤ N ) is the number of participating clients at each round.
With Assumptions 1–3 in Appendix D, the following holds for any T :
[Equation]
where x ∗ is the (local) optimum, D , and R f are some constants, and the expectation is taken over randomness in minibatches and selection of participating clients.
Remark.
It says that x t converges to the optimal point x ∗ in expectation at the rate of O (1 / √ t ) .
This rate asymptotically equals that of the conventional (non-block-coordinate, holistic) SGD algorithm.
Theorem 4.2 (Generalisation error bound) .
Assume that the variational density family for q i ( θ i ) is rich enough to subsume Gaussian.
Let d 2 ( P θ i , P i ) be the expected squared Hellinger distance between the true class distribution P i ( y | x ) and model
’s
P θ i ( y | x ) for client
i ’s data.
The optimal solution ( { q ∗ i ( θ i ) } Ni =1 , q ∗ ( ϕ )) of the optimisation problem (3) satisfies:
[Equation]
with high probability, where C, C ′ > 0 are constant, λ ∗ i = min θ ∈ Θ
|| f
θ − f i || 2 ∞ is the best error within our backbone network family Θ , and r n , ϵ n → 0 as the training data size n → ∞ .
Remark.
It implies that the optimal solution of (3) (attainable by our block-coordinate FL algorithm) is asymptotically optimal , since the RHS of (26) converges to 0 as the training data size n → ∞ .
[Figure]
Global prediction
[Figure]
Personalisation
[Figure]  R ELATED W ORK
General FL approaches. FedAvg (McMahan et al., 2017) is the pioneering seminal work on FL, which proposed fairly intuitive local training and global aggregation strategies with minimal training and communication complexity.
A potential issue of divergence of global and local models due to the separated steps of local training and aggregation was addressed by model regularisation in the followup works (Li et al., 2018; Acar et al., 2021), which is shown to help the global model converge more reliably. Recent approaches aimed to incorporate benefits from existing machine learning approaches including domain adaptation/generalisation, clustering, multi-task learning, transfer learning, and meta-learning.
Due to the lack of space, we leave related references in Appendix I.
Comparison to existing Bayesian FL approaches.
Some recent studies tried to address the FL problem using Bayesian methods.
As we mentioned earlier, the key difference is that these methods do not introduce Bayesian hierarchy , and ultimately treat network weights θ as a random variable shared across all clients, while our approach assigns individual θ i to each client i governed by a common prior p ( θ i | ϕ ) . The non-hierarchical approaches must all resort to ad hoc heuristics or strong assumptions in parts of their algorithm.
Due to the lack of space, we leave related references and discussions in Appendix I.
E VALUATION
In this section we evaluate the proposed hierarchical Bayesian models on two benchmark datasets: the popular CIFAR-100 and the challenging corrupted version ( CIFAR-C-100 ) that renders the client data more heterogeneous both in input images and class distributions.
FL settings for CIFAR-100.
We follow the settings similar to those used in (Oh et al., 2022); in particular the client data distributions are heterogeneous non-iid, formed by the sharding-based class sampling (McMahan et al., 2017).
More specifically, we partition data instances in each class into non-overlapping equal-sized shards, and assign s randomly sampled shards (over all classes) to each of N clients.
Thus the number of shards per user s can control the degree of data heterogeneity: small s leads to more heterogeneity, and vice versa.
The number of clients N = 100 (each havingtraining, 100 test samples), and we denote by f
the fraction of participating clients.
So, N f = ⌊ N · f ⌋ clients are randomly sampled at each round to participate in training.
Smaller f makes the FL more challenging, and we test two settings: f = 1 . 0 and 0 .
Lastly, the number of epochs for client local update at each round is denoted by τ where we test τ = 1 and 10 , and the number of total rounds is determined by τ as ⌊ 320 /τ ⌋ for fairness.
Note that smaller τ incurs more communication cost but often leads to higher accuracy.
FL settings for CIFAR-100-Corrupted
(CIFAR-C-100).
The dataset (Hendrycks & Dietterich, 2019) makes CIFAR-100’s test split ( 10 K images) corrupted by 19 different noise processes (e.g.,
Gaussian, motion blur, JPEG).
For each corruption type, there are 5 corruption levels, and we use the severest one.
Randomly chosen 10 corruption types are used for training (fixed) and the rest 9 types for personalisation.
We divide N = 100 clients into 10 groups, each group assigned one of thetraining corruption types exclusively (denoted by D c the corrupted data for the group c = 1 , . . . , 10 ).
Each D c is partitioned into 90% / 10% training/test splits, and clients in each group ( ⌊ N/ 10 ⌋ clients) gets non-iid train/test subsets from D c ’s train/test splits by following the sharding strategy with s = 100 or 50 .
This way, the clients in different groups have considerable distribution shift in input images, while there also exists heterogeneity in class distributions even within the same groups.
For the FL-trained models, we evaluate global prediction on two datasets: clients’ test splits from thetraining corruption types and the original (uncorrupted) CIFAR’s training split ( 50 K images).
For personalisation , we partition the clients into 9 groups, and assign one of the 9 corruption types to each group exclusively.
Within each group we form non-iid sharding-based subsets similarly, and again we split the data into the 90% training/finetuning split and 10% test.
Note that this personalisation [Table] setting is more challenging compared to CIFAR-100 since the data for personalisation are utterly unseen during the FL training stage.
We test τ = 1 and 4 scenarios.
Experimental settings.
Our implementation is based on Oh et al.
(2022) where we use the MobileNet (Howard et al., 2017) as a backbone, and follow the body-update strategy: the classification head (the last layer) is randomly initialised and fixed during training, with only the network body updated (and both the body and head updated at the personalisation stage).
We report experimental results all based on this body-update strategy since we observe that it considerably outperforms the full update for our models and all other competing methods.
The hyperparameters in our models are: ( NIW ) ϵ
= 10 − 4 and p = 1 − 0 .
001 (See below for ablation study of other values); ( Mixture ) σ 2 = 0 .
1 , ϵ = 10 − 4 , mixture order K = 2 (See Appendix F.1 for results with other values), and the gating network has the same architecture as the main backbone, but with output cardinality changed to K .
The other hyperparameters including batch size ( 50 ), learning rate ( 0 . 1 initially and decayed by 0 . 1 ) and the number of epochs in personalisation ( 5 ), are the same as those in (Oh et al., 2022).
Main results.
In Table 1 (CIFAR-100) and Table 2 (CIFAR-C-100), we compare our methods (NIW and Mixture with K = 2 ) against the popular FL methods, Fed-BABU (Oh et al., 2022),
Fed-Avg (McMahan et al., 2017), Fed-Prox (Li et al., 2018), and the recent pFedBayes (Zhang et al., 2022).
The latter is especially interesting to contrast with as it is based on variational inference, most closely related to ours.
We run the competing methods (implementation based on their public codes) with default hyperparameters (e.g., µ = 0 .
01 for FedProx) and report the results.
First of all, our two models (NIW and Mix.) consistently perform the best (by large margins most of the time) in terms of both global prediction and personalisation for nearly all FL settings on the two datasets.
This is attributed to the principled Bayesian modeling of the underlying FL data generative process in our approaches that can be seen as rigorous generalisation and extension of the existing intuitive algorithms such as Fed-Avg and Fed-Prox.
In particular, the superiority of our methods to the other
Bayesian approach pFedBayes verifies the effectiveness of modeling client-wise latent variables θ i against the commonly used shared θ modeling, especially for the scenarios of significant client data heterogeneity (e.g., CIFAR-C-100 personalisation on data with unseen corruption types).
(Ablation)
Hyperparameter sensitivity.
We test sensitivity to some key hyperparameters in our models.
For NIW, we have p = 1 − p drop , the MC-dropout probability, where we used p drop = 0 . [Table]
in the main experiments.
In Fig.
2(a)
we report the performance of NIW for different values ( p drop = 0 , 10 − 4 , 10 − 2 ) on CIFAR-100 with ( s = 100 , f = 0 . 1 , τ = 1 ) setting.
We see that the performance is not very sensitive to p drop unless it is too large (e [Table] g., 0 . 01 ).
For the Mixture model, different mixture orders K = 2 , 5 , 10 are contrasted in Fig. 2(b).
As seen, having more mixture components does no harm (no overfitting) [Table] but we do not see further improvement over K = 2 in our experiments (See also results on CIFAR-C-100 in Table 4 in Appendix).
Further analysis.
In Appendix [Table] we provide further empirical results: (i) comparison between our mixture model and simple ensemble baselines (Fig. 2(b) and F.2) and (ii) actual running times (F.3).
C ONCLUSION
We have proposed a novel hierarchical Bayesian approach to FL where the block-coordinate descent solution to the variational inference leads to a viable algorithm for FL.
Our method not only justifies the previous FL algorithms that look intuitive but theoretically less underpinned, but also generalises them even further via principled Bayesian approaches.
With strong theoretical support in convergence rate and generalisation error, our approach is also empirically shown to be superior to recent FL approaches by large margin on several benchmarks with various FL settings.
A ELBO D ERIVATION FOR G ENERAL F RAMEWORK
We derive the ELBO objective (3) for the general Bayesian FL framework.
[Equation]
Since KL divergence is non-negative, −L ( L ) must be lower bound of the data log-likelihood log p ( D 1: N ) , rendering L ( L ) as our objective function (to be minimised).
B N ORMAL -I NVERSE -W ISHART (NIW) M ODEL (D ETAILED V ERSION )
We define the prior as a conjugate form of Gaussian and Normal-Inverse-Wishart.
More specifically, each local client has Gaussian prior p ( θ i | ϕ )
=
N ( θ i ; µ, Σ) where ϕ
= ( µ, Σ) , and the global latent variable ϕ is distributed as a conjugate prior which is Normal-Inverse-Wishart (NIW),
[Equation]
where Λ = { µ 0 , Σ 0 , λ 0 , ν 0 } is the parameters of the NIW.
Although Λ can be learned via data marginal likelihood maximisation (e.g., empirical Bayes), but for simplicity we leave it fixed as: µ 0 = 0 , Σ
=
I , λ 0 = 1 , and ν 0 =
d + 2 where d is the number of parameters in θ i or µ .
This choice ensures that the mean of Σ equals I , and µ is distributed as zero-mean Gaussian with covariance Σ .
Next, our choice of the variational density family for q ( ϕ ) is the NIW, not just because it is the most popular parametric family for a pair of mean vector and covariance matrix ϕ
= ( µ, Σ) , but it can also admit closed-form expressions in the ELBO function due to the conjugacy as we derive in Sec.
B.1.
[Equation]
Although the scalar parameters l 0 , n 0 can be optimised together with m 0 , V 0 , their impact is less influential and we find that they make the ELBO optimisation a little bit cumbersome.
So we aim to estimate their optimal values in advance with reasonably good quality.
To this end, we exploit the conjugacy of the NIW prior-posterior under the Gaussian likelihood.
For each θ i , we pretend that we have instance-wise representative estimates θ i ( x, y ) , one for each ( x, y ) ∈
D i .
For instance, one can view θ i ( x, y ) as the network parameters optimised with the single training instance ( x, y ) .
Then this amounts to observing | D | ( = (cid:80) N i =
| D i | ) Gaussian samples θ i ( x, y ) ∼ N ( θ i ; µ, Σ) for ( x, y ) ∼ D
i
and i = 1 , . .
. , N .
Then applying the NIW conjugacy, the posterior is the NIW with l 0 = λ 0 + | D | = | D | + 1 and n 0 = ν 0 + | D | = | D | + d + 2 .
This gives us good approximate estimates for the optimal l 0 , n 0 , and we fix them throughout the variational optimisation.
Note that this is only heuristics for estimating the scalar parameters l 0 , n 0 quickly, and the parameters m 0 , Vare determined by the principled ELBO optimisation (Sec. B.1).
That is, L 0 = { m 0 , V 0 } .
Since the dimension d is large (the number of neural network parameters), we restrict V 0 to be diagonal for computational tractability.
The density family for q i ( θ i ) ’s can be a Gaussian, but we find that it is computationally more attractive and numerically more stable to adopt the mixture of two spiky Gaussians that leads to the
MC-Dropout (Gal & Ghahramani, 2016).
That is,
[Equation]
where (i) m
i is the only variational parameters ( L i = { m i } ), (ii) · [ l ] indicates the specific column/layer in neural network parameters where l goes over layers and columns of weight matrices, (iii) p is the (user-specified) hyperparameter where 1 − p corresponds to the dropout probability, and (iv) ϵ is a tiny constant (e.g., 10 − 6 ) that makes two Gaussians spiky, close to the delta function.
Now we provide more detailed derivations for the client optimisation and server optimisation.
B. D ETAILED D ERIVATIONS FOR NIW M ODEL
Client update.
We work on the objective function in the general client update optimisation (5).
We note that q ( ϕ ) is spiky since our pre-estimated NIW parameters l 0 and n 0 are large (as the entire training data size | D | is added to the initial prior parameters).
Due to the spiky q ( ϕ ) , we can accurately approximate the second term in (5) as: E
[Equation]
where ϕ ∗ =
( µ ∗ , Σ ∗ ) is the mode of q ( ϕ ) , which has closed forms for the NIW distribution:
[Equation]
In (33) we have the KL divergence between a mixture of Gaussians (32) and a Gaussian (30).
Similar to (Gal & Ghahramani, 2016), we apply the approximation KL ( (cid:80) i
α
i N i ||N )
≈ (cid:80) i
α i KL ( N i ||N ) as well as the reparametrised sampling for (32), which allows us to rewrite (5) as:
[Equation]
where ˜ m
i is the dropout version of m i , i.e., a reparametrised sample from (32).
Also, we use a minibatch version of the first term for a tractable SGD update, which amounts to replacing the first term by the batch average E ( x,y ) ∼ Batch [ − log p ( y | x, ˜ m i )] while downweighing the second term by the factor of 1 / | D i | .
Note that m 0 and V 0 are fixed during the optimisation.
Interestingly (35) generalises the famous Fed-Avg (McMahan et al., 2017) and
Fed-Prox (Li et al., 2018):
With p = 1 (i.e., no dropout) and setting V 0 = αI for some constant α , we see that (35) reduces to the client update formula for Fed-Prox where α controls the impact of the proximal term.
Server update.
The server optimisation (6) involves two terms, both of which we will show admit closed-form expressions thanks to the conjugacy.
Furthermore, we show that the optimal solution ( m 0 , V 0 ) of (6) has an analytic form.
First, the KL term in (6) is decomposed as:
[Equation]
By some algebra, (36) becomes identical to the following, up to constant, removing those terms that are not dependent on m 0 , V
(See Appendix B.2 for derivations):
[Equation]
Next, the second term of (6) also admits a closed form as follows (Appendix B.2 for details):
[Equation]
That is, server’s loss function L 0 is the sum of (37) and (38).
We can take the gradients of the loss with respect to m 0 , V 0 as follows (also plugging µ 0 = 0 , Σ
=
I, λ 0 = 1 ,
[Equation]
= d
[Equation] [Equation]
40) where ρ ( m 0 , m i , p )
=
pm i m ⊤
i − pm 0 m ⊤ i − pm i m ⊤ 0 + m 0 m ⊤ 0 .
We set the gradients to zero and solve for them, which yields the optimal solution:
[Equation]
Note that m i ’s are fixed from clients’ latest variational parameters.
It is interesting to see that m ∗ 0 in (41) generalises the well-known aggregation step of averaging local models in Fed-Avg (McMahan et al., 2017) and related methods: when p = 1 (i.e., no dropout), it almost 6 equals client model averaging.
Also, since ρ ( m ∗ 0 , m i , p = 1)
=
( m i − m ∗ 0 ) ( m i − m ∗ 0 )
⊤ when p = 1 , we can see that V ∗ 0 in (41) essentially estimates the sample scatter matrix with ( N +1) samples, namely clients’ m i ’s and server’s prior µ 0 = 0 , measuring how much they deviate from the center m ∗ 0 .
It is known that the dropout can help regularise the model and lead to better generalisation (Gal & Ghahramani, 2016), and with p < 1 our (41) forms a principled optimal solution.
Global prediction.
In the inner integral of (8) of the general predictive distribution, we plug p ( θ | ϕ ) =
N ( θ ; µ, Σ) and NIW q ( ϕ ) of (31).
This leads to the multivariate Student- t distribution: (cid:90)
[Equation]
where t ν ( a, B ) is the multivariate Student- t with location a , scale matrix b , and d.o.f.
ν .
Then the predictive distribution for a new test input x ∗ can be estimated as 7 :
[Equation]
) ) , where θ
[Equation]
s ) ∼ t
[Equation]
Personalisation.
With the given personalisation training data D p , we follow the general framework in (11) to find v ( θ )
≈ p
( θ | D p , ϕ ∗ ) in a variational way, where ϕ ∗ obtained from (34).
For the density family for v ( θ ) we adopt the same spiky mixture form as (32),
[Equation]
where m is the variational parameters.
This leads to the MC-dropout-like learning objective,
[Equation]
Once v is trained, our predictive distribution follows the MC sampling (12).
B. M ATHEMATICAL D ETAILS
The server optimisation (6) in our NIW model involves two terms, both of which we will show admit closed-form expressions thanks to the conjugacy.
Furthermore, we show that the optimal solution ( m 0 , V 0 ) of (6) has an analytic form.
First, the KL term in (6) is decomposed as:
[Equation]
First we work on kl a = E IW (Σ; V 0 ,n 0 ) [log IW (Σ; V 0 , n 0 )]
− E IW (Σ; V 0 ,n 0 ) [log IW (Σ; Σ 0 , ν 0 )] .
From the definition of Inverse-Wishart (assuming Σ =
( d × d ) ), log
[Equation]
where Γ d ( · ) is the multivariate Gamma function.
We use the following facts from (Bishop, 2006;
Braun & McAuliffe, 2008):
[Equation]
where ψ ( · ) is the digamma function.
Applying these to the terms in kl a yields:
[Equation]
Next, using the closed-form expression for the KL between Gaussians, kl b becomes:
[Equation]
where in (55) we use the fact (52).
Combining (56) and (55), we have:
[Equation]
Next, we derive the second term of (6) ( = utc stands for equality up to constant (w
[Equation]
r
[Equation]
t
[Equation]
m 0 , V 0 ))
[Equation]
where ρ ( m 0 , m i , p )
=
pm i m ⊤
i − pm 0 m ⊤ i − pm i m ⊤ 0 + m 0 m ⊤ 0 , and we use the definition of q i ( θ i ) in (32) and the fact (52).
C M IXTURE M ODEL (D ETAILED V ERSION )
Previously, the NIW model expresses our prior belief where each client i acquires its own network parameters θ i a priori as a Gaussian-perturbed version of the shared parameters µ , namely θ i | ϕ ∼
N ( µ, Σ) , as in (14).
This is intuitively appealing, but may not be adequate for capturing more drastic diversity in local data across clients.
In the situations where clients’ local data distributions, as well as their domains and class label semantics, are highly heterogeneous (possibly even set up for adversarial purpose), it would be ideal to consider multiple different prototypes for the network parameters, diverse enough to cover the heterogeneity in data distributions across clients.
Motivated from this idea, we introduce a mixture prior model as follows.
First we consider that there are K network parameters (prototypes) that can broadly cover the clients data distributions.
They are denoted as high-level latent variables, ϕ = { µ 1 , . . .
, µ K } , and we let them distributed independently as standard normal a priori,
[Equation]
We here note some clear distinction from the NIW prior.
Whereas the NIW prior (13) only controls the mean µ and covariance Σ in the Gaussian, from which local models θ i are sampled, the mixture prior (63) is far more flexible in covering highly heterogeneous distributions.
Each local model is then assumed to be chosen from one of these K prototypes.
Thus the prior distribution for θ i can be modeled as a mixture,
[Equation]
where σ is the hyperparameter that captures perturbation scale, and can be chosen by users or learned from data.
Note that we put equal mixing proportions 1 /K due to the symmetry, a priori.
That is, each client can take any of µ j ’s equally likely a priori.
We then describe our choice of the variational density q ( ϕ ) (cid:81)
i q i ( θ i ) to approximate the posterior p ( ϕ, θ 1: N | D 1: N ) .
First, q i ( θ i ) is chosen as a Gaussian,
[Equation] [Equation]
with small ϵ .
For q ( ϕ ) we consider a Gaussian factorised over µ j ’s, but with small variances, that is,
[Equation]
) where { r j } Kj =1 are variational parameters ( L 0 ) and ϵ is small (e.g., 10 − 4 ).
The main reason why we make q ( ϕ ) spiky is that the resulting near-deterministic q ( ϕ ) allows for computationally efficient and accurate MC sampling during ELBO optimisation as well as test time (global) prediction, avoiding difficult marginalisation (Sec.
C.1 for details).
Although Bayesian inference in general encourages to retain as many plausible latent states as possible under the given evidence (observed data), we aim to model this uncertainty by having many (possibly redundant) prototypes µ j ’s rather than imposing larger variance for a single one (e.g., finite-sample approximation of a smooth distribution).
C. D ETAILED D ERIVATIONS FOR M IXTURE M ODEL
With the full specification of the prior distribution and the variational density family, we are ready to dig into the client objective function (5) and the server (6).
Client update.
Since q ( ϕ ) is spiky, we can accurately approximate the second term of (5) as
KL ( q i ( θ i ) ||
p ( θ i | ϕ ∗ )) where ϕ ∗ = { µ ∗ j = r j } Kj =1 is the mode of q ( ϕ ) since
[Equation]
Since q i ( θ i ) is also spiky, KL ( q i ( θ i ) ||
p ( θ i | ϕ ∗ )) , the KL divergence between a Gaussian and a
Gaussian mixture, can be approximated accurately using the single mode sample
m i ∼ q i ( θ i ) , that is,
KL
[Equation]
q i
[Equation]
Note here that we use the fact that m i disappears in log q
i ( m i ) .
Plugging it into (5) yields the following optimisation for client i :
[Equation]
It is interesting to see that (70) can be seen as generalisation of Fed-Prox (Li et al., 2018), where the proximal regularisation term in Fed-Prox is extended to multiple global models r j ’s, penalizing the local model ( m i ) straying away from these prototypes.
And if we use a single prototype ( K = 1 ), the optimisation (70) exactly reduces to the local update objective of Fed-Prox.
Since log-sum-exp is approximately equal to max , the regularisation term in (70) effectively focuses on the closest global prototype r j from the current local model
m i , which is intuitively well aligned with our initial modeling motivation, namely each local data distribution is explained by one of the global prototypes.
Lastly, we also note that in the SGD optimisation setting where we can only access a minibatch
B ∼ D i during the optimisation of (70)
, we follow the conventional practice: replacing the first term of the negative log-likelihood by a stochastic estimate
E q i ( θ i ) E ( x,y ) ∼ B [ − log p ( y | x, θ i )] and multiplying the second term of regularisation by 1 | D i | .
Server update.
First, the KL term in (6) can be easily derived as:
[Equation]
and the second term of (6) approximated as follows:
[Equation]
where the approximations in (72) become accurate due to spiky q
i ( θ i ) and q ( ϕ ) , respectively.
Combining the two terms leads to the optimisation problem for the server:
[Equation]
Interestingly, (74) generalises the well-known aggregation step of averaging local models in FedAvg (McMahan et al., 2017) and related methods: Especially when K = 1 , (74) reduces to quadratic optimisation, admitting the optimal solution r ∗ 1 =
[Equation]
i .
The extra term σ 2 in the denominator can be explained by incorporating an extra zero local model originating from the prior (interpreted as a neutral model) with the discounted weight σ 2 rather than 1 .
Although (74) for K > 1 can be solved by standard gradient descent, the objective function resembles the (regularised) Gaussian mixture log-likelihood, and we can apply the Expectation-Maximisation (EM)
algorithm
(Dempster et al., 1977) instead.
Using Jensen’s bound with convexity of the negative log function, we have the following alternating steps 8 :
• E-step: With the current { r j } Kj =1 fixed, compute the prototype assignment probabilities for each local model m i :
[Equation]
where
[Equation]
• M-step: With the current assignments c ( j | i ) fixed, we solve:
[Equation]
which admits the closed form solution:
[Equation]
The server update equation (77) has intuitive meaning that the new prototype r j becomes the weighted average of the local models
m i ’s where the weights c ( j | i ) are determined by the proximity to r j
(i.e., those m i ’s that are closer to r
j have more contribution, and vice versa).
This can be seen as an extension of the aggregation step in Fed-Avg to the multiple prototype case.
Global prediction.
By plugging the mixture prior p ( θ | ϕ ) of (64) and the factorised spiky Gaussian q ( ϕ ) of (66) into the inner integral of (8), we have predictive distribution averaged equally over { r j } Kj =1 approximately, that is, (cid:82) p ( θ | ϕ ) q
( ϕ ) dϕ ≈ 1 K (cid:80)
Kj =1 p ( y ∗ | x ∗ , r j ) .
Unfortunately this is not ideal for our original intention where only one specific model r j out of K candidates is dominantly responsible for the local data.
To meet this intention, we extend our model so that the input point x ∗ can affect θ together with ϕ , and with this modification our predictive probability can be derived as:
[Equation]
To deal with the tricky part of inferring p ( θ | x ∗ , { r j } Kj =1 ) , we introduce a fairly practical strategy of fitting a gating function .
The idea is to regard p ( θ | x ∗ , { r j } Kj =1 ) as a mixture of experts (Jacobs et al., 1991; Jordan & Jacobs, 1994) where the prototypes r j ’s serving as experts,
[Equation]
where δ ( · ) is the Dirac’s delta function, and g ( x ) is a gating function that outputs a K -dimensional softmax vector.
Intuitively, the gating function determines which of the K prototypes { r j } Kj =1 the model θ for the test point x ∗ belongs to.
With (81), the predictive probability in (80) is written as:
[Equation]
However, since we do not have this oracle g ( x ) , we introduce and fit a neural network to the local training data during the training stage.
Let g ( x ; β ) be the gating network with the parameters β .
To train it, we follow the Fed-Avg 9 strategy.
In the client update stage at each round, while we update the local model m i with a minibatch B ∼ D
i , we also find the prototype closest to m i , namely j
[Equation]
= arg min
[Equation]
|| m i − r j || .
Then we form another minibatch of samples { ( x, j ∗ ) } x ∼ B (input x and class label j ∗ ), and update g ( x ; β ) by SGD.
The updated (local) β ’s from the clients are then aggregated (by simple averaging) by the server, and distributed back to the clients as an initial iterate for the next round.
Personalisation.
For p ( θ | D p , ϕ ∗ ) in the general framework (10), we define the variational distribution v ( θ )
≈ p
( θ | D p , ϕ ∗ ) as:
[Equation]
where ϵ is small positive constant, and m is the only parameters that we learn.
Our personalisation training amounts to ELBO optimisation for v ( θ ) as in (11), which reduces to:
[Equation]
Once we have optimal m (i.e., v ( θ ) ), our predictive model becomes:
[Equation] [Equation]
, (85) which is done by feed-forwarding test input x p through the network deployed with the parameters m .
D C ONVERGENCE A NALYSIS
Our (general)
FL algorithm is a special block-coordinate SGD optimisation of the ELBO function (3) with respect to the ( N + 1) parameter groups: L 0 (of q ( ϕ ; L 0 ) ), L 1 (of q 1 ( θ 1 ; L 1 ) ), . . .
, and L N (of q N ( θ N ; L N ) ).
In this section we will provide a theorem that guarantees convergence of the algorithm to a local minimum of the ELBO objective function under some mild assumptions.
We will also analyse the convergence rate.
Note that although our FL algorithm is a special case of the general block-coordinate SGD optimisation, we may not directly apply the existing convergence results for the regular block-coordinate SGD methods since they mostly rely on non-overlapping blocks with cyclic or uniform random block selection strategies (Beck & Tetruashvili, 2013; Wang & Banerjee, 2014).
As the block selection strategy in our FL algorithm is unique with overlapping blocks and non-uniform random block selection, we provide our own analysis here.
Promisingly, we show that in accordance with general regular block-coordinate SGD (cyclic/uniform non-overlapping block selection), our FL algorithm has O (1 / √ t ) convergence rate, which is also asymptotically the same as that of the conventional (holistic, non-block-coordinate) SGD optimisation.
Note that this section is about the convergence of our algorithm to an (local) optimum of the training objective (ELBO).
The question of how well this optimal model trained on empirical data performs on the unseen data points will be discussed in Sec.
E.
First we formally describe our FL algorithm as a block-coordinate SGD optimisation.
For ease of exhibition, we will simplify the notation:
The objective function in (3) is denoted as f ( x ) where x = [ x 0 , x 1 , . . .
, x N ] is the optimisation variables corresponding to x 0 :
=
L 0 , x 1 :=
L 1 , ..., x N :=
L N .
That is, x 0 is server’s parameters while x i ( i = 1 , . .
. , N ) is worker
i ’s parameters.
We let x u be the partial vector of x selected by the index set u ⊆ { 0 , 1 , . . .
, N } , and x − u be the vector of the rest elements.
Similarly ∇ u f ( x ) indicates the gradient vector with only elements at the indices in u .
Let x t be the iterate at iteration t .
Our FL algorithm is formally defined in Alg. 1.
Now we state our convergence theorem.
We first need the following mild assumptions:
Assumption 1.
Our objective function f ( x ) is locally convex, and f t ( x ) is also locally convex for all iterations t , where f t is the minibatch version of f defined on the minibatch data batch t (so that E batch t [ f t ( x )]
= f
( x ) ).
Actually, the latter implies the former.
Although the negative ELBO is in
We define the following hyperparameters:
• N f ( ≤ N ) =
the number of participating clients at each round.
• M = the number of SGD iterations per round for updating the (participating) clients.
• Let M S
=
the number of SGD iterations per round for updating the server.
• Let η t =
the reciprocal of the SGD learning rate at iteration t .
where f t is the minibatch version of f defined on the minibatch data batch t (so that E
t [ f t ( x )]
= f
( x ) ).
Note that this update is actually done independently over the participating clients i ∈
u t due to the separable objective, i.e.,
M S iterations
[Equation] [Equation]
general non-convex globally, we can regard it as a convex function within a local neighborhood, as is usually assumed in non-convex analysis (Bertsekas, 2016) and
other FL analysis (Li et al., 2020).
Assumption 2.
For all t , f t ( x ) has Lipschitz continuous gradient with constant L .
Assumption 3.
For all t , ||∇ f t ( x ) || ≤ R f and || x − x ′ || ≤ D for any x , x ′ , where R f and D are some constants.
Theorem D.1 (Convergence analysis) .
Let η t =
L + √ t , M S
= M · N f N , and x T = 1 T (cid:80) Tt =1 x t by following our FL algorithm.
With Assumptions 1–3, the following holds for any T :
[Equation]
where x ∗ is the (local) optimum, and the expectation is taken over randomness in minibatches and block selections { u t } T − 1 t =0 .
Remark.
Theorem D.1 states that x t converges to the optimal point x ∗ in expectation at the rate of
O (1 / √ t ) .
This convergence rate asymptotically equals that of the conventional (holistic, non-blockcoordinate) SGD algorithm.
To prove the theorem, we note that the algorithm Alg.
1 overall repeats the following three steps per round: i) sample the subset of clients u t from { 1 , . .
. , N } with | u t | = N f , ii) update x u t for
M iterations, and iii) update x 0 for M S iterations.
Thus in the long-term view, we can see that the algorithm proceeds as follows:
At each iteration t , we select u t as
[Equation]
0 } with prob.
[Equation]
Size- N f subset uniformly from { 1 , . . .
, N } with prob.
[Equation]
(89) and update the iterate as
[Equation]
We will use this long-term view strategy in our proof.
Next we state the following lemma that is motivated from (Wang & Banerjee, 2014), which is useful in our proof.
Lemma D.2.
Assume η t > L , and f t is (locally) convex with Lipschitz continuous gradient with constant L .
For any subset u ⊆ { 0 , 1 , . . . , N } , we define x t +1 as:
[Equation]
Then the following holds for any x :
[Equation]
Proof of Lemma D.2.
By definition, ∇ u f t ( x t ) + η t ( x t +1 u − x tu ) = 0 .
Then for any x , we have
[Equation]
Note that (95) follows from (94) since x t and x t +1 only differ at indices u .
Since f t has Lipschitz continuous gradient,
[Equation]
where we plugged (95) into (97).
We rearrange the terms in (98) as follows:
[Equation]
Due to the convexity of f t
[Equation]
we can bound the last term in (99) as
[Equation]
Plugging (102) into (99) and choosing α = η t − L ( > 0) yields:
[Equation]
Applying Assumption 3 of the bounded gradient norm completes the proof.
Now we are ready to prove our convergence theorem (Theorem D.1).
Proof of Theorem D.1.
We first aim to bound ⟨∇ f ( x t ) , x t − x ⟩ , as it upper-bounds of f ( x t ) − f ( x ) for convex f .
Note that by conditioning on x t , we can only deal with randomness in minibatch at t ( batch t ), that is,
[Equation]
Further conditioning on batch t leads to:
[Equation]
Here we aim to rewrite the summation term in (105) in terms of size N f blocks.
To this end, let us consider:
[Equation]
where 2 N,N f is defined as the set of all subsets of { 1 , . .
. , N } with size N f and no repeating elements .
For instance, 2 5 , 3 contains { 1 , 3 , 4 } and { 2 , 4 , 5 } , among others.
Obviously | 2 N,N f | = (cid:0) NN f (cid:1) , and each particular index i ∈ { 1 , . .
, N } appears exactly (cid:0)
N − 1 N f − 1 (cid:1) times in the sum (106).
Thus we can establish the following identity:
[Equation]
We plug (107) into (105) and apply Lemma D.2:
[Equation]
where we define x t +1 ( u, batch t ) for any subset u ⊆ { 0 , 1 , . . . , N } as: x t +1 u [Equation]
x
[Equation]
−
[Equation]
/η
t
[Equation]
∇
[Equation]
t
[Equation]
x
[Equation]
and x t +1 − u := x t − u .
Although we can simply use x t +1 , here we use this explicit notation to emphasise dependency of x t +1 on i and batch t .
By letting g ( x, x t , x t +1 ) :
=
η t 2 (cid:0) || x − x t
{+|| 2 − || x − x t +
 || 2 (cid:1) + R 2 f 2( η t − L )+} , we can express (109) succinctly to yield: [Equation]
[Equation] For the second term, we use the uniform expectation to replace the sum (i.e., (cid:80) u ∈ 2 N,Nf ψ ( u ) = (cid:0)
NN f (cid:1) E u ∼ 2 N,Nf [ ψ ( u )] for any function ψ ). Using (cid:0) NN f (cid:1) / (cid:0) N − 1 N f − 1 (cid:1) = N/N f , ⟨∇ f t ( x t ) , x t − x ⟩ ≤ g ( x, x t , x t +1 (0 , batch t )) + N N f E u ∼ 2 N,Nf [ g ( x, x t , x t +1 ( u, batch t ))] , (111) and the right hand side of (111) can be written as:
[Equation]
where we use our specification of M S = M · N f N . Note that the expression inside the parentheses is exactly the expectation of g ( x, x t , x t +1 ( u t , batch t )) over the random index set u t following our client-server selection strategy in the long term view, that is, (89). Then we have the following result:
[Equation]
113) where u t follows (89). As we have conditioned all quantities on batch t , we now take the expectation over batch t .
[Equation]
where we drop the dependency in x t +1 ( u t , batch t ) in notation, and use η t = L + √ t . Since f is convex, [Equation]
[Equation]
and taking the expectation over x t leads to:
[Equation]
By telescoping ( 1 T (cid:80) Tt =1 ) and using M + M S M S = N + N f N f , we have:
E
[Equation]
[Equation]
[Equation]
t
[Equation]
[Equation] There are two sums in the right hand side of (118), and they can be bounded succinctly as follows. First, we use the simple calculus to bound the second sum: (cid:80)
[Equation]
Next, we let a t :=
E ||
x − x t || 2 , and the first sum is written as: η 1 ( a 1 − [-|| x − x t +
 ||-]a 2 )+ · · · + η T ( a T − a T +1 ) = (cid:80)
Tt =1 ( η t − η t − 1 ) a t − η T a T +1 by letting η 0 = 0 .
Using a t ≤ D 2 from Assumption 3, this sum is bounded above by D 2 (cid:80) Tt =1 ( η t − η t − 1 )
=
D 2 ( η T − η 0 )
= ( √ T + L ) D 2 .
Plugging these bounds into (118) and applying Jensen’s inequality to the left hand side (i.e., E [(1 /T )
(cid:80) Tt =1 f ( x t )] ≥
E [ f ((1 /T )
(cid:80) Tt =1 x t )]
=
E [ f ( x T )] ) yields:
[Equation]
for any x , which completes the proof.
In this section we will discuss generalisation performance of our proposed algorithm, answering the question of how well the Bayesian FL model trained on empirical data performs on the unseen data points. We aim to provide the upper bound of the generalisation error averaged over the posterior distribution of the model parameters ( ϕ, { θ i } Ni =1 ) , by linking it to the expected empirical error with some additional complexity terms.
To this end, we first consider the PAC-Bayes bounds (McAllester, 1999; Langford & Caruana, 2001;
Seeger, 2002; Maurer, 2004), naturally because they have similar forms relating the two error terms (generalisation and empirical) expected over the posterior distribution via the KL divergence term between the posterior and the prior distributions. However, the original PAC-Bayes bounds have the square root of the KL in the bound, which deviates from the ELBO objective function that has the sum of the expected data loss and the KL term as it is (instead of the square root). However, there are some recent variants of PAC-Bayes bounds, specifically the PAC-Bayes- λ bound , which removes the square root of the KL and suits better with the ELBO objective function (See (Thiemann et al., 2017) or Eq.
(5) of (Rivasplata et al., 2019)). To discuss it further, the objective function of our FL algorithm (3) can be viewed as a conventional variational inference ELBO objective with the prior p ( β ) and the posterior q ( β ) , where β = { ϕ, θ 1 , . . . , θ N } indicates the set of all latent variables in our model. More specifically, the negative ELBO (function of the variational posterior distribution q ) can be written as:
[Equation]
where ˆ l n ( β ) is the empirical error/loss of the model β on the training data of size n .
We then apply the PAC-Bayes- λ bound (Thiemann et al., 2017; Rivasplata et al., 2019); for any λ ∈ (0 , 2) , the following holds with probability at least 1 − δ :
[Equation]
where l ( β ) is the generalisation error/loss of the model β .
Thus, when λ = 1 , the right hand side of (121) reduces to − 2 · ELBO ( q ) plus some complexity term, justifying why maximizing ELBO with respect to q can be helpful for reducing the generalisation error. Although this argument may look partially sufficient, but strictly saying, the extra factor 2 in the ELBO (for the choice λ = 1 ) may be problematic, potentially making the bound trivial and less useful. Other choice of λ fails to recover the original ELBO with slightly deviated coefficients for the expected loss and the KL.
In what follows, we state our new generalisation error bound for our FL algorithm, which does not rely on the PAC-Bayes but the recent regression analysis technique for variational Bayes (Pati et al., 2018; Bai et al., 2020). It was also adopted in the analysis of some personalised FL algorithm (Zhang et al., 2022) recently. E. G ENERALISATION E RROR B OUND VIA R EGRESSION A NALYSIS T ECHNIQUE We begin with the regression-based data modeling perspective and related assumptions/notations.
We denote by P i ( x, y ) the true data distribution for client i ( i = 1 , . . . , N ).
We assume that the target y is real vector-valued ( y ∈ R S y ), and there exists a true regression function f
i : R S x → R S y for each i .
That is, [Equation] where σ 2 ϵ is constant Gaussian output noise variance.
Let D i = ( X i , Y i ) ∼ P i ( x, y ) be the i.i.d.
training data of size n for each client i .
In our FL model, we assume that our backbone network is an MLP with L hidden layers of width M , and all activation functions σ ( · ) are Lipschitz continuous with constant 1. The parameters θ of the MLP are also assumed to be bounded, more formally, the parameter space Θ is defined as:
[Equation] L [Equation]
of width M } . [Equation] Note that G = dim( θ ) and B is the maximal norm bound. The MLP defines a regression function f θ : R S x
→ R S y , and the θ -induced predictive distribution is denoted as:
[Equation]
where we assume that the true noise variance is known. For notational convenience, we denote by f ( X i ) the concatenated vector of f ( x ) for all x ∈ X i , i.e., f ( X i ) =
[ f ( x )] x ∈ X i , where f ( · ) is either the true f i ( · ) or the model f θ ( · ) . Extending this notation, simply writing f i or f θ means infinite-dimensional (population) responses, that is, f i = [ f i ( x )] x ∈ R Sx and f θ similarly. For instance, || f
θ − f i || ∞ stands for the worst-case difference, namely max x ∈ R Sx || f θ ( x ) − f i ( x ) || . As a generalisation error measure, we consider the expected squared Hellinger distance between the true P i and the model P θ .
Formally, [Equation] More specifically, we will bound the posterior-averaged distance 1 N (cid:80) Ni =1 E q ∗ i
( θ i )
[ d 2 ( P θ i , P i )] , where { q ∗ i ( θ i ) } Ni =1 is an optimal solution of our FL-ELBO optimisation problem 10 (We showed in Sec. D that our block-coordinate FL algorithm converges to this optimal solution in O (1 / √ t ) rate). Theorem E.1 (Generalisation error analysis) .
Assume that the variational density family for q i ( θ i ) is rich enough to subsume Gaussian.
The optimal solution ( { q ∗ i ( θ i ) } Ni =1 , q ∗ ( ϕ )) of our FL-ELBO optimisation problem (3) satisfies (with high probability): [Equation] where C, C ′ > 0 are constant, λ ∗ i = min θ ∈ Θ || f
θ − f i || 2 ∞ is the best error within our backbone Θ , [Equation] and ϵ n = √ r n log δ ( n ) for δ > 1 constant.
Remark. Theorem E.1 implies that the optimal solution for our FL-ELBO optimisation problem (attainable by our block-coordinate FL algorithm) is asymptotically optimal , since the right hand side of (126) converges to 0 as the training data size n → ∞ . This is easy to verify: as n → ∞ , r n → 0 obviously, accordingly ϵ n → 0 , and the last term 1 N (cid:80) i λ ∗ i can be made arbitrarily close toby increasing the backbone capacity (MLPs as universal function approximators).
But practically for fixed n , as enlarging the backbone capacity (i.e., large G , L , and M ) also increases ϵ n and r n , it is important to choose the backbone network architecture properly. Note also that our assumption on the variational density family for q i ( θ i ) is easily met; for instance, the families of the mixtures of Gaussians adopted in NIW (Sec. 3.1) and mixture models (Sec. 3.2) obviously subsume a single Gaussian family. Proof of Theorem E.1.
We first aim to link the variational ELBO objective function to the Hellinger distance via Donsker-Varadhan’s (DV) theorem (Boucheron et al., 2013), motivated from (Bai et al., 2020; Zhang et al., 2022). The DV theorem allows us to express the expectation of any exponential function variationally using the KL divergence. More specifically, the following holds for any distributions p , q and any (bounded) function h ( z ) :
[Equation]
Here we set p ( z ) : = p ( θ i | ϕ ) , q ( z ) :
=
q i ( θ i ) , h ( z ) :
= log η
i ( θ i ) , where
[Equation]
and
[Equation]
and we have the following inequality that holds for any ϕ :
[Equation]
By taking the expectation with respect to q ( ϕ ) and rearranging terms
[Equation]
we have
[Equation]
For the last term of the right hand side
[Equation]
we use the bound E s ( θ ) [ η ( θ )] ≤ e Cnϵ 2 n from the regression theorem (Pati et al., 2018), which holds for any distribution s ( θ ) with high probability. The details and proof of this bound can be found in the proof of Theorem 3.1 in (Pati et al., 2018).
Applying this bound and telescoping over i = 1 , . . . , N yields:
[Equation]
We add KL ( q ( ϕ ) || p ( ϕ )) to the right hand side, which retains the inequality since KL divergence is nonnegative. Then we have the following result that holds for any q with high probability,
[Equation] where L n ( q ( ϕ ) [Equation] { q i ( θ i ) } Ni =1 ) equals:
[Equation] which exactly coincides with our FL-ELBO objective (3) up to constant, by the factor of 1 /N . Next
[Equation]
we define ˜ q
i ( θ i ) and ˜ q ( ϕ ) as follows:
˜
[Equation] [Equation] θ ∗ i
[Equation]
arg
[Equation] i
[Equation] Since ( { q ∗ i ( θ i ) } Ni =1 , q ∗ ( ϕ )) is the optimal solution of the FL-ELBO optimisation problem, it is obvious that L n ( q ∗ ( ϕ ) , { q ∗ i ( θ i ) } Ni =1 ) ≤ L n (˜ q ( ϕ ) , { ˜ q
i ( θ i ) } Ni =1 ) if the variational density family for q i ( θ i ) is rich enough to subsume Gaussian.
Now we look closely at L n (˜ q ( ϕ ) , { ˜ q i ( θ i ) } Ni =1 ) , and we note that the last two terms as per (135) are constant (i.e., not a function of data size n ). That is, [Equation]
for some constant ˜ C .
Then we can write
[Equation]
We bound the expected − l n term in (139) using use Lemma E.2 below 11 , which states that with high probability,
[Equation]
for some constant C ′ > 0 . Plugging this bound into (139), we have the following derivation where we start from (134) with q ( ϕ ) = q ∗ ( ϕ ) and q i ( θ i ) = q ∗ i ( θ i ) :
[Equation]
By dividing both sides by n , we complete the proof.
Lemma E.2 (From the proof of Lemma 4.1 in (Bai et al., 2020)) . For ˜ q i ( θ i ) defined 12 as in (136) and r n , λ ∗ i defined as in Theorem E.1, the inequality (140) holds with high probability. Proof of Lemma E.2.
From our regression model assumption (122) and (124), E ˜
[Equation]
We first work on R 1 .
Since
[Equation]
we have
[Equation]
where in (149), we use the definition of λ ∗ i and the fact
E ˜ q
i ( θ i ) ||
f θ i − f θ ∗ i || 2 ∞ ≤ r n from Appendix G in (Chérief-Abdellatif, 2020).
Next
[Equation]
we bound R 2 .
Since ( Y i − f i ( X i )) ∼ N (0 , σ 2 ϵ I ) and independent of θ i
[Equation]
we can let ϵ :=
Y i − f i ( X i ) for ϵ ∼ N (0 , σ 2 ϵ I ) .
Then
[Equation]
where c f = (cid:13)(cid:13) E ˜ q i [Equation] θ i
[Equation]
f
[Equation]
X
[Equation]
− f θ
[Equation]
Applying Jensen’s inequality on the convexity of || · || 22 , c f ≤ E ˜ q
i ( θ i ) || f i ( X i ) − f θ i ( X i ) || 22 =
{+R 1 . Due to the property of Gaussian, there exists some constant C ′ 
 such that R 2 ≤ C ′ 
+}
{+· c f ≤ C ′ 
 · R 1 with high probability. Plugging these bounds on R 1 and Rback+} to (146) leads to: [Equation]
{+Letting C ′ : = 1+2 C ′ 
 σ 2+} ϵ (constant) completes the proof. F A DDITIONAL E XPERIMENTAL R ESULTS F. M ORE R ESULTS ON CIFAR-100 & CIFAR-C-
We test our mixture model with different mixture orders K = 2 , 5 , 10 on CIFAR-100 (Table 3) and CIFAR-C-100 (Table 4). In the last columns of the tables, we also report the performance of the centralised (non-FL) training, in which the batch sampling follows the corresponding FL settings. [Table]
[Table] [Figure] That is, at each round, the minibatches for SGD (for conventional cross-entropy loss minimisation) are sampled from the data of the participating clients. The centralised training sometimes outperforms the best FL algorithms (our models), but can fail completely especially when data heterogeneity is high (small s ) and τ is large.
This may be due to overtraining on biased client data for relatively few rounds.
Our FL models perform well consistently and stably being comparable to centralised training on its ideal settings (small τ and/or large s ).
Our mixture model maintains K backbone networks (specifically { r j } Kj =1 ) where the mixture order K is usually small but greater than 1 (e.g., K = 2 ). Thus it requires extra computational resources than other methods (including our NIW model) that only deal with a single backbone.
As a baseline comparison, we aim to come up with some simple extension of Fed-Avg (McMahan et al., 2017) that incorporates multiple (the same K ) networks. Here are the detailed descriptions of the baseline ensemble extensions: [Table] [Table]
[Table]
The server maintains K networks (denoted by θ 1 , . . , θ K ). We partition the clients into K groups with equal proportions. We will assign each θ j to each group j ( j = 1 , . . .
, K ). At each round, each participating client i receives the current model θ j ( i ) from the server, where j ( i ) means the group index to which client i belongs. The clients perform local updates as usual by warm-start with the received models, and send the updated models back to the server. The server collects updated local models from the clients, and takes the average within each group j to update θ j . 6.
After training, we have trained K networks. At test time, we can use these K networks in two different ways/options: ( Preset option) Each client i uses the network assigned to its group, i.e., θ j ( i ) , for both prediction and finetuning/personalisation; ( Ensemble option) We use all K networks (as an ensemble) for prediction and finetuning.
[Table]
Note that K = 1 exactly reduces to Fed-Avg (or Fed-BABU). In Fig. 3 we visualise the performance of these ensemble baselines, compared with our mixture model for different K = 2 , 5 , 10 on CIFAR100 with ( f = 0 . 1 , τ = 1 ) setting.
It clearly shows that these simple ensemble strategies are prone to overfit. The result signifies the importance of the sophisticated negative log-sum-exp regularisation in the client/server updates as in (22) and (23) in our mixture model. F. R UNNING T IMES Although our models achieve significant improvement in prediction accuracy, we have extra computational overhead compared to simpler FL methods like Fed-BABU.
To see if this extra cost is allowable, we measure/compare wall clock times in Table 5, where all methods are tested on the same machine, Xeon 2.20GHz CPU with a single RTX 2080 Ti GPU. For NIW, the extra cost in the local client update and personalisation (training) originates from the penalty term in (17), while model weight squaring to compute V 0 in (18) incurs additional cost in server update. For Mixture, the increased time in training is mainly due to the overhead of computing distances from the K server models in (22) and (23). However, overall the extra costs are not prohibitively large, rendering our methods sufficiently practical.
We provide pseudocodes for our algorithms: Training algorithms • General framework in Alg.
• Normal-Inverse-Wishart case in Alg. • Mixture case in Alg. Global prediction algorithms • General framework in Alg. • Normal-Inverse-Wishart case in Alg.
• Mixture case in Alg. Personalisation algorithms • General framework in Alg. 8. • Normal-Inverse-Wishart case in Alg. • Mixture case in Alg.
Based on the detailed algorithms in Sec. G. we can easily analyse the computational complexity of the proposed algorithms. They are summarised in Table 6 (training complexity with communication costs), Table 7 (global prediction complexity) and Table 8 (personalisation complexity)
[Equation]
[Equation]
[Equation]
[Equation]
[Equation]
[Equation]
[Table] [Table] [Table] [Table]
[Table]
[Table]
[Equation]
where ˜ m i is the dropout version (with probability 1 − p ) of m i . Initial
i
be either copied
or the
iterate
the
is able to m i locally.
[Equation]
where ρ ( m 0 , m i , p )
= pm i m ⊤ i − pm 0 m ⊤ i − pm i m ⊤ 0 + m 0 m ⊤ 0 .
Input: Initial L 0 = { r j } Kj =1 in q ( ϕ ; L 0 ) =
(cid:81)
j N ( µ j ; r j , ϵ 2 I ) and β in the gating network g ( x ; β ) .
Output: Trained parameters L 0 = { r j } Kj =1 and β .
For
R do :
: min
[Equation]
i
[Equation]
i |
[Table]
[Table]
log
[Table]
j
[Table]
exp (cid:18)
[Equation]
|
[Equation]
[Table]
i − r j ||2 σ(cid:19) , where q i ( θ i ; m i ) =
N ( θ i ; m i , ϵ 2 I ) .
Initial
[Table]
i can
[Table]
either the center of { r j } Kj =1 or the last iterate if the client is able
to
[Table]
m i locally. β
i
[Table]
SGD update of β in g ( x ; β ) with data { ( x, j ∗ ) } x ∼ D i where j ∗ = arg min j || m i − r j || . Each client i ∈ I sends the updated L i
= m
i and β i back to the server. Upon receiving { m i } ∈I and { β i } ∈I , the server updates L 0 = { r j } Kj =1 by the one-step EM:
[Equation]
E-
[Equation]
and
[Table]
by aggregation:
[Table] ∗ = 1 N f (cid:80) i ∈I β i .
Input: Personal training data D p Test input x p Learned
= NIW
{ m V , l
, n
[-C ′ 
-]Output Input: Personal training data D p . Test input x p .
[-such that R 2 ≤ C ′ 
 · c f ≤ C ′ 
-]Learned model L 0 = { r j } Kj =1 in q ( ϕ ; L 0 ) = (cid:81)
j N ( µ j ; r j , ϵ 2 I ) .
Output: Predictive distribution p ( y p | x p , D p Estimate m in v ( θ ; m ) = N (
m, ϵ 2 I )
solving ( SGD): log
[-= 1+2 C ′ 
 σ 2 ϵ (constant) completes the proof.-]Return p ( y p | x p , D p , D 1: N ) ≈ p ( y p | x p , m ) .
H (R EVISION ): A DDITIONAL E XPERIMENTS H. CIFAR-100 WITH THE EXTRA FOUR FL METHODS
The results are summarized in Table 9 where we use the following hyperparameters for the competing methods. FedPA (Al-Shedivat et al., 2021): shrinkage parameter ρ = 0 . 01 ; FedBE (Chen & Chao, [Table] All quantities are per-test-batch costs.
In the the [Table]
All quantities are per-train/test-batch costs. In the entries, d = the number of parameters in the backbone network, F = time for feed-forward pass [Table] and B = time for backprop.
[Table]
{+2021): the number of ensemble components 
+}
; FedEM (Marfoq et al., 2021): the number of base models 3. H. MNIST AND F ASHION -MNIST The FL setting is as follows: the number of clients N = 100 , the number of shards per client s = 5 , the fraction of participating clients per round f = 0 . 1 , and the number of local training epochs per round τ = 1 (total number of rounds 100) or 5 (total number of rounds 20).
FedBE and FedEM use three component models. The backbone is an MLP with a single hidden layer with 256 units. The results are summarized in Table 10 (MNIST) and Table 11 (Fashion-MNIST). H. EMNIST
The FL setting is as follows: the number of clients N = 200 , the fraction of participating clients per round f = 0 .
2 , and the number of local training epochs per round τ = 1 (total number of rounds 300). We follow the standard Dirichlet-based client data splitting. FedBE and FedEM use three component models. The backbone is a standard ConvNet with two hidden layers.
The results are summarized in Table 12.
I (R EVISION ): E XTENDED R ELATED W ORK
General FL approaches.
Perhaps the seminal pioneering work on FL is attributed to FedAvg (McMahan et al., 2017), which proposed fairly intuitive local training and global aggregation strategies with minimal training and communication complexity.
A potential issue of divergence of global and local models due to the separated steps of local training and aggregation was addressed by model regularisation in the follow-up works (Li et al., 2018; Acar et al., 2021), which is shown to help the global model converge more reliably.
Recent approaches aimed to incorporate benefits from existing machine learning approaches including domain adaptation/generalisation, clustering, multi-task learning, transfer learning, and meta-learning.
To deal with heterogeneous client data distributions, those works in (Peterson et al., 2019; Zhang et al., 2021; Sun et al., 2021) attempted to tackle the FL problem in the perspective of (multi-)Domain Adaptation/Generalisation.
Another interesting line of works aims to cluster clients with similar data distributions together (Briggs et al., 2020;
Mansour et al., 2020).
Along the line, the shared representations among the related or similar clients can be modeled motivated from general multi-task learning (Smith et al., 2017; Dinh et al., 2021).
Motivated from transfer learning, reasonable attempts are made to exploit the idea of learning/transferring knowledge from related clients (Chen et al., 2020;
Yang et al., 2020; Dinh et al., 2020; Li et al., 2021), Last but not least, there have been attempts to the personalised FL methods based on meta learning since the fientuning from the global trained model can be seen as adaptation to new data (Chen et al., 2018; Fallah et al., 2020).
Comparison to existing Bayesian FL approaches.
Some recent studies tried to address the FL problem using Bayesian methods.
As we mentioned earlier, the key difference is that these methods do not introduce Bayesian hierarchy , and ultimately treat network weights θ as a random variable shared across all clients, while our approach assigns individual θ i to each client i governed by a common prior p ( θ i | ϕ ) .
The non-hierarchical approaches must all resort to ad hoc heuristics or strong assumptions in parts of their algorithm.
More specifically, FedPA (Posterior Averaging)
(Al-Shedivat et al., 2021) aims to establish the decomposition, p ( θ | D 1: N ) ∝ (cid:81)
Ni =1 p ( θ | D i ) also known as product of experts , to allow client-wise inference/optimisation of p ( θ | D i ) .
Unfortunately this decomposition does not hold in general unless we make a strong assumption of uninformative prior p ( θ ) ∝ 1 as they did.
FedBE (Bayesian Ensemble) (Chen & Chao, 2021) aims to build the global posterior distribution p ( θ | D 1: N ) from the individual posteriors p
( θ | D i ) in either of two ad-hoc ways: SWAG (Maddox et al.
, 2019)-like model averaging over clients, or a convex combination of the modes of the local posteriors.
pFedBayes (Zhang et al., 2022) can be seen as an implicit regularisation-based method to approximate p ( θ | D 1: N ) from individual posteriors p
( θ | D i ) .
To combine the individual posteriors, they introduce the so-called global distribution w ( θ ) , which essentially serves as a regulariser that aims to enforce local posteriors p ( θ | D i ) not to deviate from it, i.e., p ( θ | D i )
≈ w ( θ ) for all i .
The introduction of w ( θ ) and its update strategy appears to be a hybrid treatment rather than solely Bayesian perspective.
Finally, FedEM (Marfoq et al., 2021) forms a seemingly reasonable hypothesis that local client data distributions can be identified as mixtures of a fixed number of base distributions (with different mixing proportions).
However, although they have probabilistic modeling, mixture estimation, and base distribution learning under this hypothesis, this method is not a Bayesian approach.
FedGP (Achituve et al., 2021b) aims to extend the GP-Tree algorithm (Achituve et al., 2021a) to the FL setting via the shared deep kernel learning.
To this end, the clients perform GP-Tree kernel learning locally on its own data while the server aggregation simply follows the FedAvg algorithm to learn a global kernel. In this sense, the overall approach is quite different from our hierarchical Bayesian treatment. FedPop (Kotelevskii et al., 2022):
It has a similar hierarchical Bayesian model structure as ours.
But they split the backbone network parameters into those of the feature extractor (denoted by ϕ in the paper) and the linear classification head ( β ).
In their model, the feature extractor weights ϕ are shared across the clients (called fixed effects ), and the client-wise classification head parameters
z i are sampled from β , i.e., z i ∼ p ( z | β ) .
Thus the client data D i is generated by ϕ and z i .
The main differences from our approach are in four folds: 1) The higher-level variables β and local variables z i sampled from β are both restricted to the linear classification head part of the network, which makes imposing uncertainty in model parameters quite limited; 2)
Moreover, they do not
[Table]
T a b l e 10 : (
M N I
S T )
G l ob a l p r e d i c ti on a nd p e r s on a li s a ti on acc
u r ac
y .
( a )
G l ob a l p r e d i c ti on p e rf o r m a n ce ( i n iti a l acc u r ac y ) F L s e tti ng s
O u r
M e t hod s
F e dB A B
U
F e dA vg F e dP r ox p F e d B a y e s F e d P
A
F e d B
E
F e d E
M
F e d P op s f τ
N I W M i x . ( K = 2 ) 0 . ( b ) P e r s on a li s a ti on p e rf o r m a n ce
F L s e tti
ng s
O u r
M e t hod s
F e dB A B
U
F e dA vg
F e dP r ox p F e d
B a y e s
F e d P
A
F e d B
E
F e d E
M
F e d P op s f τ N I W M i x . ( K = 2 ) 0 .
[Table]
T a b l e 11 : (
F a s h i onM N I
S T )
G l ob a l p r e d i c ti on a nd p e r s on a li s a ti on acc
u r ac
y .
( a )
G l ob a l p r e d i c ti on p e rf o r m a n ce
( i n iti a l acc u r ac y )
F L s e tti
ng s
O u r
M e t hod s
F e dB A B
U
F e dA vg
F e dP r ox p F e d
B a y e s
F e d P
A
F e d B
E
F e d E
M
F e d P op s f τ
N I W
M i x .
{+( K = 2 ) 0 . 84 .
+}
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
( b ) P e r s on a li s a ti on p e rf o r m a n ce
F L s e tti
ng s
O u r
M e t hod s
F e dB A B
U
F e dA vg
F e dP r ox p F e d
B a y e s
F e d P
A F e d B E F e d E
M F e d P op s f τ N I W M i x .
( K = 2 ) 0 .
[Table]
[Table] [Table]
[Table]
[Table]
[Table] [Table]
[Table]
[Table]
[Table]
[Table]
T a b l e 12 : ( E M N I S T )
G l ob a l p r e d i c ti on a nd p e r s on a li s a ti on acc
u r ac y .
( a ) G l ob a l p r e d i c ti on p e rf o r m a n ce
( i n iti a l acc u r ac y )
F L s e tti ng
O u r M e t hod s F e dB A B U
F e dA vg
F e dP r ox p F e d B a y e s F e d P A
F e d B
E
F e d E
M
F e d P op f τ N I W M i x . ( K = 2 ) 0 .
( b ) P e r s on a li s a ti on p e rf o r m a n ce F L s e tti ng O u r M e t hod s
F e dB A B
U
F e dA vg
F e dP r ox p F e d
B a y e s
F e d P
A
F e d B E F e d E M
F e d P op f τ
N I W M i x . ( K = 2 ) 0 . actually treat β (and ϕ of feature extractor) as random variables, but deterministic variables which are optimized in empirical Bayes learning.
This hinders the model from benefiting from hierarchical
Bayesian modeling (e.g., they do not have prior distribution p ( β ) at all); 3) Their optimization is alternating between the feature extractor ϕ and the head prior parameters β , utterly different from our block coordinate optimization alternating between higher level random variables and individual local variables; 4) They did not use variational inference for inference p ( z i | D i , ϕ, β ) , but MCMC sampling (Lagevin dynamics), which is the very reason why they had to reduce the size of the latents
z i only limited to classification heads, instead of full network parameters as we did.