Federated Machine Learning Using Locality-Sensitive Hashing
The use of locality-sensitive hashing for client selection and model update optimization in federated learning systems addresses inefficiencies in existing methods, enhancing efficiency and accuracy by dynamically selecting clients and minimizing communication overhead.
Patent Information
- Application Number
- JP2023515398
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2020-09-08
- Filing Date
- 2021-07-20
- Publication Date
- 2025-01-29
- Estimated Expiration
- 2041-07-20
AI Technical Summary
Existing federated learning systems face inefficiencies in client selection, resource utilization, and model update processes, particularly due to random or optimization-based methods that do not account for data characteristics and dynamic model changes, leading to suboptimal communication and processing times.
A method using locality-sensitive hashing (LSH) to dynamically select clients based on gradient vectors, grouping clients into clusters, and optimizing model updates to minimize gradient divergence and communication overhead.
This approach enhances the efficiency of federated learning by reducing communication overhead and improving convergence accuracy while maintaining model quality, achieving comparable results with full gradient transmission methods at a fraction of the communication cost.
Smart Images

Figure 0007623775000002 
Figure 0007623775000003 
Figure 0007623775000004
Abstract
Description
[Technical field]
[0001] The present invention relates generally to federated machine learning, and more particularly to using locality sensitive hashing to dynamically select clients and efficiently update models in federated machine learning. [Background technology]
[0002] Federated machine learning allows multiple clients or devices (e.g., edge devices and mobile devices) to collaboratively train or learn a global model, or a combination thereof. A federated learning system can have hundreds to millions of clients. Since some of the clients may have similar local data to train the global model, it is often sufficient to have only one subset of clients involved in the federated machine learning process. Also, only one subset of clients is selected due to cost and resource efficiency. The size of deep neural networks (DNNs) in federated machine learning is usually large, and it is very inefficient to transmit all model parameters.
[0003] Previous disclosures use random selection of clients. In random selection of clients, the resource and cost efficiency of clients is usually not considered, and the fact that some clients have unique data and can provide important information for machine learning is ignored. For example, Bonawitz et al. disclose a method in "Towards Federated Learning at Scale: System Design (arXiv:1902.01046v2, 2019)" in which the selection of clients is performed by simple reservoir sampling.
[0004] Previous disclosures also use optimization-based client selection approaches, in which transmission and processing times are usually considered, but data characteristics at the client (e.g., differences in data distribution) are ignored. For example, Nishio et al. disclose a method in "Client Selection for Federated Learning with Heterogeneous Resources in Mobile Edge (arXiv:804.08333v2, 2018)" in which the time required for dissemination and scheduled update and upload processes is estimated, and client selection for these processes is determined based on the estimated time.
[0005] Regarding model updates, previous disclosures use model compression or communication interval adaptation. In the previous disclosures, the degree of compression or communication interval needs to be predetermined. However, the determined degree of compression or communication interval may not capture the latest dynamics of the model parameters. For example, Konecny et al. propose a method to reduce uplink communication costs in “Federated Learning: Strategies for Improving Communication Efficiency (arXiv:1610.05492v1, 2016).” In another example, Wang et al. propose a control algorithm in “Adaptive Federated Learning in Resource Constrained Edge Computing Systems (IEEE Journal on Selected Areas In Communications, 2019)” that determines the best tradeoff between local updates and global parameter aggregation to minimize a loss function under a given resource budget. Summary of the Invention [Means for solving the problem]
[0006] In a first aspect, a computer-implemented method is provided for using locality-sensitive hashing to dynamically select clients in federated machine learning. The computer-implemented method includes receiving, by a server in a federated machine learning system, from each client in the system, a respective locality-sensitive hash vector calculated based on a respective gradient vector of a training objective function. The computer-implemented method further includes grouping, by the server, each of the clients into a respective cluster based on the respective locality-sensitive hash vector. The computer-implemented method further includes selecting, by the server, a subset of the respective clients for further participation in the federated machine learning by selecting at least one client from each of the respective clusters. In the computer-implemented method, using the respective locality-sensitive hash vectors in the federated machine learning speeds up transmitting and processing model parameters.
[0007] In the first aspect, the computer-implemented method further includes determining, by the server, whether a new round of client selection is necessary; in response to determining that the new round of client selection is necessary, requesting, by the server, each of the clients to submit a respective new locality-sensitive hash vector calculated based on a respective current gradient vector of the training objective function; regrouping, by the server, each of the clients into a respective new cluster based on the respective new locality-sensitive hash vector; and selecting, by the server, a new subset of the respective clients for further participation in the federated machine learning by selecting at least one client from each of the respective new clusters. The computer-implemented method further includes, in response to determining that the new round of client selection is not necessary, maintaining, by the server, the subset of the respective clients for further participation in the federated machine learning. The server initiates the new round of client selection in response to at least one of the following conditions: a number of selected clients in the subset of each client become unavailable; costs of the subset of each client have changed significantly; model parameters are updated in a significantly different direction or magnitude from the previous training cycle; and a predetermined amount of time or a predetermined number of iterations has elapsed.
[0008] In the first aspect, the computer-implemented method further includes transmitting, by the server, the model parameters to each of the clients. The computer-implemented method further includes calculating, by each of the clients, the respective gradient vectors using each of the local data sets and the model parameters. The computer-implemented method further includes calculating, by each of the clients, the respective locality sensitive hash vectors. The computer-implemented method further includes transmitting, by each of the clients, the respective locality sensitive hash vectors to the server. To calculate the respective locality sensitive hash vectors, the computer-implemented method further includes projecting, by each of the clients, the respective gradient vectors into a low-dimensional space.
[0009] In the first aspect, the respective clients begin transmitting the respective locality sensitive hash vectors having a low dimension, and upon determining that higher accuracy of the respective locality sensitive hash vectors is required, the server requests the respective clients to transmit the respective locality sensitive hash vectors having higher dimensions until the server is satisfied with received information contained within the respective locality sensitive hash vectors.
[0010] In a second aspect, a computer-implemented method is provided for using locality-sensitive hashing to dynamically select clients in federated machine learning. The computer-implemented method includes receiving, by a server in a federated machine learning system, from each client in the federated machine learning system, a respective locality-sensitive hash vector calculated based on a respective gradient vector of a training objective function. The computer-implemented method further includes finding, by the server, a subset of each of the clients by solving an optimization problem to minimize gradient divergence for the subset of each of the clients, where the respective locality-sensitive hash vector is used in solving the optimization problem. The computer-implemented method further includes selecting, by the server, the subset of each of the clients for further participation in the federated machine learning. In the computer-implemented method, using the respective locality-sensitive hash vectors in the federated machine learning speeds up sending and processing model parameters.
[0011] In the second aspect, the computer-implemented method further includes determining, by the server, whether a new round of client selection is necessary; in response to determining that the new round of client selection is necessary, requesting, by the server, each of the clients to send a respective new locality-sensitive hash vector calculated based on a respective current gradient vector of the training objective function; finding, by the server, a new subset of the respective clients by solving an optimization problem to minimize gradient divergence for the new subset of the respective clients, where the respective new locality-sensitive hash vector is used in solving the optimization problem; and selecting, by the server, the new subset of the respective clients for further participation in the federated machine learning. The computer-implemented method further includes, in response to determining that the new round of client selection is not necessary, maintaining, by the server, the subset of the respective clients for further participation in the federated machine learning. The server initiates the new round of client selection in response to at least one of the following conditions: a number of selected clients in the subset of each client become unavailable; costs of the subset of each client have changed significantly; model parameters are updated in a significantly different direction or magnitude from the previous training cycle; and a predetermined amount of time or a predetermined number of iterations has elapsed.
[0012] In the second aspect, the computer-implemented method further includes transmitting, by the server, the model parameters to each of the clients. The computer-implemented method further includes calculating, by each of the clients, the respective gradient vectors using each of the local data sets and the model parameters. The computer-implemented method further includes calculating, by each of the clients, the respective locality sensitive hash vectors. The computer-implemented method further includes transmitting, by each of the clients, the respective locality sensitive hash vectors to the server. To calculate the respective locality sensitive hash vectors, the computer-implemented method further includes projecting, by each of the clients, the respective gradient vectors into a low-dimensional space.
[0013] In the second aspect, the respective clients begin transmitting the respective locality sensitive hash vectors having a low dimension, and upon determining that higher accuracy of the respective locality sensitive hash vectors is required, the server requests the respective clients to transmit the respective locality sensitive hash vectors having higher dimensions until the server is satisfied with received information contained within the respective locality sensitive hash vectors.
[0014] In a third aspect, a computer-implemented method is provided for using locality-sensitive hashing to efficiently update models in federated machine learning. The computer-implemented method includes receiving, by a server in the federated machine learning system, from each client in the federated machine learning system, a respective locality-sensitive hash vector calculated based on a respective parameter vector of each updated model. The computer-implemented method further includes determining, by the server, whether the updated respective model of the selected respective client is sufficiently different from a model sent from the server to the selected respective client for training based on a distance between the locality-sensitive hash vector of the model and the respective locality-sensitive hash vector. The computer-implemented method further includes, in response to determining that the updated respective model is sufficiently different from the model, requesting, by the server, each selected client to send the respective parameter vector to the server. In the computer-implemented method, using the respective locality-sensitive hash vectors in the federated machine learning speeds up transmitting and processing model parameters.
[0015] In the third aspect, the computer-implemented method further includes, in response to determining that the updated respective models are not sufficiently different from the model, requesting, by the server, each of the selected clients to continue training the model and to transmit the respective locality-sensitive hash vector to the server.
[0016] In the third aspect, the computer-implemented method further includes computing the respective locality sensitive hash vectors by each of the selected clients. The computer-implemented method further includes transmitting the respective locality sensitive hash vectors by each of the selected clients to the server. To compute the respective locality sensitive hash vectors, the computer-implemented method further includes projecting, by each of the selected clients, respective parameter vectors of the updated respective models into a low-dimensional space.
[0017] In the third aspect, the computer-implemented method for determining the selected respective clients further includes receiving, by the server, the respective locality-sensitive hash vectors from each client in the federated machine learning system; grouping, by the server, the respective clients into respective clusters based on the respective locality-sensitive hash vectors; and determining, by the server, the selected respective clients to further participate in the federated machine learning system by selecting at least one client from each of the respective clusters.
[0018] In the third aspect, the computer-implemented method for determining the selected respective clients further includes receiving, by the server, the respective locality-sensitive hash vectors from each client in the federated machine learning system; finding, by the server, a subset of the respective clients by solving an optimization problem to minimize gradient divergence for the subset of the respective clients; and determining, by the server, the subset of the respective clients as the selected respective clients to further participate in the federated machine learning system. [Brief description of the drawings]
[0019] [Figure 1]FIG. 1 is a system diagram illustrating a federated machine learning system according to one embodiment of the present invention. [Diagram 2] FIG. 2 presents a flow chart diagram illustrating the operational steps of using locality-sensitive hashing to dynamically select a client according to one embodiment of the present invention. [Diagram 3] FIG. 3 presents a flow chart diagram illustrating the operational steps of using locality-sensitive hashing to dynamically select a client in accordance with another embodiment of the present invention. [Figure 4] FIG. 4 presents a flow chart diagram illustrating the operational steps of using locality-sensitive hashing to efficiently update models according to one embodiment of the present invention. [Diagram 5] FIG. 5 presents experimental results using locality-sensitive hashing to dynamically select clients, according to one embodiment of the present invention. [Figure 6(A)] FIG. 6(A) presents experimental results using locality-sensitive hashing to efficiently update models, according to one embodiment of the present invention. [Figure 6(B)] FIG. 6(B) presents experimental results using locality-sensitive hashing to efficiently update models, according to one embodiment of the present invention. [Figure 7] FIG. 7 is a diagram illustrating components of a computing device or server according to one embodiment of the invention. [Figure 8] FIG. 8 illustrates a cloud computing environment according to one embodiment of the invention. [Figure 9] FIG. 9 illustrates abstraction model layers in a cloud computing environment according to one embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0020] FIG. 1 is a system diagram illustrating a federated machine learning system 100 according to one embodiment of the present invention. The federated machine learning system 100 includes a server 110. The federated machine learning system 100 further includes N clients, namely, client 1 (120-1), client 2 (120-2), ..., and client N (120-N). For example, the clients may be edge devices and mobile devices. Each client has its own local dataset: client 1 (120-1) has local data 1 (125-1), client 2 (120-2) has local data 2 (125-2), ..., and client N (120-N) has local data N (125-N).
[0021] In one embodiment, server 110 may reside on a computing device. In another embodiment, server 110 may reside on a virtual machine or another virtualization implementation that runs on a computing device, which is described in more detail in a later paragraph with reference to FIG. 7.
[0022] Each of Client 1 (120-1), Client 2 (120-2), ..., and Client N (120-N) may reside on a computing device, which may be any electronic device or computing system capable of receiving input from a user, executing computer program instructions, and communicating with another computing system over a network. The computing devices are described in more detail in a later paragraph with reference to FIG. 7.
[0023] In one embodiment, local data 1 (125-1), local data 2 (125-2), ..., and local data N (125-N) are hosted by each of client 1 (120-1), client 2 (120-2), ..., and client N (120-N). In another embodiment, local data 1 (125-1), local data 2 (125-2), ..., and local data N (125-N) are stored in a storage device, and the local datasets are loaded into client 1 (120-1), client 2 (120-2), ..., and client N (120-N) during the federated machine learning process.
[0024] The federated machine learning system 100 may be implemented in a network, which may be any combination of connections and protocols that support communication between the server 110 and each of the client 1 (120-1), client 2 (120-2), ..., and client N (120-N). For example, the network may be the Internet, which represents a worldwide collection of networks and gateways to support communication between Internet-connected devices. The network may be implemented as an intranet, a local area network (LAN), a wide area network (WAN), or a wireless network. The federated machine learning system 100 may be implemented in a cloud computing environment, which is described in the following paragraphs with reference to Figures 8 and 9.
[0025] A standard federated machine learning process includes: (1) server 110 sends model parameters (or model parameter vectors) to client 1 (120-1), client 2 (120-2), ..., and client N (120-N); (2) each of client 1 (120-1), client 2 (120-2), ..., and client N (120-N) calculates its updated model parameters using stochastic gradient descent and then sends either the model parameter vector or the changes (differences) in the model parameter vector to server 110; (3) server 110 aggregates the model parameter vectors or the changes (differences) in the model parameter vectors received from client 1 (120-1), client 2 (120-2), ..., and client N (120-N), and then updates the model parameters in server 110; (4) the federated machine learning system 100 repeats the above (1) to (4) until convergence.
[0026] An embodiment of the present invention discloses a method for dynamically selecting clients and using locality sensitive hashing to determine an optimal subset of clients. An embodiment of the present invention discloses a method for efficiently updating a model and using locality sensitive hashing to determine whether a complete parameter vector should be sent from the client to the server.
[0027] 2 presents a flow chart diagram illustrating the operational steps of using locality-sensitive hashing to dynamically select clients according to one embodiment of the present invention. In this embodiment shown in FIG. 2, dynamically selecting clients is performed by clustering clients based on locality-sensitive hash vectors.
[0028] In step 210, a server in the federated machine learning system sends model parameters to clients in the federated machine learning system at the start of a federated machine learning process. For example, as shown in Figure 1, server 110 in federated machine learning system 100 sends model parameters to client 1 (120-1), client 2 (120-2), ..., and client N (120-N).
[0029] In step 220, the clients calculate respective gradient vectors of the training objective function using their respective local data sets and the model parameters received from the server in step 210. Each of the clients calculates its own gradient vector of the training objective function and each of the clients uses its own local data set. For example, client 1 (120-1), client 2 (120-2), ..., and client N (120-N) each calculates its own gradient vector using local data 1 (125-1), local data 2 (125-2), ..., and local data N (125-N), respectively.
[0030] In step 230, the clients compute a locality sensitive hash (LSH) vector based on their respective gradient vectors. For example, client 1 (120-1), client 2 (120-2), ..., and client N (120-N) each compute their own locality sensitive hash (LSH) vector based on their own gradient vector. Each of the clients projects the gradient vector into a low-dimensional space, which may be spanned by principal components of historical gradient updates (e.g., obtained by principle component analysis (PCA) with random matrices).
[0031] The dimension (size) of an LSH vector may change over time based on the server's judgment (estimate) of how the client's gradients differ. The dimension (size) of an LSH vector may also be related to the total number of clients. The client may initially start by sending a low-dimensional LSH vector. If the server determines that more accuracy is needed (e.g., if there are too many collisions or nearby hash vectors), the server may request the client to send a higher-dimensional LSH vector. The server may request the client to further increase the dimension of the LSH vector until the server is satisfied with the received information contained in the LSH vector.
[0032] In step 240, the client sends each of the locality sensitive hash (LSH) vectors to the server. For example, each of client 1 (120-1), client 2 (120-2), ..., and client N (120-N) sends its own locality sensitive hash (LSH) vector to the server 110. The locality sensitive hash (LSH) vectors are utilized for efficient communication between the server and each of the multiple clients. By using the respective locality sensitive hash vectors in the federated machine learning, the sending and processing of model parameters can be accelerated. A gradient vector, a model parameter vector, or a hash of the difference of model parameter vectors is sent from each of the clients to the server, so that similar vectors are either in the same bucket with the same hash code or are close to each other in the metric space.
[0033] In response to receiving the locality sensitive hash (LSH) vectors from the clients, at step 250, the server groups the clients into clusters based on the respective locality sensitive hash (LSH) vectors of the plurality of locality sensitive hash (LSH) vectors. For example, the server 110 receives the respective locality sensitive hash (LSH) vectors of the plurality of locality sensitive hash (LSH) vectors provided by client 1 (120-1), client 2 (120-2), ..., and client N (120-N), and based on the plurality of LSH vectors, the server 110 groups client 1 (120-1), client 2 (120-2), ..., and client N (120-N) into the clusters. In some embodiments, for example, the server groups the clients into the clusters based on similarities between the clients. Here, the similarity is calculated using each of the locality sensitive hash (LSH) vectors provided by the client. In some other embodiments, for example, the server uses K-means to group the each of the locality sensitive hash (LSH) vectors of the client's LSH vectors.
[0034] In step 260, the server selects a subset of the clients to further participate in the federated machine learning by selecting at least one client from each of the multiple clusters. Other clients not selected in the subset will not participate in the next round of federated machine learning until they are reselected. For example, the server 110 selects a subset of client 1 (120-1), client 2 (120-2), ..., and client N (120-N) to further participate in the federated machine learning. Selecting at least one client from each cluster can be done in a random, round robin, or resource-based manner. In step 270, the subset of clients (selected in step 260) further participates in the federated machine learning.
[0035] In selecting the subset of clients, the server may calculate distances between LSH vectors to determine whether clients in a particular cluster are significantly different from other clients in other clusters. Clients in a particular cluster are not selected if the goal of model training is to match the data of other clients in other clusters.
[0036] In step 280, the server determines whether a new round of client selection is necessary. The frequency of performing the LSH-based client selection procedure is selected by the server, which monitors the state of the federated machine learning system and the trend of model parameter updates. For example, a new round of client selection may be initiated under at least one of the following conditions: (1) a large number of previously selected clients become unavailable; (2) the cost of selected clients has changed significantly; (3) model parameters are updated in a direction or magnitude significantly different from the previous training cycle; (4) a predetermined time or a predetermined number of iterations has passed.
[0037] In response to determining that a new round of client selection is necessary (the "Yes" branch of block 280), the federated machine learning system repeats steps 210-280. The server requests the clients to send new locality sensitive hash vectors calculated based on the current gradient vectors of the training objective function. The server regroups the clients into new clusters based on the respective locality sensitive hash (LSH) vectors of the new LSH vectors. The server selects a new subset of the clients by choosing at least one client from each of the new clusters.
[0038] In response to determining that the new round of client selection is not necessary (the "No" branch of block 280), the federated machine learning system repeats steps 270 through 280. The server retains the subset of clients for further participation in the federated machine learning. The subset of clients continues to participate in the federated machine learning until the server determines at step 280 that the new round of client selection is necessary.
[0039] 3 presents a flow chart diagram illustrating the operational steps of using locality-sensitive hashing to dynamically select clients according to another embodiment of the present invention. In this embodiment shown in FIG. 3, the dynamic selection of clients is performed by using an optimization procedure that minimizes the gradient divergence subject to cost and resource constraints.
[0040] Steps 310 to 340 in FIG. 3 are similar to steps 210 to 240 in FIG. 2. For brevity, steps 310 to 340 are listed below. For detailed discussion, the previous paragraphs related to steps 210 to 240 may be referred to. In step 310, a server in a federated machine learning system sends model parameters to a client in the federated machine learning system at the start of the federated machine learning process. In step 320, the client calculates respective gradient vectors of a training objective function using each local dataset and the model parameters received from the server in step 310. In step 330, the client calculates a plurality of locality sensitive hash (LSH) vectors based on the respective gradient vectors. In step 340, the client sends each of the locality sensitive hash (LSH) vectors of the plurality of locality sensitive hash (LSH) vectors to the server.
[0041] In response to receiving a Locality Sensitive Hash (LSH) vector from a client, in step 350, the server finds the subset of clients by solving an optimization problem that minimizes the gradient divergence for the subset of clients. The optimization problem can be as follows:
number
[0042] where gi is the locality sensitive hash (LSH) vector of the gradient vector of client i, and C is the maximum number of selected clients or the subset of the clients. The locality sensitive hash (LSH) vector is used in solving the optimization problem. In step 360, the server selects the subset of the clients (found in step 350) to further participate in federated machine learning.
[0043] Steps 370-380 in Fig. 3 are similar to steps 270-280 in Fig. 2. For brevity, steps 370-380 are listed below. For detailed discussion, reference may be made to the previous paragraphs related to steps 270-280. In step 370, the subset of clients (selected in step 360) further participates in the federated machine learning. In step 380, the server determines whether a new round of client selection is necessary.
[0044] In response to determining that a new round of client selection is necessary (the "Yes" branch of block 380), the federated machine learning system repeats steps 310-380. The server requests the clients to send new locality-sensitive hash vectors calculated based on the current gradient vectors of the training objective function. The server finds a new subset of clients by solving an optimization problem that minimizes the gradient divergence for the new subset of clients. The new locality-sensitive hash vectors are used in solving the optimization problem. The server selects the new subset of clients for further participation in federated machine learning.
[0045] In response to determining that the new round of client selection is not necessary (the "No" branch of block 380), the federated machine learning system repeats steps 370 through 380. The server retains the subset of clients for further participation in the federated machine learning. The current subset of clients continues to participate in the federated machine learning until the server determines at step 380 that the new round of client selection is necessary.
[0046] FIG. 4 presents a flow chart diagram illustrating the operational steps of using locality-sensitive hashing to efficiently update a model according to one embodiment of the present invention. In step 410, selected clients participate in federated machine learning to train a model sent from a server. The model is sent from the server to the selected clients for training. The selected clients are the subset of clients dynamically selected in the procedure shown in FIG. 2 or FIG. 3. The model is obtained by the server by aggregating models sent from the selected clients in previous rounds of model training.
[0047] In step 420, the selected clients calculate a locality sensitive hash (LSH) vector based on the respective model parameter vector of each updated model (which are being updated by the selected client). The locality sensitive hash (LSH) vector is obtained from the model parameter vector of each updated model or from changes in the model parameter vector of each updated model. Each of the selected clients calculates its own locality sensitive hash (LSH) vector of its own updated model. To calculate its own locality sensitive hash (LSH) vector, each of the selected clients projects its own model parameter vector into a low dimensional space.
[0048] In step 430, the selected client sends a respective one of the locality sensitive hash (LSH) vectors to the server. Each of the selected clients sends its own locality sensitive hash (LSH) vector to the server. The locality sensitive hash (LSH) vectors are utilized for efficient communication between the server and each of the clients.
[0049] In response to receiving a locality sensitive hash (LSH) vector from the selected client, at step 440, the server determines whether the respective updated model of the selected client is sufficiently different from the model based on a distance between the locality sensitive hash vector of the model and the respective one of the locality sensitive hash vectors. To determine whether the respective updated models are sufficiently different, the server calculates a distance between the LSH vector of the model and each one of the LSH vectors. If the distance is greater than a predetermined threshold, the respective updated model of the selected client is sufficiently different from the model, otherwise, the respective updated model of the selected client is determined to not be sufficiently different from the model.
[0050] In response to determining that the updated respective models of the selected clients are sufficiently different from the model (the "Yes" branch of block 450), at step 460, the server requests the selected clients to send the respective parameter vectors of the updated respective models to the server. The respective parameter vectors are full parameter vectors that capture the updated respective models. In response to determining that the updated respective models of the selected clients are not sufficiently different from the model (the "No" branch of block 450), the federated machine learning system repeats steps 410-450, and the server requests the selected clients to continue training the model and to continue sending the respective locality-sensitive hash vectors to the server until the updated respective models of the selected clients are sufficiently different from the model.
[0051] To illustrate the advantages of the LSH-based client selection disclosed in this invention, an experiment was conducted using the Modified National Institute of Standards and Technology (MNIST) dataset, which contains handwritten digits with 10 different labels. In the experiment, a three-layer neural network model with 300 neurons in the hidden layer was used.
[0052] In the experiment of client selection based on LSH, the federated learning system had 50 clients and non-IID data distribution. Each client only had data containing one label, so for each label, the corresponding data samples were randomly divided into five different clients, and the data samples of different clients were made to not overlap.
[0053] In the experiment of client selection based on LSH, client selection was performed at the beginning of associative learning, and then every 100 iterations. The experiment used K-means to group the LSH vectors of gradients (computed by the client) into 10 clusters, and then one client was randomly selected from each cluster. The LSH algorithm uses a random matrix to project the original vector onto a low-dimensional space.
[0054] Figure 5 presents experimental results using locality-sensitive hashing to dynamically select clients according to one embodiment of the present invention. Figure 5 presents the results of three experiments: first experiment - using locality-sensitive hashing to dynamically select clients (proposed in the present invention); second experiment - random client selection (prior art); and third experiment - client selection based on full transmission of gradients from client to server (full transmission of gradients without using locality-sensitive hashing).
[0055] Both the first experiment (using the locality-sensitive hashing proposed in this invention) and the third experiment (without using locality-sensitive hashing) achieved 94% convergence accuracy in 1000 iterations. However, the second experiment (random client selection) achieved only 77% accuracy in the same number of iterations.
[0056] In the first experiment (using the locality sensitive hashing proposed in this invention), only a 10-dimensional LSH vector needed to be transmitted from each client to the server. However, in the third experiment (full transmission of gradients without using locality sensitive hashing), a 238,510-dimensional vector needed to be transmitted from each client to the server. The method proposed in this invention achieved the same convergence and classification accuracy as the method with full transmission of gradients, while the method proposed in this invention only transmitted 10 / 238510 ≈ 0.004% of the original gradient vector. From this, it was concluded that the method proposed in this invention significantly reduced the communication overhead.
[0057] In the experiment of LSH-based model updating, an LSH vector of size 100 was used to encode the updated parameter vector of each selected client, and the parameter vectors of all selected clients were aggregated only if the relative change of the parameters (calculated based on the LSH vectors received by the server) exceeded a predefined threshold, which was empirically set as follows: 2.5% for the first 1000 iterations, and 0.5% for the remaining iterations.
[0058] FIG. 6(A) and FIG. 6(B) present experimental results of using locality sensitive hashing to efficiently update models according to one embodiment of the present invention. FIG. 6(A) and FIG. 6(B) present experimental results for two experiments: (1) the method proposed in the present invention, and (2) the method with full transmission of gradients. FIG. 6(A) shows the classification accuracy for the number of transmitted floating-point numbers per client from 0 to 200,000,000. FIG. 6(B) shows the classification accuracy for the number of transmitted floating-point numbers per client from 0 to 4,500,000. FIG. 6(A) and FIG. 6(B) further show that the method proposed in the present invention reduces the communication overhead during iterative model updates by up to 20% compared to the method with full transmission of gradients, especially in the initial training stage. FIG. 6(A) and FIG. 6(B) further show that the method proposed in the present invention converges to the same accuracy as the method with full parameter vector transmission.
[0059] 7 is a diagram illustrating components of a computing device or server 700 in accordance with one embodiment of the invention. It should be understood that FIG. 7 provides only an example of one implementation and is not intended to imply any limitation with respect to the environments in which different embodiments may be implemented.
[0060] Referring to Figure 7, a computing device or server 700 includes one or more processors 720, memory 710, and one or more tangible storage devices 730. In Figure 7, communication between the above-mentioned components of the computing device or server 700 is indicated by numeral 790. The memory 710 includes one or more Read Only Memories (ROMs) 711, one or more Random Access Memories (RAMs) 713, and one or more caches 715. One or more operating systems 731 and one or more computer programs 733 reside on the one or more computer readable tangible storage devices 730.
[0061] The computing device or server 700 further comprises one or more I / O interfaces 750 that allow for the input and output of data to and from one or more external devices 760 that may be connected to the computing device or server 700. The computing device or server 700 further comprises one or more network interfaces 740 for communication between the computing device or server 700 and a computer network.
[0062] The present invention may be a system, method, or computer program product, or combination thereof, at any level of technical detail that may be integrated. The computer program product may include one or more computer-readable storage media having computer-readable program instructions for causing a processor to perform aspects of the present invention.
[0063] The computer readable storage medium can be a tangible device capable of holding and storing instructions for use by an instruction execution device. The computer readable storage medium can be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as a punch card or a ridge structure in a groove in which instructions are recorded, or any suitable combination thereof. As used herein, a computer-readable storage medium should not be construed as a transitory signal per se, such as an electric wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse passing through a fiber optic cable), or an electrical signal transmitted over an electrical wire.
[0064] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing device / processing device, or to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, or a wireless network, or a combination thereof. The network may be comprised of copper transmission cables, optical transmission fiber, wireless transmission, routers, firewalls, switches, gateway computers, or edge servers, or a combination thereof. A network adapter card or network interface in each computing device / processing device receives the computer-readable program instructions from the network and transmits the computer-readable program instructions to the respective computing device / processing device for storage in a computer-readable storage medium.
[0065] The computer readable program instructions for carrying out the operations of the present invention may be either assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, configuration data for an integrated circuit, or source or object code written in any combination of one or more programming languages, such as object-oriented programming languages, such as Smalltalk, C++, and the like, conventional procedural programming languages (e.g., the "C" programming language or similar programming languages). The computer readable program instructions may be executed entirely on the user's computer, partially on the user's computer, partially on the user's computer as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer via any kind of network, such as a local area network (LAN) or a wide area network (WAN), or the connection may be to an external computer (e.g., through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), may execute computer-readable program instructions by utilizing state information of the computer-readable program instructions to personalize the electronic circuitry to perform aspects of the invention.
[0066] Aspects of the present invention are described herein with reference to flowchart illustrations or block diagrams, or combinations thereof, of methods, apparatus (systems), and computer program products or computer programs according to embodiments of the present invention. It will be understood that each block of the flowchart illustrations or block diagrams, or combinations thereof, and combinations of blocks in the flowchart illustrations or block diagrams, or combinations thereof, can be implemented by computer readable program instructions.
[0067] These computer readable program instructions may be provided to a processor of a computer or other programmable data processing apparatus such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / operations specified in one or more blocks of the flowchart illustrations or block diagrams, or combinations thereof, to produce a machine. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer programmable data processing apparatus or other device, or combinations thereof, to function in a particular manner, such that a computer readable storage medium having stored thereon includes an article of manufacture including instructions that implement aspects of the functions / operations specified in one or more blocks of the flowchart illustrations or block diagrams, or combinations thereof.
[0068] The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device such that the instructions, which execute on a computer, other programmable data processing apparatus, or other device, implement the functions / acts identified in one or more blocks of the flowchart illustrations or block diagrams, or combinations thereof, to cause the computer, other programmable apparatus, or other device to perform a series of operational steps to generate a computer-implemented process.
[0069] The flowchart diagrams and block diagrams in the drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products or computer programs according to various embodiments of the present invention. In this regard, each block in the flowchart diagrams or block diagrams may represent a module, segment, or portion of an instruction, which includes one or more executable instructions for implementing one or more specified logical functions. In some alternative implementations, the functions shown in the blocks may occur out of the order shown in the drawings. For example, two blocks shown in succession may actually be accomplished as one step performed simultaneously, substantially simultaneously, partially or fully in a time-overlapping manner, depending on the functions involved, or the blocks may be performed in the reverse order. It should be noted that each block of the block diagrams or flowchart diagrams or combinations thereof, as well as combinations of multiple blocks of the block diagrams or flowchart diagrams or combinations thereof, may be implemented by a special purpose hardware-based system that performs the specified functions or operations, or may execute a combination of special purpose hardware and computer instructions.
[0070] Although the present disclosure includes detailed descriptions of cloud computing, it should be understood in advance that implementation of the teachings recited herein is not limited to a cloud computing environment. Rather, embodiments of the present invention can be implemented in conjunction with any other type of computing environment now known or later developed.
[0071] Cloud computing is a model of service delivery for enabling convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, network bandwidth, servers, processing, memory, storage, applications, virtual machines, and services) that can be rapidly provisioned and released with minimal administrative effort or interaction with the service provider. The cloud model may include at least five characteristics, at least three service models, and at least four deployment models.
[0072] Its features are as follows.
[0073] On-demand self-service: A cloud consumer can unilaterally provision computing capacity, such as server time and network storage, as needed, without the need for human interaction with the provider of the service.
[0074] Broad Network Access: Capabilities are available over the network and accessed via standard mechanisms that facilitate use by heterogeneous thin or thick client platforms (e.g., cell phones, laptops, and PDAs).
[0075] Resource Pooling: Provider computing resources are pooled to serve multiple consumers using a multi-tenant model, and various physical and virtual resources are dynamically allocated and reallocated according to demand. Consumers generally have no control or knowledge of the exact location of the provided resources, but are said to be location-independent in that they may be able to specify a location at a higher level of abstraction (e.g., country, state, or data center).
[0076] Rapid Elasticity: Capabilities can be provisioned quickly and elastically, sometimes automatically, quickly scaled out, quickly released and quickly scaled in. To the consumer, the capabilities available for provisioning are often unlimited and can be purchased in any quantity at any time.
[0077] Measured Services: Cloud systems automatically control and optimize resource usage by using metering capabilities at some level of abstraction appropriate to the type of service (e.g., storage, processing, bandwidth, and active user accounts). Resource usage can be monitored, controlled, and reported, providing transparency to both providers and consumers of the services being utilized.
[0078] The service model is as follows:
[0079] Software as a Service (SaaS): The capability offered to consumers to use a provider's applications running on a cloud infrastructure. The applications are accessible from a variety of client devices through a thin-client interface, e.g., a web browser (e.g., web-based email). The consumer does not manage or control the underlying cloud infrastructure, including networks, servers, operating systems, storage, or even individual application functions, with the possible exception of limited user-specific application configuration settings.
[0080] Platform as a Service (PaaS): A capability offered to a consumer to deploy consumer-created or acquired applications, created using programming languages and tools supported by the provider, onto a cloud infrastructure. The consumer does not manage or control the underlying cloud infrastructure, e.g., including networks, servers, operating systems, or storage, but does have control over the deployed applications and, in some cases, the application-hosting environment configuration.
[0081] Infrastructure as a Service (IaaS): The capability offered to consumers to provision processing, storage, network, and other basic computing resources on which the consumer can deploy and run any software, which may include operating systems and applications. The consumer does not manage or control the underlying cloud infrastructure, but does have control over the operating systems, storage, deployed applications, and in some cases, limited control over selecting network components (e.g., host firewalls).
[0082] The deployment models are as follows:
[0083] Private Cloud: Cloud infrastructure is operated exclusively for an organization. The cloud infrastructure may be managed by the organization or a third party, and may be on-premises or off-premises.
[0084] Community Cloud: Cloud infrastructure is shared by several organizations and supports a particular community with common concerns (e.g., mission, security requirements, policies, and compliance considerations). The cloud infrastructure may be managed by the organizations or a third party, and may reside on-premise or off-premise.
[0085] Public Cloud: The cloud infrastructure is available to the general public or large industry groups and is owned by an organization that sells cloud services.
[0086] Hybrid Cloud: The cloud infrastructure remains a unique entity, but is a hybrid of two or more clouds (private, community, or public) brought together by standardized or specialized technologies that enable data and application portability (e.g., cloud bursting for load balancing between clouds).
[0087] A cloud computing environment is service oriented with a focus on statelessness, low coupling, modularity, and semantic interoperability. At the heart of cloud computing is an infrastructure that includes a network of interconnected nodes.
[0088] Referring now to FIG. 8, an exemplary cloud computing environment 50 is illustrated. As illustrated, the cloud computing environment 50 includes one or more cloud computing nodes 10 with which local computing devices used by cloud consumers, such as a personal digital assistant (PDA) or mobile phone 54A, a desktop computer 54B, a laptop computer 54C, or an automobile computer system 54N, or combinations thereof, may communicate. The nodes 10 may communicate with each other. They may be physically or virtually grouped in one or more networks, such as a private cloud, a community cloud, a public cloud, or a hybrid cloud, or combinations thereof, as described herein (not shown). This allows the cloud computing environment 50 to provide infrastructure, platform, or software, or combinations thereof, as a service without the cloud consumer having to maintain resources on the local computing device. It is understood that the types of computing devices 54A-N illustrated are intended to be exemplary only, and that the computing nodes 10 and the cloud computing environment 50 communicate with any type of computerized device (e.g., using a web browser) over any type of network or network addressable connection or combinations thereof.
[0089] Referring now to Figure 9, a set of functional abstraction layers provided by cloud computing environment 50 (Figure 8) is shown. It should be understood that the components, layers and functions shown in Figure 9 are intended to be merely exemplary, and that embodiments of the present invention are not limited thereto. As shown, the following layers and corresponding functions are provided:
[0090] The hardware and software layer 60 includes hardware and software components. Examples of hardware components include mainframes 61, RISC (Reduced Instruction Set Computer) architecture based servers 62, servers 63, blade servers 64, storage devices 65, and networks and networking components 66. In some embodiments, the software components include network application server software 67 and database software 68.
[0091] The virtualization layer 70 provides an abstraction layer from which the following examples of virtual entities may be provided: virtual servers 71; virtual storage 72; virtual networks 73, including, for example, virtual private networks; virtual applications and operating systems 74; and virtual clients 75.
[0092] In one example, the management layer 80 may provide multiple functions described below. Resource provisioning 81 provides dynamic procurement of computing and other resources utilized to execute tasks within the cloud computing environment. Metering and pricing 82 provides cost tracking as resources are utilized within the cloud computing environment and billing or invoicing for the consumption of these resources. In one example, these resources may include application software licenses. Security provides identity verification for cloud consumers and tasks, and protection for data and other resources. User portal 83 provides access to the cloud computing environment for consumers and system administrators. Service level management 84 provides allocation and management of cloud computing resources such that required service levels are met. Service level agreement (SLA) planning and fulfillment 85 provides pre-provisioning and procurement of cloud computing resources where future requirements are predicted according to SLAs.
[0093] Workload tier 90 provides examples of functions for which the cloud computing environment may be utilized. Examples of workloads and functions that may be provided from this tier include mapping and navigation 91; software development and lifecycle management 92; virtual classroom instruction provision 93; data analytics processing 94; transaction processing 95; and function 96. In the present invention, function 96 is the use of locality-sensitive hashing in federated machine learning to dynamically select clients and efficiently update models.
Claims
1. 1. A computer-implemented method for using locality-sensitive hashing to dynamically select clients in federated machine learning, comprising: receiving, by a server in the federated machine learning system, from each client in the federated machine learning system, a respective locality-sensitive hash vector calculated based on a respective gradient vector of a training objective function; the server grouping the respective clients into respective clusters based on the respective locality sensitive hash vectors; and selecting a subset of the respective clients for further participation in the federated machine learning by selecting at least one client from each of the respective clusters. Including, wherein using the respective locality-sensitive hash vectors in the federated machine learning speeds up transmitting and processing model parameters.
2. the server determining if a new round of client selection is necessary; responsive to determining that a new round of client selection is necessary, the server requesting each of the clients to transmit a respective new locality-sensitive hash vector calculated based on a respective current gradient vector of the training objective function; the server regrouping the respective clients into respective new clusters based on the respective new locality sensitive hash vectors; and the server selecting a new subset of the respective clients to further participate in the federated machine learning by selecting at least one client from each of the respective new clusters. The computer-implemented method of claim 1 , further comprising:
3. responsive to determining that the new round of client selection is not necessary, the server maintains the subset of the respective clients for further participation in the federated machine learning. The computer-implemented method of claim 2 , further comprising:
4. 3. The computer-implemented method of claim 2, wherein the server initiates the new round of client selection in response to at least one of the following conditions: a number of selected clients in the subset of each client become unavailable; costs of the subset of each client have changed significantly; model parameters are updated in a significantly different direction or magnitude from a previous training cycle; and a predetermined time or number of iterations has elapsed.
5. said server transmitting said model parameters to said respective clients; calculating, by each of the clients, each of the gradient vectors using each of the local data sets and the model parameters; said respective locality sensitive hash vector being calculated by said respective client; and said respective clients transmitting said respective locality sensitive hash vectors to said server; The computer-implemented method of claim 1 , further comprising:
6. said respective clients projecting said respective gradient vectors into a low dimensional space to compute said respective locality sensitive hash vectors. The computer-implemented method of claim 5 , further comprising:
7. 7. The computer-implemented method of claim 6, wherein the respective clients begin sending the respective locality-sensitive hash vectors having a lower dimension, and wherein, in response to determining that higher accuracy of the respective locality-sensitive hash vectors is required, the server requests the respective clients to send the respective locality-sensitive hash vectors having a higher dimension until the server is satisfied with received information contained in the respective locality-sensitive hash vectors.
8. 1. A computer-implemented method for using locality-sensitive hashing to dynamically select clients in federated machine learning, comprising: receiving, by a server in the federated machine learning system, from each client in the federated machine learning system, a respective locality-sensitive hash vector calculated based on a respective gradient vector of a training objective function; the server finding the subset of each of the clients by solving an optimization problem to minimize gradient divergence for the subset of each of the clients, where the respective locality sensitive hash vectors are used in solving the optimization problem; and the server selecting the subset of the respective clients to further participate in the federated machine learning. Including, wherein using the respective locality-sensitive hash vectors in the federated machine learning speeds up transmitting and processing model parameters; The method.
9. the server determining if a new round of client selection is necessary; responsive to determining that a new round of client selection is necessary, the server requesting each of the clients to transmit a respective new locality-sensitive hash vector calculated based on a respective current gradient vector of the training objective function; the server finding the new subset of each of the clients by solving an optimization problem to minimize a gradient divergence for the new subset of each of the clients, where the new locality-sensitive hash vector is used in solving the optimization problem; and the server selecting the new subset of each of the clients to further participate in the federated machine learning.
10. The computer-implemented method of claim 8, further comprising:
10. responsive to determining that the new round of client selection is not necessary, the server maintains the subset of the respective clients for further participation in the federated machine learning.
10. The computer-implemented method of claim 9, further comprising:
11. 10. The computer-implemented method of claim 9, wherein the server initiates the new round of client selection in response to at least one of the following conditions: a large number of selected clients in the subset of each client become unavailable; costs of the subset of each client have changed significantly; model parameters are updated in a significantly different direction or magnitude from a previous training cycle; and a predetermined amount of time or a predetermined number of iterations has elapsed.
12. said server transmitting said model parameters to said respective clients; calculating, by each of the clients, each of the gradient vectors using each of the local data sets and the model parameters; said respective locality sensitive hash vector being calculated by said respective client; and said respective clients transmitting said respective locality sensitive hash vectors to said server; 10. The computer-implemented method of claim 8, further comprising:
13. said respective clients projecting said respective gradient vectors into a low dimensional space to compute said respective locality sensitive hash vectors.
13. The computer-implemented method of claim 12, further comprising:
14. 14. The computer-implemented method of claim 13, wherein the respective clients begin sending the respective locality-sensitive hash vectors having a lower dimension, and wherein, in response to determining that higher accuracy of the respective locality-sensitive hash vectors is required, the server requests the respective clients to send the respective locality-sensitive hash vectors having a higher dimension until the server is satisfied with received information contained in the respective locality-sensitive hash vectors.
15. 1. A computer-implemented method for using locality-sensitive hashing to efficiently update a model in federated machine learning, comprising: receiving, by a server in the federated machine learning system, from each client in the federated machine learning system, each locality-sensitive hash vector calculated based on a respective parameter vector of each updated model; determining, by the server, whether the updated respective model of each selected client is sufficiently different from a model sent from the server to each selected client for training based on a distance between the locality sensitive hash vector of the model and the respective locality sensitive hash vector; and and in response to determining that the updated respective model is sufficiently different from the model, the server requests each of the selected clients to transmit the respective parameter vector to the server. Including, wherein using the respective locality-sensitive hash vectors in the federated machine learning speeds up transmitting and processing model parameters.
16. and in response to determining that the updated respective models are not sufficiently different from the model, the server requests each of the selected clients to continue training the model and to transmit the respective locality-sensitive hash vectors to the server.
20. The computer-implemented method of claim 15, further comprising:
17. computing, by each of the selected clients, the respective locality sensitive hash vector; and each of the selected clients sending the respective locality sensitive hash vector to the server; 20. The computer-implemented method of claim 15, further comprising:
18. projecting, by each of the selected clients, each of the updated model's respective parameter vectors into a low-dimensional space to compute each of the locality-sensitive hash vectors.
20. The computer-implemented method of claim 17, further comprising:
19. To determine each of the selected clients, receiving, by the server, each of the locality-sensitive hash vectors from each of the clients in the federated machine learning system; the server grouping the respective clients into respective clusters based on the respective locality sensitive hash vectors; and the server determining, by selecting at least one client from each of the respective clusters, each of the selected clients for further participation in the federated machine learning.
20. The computer-implemented method of claim 15, further comprising:
20. To determine each of the selected clients, receiving, by the server, each of the locality-sensitive hash vectors from each of the clients in the federated machine learning system; the server finding the subset of each of the clients by solving an optimization problem to minimize a gradient divergence for the subset of each of the clients; and determining by the server the subset of the respective clients as the selected respective clients to further participate in the federated machine learning; 20. The computer-implemented method of claim 15, further comprising:
Citation Information
Patent Citations
Gradient compression device, gradient compression method and program
JP2019080232A
Smart Reply using on-device model
JP2019535073A
Communication Efficient Federated Learning
US20190340534A1