A communication method, device and system based on model training
By judging the stability of model parameters and stopping the transmission of stable parameters, the problem of delayed model parameters transmission in federated learning systems is solved, and communication efficiency is improved.
Patent Information
- Application Number
- CN202010077048.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-23
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2040-01-23
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 CN113162861B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a communication method, device and system based on model training. Background Art
[0002] The federated learning (FL) system is an emerging basic technology for artificial intelligence. Its main idea is to build a machine learning model based on the data sets on multiple communication devices through collaboration between a central server and multiple communication devices. In the process of building the machine learning model, there is no need to share data between the various communication devices to prevent data leakage.
[0003] In the federated learning system, the central server sends the values of each parameter of the machine learning model to each communication device, and each communication device acts as a collaborative unit to train the model locally, update the values of each parameter of the machine learning model, and send the gradient of each parameter value to the central server. The central server generates new model parameter values based on the gradient of each parameter value. Repeat the above steps until the machine learning model converges and the entire model training process is completed.
[0004] As machine learning models become larger, the amount of model parameter data that needs to be transmitted between communication devices and central servers is also increasing. Limited by the Internet connection speed, bandwidth and other issues, the delay in model parameter transmission between communication devices and central servers is long, and the model parameter value update rate is slow. Summary of the invention
[0005] The model training-based communication method, device and system provided in the present application can effectively reduce the amount of data transmitted between communication equipment and servers, and improve communication efficiency without losing model training accuracy.
[0006] In order to achieve the above objectives, this application adopts the following technical solutions:
[0007] 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 a communication device. The method may include: the communication device determines the change amount of the first model parameter value. 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 time period. The update amount of the first model parameter value is determined by the communication device based on user data during the model training process. The communication device receives the second model parameter value sent by the central server. Within the preset time period, the second model parameter value does not include the first model parameter value.
[0008] Among them, the first model parameter is a model parameter that participates in determining whether it is stable, and its number is not limited, and it can be any one or more model parameters. If the first model parameter is determined to be stable, the first model parameter is a model parameter that does not participate in the transmission of update amount and value within a preset period of time. The second model parameter is a model parameter that participates in the transmission of 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.
[0009] Among them, the change in 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 in its value is mainly a small-amplitude oscillation change, which is of little significance to the model training. Therefore, a preset time period can be set, and the transmission of the stable update amount of the first model parameter value is stopped within the preset time period. It can be understood that 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 the preset time period, thereby reducing the amount of data in both directions between the communication device and the central server.
[0010] After receiving the updated model parameter values sent by the central server, the communication device can build an updated local training model and use local user data to train the model. During the training process, the model parameter values are adjusted based on the user data to obtain the updated value of the model parameter values, that is, the gradient of the model parameter values.
[0011] In this way, after the communication device determines that the model parameters are stable based on the change in the model parameter values, the update amount of the model parameter values can be stopped within a preset time period, which can effectively reduce the amount of data transmitted between the communication device and the server, and improve communication efficiency without losing the accuracy of model training.
[0012] In a possible implementation, the method further includes: after a preset period of time, 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.
[0013] That is, after the preset period, the first model parameter that stopped transmitting 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 in the value of the model parameter.
[0014] In a possible implementation, the model parameter values and the updated values are transmitted between the communication device and the central server via messages.
[0015] In one 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 period of time, including: the communication device sends a message to the central server, 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. Wherein, within the preset period of time, 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 has not transmitted the update amount of the first model parameter value to the central server.
[0016] The identification bit included in the message may include, for example, a bit mapping, where each bit corresponds to data of a model parameter. The value of the identification bit may be set to 0 / 1 for distinction, for example.
[0017] In this way, after receiving the message sent by the communication device, the central server can determine whether the update amount of the model parameter value corresponding to the identification bit is transmitted according to the update amount of the model parameter value carried in the message corresponding to the value of each identification bit, and then quickly read the update amount of the transmitted model parameter value. It is also possible to quickly determine the update amount of the first model parameter value 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.
[0018] 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. 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 communication device transmits the update amount of the second model parameter value to the central server.
[0019] In this way, the message only contains the update amount of the second model parameter value and its corresponding identification bit, and then 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.
[0020] In other possible designs, the message does not directly include the update amount of the first model parameter value. The communication device and the central server pre-set the transmission order of the update amount of the third model parameter value in the message to be transmitted. Afterwards, when the communication device determines that the first model parameter is stable, even if the message transmitted to the central server does not directly include 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 based on the vacant bits, and can also know which update amounts of the second model parameter values the transmitted data corresponds to.
[0021] In a possible implementation, the communication device determines the change in the value of the first model parameter, including: the communication device obtains the change in the value of the first model parameter according to historical information of the value of the first model parameter. For example, the historical value of the first model parameter or the change in the historical value is obtained, and then the change in the value of the first model parameter this time can be calculated in combination with the value of the first model parameter this time.
[0022] In a possible implementation, the historical information of the values includes: the effective change amount of the first model parameter value and the accumulated change amount of the first model parameter value.
[0023] The effective change amount and cumulative change amount of the first model parameter value this time can be obtained based on the effective change amount and cumulative change amount of all the first model parameter values obtained. Alternatively, it can be obtained based on the effective change amount and cumulative change amount of the first model parameter values obtained in the most recent detections. Alternatively, it can be obtained based on the effective change amount and cumulative change amount of the first model parameter values obtained in the last detection. Afterwards, the change amount of the first model parameter value can be obtained based on the ratio of the effective change amount and cumulative change amount of the first model parameter value.
[0024] Exemplarily, the exponential moving average (EMA) method can be used to obtain the effective change amount and cumulative change amount of the first model parameter value this time based on the effective change amount of the first model parameter value obtained in the last detection and the cumulative change amount of the first model parameter value, and the first model parameter values obtained in the last and current detections, and then obtain the change amount of the first model parameter value. Moreover, by using the EMA method to obtain the change amount of the first model parameter value, it is only necessary to save the effective change amount and cumulative change amount of the first model parameter value obtained last time, and the first model parameter value obtained last time, which can effectively reduce the occupied storage space.
[0025] In a possible implementation, the communication device determines that the first model parameter is stable according to a change in the value of the first model parameter, including: if the change in the value of the first model parameter is less than a preset threshold, determining that the first model parameter is stable.
[0026] Exemplarily, the preset threshold value can be determined based on experimental data, expert experience, etc. If the change in the value of the first model parameter is less than the preset threshold value, it indicates that the current first model parameter has converged and stabilized, and continued transmission will not make a significant contribution to the training of the model, so the transmission of the update value of the first model parameter value can be stopped.
[0027] In a possible implementation, the communication device determines the amount of change in the value of the first model parameter, including: the communication device determines the amount of change in the value of the first model parameter M times; wherein M is a positive integer greater than or equal to 2. The communication device determines the preset condition that the preset time period satisfies according to the k-th stable state of the first model parameter, including: if the first model parameter is determined to be stable according to the amount of change in the value of the first model parameter for the kth time, then the duration of the preset time period is the first duration, and the first duration is greater than the second duration. The second duration is the duration of the preset time period for stopping sending the updated amount of the first model parameter value to the central server when the first model parameter is determined to be stable for the k-1th time; or, the second duration is the duration obtained when the first model parameter is determined to be unstable for the k-1th time, and is used to adjust the preset time period duration corresponding to the next time the first model parameter is stable; wherein k is a positive integer, k≤M.
[0028] In one possible implementation, the preset condition also includes: if it is determined for the kth time that the first model parameter is not stable, then a third time duration is obtained for adjusting the preset time period corresponding to the next time the first model parameter is stable, and the third time duration is less than the fourth time duration; wherein the fourth time duration is the time duration of the preset time period for stopping sending the updated amount of the first model parameter value to the central server when the first model parameter is determined to be stable for the k-1th time, or the fourth time duration is the time duration obtained for adjusting the preset time period corresponding to the next time the first model parameter is stable when it is determined for the k-1th time that the first model parameter is not stable.
[0029] That is to say, in the process of transmitting the update amount or value of the model parameter between the communication device and the central server, a duration will be obtained each time the change in the value of the first model parameter is determined by detection. If the first model parameter is determined to be stable this time, indicating that the first model parameter has converged, it is necessary to increase the duration of the first model parameter to stop transmitting, then the obtained duration is the duration of the preset period, and the duration is greater than the duration obtained in the previous detection. If the first model parameter is determined to be unstable this time, indicating that the first model parameter has not converged, it is necessary to reduce the duration of the next stop transmission of the first model parameter, then the obtained duration is the duration used to adjust the duration obtained for the next detection, and the duration is less than the duration obtained in the previous detection.
[0030] In this way, the duration of the preset period of stopping transmission can be dynamically adjusted according to the stable state of the first model parameter, and the number of model parameters of the parameter model training transmitted between the communication device and the central server can be flexibly controlled, thereby ensuring that the accuracy of the final model meets the requirements.
[0031] In a possible implementation, if the communication device determines that the first model parameter is stable according to the amount of change in the value of the first model parameter, the communication device stops sending the update amount of the first model parameter value to the central server within a preset period of time, including: if the k-th communication device determines that the first model parameter is stable according to the amount of change in the value of the first model parameter, then stop sending the update amount of the first model parameter value to the central server within n sending cycles; where n is a positive integer. After n sending cycles, if the k+1-th communication device determines that the first model parameter is stable according to the amount of change in the value of the first model parameter, then stop sending the update amount of the first model parameter value to the central server within (n+m) sending cycles; where m is a positive integer. After n sending cycles, if the k+1-th communication device determines that the first model parameter is not stable according to the amount of change in the value of the first model parameter, then if the k+2-th communication device determines that the first model parameter is stable according to the amount of change, stop sending the update amount of the first model parameter value to the central server within (n / r+m) sending cycles; where r is a positive integer greater than or equal to 2, and (n / r)≥1. The sending period is the period during which the communication device sends the updated amount of the model parameter value to the central server.
[0032] 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 sending cycle. After determining that the first model parameter is stable, the preset period for stopping the transmission this time is obtained by adding an integer number of the sending cycle duration to the duration obtained last time. After determining that the first model parameter is unstable, the duration obtained last time is proportionally reduced to obtain the duration this time.
[0033] For example, assuming that in the fifth (kth) detection, the length of the preset time period during which the first model parameter is stably obtained is 2 sending cycle lengths.
[0034] If the first model parameter is detected to be stable for the sixth time (k+1th time) after the preset time period, the duration of the preset time period may be 2+1=3 sending cycle durations.
[0035] If the first model parameter is detected to be unstable for the sixth time (k+1th time) after the preset period, the obtained duration can be 2 / 2=1 transmission cycle duration. If the first model parameter is detected to be stable for the seventh time (k+2th time), the obtained duration of the preset period can be 2 / 2+1=2 transmission cycle durations.
[0036] In a possible implementation, the method further includes: the communication device determines the change in the value of the first model parameter according to a detection period; and the sending period is smaller than the detection period.
[0037] Since it is meaningful for the communication device to determine the stable state of the first model parameter value only after sending the update amount of the first model parameter value and obtaining the updated first model parameter value, the sending period should be smaller than the detection period.
[0038] 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, reducing the value of the preset threshold.
[0039] That is to say, after the number of model parameters that stop transmitting reaches a certain proportion, it is necessary to lower the threshold for determining whether the model parameters are stable, thereby reducing the number of model parameters that stop transmitting and ensuring that the model parameters participating in model training have the updated values.
[0040] In this way, the preset threshold is adjusted dynamically to avoid too many model parameters that stop transmitting, which prolongs the model training process or affects the final accuracy of the model. For example, when a large number of model parameters stop transmitting, only the unchanged values of the model parameters that stop transmitting can be used to train the model within the preset period, and the training effect may not be ideal. Only after waiting for the preset period of each model parameter that stops transmitting to arrive, can the updated values of these model parameters be obtained and the model can be continued to be trained, resulting in too long a training time for the model to reach the model convergence condition.
[0041] In a possible implementation, before the communication device determines the amount of change in the value of the first model parameter, the method further includes: the communication device receives the value of the second model parameter sent by the central server. For example, the sending period is 5 seconds and the detection period is 10 seconds. Then the communication device sends the update amount of the first model parameter value to the central server every 5 seconds, and similarly the central server sends the first model parameter value to the communication device every 5 seconds. The communication device confirms the amount of change in the value of the first model parameter every 10 seconds, and determines whether the first model parameter is stable based on the amount of change.
[0042] 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 time period, the update amount of the second model parameter value does not include the update amount of the first model parameter value. Among them, the first model parameter is a stable model parameter determined 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 the preset time period, the updated value of the second model parameter does not include the updated value of the first model parameter.
[0043] 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 the user data during the model training process. That is, the communication device determines the update amount of the model parameter value according to the user data during the model training process. In addition, the communication device determines 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.
[0044] That is to say, the central server will determine whether the communication device has stopped transmitting part of the model parameters according to the update amount of the received model parameter values. If the transmission of part of the model parameters has been stopped, the central server will also stop transmitting the model parameters that the communication device has stopped transmitting within a preset period of time. This will reduce the amount of data transmitted in both directions and improve communication efficiency.
[0045] In a possible implementation, the method further includes: after a preset period of time, the central server sends the first model parameter value to the communication device and receives an update amount of the first model parameter value sent by the communication device.
[0046] After the preset period, the communication device will automatically start to send the updated amount of the model parameter value to the central server, and then the central server will determine the updated value of the model parameter according to the updated amount of the model parameter value, so that after the preset period, the central server transmits the updated value of the model parameter that was previously stopped to the communication device. In this way, the bidirectional adaptive communication data volume adjustment between the central server and the communication device is realized.
[0047] In a possible implementation, the central server sends an updated value of the second model parameter to the communication device; within a preset period of time, 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, 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 period of time, 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, the message includes the updated value of the second model parameter and the value of the corresponding identification bit. Wherein, within the preset period of time, 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.
[0048] In a possible implementation, the first model parameter is a model parameter whose stability is determined according to a change in the value of the first model parameter, including: if the change in the value of the first model parameter is less than a preset threshold, determining that the first model parameter is stable.
[0049] In a possible implementation manner, before the central server receives the update amount of the second model parameter value sent by the communication device, the method further includes: the central server sends the second model parameter value to the communication device.
[0050] That is to say, the process of model parameter transmission between the central server and the communication device is a cyclic interactive process, which requires the central server to send the model parameter value to the communication device, and the communication device can obtain the updated amount of the model parameter value based on the model parameter value, and then the central server can obtain the updated amount of the model parameter value.
[0051] In a third aspect, the present application provides a communication device based on model training, the device comprising: a processing unit, a sending unit, and a receiving unit. The processing unit is used to determine the amount of change in the value of a first model parameter. The processing unit is also used to determine whether the first model parameter is stable based on the amount of change in the value of the first model parameter. The sending unit is used to send the updated amount of the first model parameter value to a central server; if the processing unit determines that the first model parameter is stable based on the amount of change in the value of the first model parameter, the sending unit stops sending the updated amount of the first model parameter value to the central server within a preset time period. The updated 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 second model parameter value sent by the central server; within the preset time period, the second model parameter value does not include the first model parameter value.
[0052] In a possible implementation, the sending unit is further configured to send the update amount of the first model parameter value to the central server after a preset period of time. The receiving unit is further configured to receive the first model parameter value sent by the central server after a preset period of time.
[0053] In a possible implementation, the sending unit is specifically used to: send a message to the central server, the message including 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. Wherein, within a 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 has not transmitted the update amount of the first model parameter value to the central server. Alternatively, 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 update amount of the second model parameter value is used to indicate that the sending unit transmits the update amount of the second model parameter value to the central server.
[0054] In a possible implementation manner, the processing unit is specifically configured to obtain a change in the value of the first model parameter according to historical information of the value of the first model parameter.
[0055] In a possible implementation, the historical information of the values includes: the effective change amount of the first model parameter value and the accumulated change amount of the first model parameter value.
[0056] In a possible implementation, the processing unit is specifically used to determine whether the first model parameter is stable according to a change in the value of the first model parameter; if the change in the value of the first model parameter is less than a preset threshold, determine that the first model parameter is stable.
[0057] In one possible implementation, the processing unit is specifically used to: determine the change in the value of the first model parameter M times. Wherein, M is a positive integer greater than or equal to 2. The preset condition that the preset time period satisfies is determined according to the k-th stable state of the first model parameter, including: if the first model parameter is determined to be stable according to the change in the value of the first model parameter for the kth time, then the duration of the preset time period is the first duration, and the first duration is greater than the second duration; wherein, the second duration is the duration of the preset time period for stopping sending the updated amount of the first model parameter value to the central server when the first model parameter is determined to be stable for the k-1th time, or, the second duration is the duration obtained when the first model parameter is determined to be unstable for the k-1th time, and is used to adjust the preset time period corresponding to the next time the first model parameter is stable; wherein, k is a positive integer, k≤M.
[0058] In one possible implementation, the preset condition also includes: if it is determined for the kth time that the first model parameter is not stable, then a third time duration is obtained for adjusting the preset time period corresponding to the next time the first model parameter is stable, and the third time duration is less than the fourth time duration; wherein the fourth time duration is the time duration of the preset time period for stopping sending the updated amount of the first model parameter value to the central server when the first model parameter is determined to be stable for the k-1th time, or the fourth time duration is the time duration obtained for adjusting the preset time period corresponding to the next time the first model parameter is stable when it is determined for the k-1th time that the first model parameter is not stable.
[0059] In a possible implementation, if the processing unit determines that the first model parameter is stable according to the change in the value of the first model parameter for the kth time, then within n sending cycles, the sending unit stops sending the updated value of the first model parameter to the central server. Where n is a positive integer. After n sending cycles, if the processing unit determines that the first model parameter is stable according to the change in the value of the first model parameter for the k+1th time, then within (n+m) sending cycles, the sending unit stops sending the updated value of the first model parameter to the central server. Where m is a positive integer. After n sending cycles, if the processing unit determines that the first model parameter is not stable according to the change in the value of the first model parameter for the k+1th time, then if the processing unit determines that the first model parameter is stable according to the change for the k+2th time, within (n / r+m) sending cycles, the sending unit stops sending the updated 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 sending cycle is the period during which the sending unit sends the updated value of the model parameter to the central server.
[0060] In a possible implementation, the processing unit is further configured to: determine a change in the value of the first model parameter according to a detection period; and the sending period is smaller than the detection period.
[0061] In a possible implementation, the processing unit is further configured to: if the processing unit 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, reduce the value of the preset threshold.
[0062] In a possible implementation manner, 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.
[0063] In a fourth aspect, the present application provides a communication device based on model training, the device comprising: a receiving unit, a processing unit, and a sending unit. The receiving unit is used to receive the update amount of the second model parameter value sent by the communication device; 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; wherein the first model parameter is a stable model parameter determined according to the change amount of the first model parameter value. The processing unit is used to determine the updated value of the second model parameter according to the update amount of the second model parameter value. The sending unit is used to send 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.
[0064] In a possible implementation, the sending unit is further configured to send the first model parameter value to the communication device after a preset period of time. The receiving unit is further configured to receive the update amount of the first model parameter value sent by the communication device.
[0065] In a possible implementation, the sending unit is specifically used to: send a message to a communication device, the message including an updated value of a third model parameter and a corresponding value of a flag; the updated value of the third model parameter includes an updated value of the second model parameter and an updated value of the first model parameter. Wherein, within a preset time period, the value of the flag corresponding to the updated value of the first model parameter is used to indicate that the sending unit has not transmitted the updated value of the first model parameter to the communication device. Alternatively, send a message to the communication device, the message including an updated value of a second model parameter and a corresponding value of a flag; wherein, 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 flag 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.
[0066] In a possible implementation, the first model parameter is a model parameter whose stability is determined according to a change in the value of the first model parameter, including: if the change in the value of the first model parameter is less than a preset threshold, determining that the first model parameter is stable.
[0067] In a possible implementation manner, 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.
[0068] In a fifth aspect, the present application provides a communication device, comprising: one or more processors; a memory; and a computer program, wherein 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 executes a communication method based on model training as described in the first aspect above and any possible implementation thereof.
[0069] In a sixth aspect, the present application provides a communication device, comprising: one or more processors; a memory; and a computer program, wherein 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 executes a communication method based on model training as in the second aspect above and any possible implementation thereof.
[0070] In a seventh aspect, the present application provides a communication system, comprising: a central server and at least one communication device, wherein the at least one communication device executes a communication method based on model training as in the first aspect and any possible implementation thereof. The central server executes a communication method based on model training as in the second aspect and any possible implementation thereof.
[0071] In an eighth aspect, the present application provides a communication device having the function of implementing the communication method based on model training as described in the first aspect to the second aspect, and any possible implementation thereof. The 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.
[0072] In a ninth aspect, the present application provides a computer storage medium comprising computer instructions. When the computer instructions are executed on a communication device based on model training, the communication device based on model training executes the communication method based on model training as described in the first aspect to the second aspect above, and any possible implementation method thereof.
[0073] In the tenth aspect, the present application provides a computer program product. When the computer program product runs on a communication device based on model training, the communication device based on model training executes the communication method based on model training as described in the first aspect to the second aspect above, and any possible implementation method therein.
[0074] In an eleventh aspect, a circuit system is provided, the circuit system including a processing circuit, the processing circuit being configured to execute the communication method based on model training as described in the first aspect to the second aspect above, and any possible implementation manner therein.
[0075] In the twelfth aspect, an embodiment of the present application provides a chip system, comprising at least one processor and at least one interface circuit, wherein the at least one interface circuit is used to perform transceiver functions and send instructions to at least one processor, and when the at least one processor executes the instructions, the at least one processor executes the model training-based communication method as described in the first aspect to the second aspect above, and any possible implementation method therein.
[0076] Among them, the technical effects brought about by any design method in the second aspect to the twelfth aspect can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 A schematic diagram of an application scenario of a communication method based on model training provided in an embodiment of the present application;
[0078] Figure 2 A schematic diagram of the hardware structure of a communication device provided in an embodiment of the present application;
[0079] Figure 3 Schematic diagram of the process of the communication method based on model training provided in the embodiment of the present application Figure 1 ;
[0080] Figure 4 A schematic diagram of a message structure provided for an embodiment of the present application;
[0081] Figure 5 Schematic diagram of the process of the communication method based on model training provided in the embodiment of the present application Figure 2 ;
[0082] Figure 6 Schematic diagram of the process of the communication method based on model training provided in the embodiment of the present application Figure 3 ;
[0083] Figure 7 An experimental data result analysis provided for the embodiment of the present application Figure 1 ;
[0084] Figure 8 An experimental data result analysis provided for the embodiment of the present application Figure 2 ;
[0085] Fig. 9 An experimental data result analysis provided for the embodiment of the present application Figure 3 ;
[0086] Fig.10 A schematic diagram of a communication device based on model training provided in an embodiment of the present application Figure 1 ;
[0087] Fig.11 A schematic diagram of a communication device based on model training provided in an embodiment of the present application Figure 2 ;
[0088] Fig.12 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0089] The following is a detailed description of the model training-based communication method, device and system provided in the embodiments of the present application in conjunction with the accompanying drawings.
[0090] The solution of the embodiment of the present application is mainly applied to a distributed system of 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 the distributed system of machine learning, each communication device has the same status, stores user data, and does not share user data between each communication device. It can carry out efficient machine learning between multiple communication devices under the premise of ensuring information security during big data exchange and protecting terminal data and personal data privacy.
[0091] For example, Figure 1 As shown, the distributed system 100 for machine learning includes a central server 10 and at least one communication device 20, such as Figure 1 The central server 10 and at least one communication device 20 may be connected via a wired network or a wireless network. The embodiment of the present application does not specifically limit the connection method between the central server 10 and at least one communication device 20.
[0092] The central server 10 may be a device or server with computing functions such as a cloud server or a network server. The central server 10 may be a single server, or a server cluster consisting of multiple servers, or a cloud computing service center. The central server 10 stores a neural network model, and the neural network model parameter values may be sent to at least one communication device 20 through an interactive interface.
[0093] 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. A relevant human-computer interaction interface can be provided to collect local user data based on model training. For example, it can include a mobile phone, a tablet computer, 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 embodiment of the present application does not impose any special restrictions on the specific form of the communication device.
[0094] The communication device 20 stores local data. 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 is understandable that the larger the amount of training data, the better the performance of the model trained. 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 model parameter values or the update amount of the values are transmitted between multiple communication devices 20 in order to increase the amount of data contained in the training data, it is not conducive to protecting privacy data.
[0095] In order to protect privacy data and data security, the distributed system 100 of machine learning can optimize the local model in each communication device 20 without sharing local data between the communication devices 20. Figure 1 As shown, each communication device 20 does not need to share local data, but sends the updated value of each parameter of the local model before and after training to the central server 10. The central server 10 trains the model using the updated value of the model parameter sent by each communication device 20, and sends the trained model parameter value to each communication device 20. Each communication device 20 then uses local data to train the local model constructed using the updated model parameter value. In this way, after looping the above steps, the central server 10 can obtain a neural network model with better performance and send it to each communication device 20. The update amount can also be called a gradient.
[0096] It should be noted that some documents describe the above-mentioned machine learning process as federated learning. Therefore, the above-mentioned machine learning distributed system can also be described as a distributed system of federated learning. The technical solution in the embodiment of the present application can be a communication method based on model training, and 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.
[0097] The above-mentioned distributed system 100 for machine learning can be applied in the following scenarios:
[0098] Scenario 1: Improving the input performance of mobile phone input methods.
[0099] For example, a mobile phone input method can predict and display the words that may be entered later based on the words currently entered 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 such as the websites visited by the user and the user's travel locations, cannot be shared directly.
[0100] Thus, Google has introduced a method based on machine learning distributed system to improve the prediction model of mobile phone input vocabulary. First, the central server in Google will send the prediction model parameter values to multiple mobile phones, and then obtain the update amount of the model parameter values obtained by each mobile phone based on its own local user data training prediction model. The central server averages and superimposes the update amount of the prediction model parameter values fed back by each mobile phone to obtain a unified new prediction model. In this way, without the mobile phone having to share local user data, through continuous iterative updates, a prediction model with high prediction accuracy can be finally obtained, thereby improving the performance of the mobile phone input method.
[0101] The application scenarios of the distributed system of machine learning may include the scenario based on a large number of communication devices in the above scenario 1, and may also include scenarios based on a limited number of communication devices, such as the following scenario 2.
[0102] Scenario 2: Scenario for improving medical prediction models.
[0103] For example, the training data required for the establishment of a prediction model for developing treatment methods and obtaining treatment prediction results in a hospital is patient data. The actual and potential consequences of violating patient privacy when using patient data for model training may be serious.
[0104] In this way, based on a distributed system of machine learning, each hospital can use its own patient data to train a prediction model without sharing their own patient data. The central server will integrate the updated values of all prediction model parameters to ultimately obtain a more accurate prediction model that integrates all hospital patient data. The final model parameter values will be sent to each hospital, thereby improving each hospital's medical prediction model.
[0105] Figure 2 The hardware structure diagram of the communication device 20 provided in the embodiment of the present application is shown in FIG. 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 suitable components.
[0106] The bus 110 may be a circuit that connects the above elements to each other and transfers communications between the above elements.
[0107] The processor 120 may receive commands from the other components described above (eg, the memory 130, the user input module 140, the display module 150, the communication interface 160, etc.) via the bus 110, may interpret the received commands, and may perform calculations or data processing according to the interpreted commands.
[0108] The processor 120 may 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 present application.
[0109] In some embodiments, the processor 120 is used to establish a local model based on the model parameter values received from the central server 10, and train the local model using local user data to obtain an update amount of the model parameter values.
[0110] The memory 130 may store commands or data received from the processor 120 or other elements (eg, 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.
[0111] The memory 130 may 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 an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compressed optical disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 130 may exist independently and be connected to the processor 120 via the bus 110. The memory 130 may also be integrated with the processor 120.
[0112] The memory 130 is used to store computer-executable instructions for implementing the solution of the present application, and the execution is controlled by the processor 120. The processor 120 is used to execute the computer-executable instructions stored in the memory 130, thereby implementing the communication method based on model training provided in the following embodiments of the present application.
[0113] Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, instructions, computer program or other names, which are not specifically limited in the embodiments of the present application.
[0114] In some embodiments, the memory 130 stores user data input by the communication device 20 through the user input module 140 based on human-computer interaction, or user data obtained by the communication device 20 in other ways. 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, which is not specifically limited in the embodiments of the present application.
[0115] The user input module 140 may receive data or commands input from a user via an input-output means (eg, a sensor, a keyboard, a touch screen, etc.), and may transmit the received data or commands to the processor 120 or the memory 130 through the bus 110 .
[0116] The display module 150 may display various information (eg, multimedia data, text data) received from the above elements.
[0117] The communication interface 160 can control the communication between the communication device 20 and the central server 10. When the communication device 20 is paired with the central server 10, the communication interface 160 can receive the model parameter values sent by the central server 10, and send the update amount of the model parameter values to the central server, and can also control the sending period of the update amount of the model parameter values. The sending period of the update amount of the model parameter values can also be executed by the processor 120 controlling the communication interface 160.
[0118] According to various 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 be operable to connect the communication device 20 to the network 161.
[0119] It should be understood that the hardware structure of the communication device 20 shown in the figure is only an example, and the communication device 20 may have more Figure 2 More or fewer components may be shown, two or more components may be combined, or there may be a different configuration of components.
[0120] At present, the communication method for model training of distributed systems based on machine learning is generally that the central server sends all model parameter values to the communication device, and the communication device obtains the update amount of all model parameter values based on the model parameter values, and sends all the update amounts of all 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. But 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 oscillations, which are of little significance to model training.
[0121] In view of this, an embodiment of the present application provides a communication method based on model training, which can confirm whether the model parameters are stable based on the change in the transmitted model parameter values, and then confirm whether to stop transmitting the corresponding model parameter value update. In this way, the amount of transmitted data can be reduced and the communication efficiency can be improved without losing the accuracy of model training.
[0122] like Figure 3 As shown, a flow chart of a communication method based on model training is provided in an embodiment of the present application, and the method may include S101-S103:
[0123] S101. A communication device determines a change in a value of a first model parameter.
[0124] Among them, the first model parameter can be at least one model parameter among the model parameters sent by the central server received by the communication device, that is, the change amount of all model parameter values received can be determined, or only the change amount of some model parameter values among all model parameter values received can be determined. For example, the communication device receives 100 model parameter values, and 2 model parameter values among 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 that these 2 model parameter values are continuously updated. Therefore, the number of 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.
[0125] Exemplarily, from the above description, it can be seen that in a distributed system of machine learning, a communication device will receive a first model parameter value sent by a central server, and the communication device can obtain a change in the first model parameter value based on historical information of the received first model parameter value.
[0126] The historical information may include the effective change amount of the first model parameter value and the accumulated change amount of the first model parameter value.
[0127] In some embodiments, an exponential moving average (EMA) method is used to obtain the change in the first model parameter value according to the effective change in the first model parameter value and the cumulative change in the first model parameter value.
[0128] For example, the communication device obtains the effective change E of the first model parameter value obtained for the kth time. k and the cumulative change of the first model parameter value The ratio of the first model parameter value is obtained by the change P; where the change Effective change E k and the cumulative change of the first model parameter value The initial value of is 0.
[0129] Among them, if k = 1, then The change in the value of the first model parameter is P=1.
[0130] If k is a positive integer greater than or equal to 2, then the effective change E k =αE k-1 +(1-α)Δk, cumulative change Among them, α is the weight parameter, which is used to indicate the degree of weight attenuation, 0<α<1; E k-1 is the effective change of the first model parameter value at k-1 times; is the cumulative change of the first model parameter value in the k-1th time; Δk is the difference between the first model parameter values obtained in the kth time and the k-1th time. Among them, α is a variable, which decreases exponentially according to the number of calculations. The specific method of obtaining it can be referred to the prior art, and the embodiments of this application will not be repeated here.
[0131] Exemplarily, if k=2, that is, the communication device currently obtains the first model parameter value for the second time, assuming that the first model parameter value for the first time is -4, the first model parameter value for the second time is 6, and α=0.5. Then the effective change amount of the second first model parameter value E2=αE1+(1-α)Δk=α(1-α)Δk1+(1-α)Δk2=0.5*(1-0.5)*(-4)+(1-0.5)*(6-(-4))=4, and the cumulative change amount of the first model parameter value is Then we get the change of the first model parameter value
[0132] In this way, the memory of the communication device only needs to store the first model parameter value received last time, the effective change amount and the cumulative change amount of the first model parameter value determined last time, and then the effective change amount and the cumulative change amount of the first model parameter value can be determined based on the first model parameter value received this time, and then the change amount of the first model parameter value can be determined. The change amount of the first model parameter value can be determined using a relatively low storage space.
[0133] In some other embodiments, the communication device may determine the change amount of the first model parameter value this time based on the change amount of the first model parameter value each time in the most recent detections.
[0134] For example, the communication device obtains the changes in the values of the first model parameters for the most recent a times, respectively k1, k2, k3…k a ; Then the effective change of the first model parameter value is The cumulative change of the first model parameter value is Therefore, the change in the value of the first model parameter Where b is a natural number, which is the intermediate data used for calculation. For example, if a=3, then the effective change of the first model parameter value in the sixth detection is Wherein, k0 represents the difference between the first model parameter values obtained in the sixth detection and the fifth detection.
[0135] It is understandable that if the amount of data stored in the communication device is insufficient, all the stored data can be used to determine the change in the value of the first model parameter. Exemplarily, assuming a=10, the communication device needs to store the changes in the values of the first model parameter for the last 10 times. When the number of changes in the values of the first model parameter stored is insufficient, the changes in the values of the first model parameter stored are used to obtain the change in the values of the first model parameter for this time. For example, for the sixth detection, only the data of the first five times is retained in the memory, which is less than 10 times, and the data of these five times is used to obtain the change in the values of the first model parameter for this time.
[0136] S102: If the communication device determines that the first model parameter is stable based on the change in the value of the first model parameter, the communication device stops sending the update amount of the first model parameter value to the central server within a preset time period.
[0137] Among them, the communication device is used to perform model training based on user data, and determine the update amount of the model parameter values during the model training process, and the update amount can also be called a gradient. After the communication device receives the updated model parameter values sent by the central server, it will build a model and train the model using local user data. During the training process, the model parameter values will be adjusted based on the user data, and then the update amount of the model parameter values will be obtained, and the update amount of the model parameter values will be 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, and the specific determination method can refer to the prior art, and the embodiment of the present application does not specifically limit this.
[0138] Exemplarily, a detection period can be set, and the communication device obtains the change in the value of the first model parameter according to the detection period, that is, according to the detection period, periodically determines whether the first model parameter is stable. It is understandable that the communication device will also send the updated value of the first model parameter to the central server according to the preset sending period. In addition, the change in the value of the first model parameter will only be generated after the data is sent and received, so the sending period must be smaller than the detection period. For example: the sending period is 5s, and the detection period is 10s. The communication device sends the updated value of the first model parameter to the central server every 5s, and similarly the central server sends the first model parameter value to the communication device every 5s. The communication device confirms the change in the value of the first model parameter every 10s, and determines whether the first model parameter is stable based on the change.
[0139] In this way, the change amount of the first model parameter value can be periodically determined through the above step S101, and then whether the first model parameter is stable can be determined according to the change amount of the first model parameter value. Exemplarily, a preset threshold can be set according to experimental data or historical experience values, and if the change amount of the first model parameter value obtained by the method in the above step S101 is less than the preset threshold, the first model parameter is judged to be stable. If the first model parameter is stable, the communication device stops sending the update amount of the first model parameter value to the central server within the preset period, and correspondingly, the central server also stops sending the first model parameter value to the communication device within the preset period. That is, after the first model parameter is stable, the first model parameter value 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 the first model parameter is stable. In other words, the first model parameter is a model parameter that participates in determining whether it is stable, and its number is not limited, and it can be any one or more model parameters. If it is determined that the first model parameter is stable, the first model parameter is a model parameter that does not participate in the transmission within the preset period. The second model parameter is a model parameter that participates 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 can be one or more. Optionally, all the first model parameters and all the second model parameters constitute all the model parameters (also referred to as third model parameters).
[0140] In some embodiments, during the preset period of time when the first model parameter stops transmitting, the historical information of the first model parameter no longer changes. After the preset period of time, the communication device sends the updated amount of the first model parameter value to the central server and receives the first model parameter value sent by the central server. Then, after the preset period of time is reached, after the first model parameter automatically starts to participate in the transmission, it will also start to automatically record historical information. For example, it automatically starts to record the effective change amount of the first model parameter value and the cumulative change amount of the first model parameter value.
[0141] In some embodiments, the communication device and the central server can transmit model parameter values and update amounts via messages. Figure 4 As shown in (a), a message structure provided by an embodiment of the present application includes a message header and message data. The message header information includes the destination address, source address, header, and length / type of the message.
[0142] The source address and destination address mentioned above are both media access control address (MAC) addresses, and the specific structure of the message can refer to the prior art. In the embodiment of the present application, the header includes an identification bit corresponding to the update amount of the model parameter value.
[0143] In one 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, and the value of the identification bit is used to indicate whether the communication device transmits the update amount of the third model parameter value to the central server. Exemplarily, a special character can be set in the identification bit, such as the identification bit value "1" indicates that the communication device sends the update amount of the model parameter value corresponding to the identification bit to the central server. The identification bit value "0" indicates that the communication device does not send the update amount of the model parameter value corresponding to the identification bit to the central server. In this way, the central server knows based on the value of the identification bit of the header that the communication device did not transmit the update amount of the first model parameter value within the preset time period, but transmitted the update amount of the second model parameter value. In other words, the update amount of the model parameter value transmitted between the communication device and the central server is the update amount of the third model parameter value, and the update amount of the third model parameter value includes the update amount of the second model parameter value that is determined to be transmittable and the update amount of the first model parameter value that cannot be transmitted within the preset time period. For example, Figure 4 As shown in (a), a possible implementation method of the identification bit corresponding to the update amount of the model parameter value is assumed to include five model parameters A, B, C, D, E and F. Among them, the communication device determines that the three model parameters B, E and F of the first model parameters are stable, then the value of the identification bit corresponding to the update amount of the three first model parameter values B, E and F is 0. The value of the identification bit corresponding to the update amount of the three second model parameter values A, C and D is 1. It means that the data segment of the message transmitted this time contains the data corresponding to the A, C and D model parameters, and does not contain the data corresponding to the B, E and F model parameters.
[0144] In another possible design of the message, the packet header of the message includes the update amount of the second model parameter value and the value of the corresponding identification bit. In the preset 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 update amount of the second model parameter value is used to indicate that the communication device transmits the update amount of the second model parameter value to the central server. For example, Figure 4As shown in (b), a possible implementation method of the identification bit corresponding to the update amount of the model parameter value, the value of the identification bit corresponding to the update amount of the three second model parameter values A, C and D carried in the message, the value can be set to 1, which means that the data corresponding to the A, C and D model parameters are included in the data segment of the message transmitted this time.
[0145] It is understandable that there may be other ways of designing the message header to indicate the meaning of the model parameters being transmitted. For example, the order of the update amount of the third model parameter value in the message to be transmitted is pre-set between the communication device and the central server. Afterwards, after the communication device determines that the first model parameter is stable, the message transmitted to the central server does not directly contain the update amount of the first model parameter value. The central server may also determine which update amounts of the first model parameter values have stopped being transmitted based on the vacant bits, and may also know which update amounts of the 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 identification bit corresponding to the update amount of the first model parameter value may be empty. In this way, the central server may know that, based on the value of the identification bit of the message being empty, the update amount of the model parameter value with the identification bit being empty within the preset time period is the update amount of the first model parameter value not transmitted by the communication device.
[0146] In some embodiments, each time the communication device determines that the first model parameter is stable and needs to stop transmitting the updated amount of the first model parameter value, it is also necessary to determine the ratio of the number of the first model parameter to the number of the third model parameter. 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, the value of the preset threshold is reduced. In other words, after the number of model parameters that stop transmitting reaches a certain ratio, it is necessary to lower the threshold for determining whether the model parameters are stable, thereby reducing the number of model parameters that stop transmitting, and ensuring that the number of model parameters participating in model training is the number of model parameters with updated values.
[0147] In this way, the preset threshold is adjusted dynamically to avoid too many model parameters that stop transmitting, which prolongs the model training process or affects the final accuracy of the model. For example, when a large number of model parameters stop transmitting, only the unchanged values of the model parameters that stop transmitting can be used to train the model within the preset period, and the training effect may not be ideal. Only after the preset period of each model parameter that stops transmitting is reached, the updated values of these model parameters can be obtained and the model can be trained again, resulting in too long a training time for the model to reach the model convergence condition.
[0148] S103: The communication device receives the second model parameter value sent by the central server, wherein the second model parameter value does not include the first model parameter value within a preset time period.
[0149] Exemplarily, after the communication device sends the updated amount of the second model parameter value to the central server, the central server obtains the updated amount of the model parameter value sent by one or more communication devices, and sends the updated value of the second model parameter to the corresponding communication device. Wherein, within the preset time period, the first model parameter does not participate in the transmission, and the updated value of the second model parameter does not include the updated value of the first model parameter.
[0150] In some embodiments, after a preset period of time, 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.
[0151] That is to say, if the communication device does not send the updated amount of the first model parameter value to the central server within the preset period, 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 amount of data in both directions between the communication device and the central server. After the preset period, the communication device and the central server will automatically start to transmit the first model parameter value and the updated amount of the value, realizing adaptive adjustment of the amount of transmitted data.
[0152] Exemplarily, if the communication device determines the change in the value of the first model parameter, it needs to first receive the first model parameter value sent by the central server before it can determine the change based on the first model parameter value received this time and the first model parameter value received previously. Therefore, step S104 can also be included before the above-mentioned step S101.
[0153] S104: The communication device receives a second model parameter value sent by the central server.
[0154] In some embodiments, initially, the communication device receives the third model parameter value sent by the central server as all the model parameter values used for model training. In the subsequent interaction process, the number of the third model parameters will change according to the number of updates of the model parameter values sent by the communication device to the central server, such as changing to the second model parameter except the first model parameter that stops transmitting. That is, after the communication device sends the update amount of the model parameter value to the central server, the central server will determine the updated value of the model parameter according to the update amount of the model parameter value, and then send the updated value to the communication device. Subsequently, according to the detection cycle, after the communication device receives the second model parameter value, it will judge the stability of all or part of the model parameters, and the all or part of the model parameters are the first model parameters in the above step S101. In the distributed system of machine learning, the model training process includes the interactive process of transmitting the update amount or value of the model parameter between the communication device and the central server. In the interactive process, the convergence of the model is achieved and the training process is completed.
[0155] In the above steps S101 to S103, each communication device determines the stability of the first model parameter value, and then determines whether to stop transmitting the update amount of the first model parameter value. It is understandable that the central server can also determine the stability of the first model parameter value to confirm whether to stop transmitting the first model parameter value. In addition, a notification can also be sent to each corresponding communication device to inform the corresponding communication device of the judgment result, thereby ensuring that each communication device knows whether to stop sending the update amount of the first model parameter value to the central server in the next sending cycle.
[0156] Therefore, the communication method for model training provided in the embodiment of the present application stops transmitting the update amount of the first model parameter value within a preset period of time if the first model parameter value is determined to be stable. It can flexibly reduce the amount of data transmitted between the communication device and the central server without losing the accuracy of model training, thereby improving communication efficiency.
[0157] In the above step S102, the communication device sends the updated amount of the model parameter value to the central server according to the sending cycle, 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 cycle, determines the updated amount of the model parameter value for which transmission can be stopped, and obtains a duration for each detection. If the first model parameter is stable, the obtained duration is the duration of the preset period for stopping transmission; if the first model parameter is unstable, the obtained duration is the duration used to adjust the duration obtained when determining whether the first model parameter value is stable next time. In this way, in the process of interactive transmission of model parameter values and the updated amount of values between the communication device and the central server, it is possible to flexibly adjust the model parameters for which transmission can be stopped and the corresponding duration. See. Figure 5 The flowchart shown can realize the transmission process of the model parameter values and the update amount of the values in the cyclic interaction between the communication device and the central server, and realize the flexible adjustment of the obtained duration through the following steps. Among them, the duration of the preset period of stopping the transmission of the first model parameter can be an integer multiple of the sending cycle, or it can be any customized duration, and the embodiment of the present application does not make specific limitations on this.
[0158] Step 1: Determine whether the first model parameter is stable.
[0159] Exemplarily, after starting the model training process, the communication device will receive the third model parameter value sent by the central server, and the communication device will use the third model parameter value to build a local model, and use local data to train the model, and send 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 to build the model. When the model training process starts for the first time, the central server will send all the model parameter values to the communication device for building the initial model.
[0160] Afterwards, the receiving central server sends the updated third model parameter value, and determines whether the first model parameter value is stable through the method 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 updated value of the first model parameter value.
[0161] Step 2: obtaining a preset time period for stopping transmission of the update amount of the first model parameter value as an initial time period.
[0162] Exemplarily, after determining that the first model parameter is stable, indicating that the first model parameter has converged, the transmission of the update amount of the first model parameter value can be stopped within a preset period of time, thereby reducing the amount of data communicated between the communication device and the central server. At this time, the preset period of time for which the transmission of the update amount of the first model parameter value needs to be stopped is the initial duration. The initial duration can be an integer number of sending cycles or a custom time period, and the duration can be adjusted later by increasing or decreasing the number of sending cycles or the custom time period.
[0163] In some embodiments, after determining that it is necessary to stop transmitting the update amount of the first model parameter value, it is also necessary to calculate the ratio of the number of the first model parameters that are stopped from transmitting to the number of the third model parameters. If it is greater than the preset ratio, the preset threshold is reduced. By reducing the preset threshold for determining whether the first model parameter is stable, the number of model parameters that are stopped from transmitting can be reduced in the subsequent process of determining whether the first model parameter is stable, thereby ensuring the accuracy of model training. Among them, the preset ratio can be customized according to the empirical value.
[0164] Step 3: When the initial duration is reached, the update amount of the first model parameter value begins to be transmitted.
[0165] Exemplarily, after reaching the preset time period, the first model parameter that stops transmitting automatically participates in the transmission according to the transmission cycle. During the transmission process, it is determined whether the first model parameter is stable according to the detection cycle. If the first model parameter is stable, step 4 is executed; if the first model parameter is unstable, step 8 is executed.
[0166] Step 4: The preset time period for stopping the transmission of the update amount of the first model parameter value is greater than the initial time period.
[0167] Exemplarily, after confirming that the first model parameter is stable, it is necessary to obtain a preset time period for stopping the transmission of the updated amount of the first model parameter value, and stop the transmission within the preset time period. Since the time period obtained when the first model parameter was last judged was the initial time period, the time period of the preset time period obtained for this time of judging stability must be greater than the initial time period obtained last time. For example, if the initial time period obtained by model parameter 1 in the last detection cycle is 1 sending cycle, then after stopping the transmission for 1 sending cycle, model parameter 1 automatically participates in the transmission. The sending cycle is shorter than the detection cycle, so model parameter 1 will be detected again after participating in the transmission for a period of time. If it is determined that model parameter 1 is stable this time, a preset time period greater than 1 sending cycle can be obtained, such as 2 sending cycles.
[0168] In some embodiments, similar to the above step 2, it is necessary to calculate the ratio of the number of first model parameters that stop transmitting to the number of third model parameters. If it is greater than a preset ratio, the preset threshold is reduced.
[0169] Step 5: When the preset time period is reached, the update amount of the first model parameter value begins to be transmitted.
[0170] Exemplarily, after reaching the preset time period, the first model parameter that stopped transmitting automatically starts to participate in the transmission and continues to participate in the determination of its stability. If the first model parameter is stable, step six is executed; if the first model parameter is unstable, step seven is executed.
[0171] Step 6: The preset time period for stopping the transmission of the update amount of the first model parameter value is obtained to be greater than the time period obtained last time.
[0172] Exemplarily, since the first model parameter is stable this time, it is necessary to obtain a preset time period for stopping transmission of the update amount of the first model parameter value and stop transmission within the preset time period. The preset time period for stopping transmission should be longer than the time obtained in the last detection.
[0173] In some embodiments, similar to the above step 2, it is necessary to calculate the ratio of the number of first model parameters that stop transmitting to the number of third model parameters. If it is greater than a preset ratio, the preset threshold is reduced.
[0174] After completing step 6, return to step 5, that is, after the transmission starts automatically after reaching the preset time period, continue to determine whether the value of the first model parameter is stable. That is, the entire model training process is a cyclic interaction process of model parameter values and value update between the communication device and the central server. During the model training process, the stability of the model parameters needs to be repeatedly determined according to the detection cycle and the corresponding duration is obtained.
[0175] That is to say, the communication device determines the change in the value of the first model parameter M times. Wherein, M is a positive integer greater than or equal to 2. The preset condition that the communication device determines to satisfy the preset time period based on the k-th stable state of the first model parameter includes: if the first model parameter is determined to be stable based on the change in the value of the first model parameter for the kth time, then the duration of the preset time period is the first duration, and the first duration is greater than the second duration. Wherein, the second duration is the duration of the preset time period during which the update amount of the first model parameter value is stopped from being sent to the central server when the first model parameter is determined to be stable for the k-1th time. Alternatively, the second duration is the duration obtained when it is determined for the k-1th time that the first model parameter is not stable, and is used to adjust the preset time period duration corresponding to the next time the first model parameter is stable; wherein, k is a positive integer, k≤M.
[0176] Step 7: Continue to transmit the updated value of the first model parameter value, and obtain a duration that is less than the duration obtained last time.
[0177] Exemplarily, since the first model parameter is unstable, it is necessary to obtain a duration for adjusting the duration of the next detection, and the duration obtained this time should be less than the duration obtained in the previous detection. The value of the first model parameter in the previous detection can be stable or unstable.
[0178] After completing step seven, return to step five, that is, continue to determine whether the value of the first model parameter is stable in the next detection cycle.
[0179] That is to say, the communication device determines the change in the value of the first model parameter M times. Wherein, M is a positive integer greater than or equal to 2. The communication device determines the preset condition that the preset time period satisfies according to the k-th stable state of the first model parameter, and further includes: if the first model parameter is determined to be unstable for the k-th time, then the third duration obtained for adjusting the preset time period duration corresponding to the next time the first model parameter is stable is less than the fourth duration. Wherein, the fourth duration is the duration of the preset time period for stopping sending the updated amount of the first model parameter value to the central server when the first model parameter is determined to be stable for the k-1th time. Alternatively, the fourth duration is the duration obtained for adjusting the preset time period duration corresponding to the next time the first model parameter is stable when the first model parameter is determined to be unstable for the k-1th time.
[0180] Step 8: Continue to transmit the updated value of the first model parameter value, and obtain a duration that is less than the initial duration.
[0181] Exemplarily, if the first model parameter is unstable, the transmission continues, and this time a duration for adjusting the duration of the next detection can be obtained, and this time the duration will be smaller than the initial duration.
[0182] That is to say, in the process of transmitting the model parameter values and the updated amount of the values between the communication device and the central server, a duration will be obtained after each detection to determine the change in the value of the first model parameter. If the first model parameter is determined to be stable this time, indicating that the first model parameter has converged, it is necessary to increase the duration of the first model parameter to stop transmitting the updated amount of the value, then the obtained duration is the duration of the preset period, and the duration is greater than the duration obtained in the previous detection. If the first model parameter is determined to be unstable this time, indicating that the first model parameter has not converged, it is necessary to reduce the duration of the first model parameter to stop transmitting the updated amount of the value next time, then the obtained duration is the duration used to adjust the duration obtained for the next detection, and the duration is less than the duration obtained in the previous detection.
[0183] In this way, the duration of the preset period of stopping transmission can be dynamically adjusted according to the stable state of the first model parameter, and the number of model parameters of the parameter model training transmitted between the communication device and the central server can be flexibly controlled, thereby ensuring that the accuracy of the final model meets the requirements.
[0184] Based on the above steps 1 to 8, for example, if the duration of the preset time period is adjusted based on the duration of the sending cycle, then if the k-th communication device determines that the first model parameter is stable based on the change in the value of the first model parameter, it stops sending the update amount of the value of the first model parameter to the central server within n sending cycles, where n is a positive integer.
[0185] After n sending cycles, if the k+1th communication device determines that the first model parameter is stable according to the change in the first model parameter value, it stops sending the update amount of the first model parameter value to the central server within (n+m) sending cycles, where m is a positive integer.
[0186] After n sending cycles, if the k+1th communication device determines that the first model parameter is not stable according to the change in the value of the first model parameter, then if the k+2th communication device determines that the first model parameter is stable according to the change, it stops sending the update amount of the first model parameter value to the central server within (n / r+m) sending cycles. Where r is a positive integer greater than or equal to 2, and (n / r)≥1.
[0187] Exemplarily, assuming that in the fifth (kth) detection, the length of the preset time period during which the first model parameter is stably obtained is 2 sending cycle lengths.
[0188] If the first model parameter is detected to be stable for the sixth time (k+1th time) after the preset time period, the duration of the preset time period may be 2+1=3 sending cycle durations.
[0189] If the first model parameter is detected to be unstable for the sixth time (k+1th time) after the preset period, the obtained duration can be 2 / 2=1 transmission cycle duration. If the first model parameter is detected to be stable for the seventh time (k+2th time), the obtained duration of the preset period can be 2 / 2+1=2 transmission cycle durations.
[0190] like Figure 6 As shown, it is a flow chart of another communication method based on model training provided in an embodiment of the present application, and the method may include S201-S203:
[0191] S201: The central server receives an update amount of a second model parameter value sent by a communication device. Within a preset period of time, the update amount of the second model parameter value does not include an update amount of the first model parameter value.
[0192] The first model parameter is a model parameter that is determined to be stable according to the change in the value of the first model parameter. The process of determining that the first model parameter is stable includes determining that the first model parameter is stable if the change in the value of the first model parameter is less than a preset threshold. The specific method can refer to the relevant description of the above step S101, which will not be repeated here.
[0193] 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 the user data during the model training process. That is, the communication device determines the update amount of the model parameter value according to the user data during the model training process. In addition, the communication device determines 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.
[0194] Exemplarily, after a preset period of time, 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.
[0195] That is to say, the central server will determine whether the communication device has stopped transmitting part of the model parameters according to the update amount of the received model parameter values. If the transmission of part of the model parameters has been stopped, the central server will also stop transmitting the model parameters that the communication device has stopped transmitting within a preset period of time. This will reduce the amount of data transmitted in both directions and improve communication efficiency.
[0196] For the rest of the content, please refer to the relevant description of step S101 to step S103, which will not be repeated here.
[0197] S202. The central server determines an updated value of the second model parameter according to an update amount of the second model parameter value.
[0198] Exemplarily, after the central server receives the update amount of the model parameter value sent by each communication device, it will average and superimpose the update amount of the model parameter 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 be referred to the prior art, and the embodiment of the present application will not be repeated here.
[0199] S203: The central server sends the updated value of the second model parameter to the communication device. Within a preset period of time, the updated value of the second model parameter does not include the updated value of the first model parameter.
[0200] Exemplarily, the model parameter values and update amounts are transmitted between the central server and the communication device via messages.
[0201] In one possible design of the message, the central server sends a message to the communication device, the message including the updated value of the third model parameter and the value of the corresponding identification bit. In which, within a 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.
[0202] 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. In 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 central server transmits the updated value of the second model parameter to the communication device.
[0203] For the rest of the content, please refer to the relevant description of step S101 to step S103, which will not be repeated here.
[0204] Exemplarily, if the central server receives the update amount of the second model parameter value sent by the communication device, it is necessary to first send the model parameter value to the communication device so that the communication device can determine the change amount of the model parameter value based on the model parameter value, and then determine the update amount of the second model parameter value that can be transmitted, and send the update amount of the second model parameter value to the central server. Therefore, step S204 can also be included before step S201.
[0205] S204: The central server sends a second model parameter value to the communication device.
[0206] For example, the rest of the content can refer to the relevant description of step S104, which will not be repeated here.
[0207] Communication method based on model training provided by the present application. The effect of the technical solution provided by the embodiment of the present application is described below in combination with specific experimental data.
[0208] The model training method in the distributed system of machine learning provided in the embodiments of the present application and the prior art is implemented on the Pytorch platform. Among them, the client in the distributed system of machine learning includes 50 communication devices. Each communication device is configured as m5.xlarge, including 2vCPUs, 8GB of memory, 9Mbps download bandwidth, and 3Mbps upload bandwidth. The server side is a central server, configured as c5.9xlarge, with a bandwidth of 10Gbps. The Pytorch platform is installed in the communication device and the central server to form a cluster, and the cluster information includes an elastic compute cloud (EC2) cluster.
[0209] The embodiments of the present application mainly analyze the experimental data structure from the following three aspects, reflecting the beneficial effects of the technical solution provided by the present application: overall performance, convergence and overhead. Among them, the experimental results are mainly compared with the standard distributed system algorithm of machine learning. The training data set includes a small data set CIFAR-10 for identifying ubiquitous objects and a keyword spotting dataset (KWS). The neural network model includes LeNet, a residual network (ResNet) 18 and a long short-term memory network (LSTM) with two layers of loops (recurrent layer). Among them, LeNet and ResNet18 use the data set CIFAR-10 to train the neural network model. The LSTM with two layers of loops (recurrent layer) uses the data set KWS to train the neural network model.
[0210] First, comparison of overall performance.
[0211] The process of training three neural network models is compared by using the communication method for model training provided in the embodiment of the present application and the communication method for model training in the prior art, and the total amount of data transmission between the communication device and the central server and the average time of each transmission are obtained.
[0212] As shown in Table 1 below, a comparison of the total amount of data transmission is shown.
[0213] Table 1
[0214]
[0215]
[0216] As shown in Table 2 below, the average training time is compared.
[0217] Table 2
[0218] Model LeNet ResNet18 KWS-LSTM This application 0.74ms 139s 1.8s Prior art 1.02s 158s 2.2s Improved ratio 27.45% 12.03% 18.18%
[0219] Thus, it can be seen from the experimental data in Table 1 and Table 2 above that the technical solution provided in the embodiment of the present application can effectively reduce the amount of data of 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 model parameter transmission.
[0220] The second aspect is convergence analysis.
[0221] By analyzing the accuracy of the three neural network models and the number of model parameters that stopped transmission, we obtained the following Figure 7The experimental data analysis diagram of LeNet shown in the figure, Figure 8 The experimental data analysis chart of ResNet18 shown in the figure and Fig. 9 The experimental data results analysis diagram of KWS-LSTM is shown.
[0222] Figure 7 , Figure 8 and Fig. 9 The horizontal axis represents the communication rounds between the communication device and the central server, and the vertical axis represents the accuracy of the neural network model or the proportion of the number of model parameters that stop transmitting. The thick solid line represents the accuracy of the neural network model obtained by adopting the technical solution of the present application. The thin solid line represents the accuracy of the neural network model obtained by adopting the technical solution in the prior art. The dotted line represents the proportion of the number of model parameters that stop transmitting during the model training process to the number of all model parameters after adopting the technical solution of the embodiment of the present application.
[0223] It can be seen that, by using the technical solution provided in the embodiment of the present application, after stopping the transmission of some model parameters, the model can still be converged after a limited number of communication rounds, and the precision (accuracy) is stable. And the accuracy of the neural network model will not be reduced.
[0224] The third aspect is cost comparison.
[0225] Among them, the overhead includes the time overhead and memory overhead generated by the three neural network models after using the technical solution provided in the embodiments of the present application for model training communication, as well as the increased time overhead ratio and memory overhead ratio compared with the model training communication method in the prior art.
[0226] Table 3
[0227] Model LeNet ResNet18 KWS-LSTM Time cost 0.009s 1.278s 0.011s Increase in time cost 1.93% 4.50% 1.42% Memory overhead 1.2M 142MB 4.8MB Memory overhead increase ratio 0.18% 8.51% 2.35%
[0228] According to the experimental data in Table 3 above, it can be seen that the technical solution provided by the embodiment of the present application increases the time overhead and memory overhead by a small proportion and will not have too much impact on the model training process.
[0229] In summary, compared with the standard machine learning distributed system algorithm in the prior art, the technical solution provided by the embodiment of the present application can effectively reduce the total amount of data transmission and the average time of each transmission in terms of overall performance. Moreover, it will not have a significant impact on the accuracy of the neural network model and the overhead generated during the training process.
[0230] Fig.10 FIG. 1 shows a possible structural diagram of a communication device based on model training involved in the above embodiment. Fig.10As shown, the communication device 1000 based on model training includes: a processing unit 1001, a sending unit 1002 and a receiving unit 1003.
[0231] The processing unit 1001 is used to support the communication device 1000 to perform based on model training. Figure 3 Steps S101, S102 and / or other processes for the technology described in this article.
[0232] The sending unit 1002 is used to support the communication device 1000 to perform based on model training. Figure 3 Step S102 in and / or other processes for the technology described herein.
[0233] The receiving unit 1003 is used to support the communication device 1000 to perform the model training based on Figure 3 Step S103 in and / or other processes for the technology described herein.
[0234] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional unit, and will not be repeated here.
[0235] Fig.11 FIG. 1 shows a possible structural diagram of a communication device based on model training involved in the above embodiment. Fig.11 As shown, the communication device 1100 based on model training includes: a receiving unit 1101, a processing unit 1102 and a sending unit 1103.
[0236] The receiving unit 1101 is used to support the communication device 1100 based on model training to perform Figure 6 Step S201 in and / or other processes for the technology described herein.
[0237] Processing unit 1102, used to support the communication device 1100 to perform based on model training Figure 6 Step S202 in and / or other processes for the technology described herein.
[0238] The sending unit 1103 is used to support the communication device 1100 based on model training to perform Figure 6 Step S203 in and / or other processes for the technology described herein.
[0239] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional unit, and will not be repeated here.
[0240] The present application also provides a chip system, such as Fig.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 via lines. 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 processor 1201). Exemplarily, the interface circuit 1202 can read instructions stored in the memory and send the instructions to the processor 1201. When the instruction is executed by the processor 1201, the model-based training communication device can perform the various steps in the model-based training communication method in the above embodiment. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of the present application.
[0241] An embodiment of the present application also provides a computer storage medium, which stores computer instructions. When the computer instructions are executed on a communication device based on model training, the communication device based on model training executes the above-mentioned related method steps to implement the communication method based on model training in the above-mentioned embodiment.
[0242] An embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer executes the above-mentioned related steps to implement the communication method based on model training in the above-mentioned embodiment.
[0243] In addition, an embodiment of the present application also provides a device, which may specifically be a component or a module, and the device may include a connected processor and a memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor may execute the computer-executable instructions stored in the memory, so that the device executes the model training-based communication method in the above-mentioned method embodiments.
[0244] 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 repeated here.
[0245] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, 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 process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0246] In the several embodiments provided in 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 only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of modules or units, which can be electrical, mechanical or other forms.
[0247] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0248] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0249] If the 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 this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk and other media that can store program instructions.
[0250] The above is only a specific implementation 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 included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A communication method based on model training, characterized in that: Applied in a system including a central server and a communication device; the method comprises: The communication device determines a change in a value of a first model parameter; If the communication device determines that the first model parameter is stable according to the change in the value of the first model parameter, the communication device stops sending the update amount of the first model parameter value to the central server within a preset time period; wherein the update amount of the first model parameter value is determined by the communication device according to user data during model training; the duration of the preset time period is dynamically adjusted by the communication device according to the stable state of the first model parameter and preset conditions; the preset conditions include: if the first model parameter is determined to be stable according to the change in the value of the first model parameter for the kth time, the duration of the preset time period is the first duration, and the first duration is greater than the second duration; wherein the second duration is the duration of the preset time period when the update amount of the first model parameter value is stopped from being sent to the central server when the first model parameter is determined to be stable for the k-1th time; or, the second duration is the duration of the preset time period corresponding to the next time the first model parameter is stable, obtained when the first model parameter is determined to be not stable for the k-1th time; wherein k is a positive integer, k≤M, M is the number of times the communication device determines the change in the value of the first model parameter, and M is a positive integer greater than or equal to 2; The communication device receives a second model parameter value sent by the central server; wherein, within the preset time period, the second model parameter value does not include the first model parameter value; the first model parameter and the second model parameter are model parameters generated in the same model training process.
2. The method according to claim 1, characterized in that The method further comprises: After the preset period of time, 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.
3. The method according to claim 1, characterized in that The communication device stops sending the update amount of the first model parameter value to the central server within a preset period of time, including: The communication device sends a message to the central server, wherein the message includes an update amount of a third model parameter value and a value of a corresponding identification bit; the update amount of the third model parameter value includes an update amount of the second model parameter value and an 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 communication device has not transmitted the update amount of the first model parameter value to the central server; Alternatively, the communication device sends a message to the central server, wherein the message includes 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 communication device transmits the update amount of the second model parameter value to the central server.
4. The method according to claim 1, characterized in that The communication device determines a change in a value of a first model parameter, including: The communication device obtains a change in the value of the first model parameter according to 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 values includes: the effective change amount of the first model parameter value and the accumulated change amount of the first model parameter value.
6. The method according to any one of claims 1 to 5, characterized in that: The communication device determines, according to a change in a value of the first model parameter, that the first model parameter is stable, including: If the change in 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 claim 1, characterized in that The preset conditions also include: If it is determined for the kth time that the first model parameters are not stable, then the third time duration obtained is used to adjust the preset time period corresponding to the next time the first model parameters are stable, and the third time duration is less than the fourth time duration; wherein the fourth time duration is the time duration of the preset time period for stopping sending the updated amount of the first model parameter value to the central server when the first model parameters are determined to be stable for the k-1th time; or, the fourth time duration is the time duration obtained when it is determined for the k-1th time that the first model parameters are not stable and is used to adjust the preset time period corresponding to the next time the first model parameters are stable.
8. The method according to claim 1, characterized in that 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, including: If the communication device determines that the first model parameter is stable according to the change in the value of the first model parameter for the kth time, then stop sending the update amount of the value of the first model parameter to the central server within n sending cycles; wherein n is a positive integer; After the n sending cycles, if the communication device determines that the first model parameter is stable according to the change in the value of the first model parameter for the k+1th time, then stop sending the update amount of the value of the first model parameter to the central server within (n+m) sending cycles; wherein m is a positive integer; After the n sending cycles, if the communication device determines that the first model parameter is not stable according to the change in the value of the first model parameter for the k+1th time, then if the communication device determines that the first model parameter is stable according to the change in the value of the first model parameter for the k+2th time, stop sending the update amount of the first model parameter value to the central server within (n / r+m) sending cycles; wherein r is a positive integer greater than or equal to 2, and (n / r)≥1; The sending period is a period during which the communication device sends an update amount of the model parameter value to the central server.
9. The method according to claim 8, characterized in that The method further comprises: The communication device determines a change in the value of the first model parameter according to a detection period; and the sending period is smaller than the detection period.
10. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: If the communication device determines that the ratio of the number of the first model parameters to the number of the third model parameters that are stable is greater than a preset ratio, the value of the preset threshold is reduced.
11. The method according to any one of claims 1 to 5, characterized in that: Before the communication device determines the change in the value of the first model parameter, the method further includes: The communication device receives the second model parameter value sent by the central server.
12. A communication method based on model training, characterized in that: Applied in a system including a central server and a communication device; the method comprises: The central server receives the update amount of the second model parameter value sent by the communication device; 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; 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 duration of the preset time period is dynamically adjusted by the communication device according to the stable state of the first model parameter and the preset condition; the preset condition includes: if the first model parameter is determined to be stable according to the change amount of the first model parameter value for the kth time, then the duration of the preset time period is the first duration, and the first duration is greater than the second duration; wherein 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 the first model parameter is determined to be stable for the k-1th time; or, the second duration is the duration of the preset time period corresponding to the next time the first model parameter is stable, obtained when the first model parameter is determined to be unstable for the k-1th time; wherein k is a positive integer, k≤M, M is the number of times the communication device determines the change amount of the first model parameter value, and M is a positive integer greater than or equal to 2; 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 time period, the updated value of the second model parameter does not include the updated value of the first model parameter; the first model parameter and the second model parameter are model parameters generated during the same model training process.
13. The method according to claim 12, characterized in that The method further comprises: After the preset period of time, the central server sends the first model parameter value to the communication device and receives an update amount of the first model parameter value sent by the communication device.
14. The method according to claim 12, characterized in that The central server sends 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 the updated value of the first model parameter, including: The central server sends a message to the communication device, wherein 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 an updated value of the second model parameter and an 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, wherein 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.
15. The method according to any one of claims 12 to 14, characterized in that The first model parameter is a stable model parameter determined according to a change in the value of the first model parameter, including: If the change in the value of the first model parameter is less than a preset threshold, it is determined that the first model parameter is stable.
16. The method according to any one of claims 12 to 14, characterized in that: Before the central server receives the update amount of the second model parameter value sent by the communication device, the method further includes: The central server sends the second model parameter value to the communication device.
17. A communication device based on model training, characterized in that: The device comprises: a processing unit, a sending unit, and a receiving unit; The processing unit is used to determine the change in 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 in the value of the first model parameter; A sending unit, used for sending the update amount of the first model parameter value to the central server; if the processing unit determines that the first model parameter is stable according to the change amount of the first model parameter value, the sending unit stops sending the update amount of the first model parameter value to the central server within a preset time period; wherein the update amount of the first model parameter value is determined by the processing unit according to user data during the model training process; the duration of the preset time period is dynamically adjusted by the communication device according to the stable state of the first model parameter and preset conditions; the preset conditions include: if the kth time according to the change amount of the first model parameter value If the first model parameter is determined to be stable by quantitative measurement, the duration of the preset time period is the first duration, and the first duration is greater than the second duration; wherein 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 the first model parameter is determined to be stable for the k-1th time; or, the second duration is the duration of the preset time period corresponding to the next time the first model parameter is stable, obtained when the first model parameter is determined to be unstable for the k-1th time; wherein k is a positive integer, k≤M, M is the number of times the communication device determines the change amount of the first model parameter value, and M is a positive integer greater than or equal to 2; The receiving unit is used to receive the second model parameter value sent by the central server; wherein, within the preset time period, the second model parameter value does not include the first model parameter value; the first model parameter and the second model parameter are model parameters generated in the same model training process.
18. The device according to claim 17, 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 period of time; The receiving unit is further configured to receive the first model parameter value sent by the central server after the preset time period.
19. The device according to claim 17, characterized in that The sending unit is specifically used for: Sending a message to the central server, the message including 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; 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 has not transmitted the update amount of the first model parameter value to the central server; Alternatively, a message is sent to the central server, wherein the message includes 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.
20. The device according to claim 17, characterized in that The processing unit is specifically used for: The change in the value of the first model parameter is obtained according to the historical information of the value of the first model parameter.
21. The device according to claim 20, characterized in that The historical information of the values includes: the effective change amount of the first model parameter value and the accumulated change amount of the first model parameter value.
22. The device according to any one of claims 17 to 21, characterized in that The processing unit is specifically used for: Whether the first model parameter is stable is determined according to the change in the value of the first model parameter. If the change in the value of the first model parameter is less than a preset threshold, it is determined that the first model parameter is stable.
23. The device according to claim 17, characterized in that The preset conditions also include: If it is determined for the kth time that the first model parameters are not stable, then the third time duration obtained is used to adjust the preset time period corresponding to the next time the first model parameters are stable, and the third time duration is less than the fourth time duration; wherein the fourth time duration is the time duration of the preset time period for stopping sending the updated amount of the first model parameter value to the central server when the first model parameters are determined to be stable for the k-1th time; or, the fourth time duration is the time duration obtained when it is determined for the k-1th time that the first model parameters are not stable and is used to adjust the preset time period corresponding to the next time the first model parameters are stable.
24. The device according to claim 17, characterized in that If the processing unit determines for the kth time that the first model parameter is stable according to the change in the value of the first model parameter, the sending unit stops sending the update amount of the first model parameter value to the central server within n sending cycles; wherein n is a positive integer; After the n sending cycles, if the processing unit determines for the k+1th time that the first model parameter is stable according to the change in the value of the first model parameter, then within (n+m) sending cycles, the sending unit stops sending the update amount of the first model parameter value to the central server; wherein m is a positive integer; After the n sending cycles, if the processing unit determines for the k+1th time that the first model parameter is not stable according to the change in the value of the first model parameter, then if the processing unit determines for the k+2th time that the first model parameter is stable according to the change in the value of the first model parameter, within (n / r+m) sending cycles, the sending unit stops sending the update amount of the first model parameter value to the central server; wherein r is a positive integer greater than or equal to 2, and (n / r)≥1; The sending period is a period during which the sending unit sends the update amount of the model parameter value to the central server.
25. The device according to claim 24, characterized in that The processing unit is also used for: The change in the value of the first model parameter is determined according to a detection period; the sending period is smaller than the detection period.
26. The device according to any one of claims 17 to 21, characterized in that The processing unit is also used for: If the processing unit determines that the ratio of the number of the first model parameters to the number of the third model parameters that are stable is greater than a preset ratio, the value of the preset threshold is reduced.
27. The device according to any one of claims 17 to 21, characterized in that 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.
28. A communication device based on model training, characterized in that: The device comprises: a receiving unit, a processing unit, and a sending unit; The receiving unit is used to receive the update amount of the second model parameter value sent by the communication device; 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; 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 duration of the preset time period is adjusted by the communication device according to the stable state dynamics of the first model parameter and the preset conditions; the preset conditions include: if the first model parameter is determined to be stable according to the change amount of the first model parameter value for the kth time, then the duration of the preset time period is the first duration, and the first duration is greater than the second duration; wherein 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 communication device when the first model parameter is determined to be stable for the k-1th time; or, the second duration is the duration of the preset time period corresponding to the next time the first model parameter is stable, obtained when the first model parameter is determined to be unstable for the k-1th time; wherein k is a positive integer, k≤M, M is the number of times the communication device determines the change amount of the first model parameter value, and M is a positive integer greater than or equal to 2; The processing unit is used to determine the updated value of the second model parameter according to the update amount of the second model parameter value; The sending unit is used 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 the updated value of the first model parameter; the first model parameter and the second model parameter are model parameters generated in the same model training process.
29. The device according to claim 28, characterized in that The sending unit is further configured to send the first model parameter value to the communication device after the preset period of time; The receiving unit is further used to receive the update amount of the first model parameter value sent by the communication device.
30. The device according to claim 28, characterized in that The sending unit is specifically used for: Sending a message to the communication device, the message including 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 an updated value of the second model parameter and an 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 has not transmitted the updated value of the first model parameter to the communication device; Alternatively, a message is sent to the communication device, wherein 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 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.
31. The device according to any one of claims 28 to 30, characterized in that The first model parameter is a model parameter that is determined to be stable according to a change in the value of the first model parameter, including: if the change in the value of the first model parameter is less than a preset threshold, determining that the first model parameter is stable.
32. The device according to any one of claims 28 to 30, characterized in that 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.
33. A communication device, characterized in that: include: one or more processors; Memory; And a computer program, wherein 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 executes the communication method based on model training as described in any one of claims 1-11; or, the communication device executes the communication method based on model training as described in any one of claims 12-16.
34. A communication system, characterized in that: include: A central server and at least one communication device, wherein the at least one communication device executes the communication method based on model training as described in any one of claims 1-11; the central server executes the communication method based on model training as described in any one of claims 12-16.
35. A computer storage medium, characterized in that It comprises computer instructions, which, when executed on a communication device based on model training, enable the communication device based on model training to execute a communication method based on model training as described in any one of claims 1 to 11; or enable the communication device to execute a communication method based on model training as described in any one of claims 12 to 16.
36. A chip system, characterized in that: It includes at least one processor and at least one interface circuit, wherein the at least one interface circuit is used to perform transceiver functions 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 model-trained communication method as described in any one of claims 1 to 11; or, enables the communication device to execute the model-trained communication method as described in any one of claims 12 to 16.
Citation Information
Patent Citations
Distributed learning machine learning models for personalization
RU2702980C1
Model training by discarding relatively less relevant parameters
US20180268290A1