A method and device for optimizing communication overhead of federated learning

Through the combination of the adaptive gradient quantization model and the lazy gradient aggregation model, the quantization level and communication frequency are dynamically adjusted to optimize the quantization gradient transmission in federated learning, solve the problem of low communication efficiency of federated learning in the existing technology, and achieve efficient Model transfer.

CN114548421BActive Publication Date: 2024-10-01TSINGHUA UNIVERSITY
View PDF -1 Cites 0 Cited by

Patent Information

Application Number
CN202210023353.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-10
Publication Date
2024-10-01
Estimated Expiration
2042-01-10

AI Technical Summary

Technical Problem

The communication efficiency of federated learning in the existing technology is low, mainly due to the limitations of the optimization method for the number of model transmissions and the number of bits, resulting in high communication overhead.

Method used

The adaptive gradient quantization model is used to dynamically adjust the quantization level, and the communication frequency is adjusted through the lazy gradient aggregation model to optimize the transmission of quantization gradients and reduce the amount of bit transmission.

Benefits of technology

It effectively improves the communication efficiency of federated learning, reduces the overall bit transmission volume, reduces communication overhead, and achieves efficient model transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114548421B_ABST
    Figure CN114548421B_ABST
Patent Text Reader

Abstract

The present invention provides an optimization processing method and device for federated learning communication overhead. The method includes: distributing an initial global model to a local client, obtaining a target quantization level of the current round obtained by the local client based on an adaptive gradient quantization model; the target quantization level is used to quantize the gradient uploaded by the local client in the current round; based on an inert gradient aggregation model, determining whether to obtain the quantization gradient corresponding to the local client in the current round; the quantization gradient is obtained by quantizing the gradient uploaded by the local client in the current round based on the target quantization level; the quantization gradient is aggregated, and the initial global model is updated according to the aggregation result to obtain the target global model corresponding to the next round. The method provided by the present invention dynamically adjusts the quantization level through an adaptive gradient quantization model, and adjusts the communication frequency through an inert gradient aggregation model, which effectively improves the communication efficiency and reduces the communication overhead.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence analysis technology, and more particularly to a method and device for optimizing federated learning communication overhead. In addition, the present invention also relates to an electronic device and a processor-readable storage medium. Background Art

[0002] In the process of federated learning, the local client and the central server need to go through multiple rounds of interaction to obtain a global model that meets the accuracy requirements. For complex model training processes, such as the training of deep learning models, each model update may contain a large number of model parameters, resulting in low efficiency of federated learning communication overhead, so it is of great value to study how to improve the efficiency of federated learning communication.

[0003] At present, in the prior art, in order to improve the communication efficiency of federated learning, the method of reducing the number of model transmissions or reducing the number of bits uploaded by the client each time is usually adopted. Although the above two methods of optimizing communication efficiency can reduce communication overhead to a certain extent, each has its own limitations, such as only being able to determine the quantization level based on experience or grid search. Therefore, how to design an efficient optimization processing solution for the communication overhead of federated learning has become a problem that needs to be solved urgently. Summary of the invention

[0004] To this end, the present invention provides a method and device for optimizing the communication overhead of federated learning, so as to solve the defect that the optimization processing scheme for the communication overhead of federated learning in the prior art has high limitations, resulting in poor efficiency of federated learning communication.

[0005] In a first aspect, the present invention provides an optimization processing method for federated learning communication overhead, which is applied to a central server, comprising:

[0006] Distribute the initial global model to the local client, and obtain the target quantization level of the current round obtained by the local client based on a preset adaptive gradient quantization model; the target quantization level is used to quantize the gradient uploaded by the local client in the current round;

[0007] Based on a preset lazy gradient aggregation model, determine whether to obtain a quantized gradient corresponding to the local client in the current round; wherein the quantized gradient is obtained by quantizing the gradient uploaded in the current round by the local client based on the target quantization level;

[0008] Aggregation processing is performed on the quantized gradients, and the initial global model is updated according to the aggregation result to obtain a target global model corresponding to the next round.

[0009] Further, based on a preset lazy gradient aggregation model, determining whether to obtain the quantized gradient corresponding to the local client in the current round specifically includes:

[0010] Based on the preset lazy gradient aggregation model, determine whether the difference between the quantization gradient corresponding to the current round and the quantization gradient corresponding to the previous round is greater than or equal to the preset gradient range threshold. If so, determine to obtain the quantization gradient corresponding to the local client in the current round.

[0011] Further, the quantized gradients are aggregated, and the initial global model is updated according to the aggregation result to obtain a target global model corresponding to the next round, which specifically includes:

[0012] Aggregating the quantized gradient based on a preset quantized gradient aggregation model to obtain an aggregation result corresponding to the gradient descent;

[0013] The initial global model corresponding to the current training round is updated according to the aggregation result to obtain the target global model corresponding to the next training round.

[0014] Furthermore, the formula (1) corresponding to the adaptive gradient quantization model is as follows:

[0015]

[0016] In the formula, represents the target quantization level of the mth local client in the kth round, where Indicates the quantization level; b0 indicates the initial quantization level corresponding to each local client; Represents the adaptive process, which is obtained by adaptive training of the model. represents the quantized gradient corresponding to the mth local client in the first round, represents the quantized gradient corresponding to the mth local client in the kth round, represents the quantized gradient actually uploaded by the mth local client in round 0; represents the quantized gradient actually uploaded by the m-th local client in the k-1th round; m represents the m-th local client.

[0017] Furthermore, the formula (2) corresponding to the inert gradient aggregation model is as follows:

[0018] In the formula, Indicates that the mth local client uses the target quantization level in the kth round Dequantize a gradient A quantized gradient is obtained; Indicates the quantized gradient actually used by the mth local client in the k-1th round Dequantize a gradient The obtained true gradient; Used to measure the difference in the update amount of the kth round of the mth local client; represents the gradient range threshold, θ is the parameter of the global model; D represents the total number of rounds; Represents the difference between the true gradient and the quantized gradient; Represents the difference between the quantized gradient and the original gradient; ξ d and α are two hyperparameters, where ξ d is the penalty term for quantizing the gradient.

[0019] In a second aspect, the present invention further provides a method for optimizing the communication overhead of federated learning, which is applied to a local client and includes:

[0020] Obtain the initial global model distributed by the central server;

[0021] Determine the target quantization level of the current round based on a preset adaptive gradient quantization model, and quantize the gradient to be uploaded in the current round based on the target quantization level to obtain the quantization gradient corresponding to the current round;

[0022] The quantization gradient corresponding to the current round is uploaded to the central server, so as to implement aggregation processing of the quantization gradient in the central server.

[0023] In a third aspect, the present invention further provides an optimization processing device for federated learning communication overhead, comprising:

[0024] A quantization level adaptive determination unit, used to distribute the initial global model to the local client, and obtain the target quantization level of the current round obtained by the local client based on a preset adaptive gradient quantization model; the target quantization level is used to quantize the gradient uploaded by the local client in the current round;

[0025] An inert gradient aggregation processing unit, used to determine whether to obtain the quantized gradient corresponding to the local client in the current round based on a preset inert gradient aggregation model; wherein the quantized gradient is obtained by the local client quantizing the gradient uploaded in the current round based on the target quantization level;

[0026] The quantized gradient aggregation processing unit is used to perform aggregation processing on the quantized gradient and update the initial global model according to the aggregation result to obtain the target global model corresponding to the next round.

[0027] Furthermore, the inert gradient polymerization processing unit is specifically used for:

[0028] Based on the preset lazy gradient aggregation model, determine whether the difference between the quantization gradient corresponding to the current round and the quantization gradient corresponding to the previous round is greater than or equal to the preset gradient range threshold. If so, determine to obtain the quantization gradient corresponding to the local client in the current round.

[0029] Furthermore, the quantized gradient aggregation processing unit is specifically used for:

[0030] Aggregating the quantized gradient based on a preset quantized gradient aggregation model to obtain an aggregation result corresponding to the gradient descent;

[0031] The initial global model corresponding to the current training round is updated according to the aggregation result to obtain the target global model corresponding to the next training round.

[0032] Furthermore, the formula (1) corresponding to the adaptive gradient quantization model is as follows:

[0033]

[0034] In the formula, represents the target quantization level of the mth local client in the kth round, where Indicates the quantization level; b0 indicates the initial quantization level corresponding to each local client; Represents the adaptive process, which is obtained by adaptive training of the model. represents the quantized gradient corresponding to the mth local client in the first round, represents the quantized gradient corresponding to the mth local client in the kth round, represents the quantized gradient actually uploaded by the mth local client in round 0; represents the quantized gradient actually uploaded by the m-th local client in the k-1th round; m represents the m-th local client.

[0035] Furthermore, the formula (2) corresponding to the inert gradient aggregation model is as follows:

[0036] In the formula, Indicates that the mth local client uses the target quantization level in the kth round Dequantize a gradient A quantized gradient is obtained; Indicates the quantized gradient actually used by the mth local client in the k-1th round Dequantize a gradient The obtained true gradient; Used to measure the difference in the update amount of the kth round of the mth local client; represents the gradient range threshold, θ is the parameter of the global model; D represents the total number of rounds; Represents the difference between the true gradient and the quantized gradient; Represents the difference between the quantized gradient and the original gradient; ξ d and α are two hyperparameters, where ξ d is the penalty term for quantizing the gradient.

[0037] In a fourth aspect, the present invention further provides an optimization processing device for federated learning communication overhead, comprising:

[0038] A global model acquisition unit, used to acquire an initial global model distributed by a central server;

[0039] A quantization level adaptive processing unit, used to determine a target quantization level of the current round based on a preset adaptive gradient quantization model, and quantize the gradient to be uploaded in the current round based on the target quantization level to obtain a quantization gradient corresponding to the current round;

[0040] The quantization gradient uploading unit is used to upload the quantization gradient corresponding to the current round to the central server, so as to implement aggregation processing of the quantization gradient in the central server.

[0041] In a fifth aspect, the present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method for optimizing the communication overhead of federated learning as described in any one of the above items are implemented.

[0042] In a sixth aspect, the present invention further provides a processor-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the optimization processing method for federated learning communication overhead as described in any one of the above items are implemented.

[0043] The optimization processing method for the communication overhead of federated learning provided by the present invention dynamically adjusts the quantization level through an adaptive gradient quantization model, and adjusts the communication frequency through an inert gradient aggregation model, thereby effectively improving the communication efficiency, reducing the overall bit transmission amount, reducing the communication overhead, and better realizing efficient transmission in federated learning. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0045] Figure 1 It is one of the flow charts of the optimization processing method for federated learning communication overhead provided by the embodiment of the present invention;

[0046] Figure 2 It is a complete schematic diagram of a federated learning framework corresponding to the optimization processing method for federated learning communication overhead provided by an embodiment of the present invention;

[0047] Figure 3 It is a schematic diagram of gradient quantization in an optimization processing method for federated learning communication overhead provided by an embodiment of the present invention;

[0048] Figure 4 It is one of the structural schematic diagrams of the optimization processing device for federated learning communication overhead provided by the embodiment of the present invention;

[0049] Figure 5 This is a second flow chart of a method for optimizing communication overhead of federated learning provided by an embodiment of the present invention;

[0050] Figure 6 This is the second structural schematic diagram of the optimization processing device for federated learning communication overhead provided by an embodiment of the present invention;

[0051] Figure 7 It is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] In response to the optimization problem of federated learning communication overhead, the present invention proposes an optimization processing method for federated learning communication overhead, namely, an adaptive model quantization based on the lazy gradient aggregation strategy to obtain a communication collaborative learning framework AUQILA (Adaptive quantization of lazily-aggregated gradients), and applies it to the federated learning framework to reduce the overall communication volume of the local client, thereby better realizing efficient transmission in federated learning.

[0054] The following is a detailed description of an embodiment of the method for optimizing the communication overhead of federated learning according to the present invention. Figure 1As shown, it is one of the flow charts of the optimization processing method for federated learning communication overhead provided by an embodiment of the present invention, and the specific implementation process includes the following steps:

[0055] Step 101: Distribute the initial global model to the local client, and obtain the target quantization level of the current round obtained by the local client based on a preset adaptive gradient quantization model; the target quantization level is used to quantize the gradient uploaded by the local client in the current round.

[0056] In the federated learning scenario, different local clients can quantize the gradients at different determined quantization levels, thereby obtaining different quantized gradients. In the embodiment of the present invention, the application of the communication collaborative learning framework mainly includes selecting the best quantization bits for each round of communication in the LAQ (Lazy Aggregation strategy) by optimizing the gradient loss caused by skipping quantization updates.

[0057] like Figure 2 As shown in Figure 1, it shows the training process of the communication collaborative learning framework, which includes an adaptive gradient quantization model (Quantization level selection) and a lazy gradient aggregation model (LazyAggregation strategy). In each training round k: the central server pre-distributes the initial global model to each local client in the form of broadcast; the local client m calculates the target quantization level according to the following formula (1) corresponding to the adaptive gradient quantization model:

[0058]

[0059] In the formula, represents the target quantization level (optimal quantization level) of the mth local client in the kth round, where Indicates the quantization level; b0 indicates the initial quantization level corresponding to each local client, for example, the initial quantization level is 2; represents the adaptive process, which is obtained by adaptive training; among them, The quantized gradient corresponding to the mth local client in the first round, The quantized gradient corresponding to the mth local client in the kth round, The quantized gradient actually uploaded by the mth local client in round 0; The quantization gradient actually uploaded by the mth local client in the k-1th round; m represents the mth local client. If the target quantization level is higher than the preset threshold b max , then Set to b max .

[0060] In an embodiment of the present invention, after distributing the initial global model to the local client, the target quantization level of the current round calculated by the local client based on the preset adaptive gradient quantization model to dynamically adjust the number of quantization bits is obtained. After determining the target quantization level, the central server can obtain the target quantization level of the current round obtained by the local client based on the preset adaptive gradient quantization model.

[0061] Step 102: Based on a preset lazy gradient aggregation model, determine whether to obtain the quantization gradient corresponding to the local client in the current round; wherein the quantization gradient is obtained by quantizing the gradient uploaded in the current round by the local client based on the target quantization level.

[0062] In an embodiment of the present invention, based on a preset lazy gradient aggregation model, it is determined whether to obtain the quantization gradient corresponding to the local client in the current round. The specific implementation process includes: judging whether the difference between the quantization gradient corresponding to the current round and the quantization gradient corresponding to the previous round is greater than or equal to the preset gradient range threshold based on the preset lazy gradient aggregation model, and if so, determining to obtain the quantization gradient corresponding to the local client in the current round. The local client is a client in a federated learning architecture for realizing data communication with a central server. The target quantization level corresponds to the number of quantization bits, and the quantization level includes the corresponding target quantization level.

[0063] In this step, the central server determines whether the local client uploads the quantized gradient in the current round according to the formula (2) corresponding to the following lazy gradient aggregation model.

[0064]

[0065] In the formula, Indicates that the mth local client uses the target quantization level in the kth round Dequantize a gradient A quantized gradient is obtained; represents the quantized gradient actually used by the mth local client (or client m) in the k-1th round; Used to measure the difference in the update amount of the kth round of the mth local client (the difference between the quantization gradient corresponding to the current round and the quantization gradient corresponding to the previous round); represents the gradient range threshold, θ is the parameter of the global model; D represents the total number of rounds; Represents the difference between the true gradient and the quantized gradient; Represents the difference between the quantized gradient and the original gradient; ξ d and α are two hyperparameters, ξd is the preset penalty term for quantized gradient (there will be some loss when going from 32 bits to 2 bits), and α is the preset hyperparameter.

[0066] If the above formula (2) holds true, the quantized gradient Q is calculated by the corresponding local client using the following formula (3): b (g) The quantized gradient Q is uploaded by the central server. b (g).

[0067] Q b (g i )=||g||2·sign(g i )·ξ i (g,b) (3)

[0068] In the formula, g i represents the gradient (vector), i represents the number of components of a gradient, and each component of the gradient is quantized as described above, and finally a Q is obtained. b (g) or Q b (g i ); ||g||2 represents the l of the gradient g 2 norm; sign(g i ) is g i The sign of ξ is 1 if positive and -1 if negative. i (g,b) represents probability.

[0069] If the above formula (2) does not hold, the corresponding local client does not upload the quantized gradient Q in the current round. b (g) This allows the use of fewer quantization bits to transmit model parameters (or gradients) with a greater degree of update.

[0070] In the embodiment of the present invention, QSGD (Quantized Stochastic Gradient Descent) is used in AQUILA for quantization. The quantization formula is shown in the following formula (4), where l∈[0,b] is an integer such that |g i | / ||g||2∈[l / b,(l+1) / b]. For each component g of the gradient i , QSGD can be used to approximate it to an endpoint of the subinterval with a certain probability each time, and QSGD can ensure an unbiased estimate of the target gradient obtained after quantization and the original gradient. In order to understand QSGD more intuitively, we designed Figure 3 For example. Figure 3In , the target quantization level is 5: the interval has 5 endpoints 0, 0.25, 0.5, 0.75, 1. If the value of a component of the original gradient is 0.6, it has a probability of 0.6 being mapped to 0.5 and a probability of 0.4 being mapped to 0.75.

[0071]

[0072] Step 103: Aggregate the quantized gradients, and update the initial global model according to the aggregation result to obtain a target global model corresponding to the next round.

[0073] In an embodiment of the present invention, the quantized gradients are aggregated, and the initial global model is updated according to the aggregation results to obtain a target global model corresponding to the next round. The specific implementation process includes: aggregating the quantized gradients based on a preset quantized gradient aggregation model to obtain an aggregation result corresponding to the gradient descent; updating the initial global model corresponding to the current training round according to the aggregation result to obtain a target global model corresponding to the next training round.

[0074] In the actual implementation process, the central server receives the quantized gradient Q from each local client. b (g) The quantized gradients are aggregated using the following formula (5) and used to update the initial global model:

[0075]

[0076] In the formula, α represents the learning rate or learning step size; θ k The initial global model of the kth round (equivalent to the current round), that is, the global parameters of the kth round; θ k+1 represents the updated target global model of round k+1 (equivalent to the next round); M represents the data of the local client, and m represents the local client; Represents gradient descent, and after gradient descent, we get θ k+1 , which is the target global model of the k+1th round; α is the model learning rate.

[0077] It should be noted that, in the embodiment of the present invention, the quantization level or the target quantization level represents how many quantization bits are used to quantize the target to be quantized (for example, the gradient, a quantization level is used to quantize the gradient to obtain a quantized gradient). The quantization bit is how many bits this gradient (vector) uses to upload the gradient (for example, the quantization bit can be 32 bits and the quantization level can be 2 bits). The quantized gradient is the quantized gradient obtained by putting the gradient into this quantization model (quantization framework) for quantization. It can be understood that: the gradient is a vector (containing several components), and each component in the vector is used to make a quantization bit. For example, each component originally has 32 bits, and it is used for quantization at a quantization level of 2 to quantize it to finally obtain a quantization bit of 2 bits, that is, the quantized gradient obtained by the gradient.

[0078] The optimization processing method for the communication overhead of federated learning described in the embodiment of the present invention dynamically adjusts the quantization level through an adaptive gradient quantization model, and adjusts the communication frequency through an inert gradient aggregation model, thereby effectively improving the communication efficiency, reducing the overall bit transmission amount, reducing the communication overhead, and better realizing efficient transmission in federated learning.

[0079] Corresponding to the above-mentioned method for optimizing the communication overhead of federated learning, the present invention also provides a device for optimizing the communication overhead of federated learning. Since the embodiment of the device is similar to the above-mentioned method embodiment, the description is relatively simple. For relevant details, please refer to the description of the above-mentioned method embodiment. The embodiment of the device for optimizing the communication overhead of federated learning described below is only illustrative. Please refer to Figure 4 As shown, it is one of the structural schematic diagrams of an optimization processing device for federated learning communication overhead provided by an embodiment of the present invention.

[0080] The optimization processing device for federated learning communication overhead described in the present invention specifically includes the following parts:

[0081] The quantization level adaptive determination unit 401 is used to distribute the initial global model to the local client, and obtain the target quantization level of the current round obtained by the local client based on the preset adaptive gradient quantization model; the target quantization level is used to quantize the gradient uploaded by the local client in the current round;

[0082] The lazy gradient aggregation processing unit 402 is used to determine whether to obtain the quantization gradient corresponding to the local client in the current round based on a preset lazy gradient aggregation model; wherein the quantization gradient is obtained by the local client quantizing the gradient uploaded in the current round based on the target quantization level;

[0083] The quantized gradient aggregation processing unit 403 is used to perform aggregation processing on the quantized gradients, and update the initial global model according to the aggregation result to obtain the target global model corresponding to the next round.

[0084] Furthermore, the inert gradient polymerization processing unit is specifically used for:

[0085] Based on the preset lazy gradient aggregation model, determine whether the difference between the quantization gradient corresponding to the current round and the quantization gradient corresponding to the previous round is greater than or equal to the preset gradient range threshold. If so, determine to obtain the quantization gradient corresponding to the local client in the current round.

[0086] Furthermore, the quantized gradient aggregation processing unit is specifically used for:

[0087] Aggregating the quantized gradient based on a preset quantized gradient aggregation model to obtain an aggregation result corresponding to the gradient descent;

[0088] The initial global model corresponding to the current training round is updated according to the aggregation result to obtain the target global model corresponding to the next training round.

[0089] Furthermore, the formula (1) corresponding to the adaptive gradient quantization model is as follows:

[0090]

[0091] In the formula, represents the target quantization level of the mth local client in the kth round, where Indicates the quantization level; b0 indicates the initial quantization level corresponding to each local client; Represents the adaptive process, which is obtained by adaptive training of the model. represents the quantized gradient corresponding to the mth local client in the first round, represents the quantized gradient corresponding to the mth local client in the kth round, represents the quantized gradient actually uploaded by the mth local client in round 0; represents the quantized gradient actually uploaded by the m-th local client in the k-1th round; m represents the m-th local client.

[0092] Furthermore, the formula (2) corresponding to the inert gradient aggregation model is as follows:

[0093] In the formula, Indicates that the mth local client uses the target quantization level in the kth round Dequantize a gradient A quantized gradient is obtained; Indicates the quantized gradient actually used by the mth local client in the k-1th round Dequantize a gradient The obtained true gradient; Used to measure the difference in the update amount of the kth round of the mth local client; represents the gradient range threshold, θ is the parameter of the global model; D represents the total number of rounds; Represents the difference between the true gradient and the quantized gradient; Represents the difference between the quantized gradient and the original gradient; ξ d and α are two hyperparameters, where ξ d is the penalty term for quantizing the gradient.

[0094] By using the optimization processing device for the communication overhead of federated learning described in the embodiment of the present invention, the quantization level is adaptively and dynamically adjusted through an adaptive gradient quantization model, and the communication frequency is adjusted through an inert gradient aggregation model, which effectively improves the communication efficiency, reduces the overall bit transmission amount, reduces the communication overhead, and can better realize efficient transmission in federated learning.

[0095] Correspondingly, corresponding to the above-mentioned method and device for optimizing the communication overhead of federated learning, the present invention also provides another method and device for optimizing the communication overhead of federated learning. Since the embodiments of the method and device are similar to the above-mentioned method and device embodiments, the description is relatively simple. For relevant details, please refer to the description of the above-mentioned method and device embodiments. The embodiments of the method and device for optimizing the communication overhead of federated learning described below are only illustrative. Please refer to Figure 5 As shown, it is a second flow chart of an optimization processing method for federated learning communication overhead provided by an embodiment of the present invention.

[0096] Step 501: Obtain the initial global model distributed by the central server.

[0097] Step 502: Determine the target quantization level of the current round based on a preset adaptive gradient quantization model, and quantize the gradient to be uploaded in the current round based on the target quantization level to obtain the quantization gradient corresponding to the current round.

[0098] Step 503: Upload the quantization gradient corresponding to the current round to the central server, so as to implement aggregation processing of the quantization gradient in the central server.

[0099] Please refer to Figure 6 As shown, it is a second structural schematic diagram of an optimization processing device for federated learning communication overhead provided by an embodiment of the present invention.

[0100] A global model acquisition unit 601 is used to acquire an initial global model distributed by a central server;

[0101] A quantization level adaptive processing unit 602 is used to determine a target quantization level of the current round based on a preset adaptive gradient quantization model, and quantize the gradient to be uploaded in the current round based on the target quantization level to obtain a quantization gradient corresponding to the current round;

[0102] The quantization gradient uploading unit 603 is used to upload the quantization gradient corresponding to the current round to the central server, so as to implement aggregation processing of the quantization gradient in the central server.

[0103] Corresponding to the above-mentioned optimization processing method for the communication overhead of federated learning, the present invention also provides an electronic device. Since the embodiment of the electronic device is similar to the above-mentioned method embodiment, the description is relatively simple. For the relevant parts, please refer to the description of the above-mentioned method embodiment. The electronic device described below is only illustrative. Figure 7 As shown, it is a schematic diagram of the physical structure of an electronic device disclosed in an embodiment of the present invention. The electronic device may include: a processor 701, a memory 702 and a communication bus 703, wherein the processor 701 and the memory 702 complete mutual communication through the communication bus 703, and communicate with the outside through the communication interface 704. The processor 701 can call the logic instructions in the memory 702 to execute the optimization processing method for the communication overhead of federated learning, the method comprising: distributing the initial global model to the local client, and obtaining the target quantization level of the current round obtained by the local client based on the preset adaptive gradient quantization model; the target quantization level is used to quantize the gradient uploaded by the local client in the current round; based on the preset lazy gradient aggregation model, determine whether to obtain the quantization gradient corresponding to the local client in the current round; wherein the quantization gradient is obtained by the local client quantizing the gradient uploaded in the current round based on the target quantization level; the quantization gradient is aggregated, and the initial global model is updated according to the aggregation result to obtain the target global model corresponding to the next round.

[0104] In addition, the logic instructions in the above-mentioned memory 702 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: a storage chip, a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and other media that can store program codes.

[0105] On the other hand, an embodiment of the present invention further provides a computer program product, the computer program product comprising a computer program stored on a processor-readable storage medium, the computer program comprising program instructions, and when the program instructions are executed by a computer, the computer can execute the optimization processing method for the communication overhead of federated learning provided by the above-mentioned method embodiments. The method comprises: distributing the initial global model to the local client, and obtaining the target quantization level of the current round obtained by the local client based on a preset adaptive gradient quantization model; the target quantization level is used to quantize the gradient uploaded by the local client in the current round; based on a preset lazy gradient aggregation model, determining whether to obtain the quantization gradient corresponding to the local client in the current round; wherein the quantization gradient is obtained by the local client quantizing the gradient uploaded in the current round based on the target quantization level; the quantization gradient is aggregated, and the initial global model is updated according to the aggregation result to obtain the target global model corresponding to the next round.

[0106] On the other hand, an embodiment of the present invention further provides a processor-readable storage medium, on which a computer program is stored, and when the computer program is executed by the processor, it is implemented to execute the optimization processing method for federated learning communication overhead provided by the above embodiments. The method includes: distributing the initial global model to the local client, and obtaining the target quantization level of the current round obtained by the local client based on a preset adaptive gradient quantization model; the target quantization level is used to quantize the gradient uploaded by the local client in the current round; based on a preset lazy gradient aggregation model, determine whether to obtain the quantization gradient corresponding to the local client in the current round; wherein the quantization gradient is obtained by the local client quantizing the gradient uploaded in the current round based on the target quantization level; aggregate the quantization gradient, and update the initial global model according to the aggregation result to obtain the target global model corresponding to the next round.

[0107] The processor-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.

[0108] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0109] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for optimizing the communication overhead of federated learning, applied to a central server, characterized in that: include: Distributing the initial global model to the local client, and obtaining the target quantization level of the current round obtained by the local client based on a preset adaptive gradient quantization model; The target quantization level is used to quantize the gradient uploaded by the local client in the current round; the formula (1) corresponding to the adaptive gradient quantization model is as follows: In the formula, represents the target quantization level of the mth local client in the kth round, where Indicates the quantization level; b0 indicates the initial quantization level corresponding to each local client; Represents the adaptive process, which is obtained by adaptive training of the model. represents the quantized gradient corresponding to the mth local client in the first round, represents the quantized gradient corresponding to the mth local client in the kth round, represents the quantized gradient actually uploaded by the mth local client in round 0; represents the quantized gradient actually uploaded by the m-th local client in the k-1th round; m represents the m-th local client; Based on a preset lazy gradient aggregation model, determine whether to obtain a quantized gradient corresponding to the local client in the current round; wherein the quantized gradient is obtained by quantizing the gradient uploaded in the current round by the local client based on the target quantization level; The formula (2) corresponding to the inert gradient polymerization model is as follows: In the formula, Indicates that the mth local client uses the target quantization level in the kth round Dequantize a gradient A quantized gradient is obtained; Indicates the quantized gradient actually used by the mth local client in the k-1th round To quantize a ladder represents the gradient range threshold, θ is the parameter of the global model; D represents the total number of rounds; Represents the difference between the true gradient and the quantized gradient; Represents the difference between the quantized gradient and the original gradient; ξ d and α are two hyperparameters, where ξ d is the penalty term for quantizing the gradient; Aggregation processing is performed on the quantized gradients, and the initial global model is updated according to the aggregation result to obtain a target global model corresponding to the next round.

2. The method for optimizing the communication overhead of federated learning according to claim 1, characterized in that: Based on a preset lazy gradient aggregation model, determining whether to obtain the quantized gradient corresponding to the local client in the current round specifically includes: Based on the preset lazy gradient aggregation model, determine whether the difference between the quantization gradient corresponding to the current round and the quantization gradient corresponding to the previous round is greater than or equal to the preset gradient range threshold. If so, determine to obtain the quantization gradient corresponding to the local client in the current round.

3. The method for optimizing the communication overhead of federated learning according to claim 1, characterized in that: Aggregating the quantized gradients, and updating the initial global model according to the aggregation results to obtain a target global model corresponding to the next round, specifically including: Aggregating the quantized gradient based on a preset quantized gradient aggregation model to obtain an aggregation result corresponding to the gradient descent; The initial global model corresponding to the current training round is updated according to the aggregation result to obtain the target global model corresponding to the next training round.

4. A method for optimizing the communication overhead of federated learning, applied to a local client, characterized in that: include: Obtain the initial global model distributed by the central server; The target quantization level of the current round is determined based on the preset adaptive gradient quantization model, and the gradient to be uploaded in the current round is quantized based on the target quantization level to obtain the quantization gradient corresponding to the current round; the formula (1) corresponding to the adaptive gradient quantization model is as follows: In the formula, represents the target quantization level of the mth local client in the kth round, where Indicates the quantization level; b0 indicates the initial quantization level corresponding to each local client; Represents the adaptive process, which is obtained by adaptive training of the model. represents the quantized gradient corresponding to the mth local client in the first round, represents the quantized gradient corresponding to the mth local client in the kth round, represents the quantized gradient actually uploaded by the mth local client in round 0; represents the quantized gradient actually uploaded by the m-th local client in the k-1th round; m represents the m-th local client; Uploading the quantization gradient corresponding to the current round to a central server, so as to implement aggregation processing of the quantization gradient using a preset lazy gradient aggregation model in the central server; The formula (2) corresponding to the inert gradient polymerization model is as follows: In the formula, Indicates that the mth local client uses the target quantization level in the kth round Dequantize a gradient A quantized gradient is obtained; Indicates the quantized gradient actually used by the mth local client in the k-1th round To quantize a ladder represents the gradient range threshold, θ is the parameter of the global model; D represents the total number of rounds; Represents the difference between the true gradient and the quantized gradient; Represents the difference between the quantized gradient and the original gradient; ξ d and α are two hyperparameters, where ξ d is the penalty term for quantizing the gradient.

5. An optimization processing device for federated learning communication overhead, characterized in that: include: A quantization level adaptive determination unit, used to distribute the initial global model to the local client, and obtain the target quantization level of the current round obtained by the local client based on a preset adaptive gradient quantization model; The target quantization level is used to quantize the gradient uploaded by the local client in the current round; the formula (1) corresponding to the adaptive gradient quantization model is as follows: In the formula, represents the target quantization level of the mth local client in the kth round, where Indicates the quantization level; b0 indicates the initial quantization level corresponding to each local client; Represents the adaptive process, which is obtained by adaptive training of the model. represents the quantized gradient corresponding to the mth local client in the first round, represents the quantized gradient corresponding to the mth local client in the kth round, represents the quantized gradient actually uploaded by the mth local client in round 0; represents the quantized gradient actually uploaded by the m-th local client in the k-1th round; m represents the m-th local client; The lazy gradient aggregation processing unit is used to determine whether to obtain the quantization gradient corresponding to the local client in the current round based on a preset lazy gradient aggregation model; wherein the quantization gradient is obtained by quantizing the gradient uploaded in the current round by the local client based on the target quantization level; the formula (2) corresponding to the lazy gradient aggregation model is as follows: In the formula, Indicates that the mth local client uses the target quantization level in the kth round Dequantize a gradient A quantized gradient is obtained; Indicates the quantized gradient actually used by the mth local client in the k-1th round To quantize a ladder represents the gradient range threshold, θ is the parameter of the global model; D represents the total number of rounds; Represents the difference between the true gradient and the quantized gradient; Represents the difference between the quantized gradient and the original gradient; ξ d and α are two hyperparameters, where ξ d is the penalty term for quantizing the gradient; The quantized gradient aggregation processing unit is used to perform aggregation processing on the quantized gradient and update the initial global model according to the aggregation result to obtain the target global model corresponding to the next round.

6. An optimization processing device for federated learning communication overhead, characterized in that: include: A global model acquisition unit, used to acquire an initial global model distributed by a central server; The quantization level adaptive processing unit is used to determine the target quantization level of the current round based on a preset adaptive gradient quantization model, and quantize the gradient to be uploaded in the current round based on the target quantization level to obtain the quantization gradient corresponding to the current round; the formula (1) corresponding to the adaptive gradient quantization model is as follows: In the formula, represents the target quantization level of the mth local client in the kth round, where Indicates the quantization level; b0 represents the initial quantization level corresponding to each local client; Represents the adaptive process, which is obtained by adaptive training of the model. represents the quantized gradient corresponding to the mth local client in the first round, represents the quantized gradient corresponding to the mth local client in the kth round, represents the quantized gradient actually uploaded by the mth local client in round 0; represents the quantized gradient actually uploaded by the m-th local client in the k-1th round; m represents the m-th local client; A quantization gradient uploading unit, used to upload the quantization gradient corresponding to the current round to a central server, so as to implement aggregation processing of the quantization gradient by using a preset lazy gradient aggregation model in the central server; The formula (2) corresponding to the inert gradient polymerization model is as follows: In the formula, Indicates that the mth local client uses the target quantization level in the kth round Dequantize a gradient A quantized gradient is obtained; Indicates the quantized gradient actually used by the mth local client in the k-1th round To quantize a ladder represents the gradient range threshold, θ is the parameter of the global model; D represents the total number of rounds; Represents the difference between the true gradient and the quantized gradient; Represents the difference between the quantized gradient and the original gradient; ξ d and α are two hyperparameters, where ξ d is the penalty term for quantizing the gradient.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the processor implements the steps of the method for optimizing the communication overhead of federated learning as described in any one of claims 1 to 4.

8. A processor-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for optimizing the communication overhead of federated learning as described in any one of claims 1 to 4 are implemented.