Communication method, device and system based on model training
By judging the stability of model parameters and stopping transmission when stable, the problem of long delay in model parameters transmission in federated learning systems is solved, the communication efficiency is improved and the accuracy of model training is maintained.
Patent Information
- Application Number
- CN202510220399.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-23
- Publication Date
- 2025-06-03
AI Technical Summary
In the federated learning system, due to the large amount of data of model parameters, the transmission delay of model parameters between the communication device and the central server is long, affecting the efficiency of model training.
By determining the change amount of model parameters, the stability is judged. If it is stable, the update amount of the parameter is stopped to the central server within the preset period to reduce the amount of data transmitted.
Without losing model training accuracy, the amount of data transmission between the communication device and the central server is reduced, and the communication efficiency is improved.
Smart Images

Figure CN120090973A_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202010077048.8, and the application date of the original application is January 23, 2020. The entire content of the original application is incorporated herein by reference. Technical Field
[0002] This application relates to the field of communication technologies, and in particular, to a communication method, apparatus, and system based on model training. Background Art
[0003] A federated learning (FL) system is an emerging basic artificial intelligence technology. Its main idea is that a central server and multiple communication devices cooperate to build a machine learning model based on data sets on multiple communication devices. During the process of building the machine learning model, there is no need for data sharing between communication devices, preventing data leakage.
[0004] In the federated learning system, the central server sends the values of each parameter of the machine learning model to each communication device. Each communication device, as a cooperation unit, trains the model locally, updates the values of each parameter of the machine learning model, and sends the gradient of the value of each parameter to the central server. The central server generates new model parameter values according to the gradients of the values of each parameter. Repeat the above steps until the machine learning model converges, completing the entire model training process.
[0005] As the machine learning model becomes larger and larger, the amount of data of the model parameters that needs to be transmitted between the communication device and the central server is also increasing. Limited by problems such as the connection speed and bandwidth of the Internet, the delay of model parameter transmission between the communication device and the central server is long, and the update rate of the model parameter values is slow. Summary of the Invention
[0006] The communication method, apparatus, and system based on model training provided by this application can effectively reduce the amount of data transmitted between the communication device and the server, and improve the communication efficiency on the premise of ensuring that the model training accuracy is not lost.
[0007] To achieve the above object, this application adopts the following technical solutions:
[0008] In a first aspect, the present application provides a communication method based on model training, which is applied to a system including a central server and communication devices. The method may include: The communication device determines the change amount of the value of the first model parameter. If the communication device determines that the first model parameter is stable according to the change amount of the value of the first model parameter, the communication device stops sending the update amount of the value of the first model parameter to the central server within a preset period. Wherein, the update amount of the value of the first model parameter is determined by the communication device according to user data during the model training process. The communication device receives the value of the second model parameter sent by the central server. Wherein, within the preset period, the value of the second model parameter does not include the value of the first model parameter.
[0009] Wherein, the first model parameter is a model parameter participating in determining stability, and the number thereof is not limited, and it can be any one or more model parameters. If it is determined that the first model parameter is stable, then the first model parameter is a model parameter that does not participate in transmitting the update amount and value within the preset period. The second model parameter is a model parameter participating in the transmission of the update amount and value between the central server and the communication device. The number of the second model parameters is also not limited, and it can be one or more. Optionally, all the first model parameters and all the second model parameters constitute all the model parameters.
[0010] Wherein, the change amount of the value of the first model parameter is used to determine whether the first model parameter is stable. If the first model parameter is stable, it means that the first model parameter has converged. In the subsequent communication process, the change amount of its value is mainly small-amplitude oscillatory change, which is of little significance to model training. Therefore, a preset period can be set, and within the preset period, the update amount of the value of the stable first model parameter is stopped from being transmitted. It can be understood that if the communication device does not send the update amount of the value of the first model parameter to the central server within the preset period, then the central server will not generate and send the updated value of the first model parameter to the communication device within the preset period, thereby reducing the data volume in both directions between the communication device and the central server.
[0011] Wherein, after the communication device receives the updated value of the model parameter sent by the central server, it can construct an updated local training model and train the model using local user data. During the training process, the value of the model parameter will be adjusted based on the user data, and thus the update amount of the value of the model parameter, that is, the gradient of the value of the model parameter, is obtained.
[0012] In this way, after the communication device determines that the model parameter is stable according to the change amount of the value of the model parameter, it can stop transmitting the update amount of the value of the model parameter within the preset period, which can effectively reduce the data volume of the model parameter transmission between the communication device and the server, and improve the communication efficiency on the premise of ensuring that the model training accuracy is not lost.
[0013] In a possible implementation, the method further includes: after a preset time period, the communication device sends an update amount of the first model parameter value to the central server and receives the first model parameter value sent by the central server.
[0014] That is to say, after the preset time period, the first model parameter that stops being transmitted automatically starts to participate in the transmission. That is, the communication device can adaptively adjust the amount of data transmitted between the communication device and the central server according to the change amount of the model parameter value.
[0015] In a possible implementation, the communication device and the central server transmit the model parameter value and the update amount of the value through a message.
[0016] In a design of the message, the communication device stops sending the update amount of the first model parameter value to the central server within a preset time period, including: the communication device sends a message to the central server, and the message includes the update amount of the third model parameter value and the value of the corresponding identification bit; the update amount of the third model parameter value includes the update amount of the second model parameter value and the update amount of the first model parameter value. Among them, within the preset time period, the value of the identification bit corresponding to the update amount of the first model parameter value is used to indicate that the communication device does not transmit the update amount of the first model parameter value to the central server.
[0017] Among them, the identification bits included in the message can include, for example, bit mapping, and each bit corresponds to the data of a model parameter. The value of the identification bit can be set to 0 / 1 for distinction, etc.
[0018] In this way, after receiving the message sent by the communication device, the central server can determine whether to transmit the update amount of the model parameter value corresponding to the identification bit according to the value of the update amount of the model parameter value carried in the message corresponding to each identification bit, and then can quickly read the update amount of the value of the transmitted model parameter. It can also quickly determine the update amount of the value of the first model parameter that has stopped being transmitted, and the updated value of the first model parameter is not included in the data returned to the communication device.
[0019] In another design of the message, the communication device sends a message to the central server, and the message includes the update amount of the second model parameter value and the value of the corresponding identification bit. Among them, within the preset time period, the update amount of the second model parameter value does not include the update amount of the first model parameter value, and the value of the identification bit corresponding to the second model parameter is used to indicate that the communication device transmits the update amount of the second model parameter value to the central server.
[0020] In this way, the message only contains the update amount of the second model parameter value and its corresponding flag bit. Thus, the central server can directly determine the update amount of the second model parameter value transmitted according to the received message, and then directly return the updated value of the second model parameter. This can further reduce the amount of data transmitted and speed up the model training process.
[0021] In other possible designs, the message directly does not contain the update amount of the first model parameter value. The transmission order of the update amount of the third model parameter value in the message to be transmitted is preset between the communication device and the central server. After that, when the communication device determines that the first model parameter is stable, that is, the message transmitted to the central server directly does not contain the update amount of the first model parameter value, the central server can also determine which update amounts of the first model parameter values have stopped being transmitted according to the vacant bit positions, and can also know which second model parameter values the transmitted data corresponds to.
[0022] In a possible implementation manner, the communication device determines the change amount of the first model parameter value, including: the communication device obtains the change amount of the first model parameter value according to the historical information of the first model parameter value. For example, obtaining the historical value of the first model parameter or the change amount of the historical value, and then the change amount of the first model parameter value this time can be calculated in combination with the first model parameter value this time.
[0023] In a possible implementation manner, the historical information of the value includes: the effective change amount of the first model parameter value and the cumulative change amount of the first model parameter value.
[0024] Among them, the effective change amount and the cumulative change amount of the first model parameter value this time can be obtained according to all the effective change amounts and cumulative change amounts of the first model parameter values obtained. Or, it can be obtained according to the effective change amounts and cumulative change amounts of the first model parameter values obtained from the recent several detections. Or, it can be obtained according to the effective change amount and cumulative change amount of the first model parameter value obtained from the previous detection. After that, the change amount of the first model parameter value can be obtained according to the ratio of the effective change amount and the cumulative change amount of the first model parameter value.
[0025] Exemplarily, the method of exponential moving average (EMA) can be adopted. According to the effective change amount and the cumulative change amount of the first model parameter value obtained from the previous detection, as well as the first model parameter values obtained from the previous and current detections, the effective change amount and the cumulative change amount of the first model parameter value this time are obtained, and then the change amount of the first model parameter value is obtained. Moreover, by using the EMA method to obtain the change amount of the first model parameter value, only the effective change amount and the cumulative change amount of the first model parameter value obtained last time, and the first model parameter value obtained last time need to be saved, which can effectively reduce the occupied storage space.
[0026] In a possible implementation manner, the communication device determines that the first model parameter is stable according to the change amount of the first model parameter value, including: if the change amount of the first model parameter value is less than a preset threshold, it is determined that the first model parameter is stable.
[0027] Exemplarily, the preset threshold can be determined according to experimental data, expert experience values, etc. If the change amount of the first model parameter value is less than the preset threshold, it indicates that the current first model parameter has converged and stabilized, and continuing to transmit will not contribute much to the training of the model. Therefore, the update amount of the first model parameter value can be stopped from being transmitted.
[0028] In a possible implementation manner, the communication device determines the change amount of the first model parameter value, including: the communication device determines the change amount of the first model parameter value M times; where M is a positive integer greater than or equal to 2. The preset conditions satisfied by the preset period determined by the communication device according to the stable state of the first model parameter at the kth time include: if it is determined that the first model parameter is stable according to the change amount of the first model parameter value at the kth time, the duration of the preset period is the first duration, and the first duration is greater than the second duration. Where the second duration is the duration of the preset period when it is determined that the first model parameter is stable at the (k - 1)th time and the update amount of the first model parameter value is stopped from being sent to the central server; or the second duration is the duration obtained when it is determined that the first model parameter is not stable at the (k - 1)th time and is used to adjust the duration of the preset period corresponding to the next time when the first model parameter is stable; where k is a positive integer and k ≤ M.
[0029] In a possible implementation, the preset condition further includes: if it is determined for the k-th time that the first model parameter is not stable, the third duration obtained for adjusting the preset duration corresponding to the next time when the first model parameter is stable is less than the fourth duration; where the fourth duration is the duration of the preset period when it was determined for the (k - 1)-th time that the first model parameter was stable and the update amount of the first model parameter value was stopped being sent to the central server, or the fourth duration is the duration obtained for adjusting the preset duration corresponding to the next time when the first model parameter is stable when it was determined for the (k - 1)-th time that the first model parameter was not stable.
[0030] That is to say, during the process of transmitting the update amount or value of the model parameter between the communication device and the central server, after each detection and determination of the change amount of the first model parameter value, a duration is obtained. If it is determined this time that the first model parameter is stable, indicating that the first model parameter converges and the duration for stopping the transmission of the first model parameter needs to be increased, the obtained duration is the duration of the preset period, and this duration is greater than the duration obtained from the previous detection. If it is determined this time that the first model parameter is not stable, indicating that the first model parameter has not converged and the duration for stopping the next transmission of the first model parameter needs to be decreased, the obtained duration is the duration for adjusting the duration obtained from the next detection, and this duration is less than the duration obtained from the previous detection.
[0031] In this way, the preset duration for stopping the transmission can be dynamically adjusted according to the stable state of the first model parameter, and the number of model parameters for training the parameter model transmitted between the communication device and the central server can be flexibly controlled, thereby ensuring that the accuracy of the finally obtained model meets the requirements.
[0032] In a possible implementation, if the communication device determines that the first model parameter is stable based on the change amount of the first model parameter value, the communication device stops sending the update amount of the first model parameter value to the central server within a preset period, including: if the communication device determines that the first model parameter is stable based on the change amount of the first model parameter value for the kth time, it stops sending the update amount of the first model parameter value to the central server within n transmission cycles; where n is a positive integer. After n transmission cycles, if the communication device determines that the first model parameter is stable based on the change amount of the first model parameter value for the (k + 1)th time, it stops sending the update amount of the first model parameter value to the central server within (n + m) transmission cycles; where m is a positive integer. After n transmission cycles, if the communication device determines that the first model parameter is not stable based on the change amount of the first model parameter value for the (k + 1)th time, then if the communication device determines that the first model parameter is stable based on the change amount for the (k + 2)th time, it stops sending the update amount of the first model parameter value to the central server within (n / r + m) transmission cycles; where r is a positive integer greater than or equal to 2, and (n / r) ≥ 1. Here, the transmission cycle is the cycle for the communication device to send the update amount of the model parameter value to the central server.
[0033] That is to say, the duration of the preset period for stopping the transmission of the update amount of the first model parameter value can be adjusted based on the duration of the transmission cycle. After determining that the first model parameter is stable, an integer number of transmission cycle durations is added to the duration obtained last time to get the preset period for this stop of transmission. After determining that the first model parameter is unstable, the duration obtained last time is proportionally reduced to get the duration for this time.
[0034] For example, assume that for the 5th (the kth) detection, the preset period duration obtained when the first model parameter is stable is 2 transmission cycle durations.
[0035] If for the 6th (the k + 1)th) detection after reaching the preset period, the first model parameter is stable, then the duration of the preset period can be 2 + 1 = 3 transmission cycle durations.
[0036] If for the 6th (the k + 1)th) detection after reaching the preset period, the first model parameter is unstable, then the obtained duration can be 2 / 2 = 1 transmission cycle duration. If for the 7th (the k + 2)th) detection, the first model parameter is stable, then the obtained preset period duration can be 2 / 2 + 1 = 2 transmission cycle durations.
[0037] In a possible implementation, the method further includes: the communication device determines the change amount of the first model parameter value according to the detection cycle; the transmission cycle is less than the detection cycle.
[0038] Since it makes sense to judge the stable state of the first model parameter value only after the communication device sends the update amount of the first model parameter value and obtains the updated first model parameter value, the sending period should be less than the detection period.
[0039] In a possible implementation, the method further includes: if the communication device determines that the ratio of the number of stable first model parameters to the number of third model parameters is greater than a preset ratio, then reduce the value of the preset threshold.
[0040] That is to say, after the number of model parameters that stop transmission reaches a certain ratio, it is necessary to lower the determination threshold for whether the model parameters are stable, thereby reducing the number of model parameters that stop transmission, and ensuring the number of model parameters with updated values among the model parameters participating in model training.
[0041] In this way, the preset threshold is dynamically adjusted to avoid too many model parameters stopping transmission, which may prolong the model training process or affect the final accuracy of the model. For example, when a large number of model parameters stop transmission, only the unchanged values of each stopped-transmission model parameter can be used to train the model within a preset period, and the training effect may not be ideal. Only after the duration of the preset period of each stopped-transmission model parameter reaches can the updated values of these model parameters be obtained and the model training continue, resulting in too long a training time for the model to reach the model convergence condition.
[0042] In a possible implementation, before the communication device determines the change amount of the first model parameter value, the method further includes: the communication device receives the second model parameter value sent by the central server. For example, the sending period is 5s and the detection period is 10s. Then the communication device sends the update amount of the first model parameter value to the central server every 5s, and similarly, the central server sends the first model parameter value to the communication device every 5s. And the communication device confirms the change amount of the first model parameter value every 10s, and determines whether the first model parameter is stable based on the change amount.
[0043] In a second aspect, the present application provides a communication method based on model training, which is applied to a system including a central server and a communication device. The method includes: the central server receives the update amount of the second model parameter value sent by the communication device; within a preset period, the update amount of the second model parameter value does not include the update amount of the first model parameter value. Wherein, the first model parameter is a model parameter determined to be stable according to the change amount of the first model parameter value. The central server determines the updated value of the second model parameter according to the update amount of the second model parameter value. The central server sends the updated value of the second model parameter to the communication device. Within a preset period, the updated value of the second model parameter does not include the updated value of the first model parameter.
[0044] Among them, the update amount of the first model parameter value and the update amount of the second model parameter are determined by the communication device according to user data during the model training process. That is, the communication device determines the update amount of the model parameter value according to user data during the model training process. Moreover, the communication device determines the update amount of the model parameter value that needs to stop being transmitted to the central server according to the stable state of the model parameter.
[0045] That is to say, the central server determines whether the communication device has stopped transmitting some model parameters according to the received update amount of the model parameter value. If some model parameters have been stopped being transmitted, the central server also stops transmitting the model parameters that this communication device has stopped transmitting within a preset time period. Thus, the data volume transmitted in both directions is reduced, and the communication efficiency is improved.
[0046] In a possible implementation manner, the method further includes: after the preset time period, the central server sends the first model parameter value to the communication device and receives the update amount of the first model parameter value sent by the communication device.
[0047] After the preset time period, the communication device automatically starts to send the update amount of the model parameter value to the central server. Then, the central server determines the value of the model parameter after the update according to the update amount of the model parameter value. Thus, after the preset time period, the central server transmits the value of the model parameter after the update that was stopped being transmitted before to the communication device. In this way, the two-way adaptive adjustment of the communication data volume between the central server and the communication device is realized.
[0048] In a possible implementation manner, the central server sends the value of the second model parameter after the update to the communication device; within the preset time period, the value of the second model parameter after the update does not include the value of the first model parameter after the update, including: the central server sends a message to the communication device, and the message includes the value of the third model parameter after the update and the value of the corresponding identification bit; the value of the third model parameter after the update includes the value of the second model parameter after the update and the value of the first model parameter after the update. Among them, within the preset time period, the value of the identification bit corresponding to the value of the first model parameter after the update is used to indicate that the central server has not transmitted the value of the first model parameter after the update to the communication device. Or, the central server sends a message to the communication device, and the message includes the value of the second model parameter after the update and the value of the corresponding identification bit. Among them, within the preset time period, the value of the second model parameter after the update does not include the value of the first model parameter after the update, and the value of the identification bit corresponding to the value of the second model parameter after the update is used to indicate that the central server transmits the value of the second model parameter after the update to the communication device.
[0049] In a possible implementation, the first model parameter is a model parameter determined to be stable based on the change amount of the value of the first model parameter, including: if the change amount of the value of the first model parameter is less than a preset threshold, it is determined that the first model parameter is stable.
[0050] In a possible implementation, before the central server receives the update amount of the value of the second model parameter sent by the communication device, the method further includes: the central server sends the value of the second model parameter to the communication device.
[0051] That is to say, the process of model parameter transmission between the central server and the communication device is a cyclic interaction process. After the central server sends the value of the model parameter to the communication device, the communication device can obtain the update amount of the value of the model parameter based on the value of the model parameter, and then the central server can obtain the update amount of the value of the model parameter.
[0052] In a third aspect, the present application provides a communication device based on model training. The device includes: a processing unit, a sending unit, and a receiving unit. The processing unit is configured to determine the change amount of the value of the first model parameter. The processing unit is further configured to determine whether the first model parameter is stable according to the change amount of the value of the first model parameter. The sending unit is configured to send the update amount of the value of the first model parameter to the central server; if the processing unit determines that the first model parameter is stable according to the change amount of the value of the first model parameter, the sending unit stops sending the update amount of the value of the first model parameter to the central server within a preset period. Wherein, the update amount of the value of the first model parameter is determined by the processing unit according to user data during the process of model training. The receiving unit is configured to receive the value of the second model parameter sent by the central server; wherein, within the preset period, the value of the second model parameter does not include the value of the first model parameter.
[0053] In a possible implementation, the sending unit is further configured to send the update amount of the value of the first model parameter to the central server after the preset period. The receiving unit is further configured to receive the value of the first model parameter sent by the central server after the preset period.
[0054] In a possible implementation, the sending unit is specifically configured to: send a message to the central server, where the message includes the update amount of the third model parameter value and the value of the corresponding flag bit; the update amount of the third model parameter value includes the update amount of the second model parameter value and the update amount of the first model parameter value. Among them, within a preset time period, the value of the flag bit corresponding to the update amount of the first model parameter value is used to indicate that the sending unit has not transmitted the update amount of the first model parameter value to the central server. Alternatively, send a message to the central server, where the message includes the update amount of the second model parameter value and the value of the corresponding flag bit. Among them, within a preset time period, the update amount of the second model parameter value does not include the update amount of the first model parameter value, and the value of the flag bit corresponding to the update amount of the second model parameter value is used to indicate that the sending unit has transmitted the update amount of the second model parameter value to the central server.
[0055] In a possible implementation, the processing unit is specifically configured to: obtain the change amount of the first model parameter value according to the historical information of the first model parameter value.
[0056] In a possible implementation, the historical information of the value includes: the effective change amount of the first model parameter value and the cumulative change amount of the first model parameter value.
[0057] In a possible implementation, the processing unit is specifically configured to: determine whether the first model parameter is stable according to the change amount of the first model parameter value. If the change amount of the first model parameter value is less than a preset threshold, it is determined that the first model parameter is stable.
[0058] In a possible implementation, the processing unit is specifically configured to: determine the change amount of the first model parameter value M times. Where M is a positive integer greater than or equal to 2. The preset conditions satisfied by the preset time period according to the stable state of the first model parameter at the k-th time include: if it is determined that the first model parameter is stable according to the change amount of the first model parameter value at the k-th time, the duration of the preset time period is the first duration, and the first duration is greater than the second duration; among them, the second duration is the duration of the preset time period when it was determined that the first model parameter was stable at the (k - 1)-th time and the update amount of the first model parameter value was no longer sent to the central server, or the second duration is the duration obtained when it was determined that the first model parameter was not stable at the (k - 1)-th time and was used to adjust the duration of the preset time period corresponding to the next time the first model parameter is stable; where k is a positive integer and k ≤ M.
[0059] In a possible implementation, the preset condition further includes: if it is determined for the kth time that the first model parameter is not stable, the obtained third duration for adjusting the preset duration corresponding to the next time when the first model parameter is stable is less than the fourth duration; where the fourth duration is the duration of the preset period when it was determined for the (k - 1)th time that the first model parameter was stable and the update amount of the first model parameter value was stopped from being sent to the central server, or the fourth duration is the duration obtained when it was determined for the (k - 1)th time that the first model parameter was not stable and was used to adjust the preset duration corresponding to the next time when the first model parameter is stable.
[0060] In a possible implementation, if the processing unit determines for the kth time that the first model parameter is stable according to the change amount of the first model parameter value, within n transmission cycles, the sending unit stops sending the update amount of the first model parameter value to the central server. Where n is a positive integer. After n transmission cycles, if the processing unit determines for the (k + 1)th time that the first model parameter is stable according to the change amount of the first model parameter value, within (n + m) transmission cycles, the sending unit stops sending the update amount of the first model parameter value to the central server. Where m is a positive integer. After n transmission cycles, if the (k + 1)th time the processing unit determines that the first model parameter is not stable according to the change amount of the first model parameter value, then if the processing unit determines for the (k + 2)th time that the first model parameter is stable according to the change amount, within (n / r + m) transmission cycles, the sending unit stops sending the update amount of the first model parameter value to the central server; where r is a positive integer greater than or equal to 2 and (n / r) ≥ 1. Where the transmission cycle is the cycle for the sending unit to send the update amount of the model parameter value to the central server.
[0061] In a possible implementation, the processing unit is further configured to: determine the change amount of the first model parameter value according to the detection cycle; the transmission cycle is less than the detection cycle.
[0062] In a possible implementation, the processing unit is further configured to: if the ratio of the number of first model parameters determined to be stable by the processing unit to the number of third model parameters is greater than the preset ratio, then reduce the value of the preset threshold.
[0063] In a possible implementation, before the processing unit determines the change amount of the first model parameter value, the receiving unit receives the second model parameter value sent by the central server.
[0064] Fourthly, the present application provides a communication device based on model training, and the device includes: a receiving unit, a processing unit, and a sending unit. The receiving unit is configured to receive an update amount of the second model parameter value sent by a communication device; within a preset time period, the update amount of the second model parameter value does not include an update amount of the first model parameter value; wherein, the first model parameter is a model parameter determined to be stable according to a change amount of the first model parameter value. The processing unit is configured to determine a value of the second model parameter after update according to the update amount of the second model parameter value. The sending unit is configured to send the value of the second model parameter after update to the communication device; within a preset time period, the value of the second model parameter after update does not include the value of the first model parameter after update.
[0065] In a possible implementation manner, the sending unit is further configured to send the value of the first model parameter to the communication device after the preset time period. The receiving unit is further configured to receive an update amount of the value of the first model parameter sent by the communication device.
[0066] In a possible implementation manner, the sending unit is specifically configured to: send a message to the communication device, where the message includes a value of the third model parameter after update and a value of a corresponding identification bit; the value of the third model parameter after update includes the value of the second model parameter after update and the value of the first model parameter after update. Wherein, within the preset time period, the value of the identification bit corresponding to the value of the first model parameter after update is used to indicate that the sending unit does not transmit the value of the first model parameter after update to the communication device. Or, send a message to the communication device, where the message includes a value of the second model parameter after update and a value of a corresponding identification bit; wherein, within the preset time period, the value of the second model parameter after update does not include the value of the first model parameter after update, and the value of the identification bit corresponding to the value of the second model parameter after update is used to indicate that the sending unit transmits the value of the second model parameter after update to the communication device.
[0067] In a possible implementation manner, the first model parameter is a model parameter determined to be stable according to a change amount of the first model parameter value, including: if the change amount of the first model parameter value is less than a preset threshold, it is determined that the first model parameter is stable.
[0068] In a possible implementation manner, before the receiving unit receives the update amount of the value of the second model parameter sent by the communication device, the sending unit sends the value of the second model parameter to the communication device.
[0069] Fifthly, the present application provides a communication device, including: one or more processors; a memory; and a computer program, where the computer program is stored in the memory, and the computer program includes instructions; when the instructions are executed by the communication device, the communication device is caused to execute the communication method based on model training as described in the first aspect and any one of the possible implementation manners thereof.
[0070] In a sixth aspect, the present application provides a communication device, including: one or more processors; a memory; and a computer program, where the computer program is stored in the memory and the computer program includes instructions; when the instructions are executed by a central server, the central server is caused to execute the communication method based on model training in the second aspect and any possible implementation manner thereof as described above.
[0071] In a seventh aspect, the present application provides a communication system, including: a central server and at least one communication device, where the at least one communication device executes the communication method based on model training in the first aspect and any possible implementation manner thereof as described above. The central server executes the communication method based on model training in the second aspect and any possible implementation manner thereof as described above.
[0072] In an eighth aspect, the present application provides a communication device, which has the function of implementing the communication method based on model training described in the first aspect to the second aspect, and any possible implementation manner thereof as described above. This function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0073] In a ninth aspect, the present application provides a computer storage medium, including computer instructions, which when running on a communication device based on model training, cause the communication device based on model training to execute the communication method based on model training described in the first aspect to the second aspect, and any possible implementation manner thereof as described above.
[0074] In a tenth aspect, the present application provides a computer program product, which when running on a communication device based on model training, causes the communication device based on model training to execute the communication method based on model training described in the first aspect to the second aspect, and any possible implementation manner thereof as described above.
[0075] In an eleventh aspect, a circuit system is provided, which includes a processing circuit configured to execute the communication method based on model training described in the first aspect to the second aspect, and any possible implementation manner thereof as described above.
[0076] In a twelfth aspect, an embodiment of the present application provides a chip system, including at least one processor and at least one interface circuit. The at least one interface circuit is used to execute a transceiver function and send instructions to the at least one processor. When the at least one processor executes the instructions, the at least one processor executes the communication method based on model training described in the first aspect to the second aspect, and any possible implementation manner thereof as described above.
[0077] Among them, for the technical effects brought by any one of the design methods in the second aspect to the twelfth aspect, reference can be made to the technical effects brought by different design methods in the first aspect, which will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] Figure 1 FIG. is a schematic diagram of an application scenario of a communication method based on model training provided by an embodiment of the present application;
[0079] Figure 2 FIG. is a schematic diagram of the hardware structure of a communication device provided by an embodiment of the present application;
[0080] Figure 3 FIG. is a flowchart of a communication method based on model training provided by an embodiment of the present application Figure 1 ;
[0081] Figure 4 FIG. is a schematic diagram of a message structure provided by an embodiment of the present application;
[0082] Figure 5 FIG. is a flowchart of a communication method based on model training provided by an embodiment of the present application Figure 2 ;
[0083] Figure 6 FIG. is a flowchart of a communication method based on model training provided by an embodiment of the present application Figure 3 ;
[0084] Figure 7 FIG. is an analysis of experimental data results provided by an embodiment of the present application Figure 1 ;
[0085] Figure 8 FIG. is an analysis of experimental data results provided by an embodiment of the present application Figure 2 ;
[0086] Figure 9 FIG. is an analysis of experimental data results provided by an embodiment of the present application Figure 3 ;
[0087] Figure 10 FIG. is a schematic diagram of the structure of a communication device based on model training provided by an embodiment of the present application Figure 1 ;
[0088] Figure 11 FIG. is a schematic diagram of the structure of a communication device based on model training provided by an embodiment of the present application Figure 2 ;
[0089] Figure 12 FIG. is a schematic diagram of the structure of a chip system provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0090] The communication method, device and system based on model training provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0091] The solutions of the embodiments of the present application are mainly applied to a distributed system for machine learning, which includes a central server and multiple communication devices. Each communication device has its own processor and memory, and each has an independent data processing function. In this distributed system for machine learning, each communication device has the same status, stores user data, and the communication devices do not share user data with each other. It can carry out efficient machine learning among multiple communication devices while ensuring information security during big data exchange, protecting terminal data and personal data privacy.
[0092] Exemplarily, as Figure 1 shown, the distributed system 100 for machine learning includes a central server 10 and at least one communication device 20, such as Figure 1 communication device 1, communication device 2, communication device 3, and communication device 4 in
[0093] The central server 10 and at least one communication device 20 can be connected through a wired network or a wireless network. The embodiments of the present application do not specifically limit the connection manner between the central server 10 and at least one communication device 20.
[0094] Among them, the communication device 20 can also be referred to as a host, a model training host, etc. The communication device 20 can be either a server or a terminal device. It can provide a relevant human-computer interaction interface to collect local user data based on model training. For example, it can include a mobile phone, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) electronic device, an augmented reality (AR) electronic device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, a vehicle-mounted terminal, an artificial intelligence (AI) terminal, etc. The specific form of the communication device in the embodiments of the present application is not particularly limited.
[0095] Local data is stored in the communication device 20. The communication device 20 can receive the neural network model parameter values sent by the central server 10 to construct a local model, and use the local data as training data to train the local model. It can be understood that the larger the amount of training data, the better the performance of the trained model. Since the amount of local data contained in a single communication device 20 is limited, the accuracy of the trained local model is limited. If the amount of data contained in the training data is increased by transmitting the model parameter values or the update amounts of the values among multiple communication devices 20, it is not conducive to protecting privacy data.
[0096] For the consideration of protecting privacy data and data security, the distributed system 100 of machine learning can optimize the local models in each communication device 20 without sharing local data among the communication devices 20. As Figure 1 shown, there is no need to share local data among the communication devices 20. Instead, the update amounts of the values of each parameter of the local model before and after training are sent to the central server 10. The central server 10 uses the update amounts of the model parameter values sent by each communication device 20 to train the model, and sends the trained model parameter values to each communication device 20. Each communication device 20 then uses the local data to train the local model constructed using the updated model parameter values. In this way, after repeating the above steps in a loop, the central server 10 can obtain a neural network model with better performance and send it to each communication device 20. Among them, the update amount can also be referred to as a gradient.
[0097] It should be noted that in some documents, the above-mentioned machine learning process is described as federated learning. Therefore, the above-mentioned distributed system for machine learning can also be described as a distributed system for federated learning. The technical solution in the embodiments of the present application can be a communication method based on model training, or can also be described as a communication method based on federated learning. That is, the federated learning process can also be described as a model training process.
[0098] The above-mentioned distributed system 100 for machine learning can be applied to the following scenarios:
[0099] Scenario 1: A scenario for improving the input performance of mobile phone input methods.
[0100] Exemplarily, the mobile phone input method can predict and display the subsequent words that may be input according to the words currently input by the user. The prediction model used needs to be trained based on user data to improve its prediction accuracy. However, some user personal data, such as sensitive data like the websites visited by the user and the user's travel locations, cannot be directly shared.
[0101] Thus, Google has launched a method for improving the mobile phone input word prediction model based on a distributed system for machine learning. First, the central server in Google will send the prediction model parameter values to multiple mobile phones, and then it can obtain the update amounts of the model parameter values obtained by each mobile phone training the prediction model based on its respective local user data. The central server obtains a unified new prediction model by averaging and superimposing the update amounts of the prediction model parameter values fed back by each mobile phone. In this way, without the need for mobile phones to share local user data, through continuous iterative updates, a prediction model with high prediction accuracy can ultimately be obtained, thereby improving the performance of the mobile phone input method.
[0102] The application scenarios of the distributed system for machine learning can include the scenario based on a large number of communication devices in Scenario 1 above, and can also include the scenario based on a limited number of communication devices, such as Scenario 2 below.
[0103] Scenario 2: A scenario for improving the medical prediction model.
[0104] Exemplarily, the training data required for establishing a prediction model for developing treatment methods and obtaining treatment prediction results in a hospital is patient data. Applying patient data for model training may have very serious consequences of actually and potentially infringing on patient privacy.
[0105] In this way, in a distributed system based on machine learning, without sharing the patient data of their respective hospitals, each hospital can use the patient data it owns to train a prediction model. The central server synthesizes the update amounts of the parameter values of all prediction models, and finally obtains a prediction model with high accuracy that comprehensively considers the patient data of all hospitals, and sends the final model parameter values to each hospital, thereby improving the medical prediction models of each hospital.
[0106] Figure 2 The following shows a schematic diagram of the hardware structure of the communication device 20 provided by an embodiment of the present application. The communication device 20 includes a bus 110, a processor 120, a memory 130, a user input module 140, a display module 150, a communication interface 160, and other similar and / or appropriate components.
[0107] The bus 110 can be a circuit that connects the above-mentioned elements to each other and transmits communication between the above-mentioned elements.
[0108] The processor 120 can receive commands from the above-mentioned other elements (such as the memory 130, the user input module 140, the display module 150, the communication interface 160, etc.) through the bus 110, can interpret the received commands, and can perform calculations or data processing according to the interpreted commands.
[0109] The processor 120 can be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the solution of the present application.
[0110] In some embodiments, the processor 120 is used to establish a local model according to the model parameter values sent by the central server 10 received, and use local user data to train the local model to obtain an update amount of the model parameter values.
[0111] The memory 130 can store commands or data received from the processor 120 or other elements (such as the user input module 140, the display module 150, the communication interface 160, etc.) or commands or data generated by the processor 120 or other elements.
[0112] The memory 130 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or it can also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 130 can exist independently and be connected to the processor 120 through the bus 110. The memory 130 can also be integrated with the processor 120.
[0113] Among them, the memory 130 is used to store computer-executable instructions for implementing the solution of this application, and is controlled and executed by the processor 120. The processor 120 is used to execute the computer-executable instructions stored in the memory 130, so as to implement the communication method based on model training provided in the following embodiments of this application.
[0114] Optionally, the computer-executable instructions in the embodiments of this application can also be referred to as application code, instructions, computer programs or other names, and the embodiments of this application do not make specific limitations thereto.
[0115] In some embodiments, the memory 130 stores user data input by the communication device 20 through the user input module 140 in a human-computer interaction manner, or user data obtained by the communication device 20 through other means. The processor 120 can perform model training by calling the user data stored in the memory 130. Further, the processor 120 can also obtain user data online for model training, and the embodiments of this application do not make specific limitations thereto.
[0116] The user input module 140 can receive data or commands input by the user via input-output means (such as sensors, keyboards, touchscreens, etc.), and can transmit the received data or commands to the processor 120 or the memory 130 through the bus 110.
[0117] The display module 150 can display various information (such as multimedia data, text data) received from the above elements.
[0118] The communication interface 160 may control the communication between the communication device 20 and the central server 10. When the communication device 20 is paired and connected to the central server 10, the communication interface 160 may receive the model parameter values sent by the central server 10, send the update amount of the model parameter values to the central server, and may also control the sending period of the update amount of the model parameter values. Among them, the sending period of the update amount of the model parameter values may also be controlled by the processor 120 to cause the communication interface 160 to execute.
[0119] According to the embodiments disclosed in the present application, the communication interface 160 may communicate with the central server 10 directly or through the network 161. For example, the communication interface 160 may operate to connect the communication device 20 to the network 161.
[0120] It should be understood that the hardware structure of the illustrated communication device 20 is only an example, and the communication device 20 may have more or fewer components than those Figure 2 shown, may combine two or more components, or may have a different component configuration.
[0121] Currently, for the communication method of model training in a machine learning-based distributed system, generally, the central server sends all model parameter values to the communication device, the communication device obtains the update amount of all model parameter values according to the model parameter values, and sends all the update amounts of the model parameter values back to the central server. During the data transmission process, the amount of data transmitted between the central server and the communication device is large. However, in fact, in the early stage before the model converges, some model parameters have converged and stabilized, and the subsequent changes in the model parameter values are only small-amplitude oscillating changes, which are of little significance to model training.
[0122] In view of this, the embodiments of the present application provide a communication method based on model training, which can confirm whether the model parameters are stable based on the change amount of the transmitted model parameter values, and then confirm whether to stop transmitting the update amount of the corresponding model parameter values. In this way, without sacrificing the model training accuracy, the amount of transmitted data can be reduced and the communication efficiency can be improved.
[0123] As Figure 3 shown, the flowchart of a communication method based on model training provided by an embodiment of the present application is shown, and the method may include S101 - S103:
[0124] S101. The communication device determines the change amount of the first model parameter value.
[0125] Among them, the first model parameter can be at least one of the model parameters sent by the central server received by the communication device, that is, it can determine the change amount of all received model parameter values, or only determine the change amount of some model parameter values among all received model parameter values. For example, the communication device receives 100 model parameter values, and 2 of these 100 model parameter values have a greater impact on the model training process. Therefore, during the model training process, it is necessary to ensure continuous update of these 2 model parameter values. Therefore, the number of the first model parameter values is 98. After the communication device receives 100 model parameter values sent by the central server, the communication device will determine the change amount of 98 first model parameter values except the above 2 model parameter values.
[0126] Exemplarily, as can be seen from the above description, in a distributed system of machine learning, the communication device will receive the first model parameter values sent by the central server, and the communication device can obtain the change amount of the first model parameter values according to the historical information of the received first model parameter values.
[0127] Among them, the historical information can include the effective change amount of the first model parameter values and the cumulative change amount of the first model parameter values.
[0128] In some embodiments, the method of exponential moving average (EMA) is adopted to obtain the change amount of the first model parameter values according to the effective change amount of the first model parameter values and the cumulative change amount of the first model parameter values.
[0129] For example, the communication device obtains the change amount P of the first model parameter values according to the ratio of the effective change amount E k of the first model parameter values obtained at the k-th time and the cumulative change amount of the first model parameter values; among them, the change amount effective change amount E k and the cumulative change amount of the first model parameter values have an initial value of 0.
[0130] Among them, if k = 1, then the change amount P of the first model parameter values = 1.
[0131] Among them, if k is a positive integer greater than or equal to 2, the effective change amount E k = αE k-1 +(1 - α)Δk, the cumulative change amount Among them, α is a weight parameter used to represent the attenuation degree of the weight, 0 < α < 1; E k-1 is the effective change amount of the first model parameter values at the (k - 1)-th time; is the cumulative change in the value of the first model parameter at the (k - 1)-th time; Δk is the difference between the value of the first model parameter obtained at the k-th time and the value of the first model parameter obtained at the (k - 1)-th time. Among them, α is a variable that decreases exponentially according to the number of calculations. The specific obtaining method can refer to the prior art, and this application embodiment will not elaborate on it here.
[0132] Exemplarily, if k = 2, that is, currently it is the second time the communication device obtains the value of the first model parameter. Assume that the value of the first model parameter at the first time is -4, the value of the first model parameter at the second time is 6, and α = 0.5. Then the effective change amount E of the value of the first model parameter at the second time 2 = αE 1 +(1 - α)Δk = α(1 - α)Δk 1 +(1 - α)Δk 2 = 0.5*(1 - 0.5)*(-4)+(1 - 0.5)*(6 - (-4)) = 4, the cumulative change amount of the value of the first model parameter Furthermore, the change amount of the value of the first model parameter is obtained
[0133] In this way, in the memory of the communication device, only the value of the first model parameter received last time, the effective change amount and the cumulative change amount of the value of the first model parameter determined last time need to be stored. Then, according to the value of the first model parameter received this time, the effective change amount and the cumulative change amount of the value of the first model parameter this time can be determined, and further the change amount of the value of the first model parameter can be determined. Using a relatively low storage space, the change amount of the value of the first model parameter can be determined.
[0134] In some other embodiments, the communication device can determine the change amount of the value of the first model parameter this time based on the change amounts of the value of the first model parameter in each of the recent several detections.
[0135] For example, the change amounts of the value of the first model parameter obtained by the communication device in the recent a times are respectively k 1 , k 2 , k 3 …k a ; then the effective change amount of the value of the first model parameter is The cumulative change amount of the value of the first model parameter is Thus, the change amount of the value of the first model parameter Among them, b is a natural number and is an intermediate data for calculation. For example, when a = 3, for the 6th detection, the effective change amount of the value of the first model parameter is Among them, k 0 represents the difference between the value of the first model parameter obtained in the 6th detection and the value of the first model parameter obtained in the 5th detection.
[0136] It can be understood that when the amount of data stored in the communication device is insufficient, all the stored data can be used to determine the change amount of the first model parameter value. Exemplarily, assuming a = 10, the communication device needs to store the change amounts of the first model parameter values for the most recent 10 times. When the number of stored change amounts of the first model parameter values is insufficient, all the stored change amounts of the first model parameter values are used to obtain the change amount of the first model parameter value this time. For example, in the 6th detection, only the data of the previous 5 times are retained in the memory, which is less than 10 times. Then, these 5 times of data are used to obtain the change amount of the first model parameter value this time.
[0137] S102. If the communication device determines that the first model parameter is stable according to the change amount of the first model parameter value, the communication device stops sending the update amount of the first model parameter value to the central server within a preset time period.
[0138] Among them, the communication device is used to perform model training based on user data, and determines the update amount of the model parameter value during the model training process. This update amount can also be called a gradient. After the communication device receives the updated model parameter value sent by the central server, it will construct a model and use the local user data to train the model. During the training process, the model parameter value will be adjusted based on the user data, and then the update amount of the model parameter value is obtained and sent to the central server according to the sending period. Among them, the sending period can be determined based on the bandwidth of the communication device. The specific determination method can refer to the prior art, and the embodiments of the present application do not make specific limitations on this.
[0139] Exemplarily, a detection period can be set. The communication device obtains the change amount of the first model parameter value according to the detection period, that is, periodically determines whether the first model parameter is stable according to the detection period. It can be understood that the communication device will also send the update amount of the first model parameter value to the central server according to the preset sending period. Moreover, the change amount of the first model parameter value will only be generated after sending and receiving data. Therefore, the sending period is less than the detection period. For example: the sending period is 5s, and the detection period is 10s. Then the communication device sends the update amount of the first model parameter value to the central server every 5s. Similarly, the central server sends the first model parameter value to the communication device every 5s. And the communication device confirms the change amount of the first model parameter value every 10s and determines whether the first model parameter is stable based on the change amount.
[0140] In this way, through the above-mentioned step S101, the change amount of the value of the first model parameter can be determined periodically, and then whether the first model parameter is stable can be determined according to the change amount of the value of the first model parameter. Exemplarily, a preset threshold can be set according to experimental data or historical experience values, etc. If the change amount of the value of the first model parameter obtained by the method in the above-mentioned step S101 is less than the preset threshold, it is determined that the first model parameter is stable. If the first model parameter is stable, the communication device stops sending the update amount of the value of the first model parameter to the central server within the preset time period. Correspondingly, the central server also stops sending the value of the first model parameter to the communication device within the preset time period. That is to say, after the first model parameter is stable, the value of the first model parameter and the update amount of the value are not transmitted between the communication device and the central server. This process can also be understood as freezing the first model parameter after it is stable. That is to say, the first model parameter is the model parameter participating in determining whether it is stable, and the number thereof is not limited, and it can be any one or more model parameters. If it is determined that the first model parameter is stable, then the first model parameter is the model parameter that does not participate in the transmission within the preset time period. The second model parameter is the model parameter participating in the transmission of the update amount and the value between the central server and the communication device. The number of the second model parameters is also not limited, and it can be one or more. Optionally, all the first model parameters and all the second model parameters constitute all the model parameters (which can also be called the third model parameter).
[0141] In some embodiments, within the preset time period when the transmission of the first model parameter stops, the historical information of the first model parameter no longer changes. After the preset time period, the communication device sends the update amount of the value of the first model parameter to the central server and receives the value of the first model parameter sent by the central server. Then, after the preset time period is reached and the first model parameter automatically starts to participate in the transmission, it will also start to automatically record the historical information. For example, it automatically starts to record the effective change amount of the value of the first model parameter and the cumulative change amount of the value of the first model parameter.
[0142] In some embodiments, the communication device and the central server can transmit the value of the model parameter and the update amount through a message. As Figure 4 shown in (a) of, a message structure provided by an embodiment of the present application includes a message header and the data of the message itself. Among them, the message header information includes the destination address, source address, header, length / type of the message.
[0143] Among them, the source address and the destination address mentioned above are both media access control (MAC) addresses, and the specific structure of the message can refer to the prior art. In the embodiments of the present application, the header includes an identification bit corresponding to the update amount of the model parameter value.
[0144] In a possible design of the message, the message carries the update amount of the value of the third model parameter (all model parameters included in the model) and the value of the corresponding identification bit. The value of the identification bit is used to indicate whether the communication device transmits the update amount of the value of the third model parameter to the central server. Exemplarily, special characters can be set in the identification bit. For example, when the value of the identification bit is "1", it means that the communication device sends the update amount of the model parameter value corresponding to this identification bit to the central server. When the value of the identification bit is "0", it means that the communication device does not send the update amount of the model parameter value corresponding to this identification bit to the central server. In this way, the central server knows, according to the value of the identification bit in the header, that within the preset time period, the communication device does not transmit the update amount of the value of the first model parameter, but transmits the update amount of the value of the second model parameter. That is to say, the update amount of the model parameter value transmitted between the communication device and the central server is the update amount of the value of the third model parameter, and the update amount of the value of the third model parameter includes the update amount of the value of the second model parameter determined to be transmissible and the update amount of the value of the first model parameter that cannot be transmitted within the preset time period. For example, as shown in (a) of Figure 4 Figure (a) shows a possible implementation of the identification bit corresponding to the update amount of a model parameter value. Assume that the third model parameter includes five model parameters A, B, C, D, E, and F. Among them, the communication device determines that three of the first model parameters B, E, and F are stable. Then, the values of the identification bits corresponding to the update amounts of the values of the three first model parameters B, E, and F are 0. The values of the identification bits corresponding to the update amounts of the values of the three second model parameters A, C, and D are 1. This indicates that the data segment of the message transmitted this time contains the data corresponding to the model parameters A, C, and D, and does not contain the data corresponding to the model parameters B, E, and F.
[0145] In another possible design of the message, the packet header of the message contains the update amount of the value of the second model parameter and the value of the corresponding identification bit. Among them, within the preset time period, the update amount of the value of the second model parameter does not include the update amount of the value of the first model parameter, and the value of the identification bit corresponding to the update amount of the value of the second model parameter is used to indicate that the communication device transmits the update amount of the value of the second model parameter to the central server. For example, as shown in Figure 4As shown in (b) thereof, a possible implementation manner of the flag bit corresponding to the update amount of the model parameter value. The values of the flag bits corresponding to the update amounts of the three second model parameter values A, C, and D carried in the message. This value can be set to 1, indicating that the data segments of the message transmitted this time contain the data corresponding to the model parameters A, C, and D.
[0146] It can be understood that there can also be other design methods for the message header to represent the meaning of the model parameters transmitted. For example, the order of the update amounts of the third model parameter values in the message to be transmitted is preset between the communication device and the central server. After that, when the communication device determines that the first model parameter is stable, the update amount of the first model parameter value is not directly included in the message transmitted to the central server. The central server can also determine which update amounts of the first model parameter values are stopped according to the vacant bit positions, and can also know which second model parameter values the transmitted data corresponds to. For another example, when the communication device does not send the update amount of the first model parameter value to the central server, the flag bit corresponding to the update amount of the first model parameter value can be empty. In this way, the central server can know that within the preset time period, the update amounts of the model parameter values with empty flag bits are the update amounts of the first model parameter values not transmitted by the communication device according to the empty value of the flag bit of the message.
[0147] In some embodiments, every time the communication device determines that the first model parameter is stable and needs to stop transmitting the update amount of the first model parameter value, it is also necessary to determine the ratio of the number of the first model parameters to the number of the third model parameters. If the ratio of the number of the first model parameters determined to be stable to the number of the third model parameters is greater than the preset ratio, the value of the preset threshold is reduced. That is to say, after the number of the model parameters to be stopped transmitting reaches a certain ratio, it is necessary to lower the determination threshold of whether the model parameter is stable, thereby reducing the number of the model parameters to be stopped transmitting and ensuring the number of the model parameters with updated values among the model parameters participating in the model training.
[0148] In this way, the preset threshold is dynamically adjusted to avoid too many model parameters being stopped from transmitting, which may prolong the model training process or affect the final accuracy of the model. For example, when a large number of model parameters stop transmitting, only the unchanged values of each stopped transmitting model parameter can be used to train the model within the preset time period, and the training effect may not be ideal. It is only possible to obtain the updated values of these model parameters and continue to train the model after the preset time period of each stopped transmitting model parameter has elapsed, resulting in too long a training time for the model to reach the model convergence condition.
[0149] S103. The communication device receives the second model parameter value sent by the central server. Among them, within the preset time period, the second model parameter value does not include the first model parameter value.
[0150] Exemplarily, after the communication device sends the update amount of the second model parameter value to the central server, the central server will obtain the updated second model parameter value based on the update amounts of the model parameter values sent by one or more communication devices, and send the updated value of the second model parameter to the corresponding communication device. Among them, within the preset time period, the first model parameter does not participate in the transmission, so the updated value of the second model parameter does not include the updated value of the first model parameter.
[0151] In some embodiments, after the preset time period, the communication device sends the update amount of the first model parameter value to the central server and receives the first model parameter value sent by the central server.
[0152] That is to say, if the communication device does not send the update amount of the first model parameter value to the central server within the preset time period, the central server will not generate and send the updated value of the first model parameter to the communication device within this preset time period, thereby reducing the data volume in both directions between the communication device and the central server. After the preset time period, the communication device and the central server will automatically start to transmit the first model parameter value and the update amount of the value, realizing an adaptive adjustment of the transmitted data volume.
[0153] Exemplarily, if the communication device determines the change amount of the first model parameter value, it needs to first receive the first model parameter value sent by the central server before it can determine its change amount based on the first model parameter value received this time and the first model parameter value received previously. Therefore, before step S101 above, step S104 may further be included.
[0154] S104. The communication device receives the second model parameter value sent by the central server.
[0155] In some embodiments, initially, the communication device receives all the model parameter values for model training as the third model parameter values sent by the central server. During subsequent interactions, the number of the third model parameters will change according to the number of the update amounts of the model parameter values sent by the communication device to the central server. For example, it changes to the second model parameters except for the first model parameters whose transmission is stopped. That is, after the communication device sends the update amounts of the model parameter values to the central server, the central server will determine the updated values of the model parameters based on the update amounts of the model parameter values, and then send the updated values to the communication device. Subsequently, according to the detection period, after the communication device receives the second model parameter values, it will judge the stability of all or part of the model parameters among them. All or part of these model parameters are the first model parameters in step S101 above. In a distributed system of machine learning, the process of model training includes an interaction process of transmitting the update amounts or values of the model parameters between the communication device and the central server. During the interaction process, the convergence of the model is achieved and the training process is completed.
[0156] In the above steps S101 - S103, each communication device judges the stability of the first model parameter values, and then determines whether to stop transmitting the update amounts of the first model parameter values. It can be understood that the central server can also judge the stability of the first model parameter values and confirm whether to stop transmitting the first model parameter values. Moreover, a notification can be sent to the corresponding communication devices to inform the corresponding communication devices of the judgment result, so as to ensure that each communication device knows whether to stop sending the update amounts of the first model parameter values to the central server in the next sending cycle.
[0157] Thus, for the communication method of model training provided by the embodiments of the present application, if it is judged that the first model parameter values are stable, the update amounts of the first model parameter values will be stopped from being transmitted within a preset time period. It can flexibly reduce the amount of data transmitted between the communication device and the central server without sacrificing the model training accuracy, and improve the communication efficiency.
[0158] In the above step S102, the communication device sends the update amount of the model parameter value to the central server according to the sending period, and receives the model parameter value sent by the central server. The communication device detects the stability of the model parameter value according to the detection period, determines the update amount of the model parameter value that can stop transmission, and obtains a duration for each detection. If the first model parameter is stable, the obtained duration is the preset period duration for stopping transmission; if the first model parameter is unstable, the obtained duration is the duration for adjusting the duration obtained when determining whether the value of the first model parameter is stable next time. In this way, during the interactive transmission of the model parameter value and its update amount between the communication device and the central server, the model parameters that can stop transmission and the corresponding duration can be flexibly adjusted. Refer to Figure 5 the flowchart shown in, the transmission process of the model parameter value and its update amount that are cyclically interacted between the communication device and the central server can be realized through the following steps, and the obtained duration can be flexibly adjusted. The duration of the preset period for stopping the transmission of the first model parameter can be an integer multiple of the sending period or any custom duration, and the embodiments of the present application do not make specific limitations on this.
[0159] Step 1: Determine whether the first model parameter is stable.
[0160] Exemplarily, after starting the model training process, the communication device receives the third model parameter value sent by the central server. The communication device constructs a local model using the third model parameter value and trains the model using local data, and sends the update amount of the third model parameter value to the central server according to the sending period. Among them, the third model parameter value is all the model parameter values used for constructing the model. When starting the model training process for the first time, the central server sends all the model parameter values to the communication device for constructing the initial model.
[0161] After that, receive the updated third model parameter value sent by the central server, and determine whether the value of the first model parameter is stable through the methods in the above steps S101 and S102. If the first model parameter is stable, execute Step 2; if the first model parameter is unstable, continue to transmit the update amount of the first model parameter value.
[0162] Step 2: Obtain the preset period duration for stopping the transmission of the update amount of the first model parameter value as the initial duration.
[0163] Exemplarily, after determining that the first model parameter is stable, it indicates that the first model parameter has converged, and the update amount of the first model parameter value can be stopped from being transmitted within a preset time period, thereby reducing the amount of data communicated between the communication device and the central server. At this time, the preset time period duration for which the update amount of the first model parameter value needs to be stopped from being transmitted is the initial duration. The initial duration can be an integer number of transmission cycles or a custom time period, and the duration can be adjusted subsequently by increasing or decreasing the number of transmission cycles or the custom time period.
[0164] In some embodiments, after determining that the update amount of the first model parameter value needs to be stopped from being transmitted, it is also necessary to calculate the proportion of the number of first model parameters whose transmission is stopped to the number of third model parameters. If it is greater than the preset proportion, the preset threshold is decreased. Decreasing the preset threshold for determining whether the first model parameter is stable can reduce the number of model parameters whose transmission is stopped in the subsequent process of determining whether the first model parameter is stable, and ensure the accuracy of model training. Among them, the preset proportion can be custom-set according to empirical values.
[0165] Step three: When the initial duration is reached, start transmitting the update amount of the first model parameter value.
[0166] Exemplarily, after the preset time period is reached, the first model parameters whose transmission is stopped automatically participate in transmission according to the transmission cycle. During the transmission process, it is judged whether the first model parameter is stable according to the detection cycle. If the first model parameter is stable, step four is executed; if the first model parameter is not stable, step eight is executed.
[0167] Step four: Obtain that the preset time period duration for which the update amount of the first model parameter value is stopped from being transmitted is greater than the initial duration.
[0168] Exemplarily, after confirming that the first model parameter is stable, it is necessary to obtain the preset time period duration for which the update amount of the first model parameter value is stopped from being transmitted, and stop the transmission within the preset time period. Since the duration obtained during the previous judgment of this first model parameter is the initial duration, the duration of the preset time period obtained by this judgment of stability should be greater than the initial duration obtained last time. For example, for model parameter 1, the initial duration obtained in the previous detection cycle is 1 transmission cycle. Then, after stopping the transmission for 1 transmission cycle, model parameter 1 automatically participates in transmission. The transmission cycle is less than the detection cycle. Therefore, after model parameter 1 participates in transmission for a period of time, it will be detected again. If it is determined that model parameter 1 is stable this time, a preset time period duration greater than 1 transmission cycle can be obtained, such as 2 transmission cycles.
[0169] In some embodiments, similar to step two above, it is necessary to calculate the proportion of the number of first model parameters whose transmission is stopped to the number of third model parameters. If it is greater than the preset proportion, the preset threshold is decreased.
[0170] Step 5: When the duration of the preset time period is reached, start transmitting the update amount of the first model parameter value.
[0171] Exemplarily, after the duration of the preset time period is reached, the first model parameter that stops being transmitted automatically starts to participate in the transmission and continues to participate in judging its stability. If the first model parameter is stable, execute Step 6; if the first model parameter is unstable, execute Step 7.
[0172] Step 6: Obtain that the duration of the preset time period for stopping the transmission of the update amount of the first model parameter value is greater than the duration obtained last time.
[0173] Exemplarily, since the first model parameter is stable this time, it is necessary to obtain the duration of the preset time period for stopping the transmission of the update amount of the first model parameter value and stop the transmission within the preset time period. Among them, the duration of the preset time period for stopping the transmission should be greater than the duration obtained from the last detection.
[0174] In some embodiments, similar to Step 2 above, it is necessary to calculate the proportion of the number of the first model parameters that stop being transmitted to the number of the third model parameters. If it is greater than the preset proportion, the preset threshold is reduced.
[0175] After completing Step 6, return to Step 5, that is, after automatically starting the transmission when the preset time period is reached, continue to judge whether the value of the first model parameter is stable. That is, the entire model training process is a cyclic interaction process of the model parameter values and the update amounts of the values between the communication device and the central server. During the model training process, it is necessary to repeatedly judge the stability of the model parameters according to the detection period and obtain the corresponding duration.
[0176] That is to say, the communication device determines the change amount of the first model parameter value M times. Among them, M is a positive integer greater than or equal to 2. The preset conditions satisfied by the preset time period determined by the communication device according to the stable state of the first model parameter at the kth time include: if it is determined that the first model parameter is stable according to the change amount of the first model parameter value at the kth time, the duration of the preset time period is the first duration, and the first duration is greater than the second duration. Among them, the second duration is the duration of the preset time period for stopping sending the update amount of the first model parameter value to the central server when it is determined that the first model parameter is stable at the (k - 1)th time. Or, the second duration is the duration obtained when it is determined that the first model parameter is unstable at the (k - 1)th time and is used to adjust the duration of the preset time period corresponding to the next time when the first model parameter is stable; where k is a positive integer and k ≤ M.
[0177] Step 7: Continue to transmit the update amount of the first model parameter value and obtain a duration less than the duration obtained last time.
[0178] Exemplarily, since the first model parameter is unstable this time, it is necessary to obtain the duration for adjusting the duration obtained in the next detection, and the duration obtained this time should be less than the duration obtained in the previous detection. Among them, the value of the first model parameter obtained in the previous detection can be stable or unstable.
[0179] After completing Step 7, return to Step 5, that is, continue to determine whether the value of the first model parameter is stable in the next detection cycle.
[0180] That is to say, the communication device determines the change amount of the first model parameter value M times. Among them, M is a positive integer greater than or equal to 2. The preset conditions satisfied by the preset time period determined by the communication device according to the stable state of the first model parameter at the kth time also include: if it is determined that the first model parameter is not stable at the kth time, the third duration for adjusting the duration of the preset time period corresponding to the stability of the first model parameter next time is obtained, and the third duration is less than the fourth duration. Among them, the fourth duration is the duration of the preset time period when it is determined that the first model parameter is stable at the (k - 1)th time and the update amount of the first model parameter value is no longer sent to the central server. Or, the fourth duration is the duration for adjusting the duration of the preset time period corresponding to the stability of the first model parameter next time when it is determined that the first model parameter is not stable at the (k - 1)th time.
[0181] Step 8: Continue to transmit the update amount of the first model parameter value and obtain a duration less than the initial duration.
[0182] Exemplarily, if the first model parameter is unstable, continue to transmit, and this time a duration for adjusting the duration obtained in the next detection can be obtained, and this duration will be less than the initial duration.
[0183] That is to say, during the process of transmitting the model parameter value and the update amount of the value between the communication device and the central server, after each detection determines the change amount of the first model parameter value, a duration will be obtained. If it is determined that the first model parameter is stable this time, indicating that the first model parameter converges and it is necessary to increase the duration for stopping the transmission of the update amount of the value of this first model parameter, the obtained duration is the duration of the preset time period, and this duration is greater than the duration obtained in the previous detection. If it is determined that the first model parameter is unstable this time, indicating that the first model parameter has not converged and it is necessary to reduce the duration for stopping the transmission of the update amount of the value of this first model parameter next time, the obtained duration is the duration for adjusting the duration obtained in the next detection, and this duration is less than the duration obtained in the previous detection.
[0184] In this way, the duration of the preset time period for stopping the transmission can be dynamically adjusted according to the stable state of the first model parameter, and the number of model parameters for training the parameter model transmitted between the communication device and the central server can be flexibly controlled, thereby ensuring that the accuracy of the finally obtained model meets the requirements.
[0185] Based on the above steps 1 to 8, for example, if the preset period duration is adjusted based on the duration of the transmission period, then, if the k-th communication device determines that the first model parameter is stable according to the change amount of the first model parameter value, the update amount of the first model parameter value will not be sent to the central server within n transmission periods. Here, n is a positive integer.
[0186] After n transmission periods, if the (k + 1)-th communication device determines that the first model parameter is stable according to the change amount of the first model parameter value, the update amount of the first model parameter value will not be sent to the central server within (n + m) transmission periods. Here, m is a positive integer.
[0187] After n transmission periods, if the (k + 1)-th communication device determines that the first model parameter is not stable according to the change amount of the first model parameter value, then, if the (k + 2)-th communication device determines that the first model parameter is stable according to the change amount, the update amount of the first model parameter value will not be sent to the central server within (n / r + m) transmission periods. Here, r is a positive integer greater than or equal to 2, and (n / r) ≥ 1.
[0188] Exemplarily, assume that in the 5th (the k-th) detection, the preset period duration obtained when the first model parameter is stable is 2 transmission period durations.
[0189] If in the 6th (the k + 1)-th) detection after reaching the preset period, the first model parameter is stable, then the duration of the preset period can be 2 + 1 = 3 transmission period durations.
[0190] If in the 6th (the k + 1)-th) detection after reaching the preset period, the first model parameter is not stable, then the obtained duration can be 2 / 2 = 1 transmission period duration. If in the 7th (the k + 2)-th) detection, the first model parameter is stable, then the obtained preset period duration can be 2 / 2 + 1 = 2 transmission period durations.
[0191] As Figure 6 shown, it is a schematic flowchart of another communication method based on model training provided by an embodiment of the present application. The method may include S201 - S203:
[0192] S201. The central server receives the update amount of the second model parameter value sent by the communication device. Within the preset period, the update amount of the second model parameter value does not include the update amount of the first model parameter value.
[0193] Here, the first model parameter is the model parameter determined to be stable according to the change amount of the first model parameter value. The process of determining that the first model parameter is stable includes determining that the first model parameter is stable if the change amount of the first model parameter value is less than the preset threshold. For the specific method, reference can be made to the relevant description in step S101 above, and details will not be elaborated here.
[0194] Among them, the update amount of the first model parameter value and the update amount of the second model parameter are determined by the communication device according to user data during the model training process. That is, during the model training process, the communication device will determine the update amount of the model parameter value according to user data. And the communication device will determine the update amount of the model parameter value that needs to stop transmitting to the central server according to the stable state of the model parameter.
[0195] Exemplarily, after a preset time period, the central server sends the first model parameter value to the communication device and receives the update amount of the first model parameter value sent by the communication device.
[0196] That is to say, the central server will judge whether the communication device has stopped transmitting some model parameters according to the received update amount of the model parameter value. If some model parameters have been stopped from being transmitted, the central server will also stop transmitting the model parameters that this part of the communication device has stopped transmitting within the preset time period. Thus, the data volume transmitted in both directions is reduced, and the communication efficiency is improved.
[0197] For the remaining content, reference can be made to the relevant descriptions in steps S101 to S103, which will not be elaborated here.
[0198] S202. The central server determines the updated value of the second model parameter according to the update amount of the second model parameter value.
[0199] Exemplarily, after the central server receives the update amounts of the model parameter values sent by each communication device, it will perform average superposition on the update amounts of the model parameters fed back by each communication device to obtain a unified new model parameter value. The specific process of obtaining the new model parameter value can refer to the prior art, and this application embodiment will not elaborate on it.
[0200] S203. The central server sends the updated value of the second model parameter to the communication device. Within the preset time period, the updated value of the second model parameter does not include the updated value of the first model parameter.
[0201] Exemplarily, the model parameter value and the update amount are transmitted between the central server and the communication device through a message.
[0202] In a possible design of the message, the central server sends a message to the communication device, and the message includes the updated value of the third model parameter and the value of the corresponding identification bit. Among them, within the preset time period, the value of the identification bit corresponding to the updated value of the first model parameter is used to indicate that the central server has not transmitted the updated value of the first model parameter to the communication device.
[0203] In another possible design of the message, the central server sends a message to the communication device, and the message includes the updated value of the second model parameter and the value of the corresponding identification bit. Among them, within a preset time period, the updated value of the second model parameter does not include the updated value of the first model parameter, and the value of the identification bit corresponding to the updated value of the second model parameter is used to indicate that the central server transmits the updated value of the second model parameter to the communication device.
[0204] For the remaining content, reference can be made to the relevant descriptions in steps S101 to S103, which will not be elaborated here.
[0205] Exemplarily, if the central server receives the update amount of the value of the second model parameter sent by the communication device, it needs to first send the value of the model parameter to the communication device, and then the communication device can determine the change amount of the value of the model parameter based on the value of the model parameter, and further determine the update amount of the value of the second model parameter that can be transmitted, and send the update amount of the value of the second model parameter to the central server. Therefore, before step S201, step S204 can also be included.
[0206] S204. The central server sends the value of the second model parameter to the communication device.
[0207] Exemplarily, for the remaining content, reference can be made to the relevant description in step S104, which will not be elaborated here.
[0208] Based on the communication method for model training provided by this application. Next, in combination with specific experimental data, the effects of the technical solutions provided in the embodiments of this application will be described.
[0209] The model training methods in the machine learning distributed system provided in the embodiments of this application and the prior art are implemented on the Pytorch platform. Among them, the client in the machine learning distributed system includes 50 communication devices. The configuration of each communication device is m5.xlarge, including 2 vCPUs, 8 GB of memory, a download bandwidth of 9 Mbps, and an upload bandwidth of 3 Mbps. The server side is 1 central server, configured as c5.9xlarge, with a bandwidth of 10 Gbps. Install the Pytorch platform in the communication device and the central server to form a cluster, and the cluster information includes an elastic compute cloud (EC2) cluster.
[0210] The embodiments of this application mainly analyze the experimental data structures from the following three aspects to reflect the beneficial effects of the technical solutions provided by this application: overall performance, convergence, and overhead. Among them, the experimental results are mainly compared with the algorithms of standard machine learning distributed systems. The training datasets include the small dataset CIFAR-10 for identifying general objects and the keyword spotting dataset (KWS). The neural network models include LeNet, the residual network (ResNet) 18, and the long short-term memory network (LSTM) with two recurrent layers. Among them, LeNet and ResNet18 use the dataset CIFAR-10 to train the neural network model. The LSTM with two recurrent layers uses the dataset KWS to train the neural network model.
[0211] In the first aspect, comparison of overall performance.
[0212] Compare the total amount of data transmitted between the communication device and the central server and the average time for each transmission obtained by using the model training communication method provided by the embodiments of this application and the model training communication method in the prior art during the process of training three neural network models.
[0213] As shown in Table 1 below, it is the comparison of the total amount of data transmitted.
[0214] Table 1
[0215] Model LeNet ResNet18 KWS-LSTM This application 239MB 2.62G 194MB Prior art 651MB 3.12G 428MB Improvement ratio 63.29% 16.02% 54.35%
[0216] As shown in Table 2 below, it is the comparison of the average training time.
[0217] Table 2
[0218] Model LeNet ResNet18 KWS-LSTM This application 0.74ms 139s 1.8s Prior art 1.02s 158s 2.2s Improvement ratio 27.45% 12.03% 18.18%
[0219] In this way, it can be seen from the experimental data in Table 1 and Table 2 above that the technical solution provided by the embodiments of this application can effectively reduce the amount of data of the model parameters transmitted between the communication device and the central server during the training process of the neural network model, as well as the time overhead of the model parameter transmission.
[0220] In the second aspect, convergence analysis.
[0221] By analyzing the accuracy rate of the three neural network models and the proportion of the number of model parameters stopped from being transmitted, the experimental data result analysis chart of LeNet as shown in Figure 7 is obtained, Figure 8The analysis diagram of the experimental data results of ResNet18 shown and Figure 9 the analysis diagram of the experimental data results of KWS-LSTM shown.
[0222] Figure 7 、 Figure 8 and Figure 9 In, the abscissa represents the communication rounds between the communication device and the central server, and the ordinate represents the accuracy rate of the neural network model or the proportion of the number of model parameters for stopping transmission. The thick solid line represents the accuracy rate of the neural network model obtained by adopting the technical solution of this application. The thin solid line represents the accuracy rate of the neural network model obtained by adopting the technical solution in the prior art. The dashed line represents the proportion of the number of model parameters stopped from being transmitted during the model training process to the total number of all model parameters after adopting the technical solution of the embodiment of this application.
[0223] It can be seen that by adopting the technical solution provided in the embodiment of this application, after stopping the transmission of some model parameters, the model can still converge after a limited number of communication rounds, and the accuracy (accuracy rate) is stable. And it will not reduce the accuracy of the neural network model.
[0224] Third aspect, comparison of overhead.
[0225] Among them, the overhead includes the time overhead and memory overhead generated after the three neural network models perform model training communication by adopting the technical solution provided in the embodiment of this application, as well as the increased proportion of time overhead and memory overhead compared with the model training communication method in the prior art.
[0226] Table 3
[0227]
[0228]
[0229] It can be seen from the experimental data in Table 3 above that the technical solution provided in the embodiment of this application has a relatively small increase in time overhead and memory overhead, and will not have too much impact on the model training process.
[0230] In summary, compared with the standard machine learning distributed system algorithm in the prior art, adopting the technical solution provided in the embodiment of this application can effectively reduce the total amount of data transmission and the average time of each transmission in terms of overall performance. And it will not have a great impact on the accuracy of the neural network model and the overhead generated during the training process.
[0231] Figure 10 shows a possible structural schematic diagram of the communication device based on model training involved in the above embodiment. As Figure 10As shown, the communication device 1000 based on model training includes: a processing unit 1001, a sending unit 1002, and a receiving unit 1003.
[0232] Among them, the processing unit 1001 is used to support the communication device 1000 based on model training to execute Figure 3 steps S101 and S102 in and / or other processes for the technologies described herein.
[0233] The sending unit 1002 is used to support the communication device 1000 based on model training to execute Figure 3 steps S102 in and / or other processes for the technologies described herein.
[0234] The receiving unit 1003 is used to support the communication device 1000 based on model training to execute Figure 3 steps S103 in and / or other processes for the technologies described herein.
[0235] Among them, all relevant contents of each step involved in the above method embodiment can be cited in the function descriptions of the corresponding functional units, and will not be elaborated here.
[0236] Figure 11 Shows a possible structural schematic diagram of the communication device based on model training involved in the above embodiment. As Figure 11 shown, the communication device 1100 based on model training includes: a receiving unit 1101, a processing unit 1102, and a sending unit 1103.
[0237] Among them, the receiving unit 1101 is used to support the communication device 1100 based on model training to execute Figure 6 steps S201 in and / or other processes for the technologies described herein.
[0238] The processing unit 1102 is used to support the communication device 1100 based on model training to execute Figure 6 steps S202 in and / or other processes for the technologies described herein.
[0239] The sending unit 1103 is used to support the communication device 1100 based on model training to execute Figure 6 steps S203 in and / or other processes for the technologies described herein.
[0240] Among them, all relevant contents of each step involved in the above method embodiment can be cited in the function descriptions of the corresponding functional units, and will not be elaborated here.
[0241] The embodiment of the present application also provides a chip system, as Figure 12As shown, the chip system includes at least one processor 1201 and at least one interface circuit 1202. The processor 1201 and the interface circuit 1202 can be interconnected by a line. For example, the interface circuit 1202 can be used to receive signals from other devices. For another example, the interface circuit 1202 can be used to send signals to other devices (such as the processor 1201). Exemplarily, the interface circuit 1202 can read the instructions stored in the memory and send the instructions to the processor 1201. When the instructions are executed by the processor 1201, the communication device based on model training can be enabled to execute each step in the communication method based on model training in the above embodiments. Of course, the chip system can also include other discrete devices, and the embodiments of the present application do not make specific limitations thereto.
[0242] The embodiments of the present application also provide a computer storage medium. Computer instructions are stored in the computer storage medium. When the computer instructions run on the communication device based on model training, the communication device based on model training is enabled to execute the above-related method steps to implement the communication method based on model training in the above embodiments.
[0243] The embodiments of the present application also provide a computer program product. When the computer program product runs on a computer, the computer is enabled to execute the above-related steps to implement the communication method based on model training in the above embodiments.
[0244] In addition, the embodiments of the present application also provide a device. The device may specifically be a component or a module. The device may include a processor and a memory connected to each other. Among them, the memory is used to store computer execution instructions. When the device runs, the processor can execute the computer execution instructions stored in the memory so that the device executes the communication method based on model training in each of the above method embodiments.
[0245] Among them, the device, computer storage medium, computer program product or chip provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be elaborated here.
[0246] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and conciseness of description, only the above division of each functional module is used as an example. In practical applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated here.
[0247] In several embodiments provided by the present application, it should be understood that the disclosed method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the modules or units can be in electrical, mechanical or other forms.
[0248] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0249] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0250] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. And the aforementioned storage medium includes: various media such as flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disc that can store program instructions.
[0251] As described above, the above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A communication method based on model training, characterized in that, it is applied to a system including a central server and communication devices; the method includes: the communication device determines a change amount of the value of the first model parameter; if the communication device determines that the first model parameter is stable according to the change amount of the value of the first model parameter, the communication device stops sending the update amount of the value of the first model parameter to the central server within a preset period; wherein, the update amount of the value of the first model parameter is determined by the communication device according to user data during the process of model training; the communication device receives the value of the second model parameter sent by the central server; wherein, within the preset period, the value of the second model parameter does not include the value of the first model parameter, where the first model parameter is the model parameter that does not participate in transmitting the update amount and value between the central server and the communication device within the preset period, and the second model parameter is the model parameter that participates in transmitting the update amount and value between the central server and the communication device within the preset period.
2. The method according to claim 1, characterized in that, the method further includes: after the preset period, the communication device sends the update amount of the value of the first model parameter to the central server and receives the value of the first model parameter sent by the central server.
3. The method according to claim 1, characterized in that, the communication device stops sending the update amount of the value of the first model parameter to the central server within a preset period, including: the communication device sends a message to the central server, the message includes the update amount of the value of the third model parameter and the value of the corresponding flag bit; the update amount of the value of the third model parameter includes the update amount of the value of the second model parameter and the update amount of the value of the first model parameter; wherein, within the preset period, the value of the flag bit corresponding to the update amount of the value of the first model parameter is used to indicate that the communication device does not transmit the update amount of the value of the first model parameter to the central server; or, the communication device sends a message to the central server, the message includes the update amount of the value of the second model parameter and the value of the corresponding flag bit; wherein, within the preset period, the update amount of the value of the second model parameter does not include the update amount of the value of the first model parameter, and the value of the flag bit corresponding to the second model parameter is used to indicate that the communication device transmits the update amount of the value of the second model parameter to the central server.
4. The method according to claim 1, characterized in that, the communication device determines a change amount of the value of the first model parameter, including: the communication device obtains the change amount of the value of the first model parameter according to the historical information of the value of the first model parameter.
5. The method according to claim 4, characterized in that, the historical information of the value includes: the effective change amount of the value of the first model parameter and the cumulative change amount of the value of the first model parameter.
6. The method according to any one of claims 1 to 5, characterized in that, The communication device determines that the first model parameter is stable according to the change amount of the value of the first model parameter, including: If the change amount of the value of the first model parameter is less than a preset threshold, it is determined that the first model parameter is stable.
7. The method according to any one of claims 1 to 5, wherein, The communication device determines the change amount of the value of the first model parameter, including: The communication device determines the change amount of the value of the first model parameter M times; where M is a positive integer greater than or equal to 2; The preset conditions satisfied by the preset time period determined by the communication device according to the stable state of the first model parameter at the k-th time include: If it is determined at the k-th time that the first model parameter is stable according to the change amount of the value of the first model parameter, the duration of the preset time period is the first duration, and the first duration is greater than the second duration; where the second duration is the duration of the preset time period when it is determined at the (k - 1)-th time that the first model parameter is stable and the update amount of the value of the first model parameter is no longer sent to the central server; or the second duration is the duration obtained when it is determined at the (k - 1)-th time that the first model parameter is not stable and is used to adjust the duration of the preset time period corresponding to the next time the first model parameter is stable; where k is a positive integer, k ≤ M.
8. The method according to claim 7, wherein, The preset conditions further include: If it is determined at the k-th time that the first model parameter is not stable, the third duration obtained for adjusting the duration of the preset time period corresponding to the next time the first model parameter is stable is less than the fourth duration; where the fourth duration is the duration of the preset time period when it is determined at the (k - 1)-th time that the first model parameter is stable and the update amount of the value of the first model parameter is no longer sent to the central server; or the fourth duration is the duration obtained when it is determined at the (k - 1)-th time that the first model parameter is not stable and is used to adjust the duration of the preset time period corresponding to the next time the first model parameter is stable.
9. The method according to claim 7, wherein, If the communication device determines that the first model parameter is stable according to the change amount of the value of the first model parameter, then the communication device stops sending the value of the first model parameter to the central server within the preset time period. If it is determined at the k-th time that the communication device is stable according to the change amount of the value of the first model parameter, then the update amount of the value of the first model parameter is not sent to the central server within n transmission cycles; where n is a positive integer; After the n transmission cycles, if it is determined at the (k + 1)-th time that the communication device is stable according to the change amount of the value of the first model parameter, then the update amount of the value of the first model parameter is not sent to the central server within (n + m) transmission cycles; where m is a positive integer; After the n sending periods, if in the (k + 1)-th time the communication device determines that the first model parameter is not stable according to the change amount of the first model parameter value, then if in the (k + 2)-th time the communication device determines that the first model parameter is stable according to the change amount, stop sending the update amount of the first model parameter value to the central server within (n / r + m) sending periods; where r is a positive integer greater than or equal to 2, and (n / r) ≥ 1; Wherein, the sending period is the period for the communication device to send the update amount of the model parameter value to the central server.
10. The method according to claim 9, characterized in that, the method further includes: The communication device determines the change amount of the first model parameter value according to the detection period; the sending period is less than the detection period.
11. The method according to any one of claims 1 to 5, characterized in that, the method further includes: If the ratio of the number of the first model parameters determined to be stable by the communication device to the number of the third model parameters is greater than a preset ratio, then reduce the value of the preset threshold.
12. The method according to any one of claims 1 to 5, characterized in that, Before the communication device determines the change amount of the first model parameter value, the method further includes: The communication device receives the second model parameter value sent by the central server.
13. A communication method based on model training, characterized in that, It is applied to a system including a central server and a communication device; the method includes: The central server receives the update amount of the second model parameter value sent by the communication device; within a preset period, the update amount of the second model parameter value does not include the update amount of the first model parameter value; wherein, the first model parameter is the model parameter determined to be stable according to the change amount of the first model parameter value; the duration of the preset period is dynamically adjusted according to the stable state of the first model parameter; The central server determines the updated value of the second model parameter according to the update amount of the second model parameter value; The central server sends the updated value of the second model parameter to the communication device; within a preset period, the updated value of the second model parameter does not include the updated value of the first model parameter.
14. The method according to claim 13, characterized in that, the method further includes: After the preset period, the central server sends the first model parameter value to the communication device and receives the update amount of the first model parameter value sent by the communication device.
15. The method according to claim 13, characterized in that, The central server sends the updated value of the second model parameter to the communication device; within a preset period, the updated value of the second model parameter does not include the updated value of the first model parameter, including: The central server sends a message to the communication device, and the message includes the updated value of the third model parameter and the value of the corresponding identification bit; the updated value of the third model parameter includes the updated value of the second model parameter and the updated value of the first model parameter; wherein, within the preset time period, the value of the identification bit corresponding to the updated value of the first model parameter is used to indicate that the central server has not transmitted the updated value of the first model parameter to the communication device; Alternatively, the central server sends a message to the communication device, and the message includes the updated value of the second model parameter and the value of the corresponding identification bit; wherein, within the preset time period, the updated value of the second model parameter does not include the updated value of the first model parameter, and the value of the identification bit corresponding to the second model parameter is used to indicate that the central server transmits the updated value of the second model parameter to the communication device.
16. The method according to any one of claims 13 to 15, characterized in that, The first model parameter is a model parameter determined to be stable according to the change amount of the value of the first model parameter, including: If the change amount of the value of the first model parameter is less than a preset threshold, it is determined that the first model parameter is stable.
17. The method according to any one of claims 13 to 15, characterized in that, Before the central server receives the update amount of the value of the second model parameter sent by the communication device, the method further includes: The central server sends the value of the second model parameter to the communication device.
18. A communication device based on model training, characterized in that, The device includes: a processing unit, a sending unit, and a receiving unit; The processing unit is used to determine the change amount of the value of the first model parameter; The processing unit is further used to determine whether the first model parameter is stable according to the change amount of the value of the first model parameter; The sending unit is used to send the update amount of the value of the first model parameter to the central server; if the processing unit determines that the first model parameter is stable according to the change amount of the value of the first model parameter, the sending unit stops sending the update amount of the value of the first model parameter to the central server within a preset time period; wherein, the update amount of the value of the first model parameter is determined by the processing unit according to user data during the process of model training; The receiving unit is used to receive the value of the second model parameter sent by the central server; wherein, within the preset time period, the value of the second model parameter does not include the value of the first model parameter, wherein the first model parameter is a model parameter that does not participate in transmitting the update amount and value between the central server and the communication device within the preset time period, and the second model parameter is a model parameter that participates in transmitting the update amount and value between the central server and the communication device within the preset time period.
19. The device according to claim 18, characterized in that, The sending unit is further configured to send an update amount of the first model parameter value to the central server after the preset time period; The receiving unit is further configured to receive the first model parameter value sent by the central server after the preset time period.
20. The apparatus according to claim 18, wherein, The sending unit is specifically configured to: Send a message to the central server, the message including an update amount of the third model parameter value and a value of a corresponding identification bit; the update amount of the third model parameter value includes the update amount of the second model parameter value and the update amount of the first model parameter value; wherein, within the preset time period, the value of the identification bit corresponding to the update amount of the first model parameter value is used to indicate that the sending unit does not transmit the update amount of the first model parameter value to the central server; Or, send a message to the central server, the message including the update amount of the second model parameter value and the value of the corresponding identification bit; wherein, within the preset time period, the update amount of the second model parameter value does not include the update amount of the first model parameter value, and the value of the identification bit corresponding to the second model parameter is used to indicate that the sending unit transmits the update amount of the second model parameter value to the central server.
21. The apparatus according to claim 18, wherein, The processing unit is specifically configured to: Obtain a change amount of the first model parameter value according to historical information of the first model parameter value.
22. The apparatus according to claim 21, wherein, The historical information of the value includes: an effective change amount of the first model parameter value and an accumulated change amount of the first model parameter value.
23. The apparatus according to any one of claims 18 to 22, wherein, The processing unit is specifically configured to: Determine whether the first model parameter is stable according to the change amount of the first model parameter value. If the change amount of the first model parameter value is less than a preset threshold, it is determined that the first model parameter is stable.
24. The apparatus according to any one of claims 18 to 22, wherein, The processing unit is specifically configured to: Determine the change amount of the first model parameter value M times; where M is a positive integer greater than or equal to 2; The preset conditions satisfied by the preset time period according to the stable state of the first model parameter at the kth time include: If it is determined at the kth time that the first model parameter is stable according to the change amount of the first model parameter value, the duration of the preset time period is a first duration, and the first duration is greater than a second duration; wherein, the second duration is the duration of the preset time period when it is determined at the (k - 1)th time that the first model parameter is stable and the update amount of the first model parameter value is no longer sent to the central server; or, the second duration is the duration obtained when it is determined at the (k - 1)th time that the first model parameter is not stable and is used to adjust the duration of the preset time period corresponding to the next time when the first model parameter is stable; wherein, k is a positive integer, k ≤ M.
25. The apparatus according to claim 24, wherein, The preset conditions further include: If it is determined for the k-th time that the first model parameter is not stable, the third duration for adjusting the preset duration corresponding to the next time when the first model parameter is stable is obtained, and the third duration is less than the fourth duration; wherein, the fourth duration is the duration of the preset period when it was determined for the (k - 1)-th time that the first model parameter was stable and the update amount of the value of the first model parameter was stopped from being sent to the central server; or, the fourth duration is the duration obtained when it was determined for the (k - 1)-th time that the first model parameter was not stable for adjusting the preset duration corresponding to the next time when the first model parameter is stable.
26. The device according to claim 24, wherein, If the processing unit determines for the k-th time that the first model parameter is stable according to the change amount of the value of the first model parameter, within n transmission cycles, the sending unit stops sending the update amount of the value of the first model parameter to the central server; where n is a positive integer; After the n transmission cycles, if the processing unit determines for the (k + 1)-th time that the first model parameter is stable according to the change amount of the value of the first model parameter, within (n + m) transmission cycles, the sending unit stops sending the update amount of the value of the first model parameter to the central server; where m is a positive integer; After the n transmission cycles, if the processing unit determines for the (k + 1)-th time that the first model parameter is not stable according to the change amount of the value of the first model parameter, then if the processing unit determines for the (k + 2)-th time that the first model parameter is stable according to the change amount, within (n / r + m) transmission cycles, the sending unit stops sending the update amount of the value of the first model parameter to the central server; where r is a positive integer greater than or equal to 2 and (n / r) ≥ 1; wherein, the transmission cycle is the cycle for the sending unit to send the update amount of the model parameter value to the central server.
27. The device according to claim 26, wherein, The processing unit is further configured to: Determine the change amount of the value of the first model parameter according to the detection cycle; the transmission cycle is less than the detection cycle.
28. The device according to any one of claims 18 to 22, wherein, The processing unit is further configured to: If the ratio of the number of the first model parameters determined by the processing unit to be stable to the number of the third model parameters is greater than the preset ratio, then reduce the value of the preset threshold.
29. The device according to any one of claims 18 to 22, wherein, Before the processing unit determines the change amount of the value of the first model parameter, the receiving unit receives the value of the second model parameter sent by the central server.
30. A communication device based on model training, wherein, The device includes: a receiving unit, a processing unit, and a sending unit; The receiving unit is configured to receive an update amount of the second model parameter value sent by a communication device; within a preset time period, the update amount of the second model parameter value does not include an update amount of the first model parameter value; wherein, the first model parameter is a model parameter determined to be stable according to a change amount of the first model parameter value; and a duration of the preset time period is dynamically adjusted according to a stable state of the first model parameter. The processing unit is configured to determine an updated value of the second model parameter according to the update amount of the second model parameter value. The sending unit is configured to send the updated value of the second model parameter to the communication device; within a preset time period, the updated value of the second model parameter does not include an updated value of the first model parameter.
31. The apparatus according to claim 30, wherein, the sending unit is further configured to send the value of the first model parameter to the communication device after the preset time period. The receiving unit is further configured to receive an update amount of the value of the first model parameter sent by the communication device.
32. The apparatus according to claim 30, wherein, the sending unit is specifically configured to: send a message to the communication device, where the message includes an updated value of a third model parameter and a value of a corresponding identification bit; the updated value of the third model parameter includes the updated value of the second model parameter and the updated value of the first model parameter; wherein, within the preset time period, the value of the identification bit corresponding to the updated value of the first model parameter is used to indicate that the sending unit does not transmit the updated value of the first model parameter to the communication device. Or, send a message to the communication device, where the message includes the updated value of the second model parameter and the value of a corresponding identification bit; wherein, within the preset time period, the updated value of the second model parameter does not include the updated value of the first model parameter, and the value of the identification bit corresponding to the updated value of the second model parameter is used to indicate that the sending unit transmits the updated value of the second model parameter to the communication device.
33. The apparatus according to any one of claims 30 to 32, wherein, the first model parameter being a model parameter determined to be stable according to a change amount of the first model parameter value includes: if the change amount of the first model parameter value is less than a preset threshold, determining that the first model parameter is stable.
34. The apparatus according to any one of claims 30 to 32, wherein, before the receiving unit receives the update amount of the second model parameter value sent by the communication device, the sending unit sends the second model parameter value to the communication device.
35. A communication device, wherein, comprises: one or more processors; a memory; and a computer program, wherein the computer program is stored in the memory and includes instructions; when the instructions are executed by the communication device, the communication device is caused to execute the communication method based on model training according to any one of claims 1-12; or, the communication device is caused to execute the communication method based on model training according to any one of claims 13-17.
36. A communication system, characterized in that it comprises: a central server and at least one communication device, the at least one communication device executing the communication method based on model training according to any one of claims 1-12; the central server executing the communication method based on model training according to any one of claims 13-17.
37. A computer storage medium, characterized in that it comprises computer instructions, which when running on a communication device based on model training, cause the communication device based on model training to execute the communication method based on model training according to any one of claims 1-12; or, cause the communication device to execute the communication method based on model training according to any one of claims 13-17.
38. A chip system, characterized in that it comprises at least one processor and at least one interface circuit, the at least one interface circuit being used to perform transceiver functions and send instructions to the at least one processor, and when the at least one processor executes the instructions, the at least one processor executes the communication method based on model training according to any one of claims 1-12; or, cause the communication device to execute the communication method based on model training according to any one of claims 13-17.