{'fraction_non_alphanumeric': 0.04540094339622641, 'fraction_numerical': 0.014316037735849057, 'mean_word_length': 4.382886885870255, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
FedProf: Selective Federated Learning with Representation Profiling

Federated Learning (FL) has shown great potential as a privacy-preserving solution to learning from decentralized data that are only accessible to end devices (i.e., clients). In many scenarios, however, a large proportion of the clients are probably in possession of low-quality data that are biased, noisy or even irrelevant. As a result, they could significantly slow down the convergence of the global model we aim to build and also compromise its quality. In light of this, we propose FedProf, a novel algorithm for optimizing FL under such circumstances without breaching data privacy. The key of our approach is a distributional representation profiling and matching scheme that uses the global model to dynamically profile data representations and allows for low-cost, lightweight representation matching. Based on the scheme we adaptively score each client and adjust its participation probability so as to mitigate the impact of low-value clients on the training process. We have conducted extensive experiments on public datasets using various FL settings. The results show that the selective behaviour of our algorithm leads to a significant reduction in the number of communication rounds and the amount of time (up to 2.4x speedup) for the global model to converge and also provides accuracy gain.


Introduction
With the advances in Artificial Intelligence (AI), we are seeing a rapid growth in the number of AIdriven applications as well as the volume of data required to train them. However, a large proportion of data used for machine learning are often generated outside the data centers by distributed resources such as mobile phones and IoT (Internet of Things) devices. It is predicted that the data generated by IoT devices will account for 75% of the total in 2025 [1]. Under this circumstance, it will be very costly to gather all the data for centralized training. More importantly, moving the data out of their local devices (e.g., mobile phones) is now restricted by law in many countries, such as the General Data Protection Regulation (GDPR) 1 enforced in EU.
We face three main difficulties to learn from decentralized data: i) massive scale of end devices; ii) limited communication bandwidth at the network edge; and iii) uncertain data distribution and data quality. As an promising solution, Federated Learning (FL) [2] is a framework for efficient distributed machine learning with privacy protection (i.e., no data exchange). A typical process of FL is organized in rounds where the devices (clients) download the global model from the server, perform local training on their data and then upload their updated local models to the server for aggregation. Compared to traditional distributed learning methods, FL is naturally more communication-efficient at scale [3,4]. Nonetheless, several issues stand out.

Motivation
1) FL is susceptible to biased and low-quality local data. Only a fraction of clients are selected for a round of FL (involving too many clients leads to diminishing gains [5]). The standard FL algorithm [2] selects clients randomly, which implies that every client (and its local data) is considered equally important. This makes the training process susceptible to local data with strong heterogeneity and of low quality (e.g., user-generated texts [6] and noisy photos). In some scenarios, local data may contain irrelevant or even adversarial samples [7,8] from malicious clients [9,8,10]. Traditional solutions such as data augmentation [11] and re-sampling [12] prove useful for centralised training but applying them to local datasets may introduce extra noise [13] and increase the risk of information leakage [14]. Another naive solution is to directly exclude those low-value clients with low-quality data, which, however, is often impractical because i) the quality of the data depends on the learning task and is difficult to gauge; ii) some noisy or biased data could be useful to the training at early stages [15]; and iii) sometimes low-quality data are very common across the clients. In Fig. 1 we demonstrate the impact of involving "low-value" clients by running FL over 100 clients to learn a CNN model on MNIST using the standard FedAvg algorithm. From the traces we can see that training over clients with problematic or strongly biased data can compromise the efficiency and efficacy of FL, resulting in an inferior global model that takes more rounds to converge.
2) Learned representations can reflect data distribution and quality. Representation learning is vital to the performance of deep models because learned representations can capture the intrinsic structure of data and provide useful information for the downstream machine learning tasks [16]. In ML research, The value of representations lies in the fact that they characterize the domain and learning task and provide task-specific knowledge [17,18]. In the context of FL, the similarity of representations are used for refining the model update rules [19,20], but the distributional difference between representations of heterogeneous data is not yet explored.
Our study is also motivated by a key observation that representations from neural networks tend to have Gaussian patterns. As a demonstration we trained two different models (LeNet-5 and ResNet-18) on two different datasets (MNIST and CIFAR-100) separately. Fig. 2a shows the neuron-wise distribution of representations extracted from the first dense layer (FC-1) of LeNet-5. Fig. 2b shows the distribution of fused representations (in a channel-wise manner) extracted from a plain convolution layer and a residual block of ResNet-18.  These observations motivate us to study the distributional property of data representations and use it as a means to differentiate clients' value.

Contributions
Our contributions are summarized as follows: • We first provide theoretical proofs for the observation that data representations from neural nets tend to follow normal distributions, based on which we propose a representation profiling and matching scheme for fast, low-cost representation profile comparison.
• We present a novel FL algorithm FedProf that adaptively adjusts clients' participation probability based on representation profile dissimilarity.
• Results of extensive experiments show that FedProf reduces the number of communication rounds by up to 63%, shortens the overall training time (up to 2.4× speedup) while improving the accuracy of the global model by up to 6.8% over FedAvg and its variants.

Related Work
Different from traditional distributed training methods (e.g., [21,22,23]), Federated Learning assumes strict constraints of data locality and limited communication capacity [3]. Much effort has been made in optimizing FL and covers a variety of perspectives including communication [3,24,25], update rules [26,27,28,29], flexible aggregation [4,30] and personalization [31,32,33]. The control of device participation is imperative in cross-device FL scenarios [34,35] where the quality of local data is uncontrollable and the clients show varied value for the training task [36]. To this end, the selection of clients is pivotal to the convergence of FL over heterogeneous data and devices [37,38,39,40]. Non-uniform client selection is widely adopted in existing studies [41,42,43,44] and has been theoretically proven with convergence guarantees [43,5]. Many approaches sample clients based on their performance [37,45] or aim to jointly optimize the model accuracy and training time [46,47,48]. A popular strategy is to use loss as the information to guide client selection [41,49,50]. For example, AFL [41] prioritizes the clients with high loss feedback on local data, but it is potentially susceptible to noisy and unexpected data that yield illusive loss values.
Data representations are useful in the context of FL for information exchange [20] or objective adaptation. For example, [19] introduces representation similarities into local objectives. This contrastive learning approach guides local training to avoid model divergence. Nonetheless, the study on the distribution of data representations is still lacking whilst its connection to clients' training value is hardly explored either.

Data Representation Profiling and Matching
In this paper, we consider a typical cross-device FL setting [34], in which multiple end devices collaboratively perform local training on their own datasets D i , i = 1, 2, ..., n. The server owns a validation dataset D V for model evaluation. 2 Every dataset is only accessible to its owner.
Considering the distributional pattern of data representations (Fig. 2) and the role of the global model in FL, we propose to profile the representations of local data using the global model. In this section, we first provide theoretical proofs to support our observation that representations from neural network models tend to follow normal distributions. Then we present a novel scheme to profile data representations and define profile dissimilarity for fast and secure representation comparison.

Normal Distribution of Representations
In this section we provide theoretical explanations for the Gaussian patterns exhibited by neural networks' representations. We first make the following definition to facilitate our analysis. where The Lyapunov's condition can be intuitively explained as a limit on the overall variation (with |Z k − µ k | 2+δ being the (2 + δ)-th moment of Z k ) of a set of random variables. Now we present Proposition 1 and Proposition 2. The Propositions provide theoretical support for our representation profiling and matching method to be introduced in Section 3.2.
Proposition 1. The representations from linear operators (e.g., a pre-activation dense layer or a plain convolutional layer) in a neural network tend to follow a normal distribution if the layer's weighted inputs satisfy the Lyapunov's condition.
Proposition 2. The fused representations 3 from non-linear operators (e.g., a hidden layer of LSTM or a residual block of ResNet) in a neural network tend to follow the normal distribution if the layer's output elements satisfy the Lyapunov's condition.
The proofs of Propositions 1 and 2 are provided in Appendices A.1 and A.2, respectively. We base our proofs on the Lyapunov's CLT which assumes independence between the variables. The assumption theoretically holds by using the Bayesian network concepts: let X denote the layer's input and H k denote the k-th component in its output. The inference through the layer produces dependencies X → H k for all k. According to the Local Markov Property, we have H i independent of any H j (j = i) in the same layer given X. Also, the Lyapunov's condition is typically met when the model is properly initialized and batch normalization is applied. Next, we discuss the proposed representation profiling and matching scheme.

Distributional Profiling and Matching
Based on the Gaussian pattern of representations, we compress the data representations statistically into a compact form called representation profiles. The profile produced by a θ-parameterized global model on a dataset D, denoted by RP (θ, D), has the following format: where q is the profile length determined by the dimensionality of the representations. For example, q is equal to the number of kernels for channel-wise fused representations from a convolutional layer. The tuple (µ i , σ 2 i ) contains the mean and the variance of the i-th representation element. Local representation profiles are generated by clients and sent to the server for comparison (the cost of transmission is negligible considering each profile is only q × 8 bytes). Let RP k denote the local profile from client k and RP B denote the baseline profile (generated in model evaluation) on the server. The dissimilarity between RP k and RP B , denoted by div(RP k , RP B ), is defined as: where KL(·) denotes the Kullback-Leibler (KL) divergence. An advantage of our profiling scheme is that a much simplified KL divergence formula can be adopted because of the normal distribution property (see [51,Appendix B] for details), which yields: Eq. (4) computes the KL divergence without calculating any integral, which is computationally cost-efficient. Besides, the computation of profile dissimilarity can be performed under the Homomorphic Encryption for minimum knowledge disclosure (see Appendix C for details).

The Training Algorithm FedProf
Our research aims to optimize the global model over a large group of clients (datasets) of disparate training value. Given the client set U (|U | = N ), let D k denote the local dataset on client k and D V the validation set on the server, We formulate the optimization problem in (5) where the coefficient ρ k differentiates the importance of the local objective functions F k (θ) and depends on the data in D k . Our global objective is in a sense similar to the agnostic learning scenario [52] where a non-uniform mixture of local data distributions is implied.
where θ denotes the parameters of the global model h θ ∈ H : χ → Y over the feature space χ and target space Y. The coefficients {ρ k } N k=1 add up to 1. F k (θ) is client k's local objective function of training based on the loss function ℓ(·): Involving the "right" clients facilitates the convergence. With this motivation we score each client with λ k each round based on the representation profile dissimilarity: where RP k and RP B are generated by an identical global model; α k is the penalty factor deciding how biased the strategy needs to be against client k. With α k = 0 for all k = 1, 2, . . . N , our strategy is equivalent to random selection. The scores connect the representation profiling and matching scheme to the design of the selective client participation strategy adopted in our FL training algorithm FedProf, which is outlined in Algorithm 1 with both client and server processes. The key steps of our algorithm are local representation profiling (line 13), baseline representation profiling (line 18) and client scoring (lines 8 & 9). Fig. 3 illustrates the workflow of the proposed algorithm from representation profiling and matching to scheduling. The convergence rate of FL algorithms with opportunistic client selection (sampling) has been extensively studied in the literature [5,43,4]. Similar to [53,54,5], we formally make four assumptions to support our analysis of convergence. Assumptions 1 and 2 are standard in the literature [5,4,42] defining the convexity and smoothness properties of the objective functions. Assumptions 3 and 4 bound the variance of the local stochastic gradients and their squared norms in expectation, respectively. These two assumptions are also made in by [5].
It is obvious that the global objective F is also L-smooth as a linear combination of F 1 , F 2 , . . . , F N with ρ 1 , ρ 2 , . . . , ρ N being the weights.

Algorithm 1: the FedProf protocol
Input : maximum number of rounds T max , local iterations per round τ , client set U , client fraction C, validation set D V ; Output: the global model θ // Server process: running on the server 1 Initialize global model θ using a seed 2 v ← 0 // version of the latest global model 3 Broadcast the seed to all clients for identical model initialization 4 Collect initial profiles {RP k } k∈U from all the clients Update client scores {λ k } k∈U and compute Λ = k∈U λ k Return RP k return localTraining(k, θ, τ ): Update θ k using gradient-based method end 25 Return θ k return Assumption 2. F 1 , F 2 , . . . , F N are µ-strongly convex, i.e., for all k ∈ U and any x, y: Assumption 3. The variance of local stochastic gradients on each device is bounded: For all k ∈ U , Assumption 4. The squared norm of local stochastic gradients on each device is bounded: For all  Inspired by these studies, we present Theorem 1 to guarantee the global model's convergence for our algorithm. Theorem 1. Using partial aggregation and our selection strategy that satisfies α k = − ln(Λρ k ) div(RP k ,RP B ) , the global model θ(t) converges in expectation given an aggregation interval τ ≥ 1 and a decreasing step size (learning rate) η t = 2 µ(t+γ) . where The proof of Theorem 1 is provided in Appendix B where the basic assumptions and the supporting lemmas are also formally presented.

Experiments
We conducted extensive experiments to evaluate FedProf under various FL settings. Apart from FedAvg [2] as the baseline, we also reproduced several state-of-the-art FL algorithms for comparison. These include CFCFM [30], FedAvg-RP [5], FedProx [26], FedADAM [28] and AFL [55]. For fair comparison, the algorithms are grouped by the aggregation method (i.e., full aggregation and partial aggregation) and configured based on the parameter settings suggested in their papers. Note that our algorithm can adapt to both aggregation methods.

Experimental Setup
We built a discrete event-driven, simulation-based FL system and implemented the training logic under the Pytorch framework (Build 1.7.0). To evaluate the algorithms in disparate FL scenarios, we set up three different tasks using three public datasets: GasTurbine (from the UCI repository 4 ), EMNIST and CIFAR-10. With GasTurbine the goal is to learn a carbon monoxide (CO) and nitrogen oxides Aggregation method Rule of selection FedAvg [2] full aggregation random selection CFCFM [30] full aggregation submission order FedAvg-RP [5] partial (Scheme II) random selection FedProx [26] partial aggregation weighted random by data ratio FedADAM [28] partial with momentum random selection AFL [41] partial with momentum local loss valuation FedProf (ours) full/partial aggregation weighted random by score (NOx) emission prediction model over a network of 50 sensors. Using EMNIST and CIFAR-10 we set up two image classification tasks with different models (LeNet-5 [56] for EMNIST and ShuffleNet v2 [57] for CIFAR-10). We also differentiate the system scale-500 mobile clients for EMNIST and 10 dataholders for CIFAR-10-to emulate cross-device and cross-silo scenarios [34] respectively. The penalty factors α are set to (a, a, . . . , a) where a=10.0, 10.0 and 25.0 for GasTurbine, EMNIST and CIFAR-10, respectively.
In all the tasks, data sharing is not allowed between any parties and the data are non-IID across the clients. We made local data statistically heterogeneous by forcing class imbalance (for CIFAR and EMNIST) 5 or size imbalance (for GasTurbine). 6 We introduce a diversity of noise into the local datasets to simulate the discrepancy in data quality: for GasTurbine, 50% of the sensors produce noisy data (including 10% polluted); for EMNIST and CIFAR-10, a certain percentage of local datasets are irrelevant images or low-quality images (blurred or affected by salt-and-pepper noise). Aside from data heterogeneity, all the clients are also heterogeneous in performance and communication bandwidth. Considering the client population and based on the scale of the training participants suggested by [34], the selection fraction C is set to 0.2, 0.05 and 0.5 for the three tasks, respectively. More experimental settings are listed in Table 2.  5 Each client has a dominant class that accounts for roughly 60% (for EMNIST) or 37% (for CIFAR) of the local data size. 6 The sizes of local datasets follow a normal distribution For GasTurbine, the total population is 50 and the data collected by a proportion of the sensors (i.e., end devices of this task) are of low-quality: 10% of the sensors are polluted (with features taking invalid values) and 40% of them produce noisy data. For EMNIST, we set up a relatively large population (500 end devices) and spread the data (from the digits subset) across the devices with strong class imbalance-roughly 60% of the samples on each device fall into the same class. Besides, many local datasets are of low-quality: the images on 15% of the clients are irrelevant (valueless for the training of this task), 20% are (Gaussian) blurred, and 25% are affected by the salt-and-pepper noise (random black and white dots on the image, density=0.3). For CIFAR-10, same types of noise are applied but with lower percentages (10%, 20% and 20%) of clients affected. The class imbalance degree in local data distribution for the 10 clients is set to 37%, i.e., each local dataset is dominated by a single class that accounts for approximately 37% of the total size.
A sufficiently long running time is guarantee for all the three FL tasks. The maximum number of rounds T max is set to 500 for the GasTurbine task. For EMNIST, T max is set to 240 for the full aggregation and 80 for partial aggregation respectively considering their discrepancy in convergence speed. For CIFAR-10, T max is set to 150 for the full aggregation and 120 for partial aggregation respectively, which are adequate for the global model to converge in our settings.
In each FL round, the server selects a fraction (i.e., C) of clients, distributes the global model to these clients and waits for them to finish the local training and upload the models. Given a selected set of clients S, the time cost and energy cost of a communication round can be formulated as: where T comm can be modeled by Eq. (11) according to [63], where bw k is the downlink bandwidth of device k (in MHz); SNR is the Signal-to-Noise Ratio of the communication channel, which is set to be constant as in general the end devices are coordinated by the base stations for balanced SNR with the fairness-based policies; msize is the size (in MB) of the (encrypted) model; the model upload time is twice as much as that for model download since the uplink bandwidth is set to 50% of the downlink bandwidth.
T train k in Eq. (9) can be modeled by Eq. (12), where s k is the device performance (in GHz) and the numerator computes the total number of processor cycles required for processing E epochs of local training on D k .
T RP k consists of two parts: T RP gen k for local model evaluation (to generate the profiles of D k ) and T RP up k for uploading the profile. T RP k can be modeled as: where T RP gen k is estimated as the time cost of one epoch of local training; T RP up k is computed in a similar way to the calculation of T comm k in Eq. (11) (where the uplink bandwidth is set as one half of the total bw k ); RP size is the size of a profile, which is equal to 4 × 2 × q = 8 × q (four bytes for each floating point number) according to our definition of profile in (2).
Using Eq. (10) we model the energy cost of each end device by mainly considering the energy consumption of the transmitters for communication (Eq. 14) and on-device computation for local training (Eq. 15). For FedProf, there is an extra energy cost for generating and uploading profiles (Eq. 16).
where P f s 3 k is a simplified computation power consumption model [64] and P f is the power of a baseline processor. P trans is the transmitter's power. We set P trans and P f to 0.75 W and 0.7 W respectively based on the benchmarking data provided by [65] and [66].

Empirical Results
We evaluated the performance of our FedProf algorithm in terms of the efficacy (i.e., best accuracy achieved) and efficiency (i.e., costs for convergence) in establishing a global model for the three tasks. Tables 3, 4

1) Convergence in different aggregation modes:
Our results show a great difference in convergence rate under different aggregation modes. From Figs. 4 and 5, we observe that partial aggregation facilitates faster convergence of the global model than full aggregation, which is consistent with the observations made by [5]. The advantage is especially obvious on EMNIST where FedAvg-RP  requires <30 communication rounds to reach the 90% accuracy whilst the standard FedAvg needs 100+. On all three tasks, our FedProf algorithm significantly improves the convergence speed in both groups of comparison especially for the full aggregation mode.
2) Best accuracy of the global model: Throughout the FL training process, the global model is evaluated each round on the server who keeps track of the best accuracy achieved. As shown in the 2nd column of Tables 3, 4 and 5, our FedProf algorithm achieves up to 1.8%, 1.7% and 6.8% accuracy improvement over the baselines FedAvg and FedAvg-RP on GasTurbine, EMNIST and CIFAR-10, respectively.
3) Total communication rounds for convergence: The number of communication rounds required for reaching convergence is a key efficiency indicator. On GasTurbine, our algorithm takes less than half the communication rounds required by other algorithms in most cases. On EMNIST, our algorithm reaches 90% accuracy within 60 rounds whilst FedAvg and CFCFM need more than 100 with full aggregation. AFL adopts a loss-oriented client selection strategy, which shows the closest performance to our algorithm on EMNIST but fails to reach the 60% accuracy mark on CIFAR-10. A possible explanation is that noisy data (with higher losses) are less harmful at early training stage but will mislead the model update to local optima. 4) Total time needed for convergence: The overall time consumption is closely related to total communication rounds needed for convergence and the time cost for each round. Algorithms requiring more rounds to converge typically take longer to reach the accuracy target except the case of CFCFM, which priorities the clients that work faster. By contrast, our algorithm accelerates convergence  by addressing the heterogeneity of data and data quality, providing a 2.1× speedup over FedAvg on GasTurbine and 2.4× speedup over FedAvg-RP on CIFAR-10. Our strategy also has a clear advantage over CFCFM, FedProx, FedADAM and AFL for all three tasks, yielding a significant reduction (up to 65.7%) in the wall-clock time consumption until convergence. 5) Energy consumption of end devices: A main concern for the end devices, as the participants of FL, is their power usage (in training and communications). Full aggregation methods experience slower convergence and thus endure higher energy cost on the devices. For example, with a small selection fraction (C=0.05) and a large scale (N =500) for the EMNIST task, FedAvg and CFCFM consume over 15 Wh to reach the target accuracy, in which case our algorithm reduces the energy cost by over 37%. Under the CIFAR-10 FL setting with partial aggregation, the reduction by our algorithm reaches 58.9% and 64.4%-saving over 35 Wh-as compared to FedAvg-RP and FedADAM, respectively. 6) Differentiated participation with FedProf: In figs. 6 and 7 we visualize the behaviour of our selection strategy on the three tasks. Fig. 6 shows how many times clients get selected under the GasTurbine and EMNIST settings. We can observe that the clients with polluted samples or noisy data are significantly less involved in training the prediction model for GasTurbine. On EMNIST, our algorithm also effectively limits (basically excludes) the clients who hold image data of poor quality (i.e., irrelevant or severely blurred), whereas the clients with moderately noisy images are selected with reduced frequency as compared to those with normal data. Fig. 7 reveals the distribution of clients' scores assigned by FedProf throughout the training process on CIFAR-10, where our strategy  effectively avoids the low-value clients since the initial round, demonstrating that our distributional representation profiling and matching method can provide strong evidence of local data's quality and informativeness. A potential issue of having the preference towards some of the devices is about fairness. Nonetheless, one can apply our algorithm together with an incentive mechanism (e.g., [58]) to address it.

Conclusion
Federated learning provides a privacy-preserving approach to decentralized training but is vulnerable to the heterogeneity and uncertain quality of on-device data. In this paper, we use a novel approach to address the issue without violating the data locality restriction. We first provide key insights for the distribution of data representations and then develop a dynamic data representation profiling and matching scheme. Based on the scheme we propose a selective FL training algorithm FedProf that adaptively adjusts clients' participation chance based on their profile dissimilarity. We have conducted extensive experiments on public datasets under various FL settings. Evaluation results show that our algorithm significantly improves the efficiency of FL and the global model's accuracy whilst reducing the time and energy costs for the global model to converge. Our future study may involve extending our selective strategy to other variants of FL scenarios such as personalized FL, vertical FL and federated ensemble learning.

A.1 Proof of Proposition 1
Without loss of generality, we provide the proof of Proposition 1 for the pre-activation representations from dense (fully-connected) layers and standard convolutional layers, respectively. The results can be easily extended to other linear neural operators.

Dense layers
Proof. Let Ω = {neu 1 , neu 2 , ..., neu q } denote a dense layer (with q neurons) of any neural network model and H k denote the pre-activation output of neu k in Ω. We first provide the theoretical proof to support the observation that H k tends to follow a normal distribution. Let χ = R v denote the input feature space (with v features) and assume the feature X i (which is a random variable) follows a certain distribution ζ i (µ i , σ 2 i ) (not necessarily Gaussian) with finite mean For each neuron neu k , let W k = [w k,1 w k,2 . . . w k,v ] denote the neuron's weight vector, b k denote the bias, and Z k,i = X i w k,i denote the i-th weighted input. Let H k denote the output of neu k . During the forward propagation, we have: Apparently Z k,i is a random variable because Z k,i = X i w k,i (where the weights w k,i are constants during a forward pass), thus H k is also a random variable according to Eq. (17).
In an ideal situation, the inputs variables X 1 , X 2 , . . . , X v may follow a multivariate normal distribution, in which case Proposition 1 automatically holds due to the property of multivariate normal distribution that every linear combination of the components of the random vector (X 1 , X 2 , . . . , X v ) T follows a normal distribution [59]. In other words, H k = X 1 w k,1 + X 2 w k,2 + . . . + X v w k,v + b k is a normally distributed variable since w k,i and b k (k = 1, 2, . . . , v) are constants in the forward propagation. A special case for this condition is that X 1 , X 2 , . . . , X v are independent on each other and X i follows a normal distribution N (µ i , σ 2 i ) for all i = 1, 2, . . . , v. In this case, by the definition of Z k,i , we have: where Z 1 , Z 2 , . . . , Z v are independent of each other. Combining Eqs. (17) and (18), we have: For more general cases where X 1 , X 2 , . . . , X v are not necessarily normally distributed, we assume the weighted inputs Z k,i of the dense layer satisfy the Lyapunov's condition (see definition 1). As a result, we have the following according to the Central Limit Theorem (CLT) [60] considering that where s k = v i=1 w k,i σ i 2 and N (0, 1) denotes the standard normal distribution. Equivalently, for Combining Eqs. (17) and (21) we can derive that: which means that H k (k = 1, 2, . . . , v) tend to follow a normal distribution and proves our Proposition 1 for fully-connected layers.

Convolutional layers
Proof. Standard convolution in CNNs is also a linear transformation of the input feature space and its main difference from dense layers rests on the restricted size of receptive field. Without loss of generality, we analyze the representation (output) of a single kernel. To facilitate our analysis for convolutional layers, let C denote the number of input channels and K denote the kernel size. For ease of presentation, we define a receptive field mapping function Θ(k, i, j) that maps the positions (k for channel index, i and j for indices on the same channel) of elements in the feature map (i.e., the representations) to the input features. For the k-th kernel, let W k denote its weight tensor (with W k,c being the weight matrix for channel c) and b k its bias.
Given the corresponding input patch X Θ(k,i,j) , The element H k,i,j of the representations from a convolutional layer can be formulated as: where • denotes Hadamard product. The three summations reduce the results of element-wise product between the input patch and the k-th kernel to the correspond representation element H k,i,j in the feature map. For ease of presentation, here we use the notation Z (k) c,i ′ ,j ′ follows. Note that ζ can be any distribution since we do not make any distributional assumption on Z We use the condition that the random variables Z (k) c,i ′ ,j ′ satisfy the Lyapunov's condition, i.e., there exists a δ such that where s = C c=1 Then according to the Lyapunov CLT, the following holds: which proves our Proposition 1 for standard convolution layers.

A.2 Proof of Proposition 2
Without loss of generality, we prove Proposition 2 for the fused representations from the LSTM layer and the residual block of ResNet models, respectively. The results can be easily extended to other non-linear neural operators.

LSTM
Proof. Long Short-Term Memory (LSTM) models are popular for extracting useful representations from sequence data for tasks such as speech recognition and language modeling. Each LSTM layer contains multiple neural units. For the k-th unit, it takes as input the current feature vector X t = (X t,1 , X t,2 , . . .), hidden state vector H t−1 and its cell state c t−1,k . The outputs of the unit are its new hidden state h t,k and cell state c t,k . In this paper, we study the distribution of h t,k . Multiple gates are adopted in an LSTM unit: by i t,k , f t,k , g t,k and o t,k we denote the input gate, forget gate, cell gate and output gate of the LSTM unit k at time step t. The update rules of these gates and the cell state are: where the W (i)k , W (f )k , W (g)k and W (o)k are the weight parameters and b (i)k , b (f )k , b (g)k and b (o)k are the bias parameters for the gates. The output of the LSTM unit h t,k is calculated as the following: Using the final hidden states h T,k (with T being the length of the sequence) as the elements of the layer-wise representation, we apply the following layer-wise fusion to further produce H over all the h T,k in a single LSTM layer: where d is the dimension of the LSTM layer. Again, by ζ(µ k , σ 2 k ) we denote the distribution of h T,k (where the notation T is dropped here since it is typically a fixed parameter). With {h T,k |k = 1, 2, . . . , d} satisfying the Lyapunov's condition and by Central Limit Theorem H, tends to follow the normal distribution: which proves the Proposition 2 for layer-wise fused representations from LSTM.

Residual blocks
Proof. Residual blocks are the basic units in the Residual neural network (ResNet) architecture [61]. A typical residual block contains two convolutional layers with batch normalization (BN) and uses the ReLU activation function. The input of the whole block is added to the output of the second convolution (after BN) through a skip connection before the final activation. Since the convolution operators are the same as we formulate in the second part of Section A.1, here we use the notation Ψ(X) to denote the sequential operations of convolution on X followed by BN, i.e., Ψ(X) BN (Conv(X)). Again, we reuse the receptive field mapping Θ(k, i, j) as defined in Section A.1 to position the inputs of the residual block corresponding to the element Z k,i,j in the output representation of the whole residual block. Let X denote the input of the residual block and Z k,i,j denote an element in the output tensor of the whole residual block. Then we have: where f is the activation function (ReLU). We perform channel-wise fusion on the representation from the residual block to produce H k for the k-th channel: where d H and d W are the dimensions of the feature map and k is the channel index. Let ζ(µ k,i,j , σ 2 k,i,j ) denote the distribution that Z k,i,j follows. Then we apply the Lyapunov's condition to the representation elements layer-wise, i.e., where s k = dH i=1 dW j=1 σ 2 k,i,j . With the above condition satisfied, by CLT H k (the fused representation on channel k) tends to follow the normal distribution: which proves the Proposition 2 for channel-wise fused representations from any residual block.

B Convergence Analysis
In this section we provide the proof of the proposed Theorem 1. The analysis is mainly based on the results provided by [5]. We first introduce several notations to facilitate the analysis.

B.1 Notations
Let U (|U | = N ) denote the full set of clients and S(t) (|S(t)| = K) denote the set of clients selected for participating. By θ k (t) we denote the local model on client k at time step t. We define an auxiliary sequence v k (t) for each client to represent the immediate local model after a local SGD update; v k (t) is updated from θ k (t − 1) with learning rate η t−1 : where ∇F k (θ k (t − 1), ξ k,t−1 ) is the stochastic gradient computed over a batch of data ξ k,t−1 drawn from D k with regard to θ k (t − 1). We also define two virtual sequencesv(t) = N k=1 ρ k v k (t) andθ(t) = Aggregate({v k (t)} k∈S(t) ) for every time step t (Note that the actual global model θ(t) is only updated at the aggregation steps T A = {τ, 2τ, 3τ, . . .}). Given an aggregation interval τ ≥ 1, we provide the analysis for the partial aggregation rule that yieldsθ(t) as:θ where S(t) (|S(t)| = K) is the selected set of clients for the round ⌈ t τ ⌉ that contains step t. At the aggregation steps T A , θ(t) is equal toθ(t), i.e., To facilitate the analysis, we assume each client always performs model update (and synchronization) to produce v k (t) andv(t) (but obviously it does not affect the resultingθ and θ for k / ∈ S(t)).
For ease of presentation, we also define two virtual gradient sequences:ḡ(t) = N k=1 ρ k ∇F k (θ k (t)) and

B.2 Key Lemmas
To facilitate the proof of our main theorem, we first present several key lemmas.
Lemma 1 (Result of one SGD step). Under Assumptions 1 and 2 and with η t < 1 4L , for any t it holds true that where Γ = F * − N k=1 ρ k F * k . Lemma 2 (Gradient variance bound). Under Assumption 3, one can derive that Lemma 3 (Bounded divergence of w k (t)). Assume Assumption 4 holds and a non-increasing step size η t s.t. η t ≤ 2η t+τ for all t = 1, 2, . . ., it follows that Lemmas 1, 2 and 3 hold for both full and partial participation and are independent of the client selection strategy. We refer the readers to [5] for their proofs and focus our analysis on opportunistic selection.
Let q k denotes the probability that client k gets selected. Given the optimal penalty factors α k for k = 1, 2, . . . N that satisfy α k = − ln(Λρ k ) div(RP k ,RP B ) , we have q k = λ k Λ = ρ k according to Eq. (7). The next two lemmas give important properties of the aggregated modelθ as a result of partial participation and non-uniform client selection/sampling. Lemma 4 (Unbiased aggregation). For any aggregation step t ∈ T A and with q k = ρ k in the selection of S(t), it follows that Proof. First, we present a key observation given by [5] as an important trick to handle the randomness caused by client selection with probability distribution {q k } N k=1 . By taking the expectation over S(t), it follows that Let q k = ρ k , take the expectation ofθ(t) over S(t) and notice thatv(t) = k∈U ρ k v k (t): Lemma 5 (Bounded variance ofθ(t)). For any aggregation step t ∈ T A and with a non-increasing step size η t s.t. η t ≤ 2η t+τ −1 , it follows that Proof. First, one can prove that v k (t) is an unbiased estimate ofv(t) for any k: Then by the aggregation ruleθ(t) = 1 K k∈S(t) v k (t), we have: where the second term on the RHS of (45) equals zero because {v k (t)} k∈U are independent and unbiased (see Eq. 44). Further, by noticing t − τ ∈ T A (because t ∈ T A ) which implies that θ k (t − τ ) = θ (t − τ ) since the last communication, we have: where the last inequality results from E[v k (t)−θ(t−τ )] =v(t)−θ(t−τ ) and that E X−EX 2 ≤ τ X 2 . Further, we have: Let i m = arg max i ∇F k θ k (i), ξ k,i , i ∈ [t − τ, t − 1]. By using the Cauchy-Schwarz inequality, Assumption 4 and choosing a non-increasing η t s.t. η t ≤ 2η t+τ −1 , we have: Plug Z 1 back into (47) and notice that N k=1 q k = 1, we have:
By definition, we have θ(t) =θ(t) at the aggregation steps. Therefore, for t ∈ T A :

C Profile Dissimilarity under Homomorphic Encryption
The proposed representation profiling scheme encodes the representations of data into a list of distribution parameters, namely RP (θ, D) = {(µ i , σ 2 i )|i = 1, 2, . . . , q} where q is the length of the profile. Theoretically, the information leakage (in terms of the data in D) by exposing RP (θ, D) is very limited and it is basically impossible to reconstruct the samples in D given RP (θ, D). Nonetheless, Homomorphic Encryption (HE) can be applied to the profiles (both locally and on the server) so as to guarantee zero knowledge disclosure while still allowing profile matching under the encryption. In the following we give details on how to encrypt a representation profile and compute profile dissimilarity under Homomorphic Encryption (HE).
To calculate (3) and (4) under encryption, a client needs to encrypt (denoted as [[·]]) every single µ i and σ 2 i in its profile RP k (θ, D k ) locally before upload whereas the server does the same for its RP B (θ, D V ). Therefore, according to Eq. (4) we have: where the first two terms on the right-hand side require logarithm operation on the ciphertext. However, this may not be very practical because most HE schemes are designed for basic arithmetic operations on the ciphertext. Thus we also consider the situation where HE scheme at hand only provides additive and multiplicative homomorphisms [62]. In this case, to avoid the logarithm operation, the client k needs to keep every σ 2 i in RP k (θ, D k ) as plaintext and only encrypts µ i , likewise for the server. As a result, the KL divergence can be computed under encryption as: where the first term on the right-hand side is encrypted after calculation with plaintext values (σ k i ) 2 and (σ B ) 2