Sparsity-Induced Federated Machine Learning
Patent Information
- Application Number
- JP2023517950
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2020-09-28
- Filing Date
- 2021-09-28
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-09-28
AI Technical Summary
Federated learning in machine learning models faces challenges with high communication costs and inefficiencies, particularly in edge devices, leading to impracticality and suboptimal performance due to the iterative nature of data transmission.
A sparsity-inducing method for federated learning that uses gate probabilities to select and communicate subsets of model elements, combined with expectation maximization and continuous relaxation techniques to optimize local models, reducing communication while maintaining performance.
This approach significantly reduces communication costs and maintains model performance by pruning unnecessary parameters, making federated learning more efficient and practical for edge devices.
Abstract
Description
[Technical Field]
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS This application claims the benefit of and priority to Greek Patent Application No. 20200100587, filed September 28, 2020, the entire contents of which are incorporated herein by reference.
[0002] TECHNICAL FIELD
[0002] Aspects of the present disclosure relate to sparsity-inducing federated machine learning. [Background technology]
[0003]
[0003] Machine learning is generally the process of generating a trained model (e.g., an artificial neural network, tree, or other structure) that represents a generalized fit to a set of training data. Applying the trained model to new data generates inferences that can be used to gain insight into the new data.
[0004]
[0004] As the use of machine learning proliferates in various technology domains for what are sometimes referred to as artificial intelligence tasks, a need arises for more efficient processing of machine learning model data. For example, "edge processing" devices, such as mobile devices, always-on devices, and Internet of Things (IoT) devices, must balance the implementation of advanced machine learning capabilities with various interrelated design constraints, such as packaging size, native computational power, power storage and usage, data communication capacity and cost, memory size, and heat dissipation.
[0005]
[0005] Federated learning is a distributed machine learning framework that enables several clients, such as edge processing devices, to collaboratively train a shared global model without transferring their local data to a remote server. Typically, a central server coordinates the federated learning process, and each participating client communicates only model parameter information with the central server while keeping its local data private. This distributed approach addresses the challenge of limited client device capabilities (because training is federated) and often alleviates data privacy concerns.
[0006]
[0006] Although federated learning generally limits the amount of model data in any single transmission between a server and a client (or vice versa), the iterative nature of federated learning still generates a significant amount of data transmission traffic during training, which can be quite costly depending on the device and connection type. Therefore, it is generally desirable to try to reduce the size of the data exchange between the server and the client during federated learning. However, conventional methods for reducing data exchange have resulted in lower-performing models, such as when lossy compression of model data is used to limit the amount of data exchanged between the server and the client.
[0007]
[0007] Therefore, there is a need for an improved method of performing federated learning in which model performance is not compromised due to communication efficiency. Summary of the Invention
[0008]
[0008] Some aspects provide a method for performing federated learning of a machine learning model, the method comprising: for each respective client of a plurality of clients and for each training round of a plurality of training rounds, generating a subset of model elements for each client based on sampling a gate probability distribution for each model element of a set of model elements for a global machine learning model; sending to each client the subset of model elements and a set of gate probabilities based on the sampling; receiving a respective set of model updates from each respective client of the plurality of clients, wherein each gate probability of the set of gate probabilities is associated with one model element of the subset of model elements; and updating the global machine learning model based on the respective set of model updates from each respective client of the plurality of clients.
[0009]
[0009] A further aspect provides a method for performing federated learning of a machine learning model, comprising: receiving a subset of model elements from a set of model elements for a global machine learning model and a set of gate probabilities from a server managing the federated learning of the global machine learning model; generating a set of model update values based on training a local machine learning model based on the set of model elements and the set of gate probabilities, wherein each gate probability in the set of gate probabilities is associated with one model element of the subset of model elements; and transmitting the set of model update values to the server.
[0010]
[0010] Other aspects provide a processing system configured to perform the above method and methods described herein, a non-transitory computer-readable medium comprising instructions that, when executed by one or more processors of the processing system, cause the processing system to perform the above method and methods described herein, a computer program product embodied on a computer-readable storage medium comprising code for performing the above method and methods further described herein, and a processing system comprising means for performing the above method and methods further described herein.
[0011] The following description and the annexed drawings set forth in detail certain illustrative features of the one or more embodiments.
[0012]
[0012] The accompanying drawings illustrate some aspects of one or more embodiments and therefore should not be considered as limiting the scope of the present disclosure. [Brief explanation of the drawings]
[0013] [Figure 1]
[0013] FIG. 1 illustrates an exemplary training flow for promoting sparsity in federated learning. [Figure 2]
[0014] FIG. 1 illustrates an example method for performing sparsity-induced federated learning. [Figure 3]
[0015] FIG. 10 illustrates another exemplary method for performing sparsity-induced federated learning. [Figure 4]
[0016] FIG. 1 illustrates an example processing system that may be configured to perform aspects of the federated learning methods described herein. DETAILED DESCRIPTION OF THE INVENTION
[0014]
[0017] For ease of understanding, where possible, identical reference numerals have been used to designate identical elements common to the figures. It is contemplated that elements and features of one embodiment may be beneficially incorporated in other embodiments without further recitation.
[0015]
[0018] Aspects of the present disclosure provide apparatus, methods, processing systems, and computer-readable media for sparsity-induced federated machine learning.
[0016]
[0019] As machine learning models become more complex and therefore larger, it becomes increasingly difficult to train them on anything other than high-performance computers such as servers. Federated learning is a distributed machine learning framework that allows several clients, including low-power devices such as edge processing devices, to collaboratively train a shared global model. In such settings, it is generally desirable to reduce client device computation as well as overall communication costs. In particular, high communication costs can make federated learning over mobile data impractical.
[0017]
[0020] One approach to address these challenges is "federated dropout," in which the server selects a specific probability for selecting a submodel from the original model before the federated training process. Then, during the training process, the server probabilistically selects a random submodel and communicates it to each client. Thus, instead of locally training updates to the entire global model, each client trains updates to a smaller submodel. Because the submodels are subsets of the global model, the local updates computed by the clients have a natural interpretation as updates to the larger global model.
[0018]
[0021] Another approach is to modify messages from the client to the server for economy of data communication. For example, the client may select the top k most informative elements from a message intended for the server and communicate only those k most informative elements to the server. Alternatively, the client may quantize the message before it is communicated to the server.
[0019]
[0022] The embodiments described herein improve on existing approaches in several important ways. First, unlike traditional federated dropout approaches, the methods described herein allow each client to automatically determine an appropriate sub-model of the original model in a way that fits its local dataset while also being as efficient as possible. Second, rather than the server adhering to one particular global probability across sub-models, the global model can be optimized through client-specific probabilities.
[0020] Federated Averaging Through the Lens of Expectation Maximization
[0023] As mentioned above, federated learning generally works by learning a dataset D={(x1, y1),...,(x N ,y N )}, i.e., D = D1 ∪ … ∪ D SWe address the problem of training a server model (e.g., a neural network) from S with parameters w, where the parameters w may generally represent a vector, matrix, or tensor. Note that a shard may generally be a processing client participating in federated learning with a central server, and a shard may comprise a remote computer, server, mobile device, smart device, edge processing device, etc. Without loss of generality and for simplicity, in the following it is assumed that all of the shards S have the same amount of data points, but the framework can be extended to a non-uniform amount of data points by selecting appropriate weighting coefficients. The loss function L on each shard is s (D s By defining ;w), the total loss can be written as:
[0021]
number
[0022]
[0024] where N s is the number of data points in shard (e.g., device) s, and D s is the dataset on the device of shard s. In particular, the objective corresponds to empirical risk minimization (ERM) over the joint dataset D with loss L(·) for each data point.
[0023]
[0025] It is desirable to reduce the communication cost of federated learning. One approach to reducing communication during federated learning is to perform multiple gradient updates with respect to w in the inner optimization objective for each shard s, and thus the parameter φ s The goal is to obtain a "local" model with a local (or sub) model φ. These multiple gradient updates are denoted as "local epochs", i.e., the number of passes through the local dataset, abbreviated as E. Each of the shards is then assigned a local (or sub) model φ sto the server, which updates the global model in “round” t by averaging the parameters of the local machine learning models, for example, according to the following formula:
[0024]
number
[0025]
[0026] This technique is sometimes called federated averaging.
[0026]
[0027] Although simple to implement, federated averaging can provide suboptimal results for non-IID data, even though its convergence can be proven. Indeed, if the shards S have skewed distributions, the means of the local machine learning model parameters may be poor estimates of the global model. To counter this, a "proximal" term for optimization at the shard level may be used, where the proximal term is the local machine learning model φ. s promotes, under some distance, to “get closer” to the model w at the server. More formally, this can be defined as:
[0027]
number
[0028]
[0028] where
[0029]
number
[0030] is the proximal term. After each shard-specific optimization is completed, the global model can be updated in a manner similar to federated averaging, i.e., by averaging the shard-specific parameters in Equation 2.
[0031] Connecting Federated Averaging with Expectation Maximization
[0029] In particular, the entire joint averaging algorithm is compatible with any optimization procedure based on a given objective function. For example, consider the following objective function:
[0032]
number
[0033]
[0030] where D s is N s corresponds to a shard-specific dataset with data points, p(D s |w) is the server parameter w and Σ s N s =D under N s Next, consider decomposing each of the shard-specific likelihoods as follows:
[0034]
number
[0035] Here, the auxiliary latent variable φ s is introduced, and the server parameter w is the shard-specific parameter p(φ s These latent variables act as hyperparameters of the prior distribution on |w. These latent variables are parameters of the local machine learning model at shard s, and the following convenient forms of prior distribution can be used:
[0036]
number
[0037] where λ is the s acts as a regularization strength that prevents from getting too far away from w. Overall, this then leads to the following objective function:
[0038]
number
[0039]
[0033] Latent variable φ s One way to optimize this objective in the presence of is via expectation maximization (EM). EM generally consists of two steps: an expectation step in which a posterior distribution is formed over the latent variables, i.e.
[0040]
number
[0041] and for the model parameters w, we obtain D by marginalizing over this posterior distribution as follows: s This is the maximization step, where the probability of
[0042]
number
[0043]
[0035] Thus, if a single gradient step is performed on w in the maximization step, this procedure corresponds to performing gradient descent on the original objective of Equation 7. To illustrate this, let us consider the case where the gradient of Equation 7 is s =∫p(D s |φ s )p(φ s |w)dφ s can be taken with respect to w where
[0044]
number
[0045] Here, to calculate Equation 12, the local variable φ sThe posterior distribution of w must first be obtained, and then the gradient of w is estimated by marginalizing over this posterior distribution.
[0046]
[0037] When posterior inference is difficult to solve, hard EM is sometimes adopted. In such cases, the latent variable φ s The "hard" allocation of p(φ) is done in the expectation step, e.g., s |D s ) at its most probable point.
[0047]
number
[0048]
[0038] This is usually easier to do using techniques such as stochastic gradient ascent. Given these hard assignments, the maximization step corresponds to another simple maximization of
[0049]
number
[0050]
[0039] Consequently, hard EM corresponds to a block coordinate ascent type algorithm for the following objective function:
[0051]
number
[0052] Here, while w is fixed, φ 1:S Optimizing φ 1:S This is done alternately with optimizing w while fixing
[0053]
[0041] By letting λ → 0 in Equation 6, it is clear that the hard allocation in the expectation step mimics the process of optimizing a local machine learning model on each shard. Indeed, even by optimizing a model locally using stochastic gradient descent for a fixed number of iterations at a given learning rate, a specific prior distribution over the parameters can be assumed. For linear regression, this prior distribution is a Gaussian distribution centered on the initial values of the parameters, and for nonlinear models, this prior distribution can be revealed through a proximal view of each gradient descent iteration.
[0054]
number
[0055] This imposes a similar Gaussian prior centered on the previous iteration, and the learning rate η acts as the variance of that prior. * s After obtaining , the maximization step then corresponds to:
[0056]
number
[0057] A closed-form solution to this objective can then be found by setting the derivative of the objective with respect to w to zero and solving for w according to:
[0058]
number
[0059] where φ * 1:S The optimal solution for w given φ is generated using associative averaging. * 1:S is the same as the average of
[0060]
[0045] The joint averaging is performed by using a local parameter φ s However, the alternating procedure of EM corresponds to block coordinate ascent for a single objective function, which is a variational lower bound on the log-marginal likelihood. More specifically, EM iterations perform block coordinate ascent to optimize the objective
[0061]
number
[0062]
[0046] where w s is the posterior distribution p(φ s |D s ,w) are parameters of the variational approximation to the φ s The deterministic distribution of, i.e.,
[0063]
number
[0064] is sometimes used, which leads to simplifications for the following purposes:
[0065]
number
[0066] where C is a fixed constant independent of the parameters being optimized. Notably, this objective is the same as that in Equation 15.
[0067] Encouraging Sparsity in Federated Learning An enhancement of federated averaging is to promote sparsity via an appropriate prior. Promoting sparsity has two important advantages: first, the model is smaller and therefore easier to train on the device in terms of hardware; and second, it reduces communication costs since pruned parameters do not need to be communicated.
[0068]
[0049] The standard for sparsity in Bayesian models is the spike-slab prior, which is a two-component mixture of a delta spike at zero δ(0) and a continuous distribution spanning the real line, i.e., a slab. More specifically, the spike-slab prior can be defined for a Gaussian slab as follows:
[0069]
number
[0070]
[0050] Alternatively, it can be equivalently defined as a hierarchical model as follows:
[0071]
number
[0072]
[0051] where z acts as a "gating" variable that switches the parameter w on or off. Now consider using this distribution instead of a single Gaussian for the prior distribution over the parameters in the federated setting. In this case, the hierarchical model becomes:
[0073]
number
[0074] where w is the model weight at the server and θ is the probability of the binary gate. Similar to the joint averaging, the approximate distribution q(φ s |z s )q(z s ) hard EM can be performed to optimize w, θ. The variational lower bound for this model can then be written as
[0075]
number
[0076]
[0053] Or, equivalently, it can be written as follows:
[0077]
number
[0078] For shard specific weight distributions, since they are continuous, q(φ si |z si =1):=N(φ si ,ε), q(φ si |z si =1):=N(0,ε) may be used with ε≈0, where the shard weight distribution is deterministic to machine precision, but the gating variable is binary, so
[0079]
number
[0080] is the local gate z si π is the probability of activating si where Bern(·) denotes the Bernoulli distribution. To perform hard EM on binary variables,
[0081]
number
[0082] The entropy term of the approximate distribution is z s It can be removed from the above bounds because it encourages moving towards the most likely value of p(φ). Furthermore, to reach a simple and intuitive objective at the shard level, the spike at zero is distributed as a Gaussian with precision λ, i.e., p(φ si |z si = 0) = N(0,1 / λ2). Taking all of this into account and plugging in the appropriate equations into Equation 26, it can be shown that the local and global objectives are, respectively,
[0083]
number
[0084]
[0055] where
[0085]
number
[0086] and C are constants independent of the variables being optimized. In particular, locally, each shard has D s While explaining as much as possible, the prior accuracy λ and its weight (weight) are locally retained with probability π s We optimize the weights to be close to the server weights adjusted by θ and θ. Furthermore, the gate activation probabilities are optimized to be close to the server θ with an additional term that penalizes the sum of local activation probabilities. This is similar to the L0 regularization objective proposed previously.
[0087] Next, the local shard is configured as φ through some procedure. s and π sWe can consider what happens at the server after optimizing w, θ. Since the server loss for w, θ is just the sum of all the local losses, the gradient for each of the parameters is
[0088]
number
[0089]
[0057] Setting these derivatives to zero, the stationary point becomes:
[0090]
number
[0091] That is, the weighted average of the local weights and the average of the local probabilities of holding these weights. s Since is optimized to be sparse through the L0 penalty, the server probability θ will be sparse for weights that are not used by any of the shards. As a result, to obtain a final sparse architecture, weights can be pruned if their server inclusion probability θ is below a threshold such as 0.1, although other thresholds are possible.
[0092] Local Optimization
[0059] While locally optimizing φs is straightforward to do using a gradient-based optimizer, the binary variable z in Eq. s Since the expectation value for π is difficult to compute in closed form and using Monte Carlo integration does not result in reparameterizable samples, s is not trivial. To avoid these challenges, the objective can be rewritten in the equivalent form as
[0093]
number
[0094] Next, the Bernoulli distribution:
[0095]
number
[0096] is sometimes replaced by a continuous relaxation such as the hard-concrete distribution.
[0097]
number
[0098] where v s are the parameters of the surrogate distribution. In this case, the local objective is
[0099]
number
[0100]
[0061] where
[0101]
number
[0102] is continuous relaxation,
[0103]
number
[0104] is the cumulative distribution function (CDF) of . Therefore, the surrogate objective can then be easily optimized using gradient descent.
[0105] Reducing the Client to Server Communication Cost
[0062] The above model allows for learning a sparse model for inference at the server. The same framework can be used to reduce communication costs during training time by employing two techniques to reduce communication costs from client to server and from server to client, respectively.
[0106] To reduce the cost from the client to the server, sparse samples from the local distribution can be communicated rather than the distribution itself. For example, the local weights φ s and the local probability π s and to the server, the client instead sends s A random binary sample z according to s ∈{0,1}, then z si = 1 with weight φ si Only z s In this way, zero values in the parameter vector do not need to be communicated, which results in significant savings while still keeping the server gradient unbiased. More specifically, the gradient and stationary point of the server weights can be expressed as:
[0107]
number
[0108] On the other hand, the formula for the server probability is as follows:
[0109]
number
[0110] As a result, the client can select a subset of the local weights
[0111]
number
[0112] Only
[0113]
number
[0114] In this way, the client can communicate a subset of the local weights via z s When the client has access to these samples, it can form one-sample probability estimates of either the gradient or stationary point of w, θ. The client can then locally
[0115]
number
[0116] It works for smoothing purposes, so
[0117]
number
[0118] is the exact discrete sample z when the client communicates to the server. s Whenever you get a zero temperature
[0119]
number
[0120] can be formed by sampling from
[0121]
[0066] Note that this is a way to reduce communication without adding bias to the original target gradient. If the extra bias is tolerable, further techniques such as quantization and top-k gradient selection can be used to further reduce communication.
[0122] Reducing the Server to Client Communication Cost
[0067] The server needs to communicate the updated distribution to the client in each round. Unfortunately, in the case of simple unstructured pruning, each weight w i The associated θ that needs to be sent to the client i Since there is a probability for each group of weights, this doubles the communication cost. To mitigate this effect, structured pruning can be employed, which introduces a single additional parameter indicating the probability for each group of weights and is therefore more efficient in terms of the number of trainable parameters compared to unstructured pruning. Even with structured pruning, the regular weights and probabilities are sent to the server (as noted above, with structured pruning, the probability vectors become quite small except when communicating sparse samples). Therefore, for groups of modest size, e.g., the set of weights for a given convolution filter, the extra overhead is relatively small.
[0123]
[0068] If some bias is tolerated in the optimization procedure, the reduction of communication costs can be taken a step further. For example, the global model can be pruned during training after each round, and only a subset of surviving models can then be sent to each of the clients. In particular, this is efficient to implement and does not require any data on the server, since the server has access to the inclusion probability θ and can therefore remove parameters with θ less than a threshold, e.g., 0.1. This can result in a substantial reduction in communication costs, especially during later stages of training when the model is more sparse.
[0124]
[0069] An additional way to reduce communication costs is for the client to perform local pruning and thus request from the server only the subset of the original model parameters that will survive locally.
[0125]
[0070] Therefore, when performing associative learning, a generalization of associative averaging can be used to optimize sparse neural networks, which in turn leads to significant communication savings while maintaining similar performance.
[0126] Example Training Flow for Encouraging Sparsity in Federated Learning
[0071] Figure 1 shows an exemplary training flow for promoting sparsity in federated learning, as conceptually detailed above.
[0127] Initially, the server 102 generates or maintains the global model 104 in a first state. In this example, each edge between nodes in the global model 104 is associated with parameters (e.g., parameter set 105) including a weight w and a gating probability θ. As noted above, the gating probability generally represents the likelihood that the associated weight will be included in a local (or sub) model for federated training.
[0128]
[0073] At 110, the server 102 samples the global model weights w according to their associated gating probabilities θ to generate various subsets of weights and gating probabilities for each of the shards 106A-K, where each shard may represent a client device participating in federated learning with the server 102.
[0129] Based on this information, each shard 106A-K, where K is the total number of shards participating in federated learning, calculates a parameter φ based on the parameters received from the server 102. s , π s is used to generate local machine learning models 108A-K, where s is a particular shard in the set of shards S. In FIG. 1, the dotted lines between nodes in local machine learning models 108A-K indicate weights that are gated off and therefore not included in the local machine learning model training.
[0130] As shown, the local machine learning models generally differ for each shard based on different gate probabilities and random sampling performed by the server 102. This helps to increase the comprehensiveness of federated training.
[0131] At 112, each shard 106A-K trains its local machine learning model 108A-K, respectively, to generate an updated local machine learning model 108A′-K′. Additionally, each shard 106A-K generates a weight gradient and a gate gradient based on the training, e.g., as described above with respect to Equations 31 and 32.
[0132] At 114, each shard 106A-K returns model update data to the server 102. The server 102 then uses the model update data to generate an updated global model 104′. In the illustrated embodiment, the model update data sent by each shard 106A-K includes weight gradients and gate gradients for each element (e.g., 108A′-K′) of the shard's local machine learning model.
[0133]
[0078] In particular, FIG. 1 shows a single round of training for simplicity, and this process may be repeated any number of times, for example, until a training target is reached (e.g., the number of iterations is completed, the weights converge, an accuracy threshold is reached, etc.).
[0134] After associative training is complete (e.g., when the global model 104 converges), one or more nodes (in the example neural network model) may be permanently and effectively gated off (not shown in FIG. 1). More generally, the pruning rate of the global model 104 may be gradually increased during training so that the model may become extremely sparse (e.g., about 90% sparsity rate) by the end of training. For example, a 90% sparsity rate of the trained global model 104′ in the context of FIG. 1 means that 90% of the weights are pruned during training based on a set threshold.
[0135]
[0080] In particular, in this example, sparsity is induced in the weights for edges between nodes of the exemplary model, but in other examples, other aspects of the model may be associated with gate probabilities to induce alternative or additional sparsity. For example, nodes or layers within the model may be associated with gate probabilities and therefore sampled and pruned during associative training. As another example, in the context of a convolutional neural network model, individual filter channels may be associated with gate probabilities and therefore sampled and pruned to induce sparsity during training.
[0136] In addition to the sparsity induced during training based on the gate probabilities, further strategies can be implemented to reduce communication costs. As described above, to reduce communication costs from the shards (or clients) to the server (e.g., in step 114), only gradients for aspects of the model that are not gated off (e.g., weights represented by solid lines between nodes in FIG. 1 ) are sent back to the server during each training round. Thus, unlike traditional federated learning, in which all weights are sent between the shards and the server in each training round, here it is possible to save communication time and costs by sending only a subset of model data corresponding to that updated by each local machine learning model 108A-K during local training.
[0137] Furthermore, each shard (for example, 106A to K) has a gate probability π s Therefore, for example, the parameters φ of the local machine learning model can be sampled according to s ) weight gradient and (local gate probability π sRather than sending the entire set of gating gradients (for π), a shard can either send a weight update and z=1, or nothing (corresponding to z=0), where z is the "gating" variable as described above. Thus, z is a value in {0,1}, π is the probability of having z=1, and 1-π is the probability of having z=0.
[0138] This helps to reduce the communication cost between each shard and the server 102 in step 114. In such a case, the server update rule can be modified from equation (30) to equations (34) and (36) to update the weights w and probabilities for the binary gates, respectively.
[0139] Example Methods of Performing Federated Learning FIG. 2 illustrates an example method 200 for performing sparsity-inducing federated learning, which may be performed, for example, by a federated learning server, such as 102 in FIG.
[0140]
[0085] Method 200 begins at step 202, which generates a subset of model elements for each client of a plurality of clients (e.g., shards 106A-K in Figure 1) based on sampling gate probability distributions for each model element of a set of model elements of a global machine learning model.
[0141] In some embodiments of method 200, the subset of model elements comprises a subset of weights associated with edges connecting nodes in the global machine learning model. In some embodiments of method 200, the subset of model elements comprises a subset of nodes in the global machine learning model. In some embodiments of method 200, the subset of model elements comprises a subset of channels in convolution filters of the global machine learning model.
[0142]
[0087] Method 200 then proceeds to step 204, which involves sending to each respective one of the multiple clients a subset of model elements and a set of sampling-based gate probabilities, where each gate probability in the set of gate probabilities is associated with one model element of the subset of model elements (e.g., as described in step 110 with respect to Figure 1).
[0143]
[0088] The method 200 then proceeds to step 206, where a respective set of model updates is received from each respective client of the plurality of clients (eg, described in step 114 with respect to Figure 1).
[0144]
[0089] Method 200 then proceeds to step 208, where the global machine learning model is updated based on a respective set of model update values from each respective one of the multiple clients.
[0145]
[0090] In some embodiments of method 200, each set of model update values comprises a set of weight gradients associated with the local machine learning model trained by each client and a set of gate probability gradients associated with the local machine learning model trained by each client.
[0146]
[0091] In some embodiments of method 200, each set of model update values comprises a set of weight gradients associated with a local machine learning model trained by each client and a binary gate variable value associated with each weight gradient in the set of weight gradients.
[0147]
[0092] In some embodiments of method 200, updating the global machine learning model based on a respective set of model update values from each respective client of the plurality of clients further comprises pruning the updated global machine learning model based on an updated gate probability for the global machine learning model and a threshold gate probability value.
[0148]
[0093] Notably, FIG. 2 is only one example of a model consistent with the disclosure herein, and further examples having additional, fewer, and / or additional steps are possible.
[0149] FIG. 3 illustrates another exemplary method 300 for performing sparsity-induced federated learning, which may be performed by a federated learning client, such as, for example, 106A-K of FIG.
[0150]
[0095] Method 300 begins at step 302, where a subset of model elements from a set of model elements for a global machine learning model and a set of gate probabilities are received from a server managing federated learning of the global machine learning model, where each gate probability in the set of gate probabilities is associated with one model element of the subset of model elements.
[0151] In some embodiments of method 300, the subset of model elements comprises a subset of weights associated with edges connecting nodes in the global machine learning model. In some embodiments of method 300, the subset of model elements comprises a subset of nodes in the global machine learning model. In some embodiments of method 300, the subset of model elements comprises a subset of channels in convolution filters of the global machine learning model.
[0152]
[0097] Method 300 then proceeds to step 304, which generates a set of model update values based on training a local machine learning model based on the set of model elements and the set of gate probabilities (e.g., as described in step 112 with respect to Figure 1).
[0153]
[0098] The method 300 then proceeds to step 306, where the set of model updates is sent to a server (eg, described in step 114 with respect to Figure 1).
[0154]
[0099] In some embodiments of method 300, the set of model update values comprises a set of weight gradients associated with the local machine learning model and a set of gate probability gradients associated with the local machine learning model (e.g., local machine learning models 108A-K of FIG. 1).
[0155]
[0100] In some embodiments of method 300, the set of model update values comprises a set of weight gradients associated with the local machine learning model and a binary gate variable value associated with each weight gradient in the set of weight gradients.
[0156]
[0101] In some embodiments, the method 300 further includes receiving a final set of model elements from the server, where the final set of model elements corresponds to a pruned global machine learning model.
[0157]
[0102] Notably, FIG. 3 is only one example of a model consistent with the disclosure herein, and further examples having additional, fewer, and / or additional steps are possible.
[0158] Example Processing System FIG. 4 illustrates an exemplary processing system 400 that may be configured to perform aspects of the federated learning methods described herein, including, for example, methods 200 and 300 of FIGS. 2 and 3, respectively.
[0159]
[0104] The processing system 400 includes a central processing unit (CPU) 402, which in some examples may be a multi-core CPU. Instructions executed in the CPU 402 may be loaded from a program memory associated with the CPU 402 or may be loaded from memory 424, for example.
[0160]
[0105] The processing system 400 also includes additional processing components adapted to specific functions, such as a graphics processing unit (GPU) 404, a digital signal processor (DSP) 406, a neural processing unit (NPU) 408, a multimedia processing unit 410, and wireless connectivity components 412.
[0161] An NPU, such as 408, is generally a dedicated circuit configured to implement control and arithmetic logic for running machine learning algorithms, such as algorithms for processing artificial neural networks (ANNs), deep neural networks (DNNs), random forests (RFs), etc. NPUs are sometimes alternatively referred to as neural signal processors (NSPs), tensor processing units (TPUs), neural network processors (NNPs), intelligence processing units (IPUs), or vision processing units (VPUs).
[0162] NPUs such as 408 may be configured to accelerate the performance of general machine learning tasks, such as image classification, audio classification, and various other predictive models. In some examples, multiple NPUs may be instantiated on a single chip, such as a system-on-chip (SoC), while in other examples, they may be part of a dedicated neural network accelerator.
[0163]
[0108] NPUs can be optimized for training or inference, or in some cases configured to balance performance between both. For NPUs capable of performing both training and inference, the two tasks can still generally be performed independently.
[0164]
[0109] NPUs designed to accelerate training are generally configured to accelerate the optimization of new models, a highly computationally intensive operation that involves inputting an existing dataset (often labeled or tagged), iterating over the dataset, and then adjusting model parameters such as weights and biases to improve model performance. Generally, optimizing based on erroneous predictions involves backpropagating through layers of the model and determining gradients to reduce prediction error.
[0165]
[0110] NPUs designed to accelerate inference are generally configured to operate on complete models. Thus, such NPUs can be configured to input new data and quickly process the new data through already trained models to generate model outputs (e.g., inferences).
[0166]
[0111] In one implementation, the NPU 408 is part of one or more of the CPU 402, the GPU 404, and / or the DSP 406.
[0167] In some examples, the wireless connectivity component 412 may include sub-components for, for example, third-generation (3G) connectivity, fourth-generation (4G) connectivity (e.g., 4G LTE), fifth-generation connectivity (e.g., 5G or NR), Wi-Fi connectivity, Bluetooth connectivity, and other wireless data transmission standards. The wireless connectivity processing component 412 is further connected to one or more antennas 414.
[0168]
[0113] The processing system 400 may also include one or more sensor processing units 416 associated with any type of sensor, one or more image signal processors (ISPs) 418 associated with any type of image sensor, and / or a navigation processor 420 which may include satellite-based positioning system components (e.g., GPS or GLONASS) and inertial positioning system components.
[0169]
[0114] The processing system 400 may also include one or more input and / or output devices 422, such as a screen, a touch-sensitive surface (including a touch-sensitive display), physical buttons, a speaker, a microphone, or the like.
[0170]
[0115] In some examples, one or more of the processors of processing system 400 may be based on the ARM or RISC-V instruction set.
[0171] Processing system 400 also includes memory 424, which represents one or more static and / or dynamic memories, such as dynamic random access memories, flash-based static memories, etc. In this example, memory 424 includes computer-executable components that may be executed by one or more of the above-mentioned processors of processing system 400.
[0172] In this example, memory 424 includes a transmitting component 424A, a receiving component 424B, a training component 424C, an inference component 424D, a sampling component 424E, a pruning component 424F, model parameters 424G (e.g., the weights and gate probabilities described above), and a model 424H. The illustrated components, and other components not shown, may be configured to perform various aspects of the methods described herein.
[0173] Processing system 400 is merely an example and may generally perform the operations of a server and / or client / shard described herein. However, in other embodiments, some aspects may be omitted. For example, the server may omit some features that may typically be found in a mobile device, such as multimedia components 410, wireless connectivity components 412, antenna 414, sensors 416, ISP 418, and navigation components 420. The illustrated example is not meant to be limiting.
[0174] Example Clauses
[0119] Implementation examples are described in the following numbered clauses.
[0175]
[0120] Clause 1: A method for performing federated learning of a machine learning model, comprising: for each respective client of a plurality of clients and for each training round of a plurality of training rounds, generating a subset of model elements for each client based on sampling a gate probability distribution for each model element of a set of model elements for a global machine learning model; sending to each client the subset of model elements and a set of gate probabilities based on the sampling; receiving a respective set of model update values from each respective client of the plurality of clients, wherein each gate probability of the set of gate probabilities is associated with one model element of the subset of model elements; and updating the global machine learning model based on the respective set of model update values from each respective client of the plurality of clients.
[0176]
[0121] Clause 2: The method of clause 1, wherein the subset of model elements comprises a subset of weights associated with edges connecting nodes in the global machine learning model.
[0177]
[0122] Clause 3: The method described in Clause 2, wherein each set of model update values comprises a set of weight gradients associated with the local machine learning model trained by each client and a set of gate probability gradients associated with the local machine learning model trained by each client.
[0178]
[0123] Clause 4: The method described in clause 2, wherein each set of model update values comprises a set of weight gradients associated with a local machine learning model trained by each client and a binary gate variable value associated with each weight gradient in the set of weight gradients.
[0179]
[0124] Clause 5: A method according to any one of clauses 1 to 4, wherein the subset of model elements comprises a subset of nodes in the global machine learning model.
[0180]
[0125] Clause 6: A method according to any one of clauses 1 to 5, wherein the subset of model elements comprises a subset of channels within a convolution filter of the global machine learning model.
[0181]
[0126] Clause 7: A method described in any one of clauses 1 to 6, wherein updating the global machine learning model based on each set of model update values from each of the multiple clients further comprises pruning the updated global machine learning model based on updated gating probabilities for the global machine learning model and a threshold gating probability value.
[0182]
[0127] Clause 8: A method for performing federated learning of a machine learning model, comprising: receiving a subset of model elements from a set of model elements for a global machine learning model and a set of gate probabilities from a server that manages the federated learning of the global machine learning model; generating a set of model update values based on training a local machine learning model based on the set of model elements and the set of gate probabilities, wherein each gate probability in the set of gate probabilities is associated with one model element of the subset of model elements; and transmitting the set of model update values to the server.
[0183]
[0128] Clause 9: The method of clause 8, wherein the subset of model elements comprises a subset of weights associated with edges connecting nodes in the global machine learning model.
[0184]
[0129] Clause 10: The method of clause 9, wherein the set of model update values comprises a set of weight gradients associated with the local machine learning model and a set of gate probability gradients associated with the local machine learning model.
[0185]
[0130] Clause 11: The method described in clause 9, wherein the set of model update values comprises a set of weight gradients associated with the local machine learning model and a binary gate variable value associated with each weight gradient in the set of weight gradients.
[0186]
[0131] Clause 12: A method according to any one of clauses 8 to 11, wherein the subset of model elements comprises a subset of nodes in the global machine learning model.
[0187]
[0132] Clause 13: A method according to any one of clauses 8 to 11, wherein the subset of model elements comprises a subset of channels within a convolution filter of the global machine learning model.
[0188]
[0133] Clause 14: A method according to any one of clauses 8 to 13, further comprising receiving a final set of model elements from a server, the final set of model elements corresponding to a pruned global machine learning model.
[0189]
[0134] Clause 15: A processing system comprising a memory having computer-executable instructions and one or more processors, the one or more processors being configured to execute the computer-executable instructions and cause the processing system to perform a method described in any one of clauses 1 to 14.
[0190]
[0135] Clause 16: A processing system comprising means for carrying out the method according to any one of clauses 1 to 14.
[0191]
[0136] Clause 17: A non-transitory computer-readable medium comprising computer-executable instructions that, when executed by one or more processors of a processing system, cause the processing system to perform a method according to any one of clauses 1 to 14.
[0192]
[0137] Clause 18: A computer program product embodied on a computer-readable storage medium comprising code for performing the method of any one of clauses 1 to 14.
[0193] Additional Considerations The above description is provided to enable those skilled in the art to practice various embodiments described herein. The examples described herein do not limit the scope, applicability, or embodiments set forth in the claims. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other embodiments. For example, changes may be made in the function and arrangement of the described elements without departing from the scope of the present disclosure. Various examples may omit, substitute, or add various procedures or components, as appropriate. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Also, features described with respect to some examples may be combined in some other examples. For example, an apparatus may be implemented or a method may be practiced using any number of aspects described herein. Furthermore, the scope of the present disclosure is intended to cover such apparatuses or methods implemented using other structure, functions, or structure and functions in addition to or other than the various aspects of the present disclosure described herein. It should be understood that any aspect of the present disclosure disclosed herein may be embodied by one or more elements of a claim.
[0194] The word "exemplary," as used herein, means "serving as an example, instance, or illustration." Any aspect described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other aspects.
[0195] As used herein, a phrase referring to "at least one of" a list of items refers to any combination of those items, including single members. As an example, "at least one of a, b, or c" is intended to encompass a, b, c, ab, ac, bc, and abc, as well as any combination with multiples of the same element (e.g., aa, aaa, aab, aac, abb, acc, bb, bbb, bbc, cc, and ccc, or any other order of a, b, and c).
[0196]
[0141] As used herein, the term "determining" encompasses a wide variety of actions. For example, "determining" may include calculating, computing, processing, deriving, investigating, looking up (e.g., looking up in a table, database, or another data structure), ascertaining, etc. Also, "determining" may include receiving (e.g., receiving information), accessing (e.g., accessing data in a memory), etc. Also, "determining" may include resolving, selecting, choosing, establishing, etc.
[0197]
[0142] The methods disclosed herein comprise one or more steps or actions for achieving the method. The steps and / or actions of the methods may be interchanged with one another without departing from the scope of the claims. In other words, unless a specific order of steps or actions is specified, the order and / or use of specific steps and / or actions may be changed without departing from the scope of the claims. Furthermore, the various operations of the methods described above may be performed by any suitable means capable of performing the corresponding functions. These means may include various(s) hardware and / or software components and / or modules, including, but not limited to, circuits, application-specific integrated circuits (ASICs), or processors. Generally, where there are operations illustrated in figures, these operations may have corresponding counterpart means-plus-function components with similar numbering.
[0198] The following claims are not intended to be limited to the embodiments set forth herein, but are to be accorded the full scope consistent with the claim language. References to elements in the singular in the claims are not intended to mean "one and only one," unless so expressly stated, but rather "one or more." The term "some" refers to one or more, unless otherwise expressly stated. Claim elements are not to be construed under the provisions of 35 U.S.C. § 112(f) unless the elements are expressly recited using the phrase "means for" or, in the case of method claims, unless the elements are recited using the phrase "step for." All structural and functional equivalents to the elements of the various aspects described throughout this disclosure that are known or later become known to those skilled in the art are expressly incorporated herein by reference and are intended to be encompassed by the claims. Furthermore, nothing disclosed herein is intended to be dedicated to the public, regardless of whether such disclosure is expressly recited in the claims.
Claims
1. 1. A method for performing federated learning of a machine learning model, comprising: On the device, from a server that manages federated learning of a global machine learning model, a subset of model elements from a set of model elements for the global machine learning model; a set of gating probabilities, where each gating probability of the set of gating probabilities is associated with one model element of the subset of model elements, the gating probability representing a likelihood that the associated model element will be included in a local machine learning model for the respective device. generating, by the device, a set of model updates based on training the local machine learning model at the device based on the set of model elements and the set of gating probabilities, the set of model updates comprising updates for model elements and updates for gating probabilities. transmitting the set of model update values from the device to the server for updating the global machine learning model; A method comprising:
2. the subset of model elements comprises a subset of weights associated with edges connecting nodes in the global machine learning model; The set of model updates may be: A set of weight gradients associated with the local machine learning model; and a set of gated stochastic gradients associated with the local machine learning model; and or The set of model updates may be: A set of weight gradients associated with the local machine learning model; and a binary gate variable value associated with each weight gradient of said set of weight gradients; The method of claim 1 , comprising:
3. the subset of model elements comprises a subset of nodes in the global machine learning model; or The method of claim 1 , wherein the subset of model elements comprises a subset of channels within a convolution filter of the global machine learning model.
4. 10. The method of claim 1, further comprising receiving at the device from the server a final set of model elements, the final set of model elements corresponding to a pruned global machine learning model.
5. 1. A processing system comprising: a memory having computer-executable instructions; a processing system configured to execute the computer-executable instructions, From the server that manages the federated learning of the global machine learning model, a subset of model elements from a set of model elements for the global machine learning model; a set of gating probabilities, where each gating probability of the set of gating probabilities is associated with one model element of the subset of model elements, the gating probability representing a likelihood that the associated model element will be included in a local machine learning model for the respective device. generating a set of model updates based on training the local machine learning model at each device based on the set of model elements and the set of gating probabilities, the set of model updates comprising updates for model elements and updates for gating probabilities. sending the set of model update values to the server for updating the global machine learning model; one or more processors for causing A processing system comprising:
6. the subset of model elements comprises a subset of weights associated with edges connecting nodes in the global machine learning model; The set of model updates may be: A set of weight gradients associated with the local machine learning model; and a set of gated stochastic gradients associated with the local machine learning model; and or The set of model updates may be: A set of weight gradients associated with the local machine learning model; and a binary gate variable value associated with each weight gradient of said set of weight gradients; The processing system of claim 5 .
7. the subset of model elements comprises a subset of nodes in the global machine learning model; or 6. The processing system of claim 5, wherein the subset of model elements comprises a subset of channels within a convolution filter of the global machine learning model.
8. 6. The processing system of claim 5, wherein the one or more processors are further configured to receive a final set of model elements from the server, wherein the final set of model elements corresponds to a pruned global machine learning model.
9. 1. A method for performing federated learning of a machine learning model, comprising: For each respective client of the plurality of clients, and for each training round of the plurality of training rounds, generating, by the server, a subset of model elements for the respective client based on sampling a gating probability distribution for each model element of the set of model elements for the global machine learning model, where the gating probability represents a likelihood that an associated model element will be included in a local machine learning model for the respective client; from the server to each of the clients, said subset of model elements; a set of gating probabilities based on the sampling, wherein each gating probability of the set of gating probabilities is associated with one model element of the subset of model elements. receiving, at the server, a respective set of model updates from each respective client of the plurality of clients, the set of model updates comprising updates for model elements and updates for gate probabilities; updating, by the server, the global machine learning model based on the respective sets of model update values from each respective client of the plurality of clients; A method comprising:
10. the subset of model elements comprises a subset of weights associated with edges connecting nodes in the global machine learning model; The respective set of model updates may be: a set of weight gradients associated with a local machine learning model trained by each of the clients; and a set of gated stochastic gradients associated with the local machine learning model trained by each client; and or The respective set of model updates may be: a set of weight gradients associated with a local machine learning model trained by each of the clients; and a binary gate variable value associated with each weight gradient of said set of weight gradients; The method of claim 9 comprising:
11. the subset of model elements comprises a subset of nodes in the global machine learning model; or The method of claim 10 , wherein the subset of model elements comprises a subset of channels within a convolution filter of the global machine learning model.
12. 11. The method of claim 10, wherein updating the global machine learning model by the server based on the respective sets of model update values from each respective client of the plurality of clients further comprises pruning the updated global machine learning model based on updated gating probabilities for the global machine learning model and a threshold gating probability value.
13. 1. A processing system comprising: a memory having computer-executable instructions; a processing system configured to execute the computer-executable instructions, For each respective client of the plurality of clients, and for each training round of the plurality of training rounds, generating a subset of model elements for the respective client based on sampling a gating probability distribution for each model element of the set of model elements for the global machine learning model, where the gating probability represents a likelihood that an associated model element will be included in a local machine learning model for the respective client; To each of said clients, said subset of model elements; a set of gating probabilities based on the sampling, wherein each gating probability of the set of gating probabilities is associated with one model element of the subset of model elements. receiving a respective set of model updates from each respective client of the plurality of clients, the set of model updates comprising updates for model elements and updates for gate probabilities; updating the global machine learning model based on the respective sets of model update values from each respective client of the plurality of clients; one or more processors for causing A processing system comprising:
14. the subset of model elements comprises a subset of weights associated with edges connecting nodes in the global machine learning model; The respective set of model updates may be: a set of weight gradients associated with a local machine learning model trained by each of the clients; and a set of gated stochastic gradients associated with the local machine learning model trained by each client; and or The respective set of model updates may be: a set of weight gradients associated with a local machine learning model trained by each of the clients; and a binary gate variable value associated with each weight gradient of said set of weight gradients; The processing system of claim 13 , comprising:
15. 14. The processing system of claim 13, wherein to update the global machine learning model based on the respective sets of model update values from each respective client of the plurality of clients, the one or more processors are further configured to prune the updated global machine learning model based on updated gating probabilities for the global machine learning model and a threshold gating probability value.
