Model training method, system, and apparatus, and storage medium
By receiving and adjusting the training state of distributed nodes in federated learning, the problem that the central node cannot understand the training state of distributed nodes in real time is solved, and the performance and efficiency of distributed model training are improved.
Patent Information
- Application Number
- PCT/CN2023/109734
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2025-02-06
AI Technical Summary
In federated learning, central nodes cannot understand the training state of distributed nodes in real time, resulting in inconsistent training efficiency between distributed nodes and reducing the integration performance of global model parameters.
By receiving the training state sent by the distributed node and adjusting the training parameters of the local model based on this state, we ensure that the central node can timely understand and feedback the training situation of the distributed node.
The performance of distributed model training is improved, ensuring the consistent training efficiency of each distributed node, thereby improving the integration performance of global model parameters.
Smart Images

Figure CN2023109734_06022025_PF_FP_ABST
Abstract
Description
Model training method, system, device and storage medium Technical Field
[0001] The present application relates to the field of machine learning, and in particular to a model training method, system, device and storage medium. Background Art
[0002] Federated learning (FL), also known as federated learning, is a distributed machine learning method in which multiple participants exchange model parameters through a secure mechanism without exchanging data, thereby achieving collaborative training effects.
[0003] In federated learning, the multiple participants typically include a central node and multiple distributed nodes. The central node typically does not contain training data, while training data is typically stored in the distributed nodes. The distributed nodes train their local models using the training data and can upload the trained local model parameters to the central node. The central node then integrates the model parameters uploaded by multiple distributed nodes to obtain the global model parameters.
[0004] However, during the above training process, the central node does not know the training status of each distributed node. If the training efficiency among distributed nodes is inconsistent, the integration performance of the global model parameters will be reduced.
[0005] Summary of the Invention
[0006] This application provides a model training method, system, device and storage medium, which help improve the performance of distributed model training.
[0007] In a first aspect, the present application provides a model training method, applied to a first device, comprising: receiving a training status sent by a second device; and adjusting a local model in the second device based on the training status sent by the second device.
[0008] In one possible implementation, the training state is represented by an index value.
[0009] In one possible implementation, the training status includes performance information of the local model in the second device, and adjusting the local model in the second device based on the training status sent by the second device includes: adjusting the training parameters of the local model in the second device based on the training status sent by the second device.
[0010] In one possible implementation, before receiving the training status sent by the second device, the method further includes: receiving local parameters sent by the second device; wherein the local parameters are obtained by the second device after training the local model; global parameters are calculated based on the local parameters of the second device; and determining to send a training status reporting indication to the second device based on the convergence of the global parameters, wherein the training status reporting indication is used to instruct the second device to send the training status.
[0011] In one possible implementation, the training parameters include at least one or more of a learning rate and a quantization accuracy.
[0012] In one possible implementation, the training state includes the training overhead of the second device, and adjusting the local model in the second device based on the training state sent by the second device includes: adjusting the scale and / or task cycle of the local model in the second device based on the training state sent by the second device.
[0013] In one possible implementation manner, the first device is a network device, the second device is a mobile terminal, and the training status is carried via a media access control layer control element MAC CE or physical layer signaling.
[0014] In one possible implementation manner, the physical resources used to transmit the training status are indicated by the first device to the second device.
[0015] In one possible implementation manner, the method further includes: receiving a training exit indication sent by the second device, where the training exit indication is used to indicate that the second device has exited training.
[0016] In the second aspect, the present application provides a model training method, applied to a second device, including: sending a training status to a first device; receiving adjustment information of a local model in the second device sent by the first device; adjusting the local model in the second device based on the adjustment information, and training based on the adjusted local model.
[0017] In one possible implementation, the training state is represented by an index value.
[0018] In one possible implementation, the adjustment information is used to adjust the training parameters of the local model in the second device.
[0019] In one possible implementation, before sending the training status to the first device, the method further includes: sending local parameters to the first device; wherein the local parameters are obtained by the second device after training the local model; and receiving a training status reporting indication sent by the first device, wherein the training status reporting indication is used to instruct the second device to send the training status.
[0020] In one possible implementation, the training parameters include at least one or more of a learning rate and a quantization accuracy.
[0021] In one possible implementation manner, the adjustment information is used to adjust the scale and / or task period of the local model in the second device.
[0022] In one possible implementation manner, the first device is a network device, the second device is a mobile terminal, and the training status is carried via a media access control layer control element MAC CE or physical layer signaling.
[0023] In one possible implementation manner, the physical resources used to transmit the training status are indicated by the first device to the second device.
[0024] In one possible implementation manner, the method further includes: sending an exit training indication to the first device, where the exit training indication is used to indicate that the second device has exited training.
[0025] In a third aspect, the present application provides a first device comprising: a processor and a memory, wherein the memory is used to store a computer program; and the processor is used to run the computer program to implement the model training method as described in the first aspect.
[0026] In a fourth aspect, the present application provides a second device comprising: a processor and a memory, wherein the memory is used to store a computer program; and the processor is used to run the computer program to implement the model training method as described in the second aspect.
[0027] In a fifth aspect, the present application provides a model training device, comprising one or more functional modules, wherein the one or more functional modules are used to implement the model training method as described in the first aspect.
[0028] In a sixth aspect, the present application provides a model training device, comprising one or more functional modules, wherein the one or more functional modules are used to implement the model training method as described in the second aspect.
[0029] In the seventh aspect, the present application provides a model training system, comprising the first device as described in the third aspect and the second device as described in the fourth aspect.
[0030] In an eighth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer-readable storage medium is run on a first device, the first device implements the model training method as described in the first aspect; or, when the computer-readable storage medium is run on a second device, the second device implements the model training method as described in the second aspect.
[0031] In the ninth aspect, the present application provides a computer program, which, when running on a processor of a first device, enables the first device to execute the model training method as described in the first aspect; or, when running on a processor of a second device, enables the second device to execute the model training method as described in the second aspect.
[0032] In one possible design, the program in the ninth aspect may be stored in whole or in part on a storage medium packaged with the processor, or may be stored in whole or in part on a memory not packaged with the processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] FIG1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0034] FIG2 is a schematic diagram of a system architecture provided in an embodiment of the present application;
[0035] FIG3 is a flow chart of an embodiment of a model training method provided by the present application;
[0036] FIG4 is a schematic diagram of air interface transmission resources provided in an embodiment of the present application;
[0037] FIG5 is a flow chart of another embodiment of the model training method provided by the present application;
[0038] FIG6 is a flow chart of another embodiment of the model training method provided by the present application;
[0039] FIG7 is a flow chart of another embodiment of the model training method provided by the present application;
[0040] FIG8 is a schematic structural diagram of an embodiment of a model training device provided by the present application;
[0041] FIG9 is a schematic structural diagram of another embodiment of the model training device provided in this application. DETAILED DESCRIPTION
[0042] In the embodiments of this application, unless otherwise specified, the character " / " indicates that the associated objects are in an "or" relationship. For example, A / B can represent A or B. "And / or" describes the relationship between the associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exists simultaneously, or B exists alone.
[0043] It should be pointed out that the words "first", "second", etc. involved in the embodiments of this application are only used for distinguishing description purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated, nor can they be understood as indicating or implying order.
[0044] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. In addition, "at least one of the following" or similar expressions refers to any combination of these items, which may include any combination of single items or plural items. For example, at least one of A, B, or C can represent: A, B, C, A and B, A and C, B and C, or A, B and C. Among them, each of A, B, and C can be an element itself, or a set containing one or more elements.
[0045] In the embodiments of this application, the terms "exemplary," "in some embodiments," and "in another embodiment" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" in this application should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner.
[0046] In the embodiments of this application, the terms "of," "corresponding," and "relevant" may sometimes be used interchangeably. It should be noted that, when the distinction between them is not emphasized, the meanings they convey are the same. In the embodiments of this application, the terms "communication" and "transmission" may sometimes be used interchangeably. It should be noted that, when the distinction between them is not emphasized, the meanings they convey are the same. For example, "transmission" may include "sending" and / or "receiving," and may be either a noun or a verb.
[0047] In the embodiments of this application, "equal to" can be used in conjunction with "greater than" and is applicable to the technical solution adopted when "greater than" is used, and can also be used in conjunction with "less than" and is applicable to the technical solution adopted when "less than" is used. It should be noted that when "equal to" is used in conjunction with "greater than", it cannot be used in conjunction with "less than"; and when "equal to" is used in conjunction with "less than", it cannot be used in conjunction with "greater than".
[0048] Federated learning (FL), also known as federated learning, is a distributed machine learning method in which multiple participants exchange model parameters through a secure mechanism without exchanging data, thereby achieving collaborative training effects.
[0049] In federated learning, the multiple participants typically include a central node and multiple distributed nodes. The central node typically does not contain training data, while training data is usually stored in the distributed nodes. The distributed nodes train their local models using the training data and can upload the trained local model parameters to the central node. The central node can then integrate the model parameters uploaded by multiple distributed nodes, thereby obtaining the global model parameters.
[0050] However, during the above training process, the central node does not know the training status of each distributed node. If the training efficiency among distributed nodes is inconsistent, the integration performance of the global model parameters will be reduced.
[0051] In order to solve the above problems, this application proposes a model training method applied to electronic devices.
[0052] FIG1 first exemplarily shows a structural diagram of an electronic device 100 .
[0053] The above-mentioned electronic device 100 may include: at least one processor; and at least one memory communicatively connected to the above-mentioned processor, wherein: the above-mentioned memory stores program instructions that can be executed by the above-mentioned processor, and the processor calls the above-mentioned program instructions to execute the method provided in the embodiment shown in this application.
[0054] Figure 1 shows a block diagram of an exemplary electronic device 100 suitable for implementing embodiments of the present application. The electronic device 100 shown in Figure 1 is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0055] As shown in FIG. 1 , components of the electronic device 100 may include, but are not limited to, one or more processors 110 , a memory 120 , a communication bus 140 connecting different system components (including the memory 120 and the processor 110 ), and a communication interface 130 .
[0056] Communication bus 140 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of such architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnection (PCI) bus.
[0057] The electronic device 100 typically includes a variety of computer system readable media, which can be any available media that can be accessed by the device, including volatile and non-volatile media, removable and non-removable media.
[0058] The memory 120 may include a computer system readable medium in the form of a volatile memory, such as a random access memory (RAM) and / or a cache memory. The device may further include other removable / non-removable, volatile / non-volatile computer system storage media. Although not shown in FIG1 , a disk drive for reading and writing to a removable non-volatile disk (such as a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (such as a Compact Disc Read Only Memory (CD-ROM), a Digital Video Disc Read Only Memory (DVD-ROM) or other optical media) may be provided. In these cases, each drive may be connected to the communication bus 140 via one or more data medium interfaces. The memory 120 may include at least one program product having a set (e.g., at least one) program modules that are configured to perform the functions of the various embodiments of the present application.
[0059] A program / utility having a set (at least one) of program modules may be stored in memory 120. Such program modules include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. The program modules generally perform the functions and / or methods of the embodiments described herein.
[0060] The electronic device 100 can also communicate with one or more external devices (e.g., a keyboard, pointing device, display, etc.), one or more devices that enable a user to interact with the device, and / or any device that enables the device to communicate with one or more other devices (e.g., a network card, a modem, etc.). Such communication can be performed via the communication interface 130. Furthermore, the electronic device 100 can also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter (not shown in FIG. 1 ). The network adapter can communicate with other modules of the device via the communication bus 140. It should be understood that, although not shown in FIG. 1 , other hardware and / or software modules can be used in conjunction with the electronic device 100, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0061] The processor 110 executes various functional applications and data processing by running the programs stored in the memory 120, such as implementing the method provided in the embodiment of the present application.
[0062] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0063] The model training method provided in the embodiment of the present application is now described with reference to Figures 2 to 7.
[0064] Figure 2 is a schematic diagram of a system architecture according to an embodiment of the present application. Referring to Figure 2 , the system architecture may include a first device and multiple second devices, for example, the multiple second devices may include a second device a, a second device b, and a second device c.
[0065] The first device may be a central node, the second device may be a distributed node, and the first device and the second device may be the electronic device 100 described above.
[0066] The first device and the second device can be connected wirelessly via wireless Fidelity (Wi-Fi), Bluetooth, cellular network, satellite communication, etc., or can be connected via a wired method. The embodiment of the present application does not specifically limit the connection method between the first device and the second device.
[0067] It is understood that the above-mentioned wireless communication methods are only exemplary and do not constitute a limitation of the embodiments of the present application. In some embodiments, wireless communication methods provided by wireless communication systems such as Narrow Band-Internet of Things (NB-IoT), Global System for Mobile Communications (GSM), Enhanced Data rate for GSM Evolution (EDGE), Wideband Code Division Multiple Access (WCDMA), Code Division Multiple Access 2000 (CDMA2000), Time Division-Synchronization Code Division Multiple Access (TD-SCDMA), and Long Term Evolution (LTE) may also be included.
[0068] In some optional embodiments, the first device and the second device may be fixed devices, for example, the first device may be a server, and the second device may be a desktop computer.
[0069] In some optional embodiments, the first device may be a network device (eg, a base station), and the second device may be a mobile terminal.
[0070] A base station is a device deployed in a radio access network that provides wireless communication capabilities for mobile terminals. Base stations can include various forms of macro base stations, micro base stations (also called small stations), relay stations, access points, and so on. In systems using different radio access technologies, the names of devices with base station functions may vary. For example, in Long Term Evolution (LTE) systems, base stations may be called evolved NodeBs (eNBs or eNodeBs), while in third-generation mobile communication systems, base stations may be called NodeBs.
[0071] It will be understood that the base station is merely an example and does not constitute a limitation on the embodiments of the present application. In some embodiments, the network device may also be other types of devices.
[0072] A mobile terminal may also be called terminal equipment, user equipment (UE), access terminal, subscriber unit, subscriber station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device. The mobile terminal can be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication capabilities, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a vehicle networking terminal, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite wireless device, a wireless modem card, a TV set-top box (STB), customer premise equipment (CPE) and / or other devices used to communicate on a wireless system and a next-generation communication system, for example, a mobile terminal in a 5G network or a mobile terminal in a future evolved Public Land Mobile Network (PLMN) network, etc.
[0073] In the embodiment of the present application, the mobile terminal may also be a wearable device. Wearable devices may also be called wearable smart devices or smart wearable devices, etc., which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear.
[0074] The embodiments of the present application do not impose any special restrictions on the type of mobile terminal.
[0075] FIG3 is a flow chart of an embodiment of the model training method provided in this application, which specifically includes the following steps:
[0076] In step 301 , the second device obtains a local data set and trains a local model based on the local data set.
[0077] Specifically, the local data set may be collected by the second device.
[0078] It can be understood that each second device may have its corresponding data set, and therefore, each second device may train its local model according to its corresponding data set.
[0079] For example, taking the second device a, the second device b and the second device c as an example, the second device a can collect the local data set a, and can train the local model a in the second device a based on the local data set a; the second device b can collect the local data set b, and can train the local model b in the second device b based on the local data set b; the second device c can collect the local data set c, and can train the local model c in the second device c based on the local data set c.
[0080] In which, in the initial state, the first device can send the above-mentioned local model to each second device, that is, in the initial state, the local model in each second device is the same, and the initial state can be a state where the local model is not trained.
[0081] In some optional embodiments, the above-mentioned local models may also be pre-stored in each second device. The embodiment of the present application does not specifically limit the source of the local models in the second device.
[0082] In step 302, the second device sends the local parameters after model training to the first device. Correspondingly, the first device receives the local parameters sent by the second device.
[0083] Specifically, after training its corresponding local model, the second device can obtain local parameters of the corresponding model and send the local parameters to the first device.
[0084] It is understandable that after any round of training, the plurality of second devices may send the local parameters obtained after the training corresponding to the round to the first device.
[0085] In step 303, the first device obtains global parameters based on the local parameters of the second device and sends the global parameters to the second device. Accordingly, the first device receives the global parameters sent by the second device.
[0086] Specifically, after receiving the local parameters of the second devices, the first device may calculate the local parameters sent by all the second devices to obtain the global parameters.
[0087] Among them, the method of calculating local parameters can be weighted processing, or other calculation methods, or the method of determining global parameters based on local parameters can refer to the existing technology, and the embodiments of this application do not make special limitations on this.
[0088] After the first device calculates the global parameters, it can send the global parameters to each second device, so that the second device can perform subsequent model training based on the global parameters.
[0089] In step 304, the first device determines to send a training status reporting instruction to the second device based on the convergence status of the global parameters. Correspondingly, the second device receives the training status reporting instruction sent by the first device.
[0090] Specifically, after the first device calculates the global parameters, it can also determine to send a training status reporting indication to the second device based on the convergence of the global parameters. The training status reporting indication is used to instruct the second device to send the training status of the local model. The training status of the local model may include but is not limited to, for example, the correlation between the global parameters and local parameters of this round, the accuracy of the model prediction of this round, the loss of this round of training, etc.
[0091] Among them, the convergence of global parameters may refer to the local model converging to a preset condition. For example, the preset condition may be that the accuracy of the local model reaches a threshold, or other indicators of the local model reach a threshold. The embodiment of the present application does not specifically limit this.
[0092] For example, taking model accuracy as an example, if the accuracy of the local model reaches a threshold, the first device may not send a training status reporting instruction to the second device; or,
[0093] If the accuracy of the local model does not reach the threshold, the first device may send a training status reporting indication to the second device.
[0094] In step 305, the second device sends the training status to the first device. Correspondingly, the first device receives the training status sent by the second device.
[0095] Specifically, after receiving the training status reporting instruction sent by the first device, the second device may send the training status to the first device.
[0096] In some optional embodiments, after receiving the training status reporting instruction sent by the first device, the second device may also determine whether the training status needs to be sent to the first device based on the training status.
[0097] For example, taking the training state as the correlation between the global parameter and the local parameter as an example, after receiving the global parameter sent by the first device, the second device can calculate the correlation between the global parameter and the local parameter based on the global parameter and the local parameter.
[0098] The calculation method of the correlation between the global parameters and the local parameters may be specifically referred to in the prior art and will not be described in detail here.
[0099] After the second device calculates and obtains the correlation between the global parameter and the local parameter, it can determine whether the global parameter and the local parameter are correlated based on the correlation between the global parameter and the local parameter.
[0100] If the global parameters are correlated with the local parameters, it means that the improvement of this round of training is limited. Even if the second device reports the training status to the first device, it will not contribute to the convergence of the local model. Therefore, in order to save overhead and improve system performance, the second device may not send the training status to the first device; or
[0101] If there is no correlation between the global parameters and the local parameters, the second device may send a training status to the first device.
[0102] In some optional embodiments, the second device may directly send the training status to the second device; or the second device may send an index value corresponding to the training status to the second device. Since the number of bits occupied by the index value is much smaller than the number of bits occupied by the training status, the air interface overhead can be greatly reduced and the air interface performance can be improved. The above-mentioned method of sending the training status in the embodiment of the present application is not particularly limited.
[0103] Next, taking the correlation between the training state and the global parameter and the local parameter as an example, Table 1 is used to exemplify the manner in which the training state is sent as an index value.
[0104] Referring to Table 1, the correlation coefficient corresponds to the index, and each index has a corresponding correlation coefficient, wherein the correlation coefficient is used to characterize the correlation between the global parameter and the local parameter. Exemplarily, the correlation coefficient may occupy 3 bits, but this does not constitute a limitation of the embodiments of the present application. In some embodiments, the correlation coefficient may also occupy more or fewer bits.
[0105] It can be understood that the mapping relationship between the index and the correlation coefficient in the above Table 1 can be pre-set in the network device and the mobile terminal, or the mapping relationship between the index and the correlation coefficient in the above Table 1 can also be sent by the network device to the mobile terminal. For example, the first device can configure the second device through high-level signaling such as radio resource control (RRC), or the first device can instruct the second device through downlink control information (DCI), or the first device configures multiple optional mapping tables for the second device through RRC, and dynamically instructs the second device through DCI which mapping table to select. The embodiments of the present application do not specifically limit this.
[0106] After the second device calculates the correlation coefficient, it can find the index value corresponding to the correlation coefficient through Table 1 and send the index value to the first device.
[0107] In some optional embodiments, the second device may send the training status to the first device via an air interface. In this case, the first device may be a network device, and the second device may be a mobile terminal.
[0108] The training status may be carried in a Medium Access Control-Control Element (MAC CE) or in a physical layer signaling.
[0109] It can be understood that for the local model in any second device, multiple tasks can be trained simultaneously. Therefore, the training state can include the states of multiple training tasks, wherein one training task can correspond to one training state.
[0110] By way of example, taking the physical layer signaling carrying the training status as an example, FIG4 is used to exemplify the transmission method of the training status.
[0111] Referring to Figure 4, a subframe can include 20 time slots, where multiple time slots in a subframe can be used for data interaction of training tasks between the first device and the second device. For example, the data interaction can be the first device sending a local model to the second device, the second device uploading local parameters to the first device, and so on.
[0112] For example, the number of time slots occupied by data exchange corresponding to each task may be 5. Taking two training tasks as an example, the first training task may use the five time slots 0-4, and the second training task may use the five time slots 5-9. However, this does not constitute a limitation on the embodiments of the present application. In some embodiments, the number of time slots occupied by data exchange corresponding to each task may also be greater than 5 or less than 5.
[0113] In any subframe, the first device and the second device can pre-agree that time slot No. N is used to transmit the training status. Alternatively, the first device can also indicate to the second device through high-level signaling such as RRC that it can use time slot No. N in a subframe to transmit the training status. Alternatively, the first device can also indicate to the second device through DCI that it can use time slot No. N in a subframe to transmit the training status. Alternatively, the first device can also configure multiple optional time slots for the second device to transmit the training status through high-level signaling such as RRC, and can dynamically inform the second device through DCI which of the optional time slots to select as the target time slot for transmitting the training status. The embodiments of the present application do not specifically limit this. Wherein, N can be an integer between 0 and 19.
[0114] 4 , N=16, that is, the second device may transmit the training status using time slot No. 16. Taking Table 1 as an example, time slot No. 16 may carry the index value of the correlation coefficient of one or more training tasks.
[0115] If the index value of the correlation coefficient of a training task is carried, the index value of the correlation coefficient can be indicated by 3 bits. Or,
[0116] If the index value of the correlation coefficient of M training tasks is carried, the index value of the above correlation coefficient can be indicated by 3*M bits, where M is an integer greater than 1. The first group of three bits can be used to indicate the index value of the correlation coefficient of the first training task, the second group of 3 bits is used to indicate the index value of the correlation coefficient of the second training task, and so on.
[0117] Step 306: The first device adjusts the training parameters based on the training status sent by the second device.
[0118] Specifically, after the first device receives the training status sent by any second device, it can adjust the training parameters of the second device based on the training status sent by the second device.
[0119] The training parameters may include but are not limited to parameters such as learning rate.
[0120] For example, taking the training parameter as a learning rate, if the first device determines that the correlation coefficient sent by any second device is low, the learning rate may be increased; or,
[0121] If the first device determines that the correlation coefficient sent by any second device is high, the learning rate may be lowered.
[0122] It is understandable that the training status of the second device may include the training status of multiple training tasks. Therefore, the first device may adjust the training parameters corresponding to the training task based on the training status of each training task.
[0123] In step 307, the first device sends the adjusted training parameters to the second device. Correspondingly, the second device receives the adjusted training parameters sent by the first device.
[0124] Specifically, after the first device adjusts the training parameters of any second device, the adjusted training parameters may be sent to the corresponding second device.
[0125] The first device may transmit the adjusted training parameters by carrying them via a MAC CE or by carrying them via physical signaling. The manner in which the adjusted training parameters are transmitted via a MAC CE or physical signaling may be specifically referred to the manner in which the training status is transmitted via a MAC CE or physical signaling in the above embodiment, and will not be further described herein.
[0126] It is understandable that the adjusted training parameter may be a training parameter value, or a differential value, or an index value indicating the training parameter, and the embodiments of the present application do not impose any special limitation on this.
[0127] Taking the training parameter as the learning rate as an example, the adjusted training parameter can be the adjusted learning rate, or the adjusted training parameter can be a differential value relative to the learning rate of the previous round, or the adjusted training parameter can be an index value indicating the learning rate, wherein the index relationship between the training parameter and the learning rate can be pre-set between the first device and the second device, or the first device can indicate to the second device, and the embodiments of the present application do not specifically limit this.
[0128] After the second device receives the adjusted training parameters sent by the first device, it may update the local parameters based on the gradient and the adjusted training parameters, and may perform the next round of training based on the updated local parameters.
[0129] For example, still taking the training parameter as the learning rate as an example, after the second device receives the adjusted learning rate sent by the first device, it can multiply the gradient by the learning rate to adjust the gradient, and update the local parameters according to the adjusted gradient, thereby allowing the second device to perform the next round of training according to the updated local parameters.
[0130] In some optional embodiments, the local model of the second device may stop training after training based on the adjusted training parameters sent by the first device.
[0131] Exemplarily, if the second device determines that the local parameters have reached the preset conditions through training of the local model, it can exit the training and send an exit training instruction to the first device, which is used to notify the first device that the second device has exited the training.
[0132] Among them, the second device can independently decide whether to exit the training, or the first device can instruct the second device whether to allow exiting the training. This embodiment of the present application does not specifically limit this.
[0133] In some optional embodiments, the resources used by the second device to transmit the exit training instruction may be allocated by the first device. When the second device determines that it needs to transmit the exit training instruction, it can use the resources for transmitting the exit training instruction. That is, when the second device has not determined that it needs to transmit the exit training instruction, the resources for transmitting the exit training instruction can be used for other tasks.
[0134] In an embodiment of the present application, the training status is fed back to the first device by the second device, and the first device can adjust the training parameters of the second device based on the training status fed back by the second device, so that the second device can perform subsequent training based on the adjusted training parameters, thereby improving the performance of distributed model training.
[0135] FIG5 is a flow chart of another embodiment of the model training method provided by the present application, which specifically includes the following steps:
[0136] In step 501 , the second device obtains a local data set and trains a local model based on the local data set.
[0137] The specific implementation of step 501 can refer to the relevant description of step 301 in the above embodiment, which will not be repeated here.
[0138] In step 502, the second device sends the local parameters after model training to the first device. Correspondingly, the first device receives the local parameters sent by the second device.
[0139] The specific implementation of step 502 can refer to the relevant description of step 302 in the above embodiment, and will not be repeated here.
[0140] In step 503, the first device obtains global parameters based on the local parameters of the second device and sends the global parameters to the second device. Accordingly, the first device receives the global parameters sent by the second device.
[0141] The specific implementation of step 503 may refer to the relevant description of step 303 in the above embodiment, which will not be repeated here.
[0142] In step 504, the second device determines the performance improvement of the current round of training based on the global parameters and sends the performance improvement of the current round of training to the first device. Correspondingly, the first device receives the performance improvement sent by the second device.
[0143] Specifically, the performance improvement may refer to the increment of the performance of the current round of training relative to the performance of the previous round of training.
[0144] For example, if performance is the accuracy of model predictions, the performance improvement can be the increment of model prediction accuracy, where the model prediction accuracy can be verified using a test set. When the model from the previous round is tested using the test set, the prediction accuracy of the model from the previous training round can be obtained; when the model from the current round is tested using the test set, the prediction accuracy of the model from the current training round can be obtained. The performance improvement can be the difference between the prediction accuracy of the model from the current training round and the prediction accuracy of the model from the previous training round.
[0145] After the second device determines the performance improvement range, it may send the performance improvement range to the first device.
[0146] The second device may send the performance improvement value by directly sending the performance improvement value to the first device; or
[0147] The second device may convert the performance improvement into an index value and send the index value to the first device. The mapping method between the performance improvement and the index value may refer to the mapping method between the correlation coefficient and the index value in the above embodiment, and will not be repeated here.
[0148] For example, Table 2 shows the mapping relationship between the performance improvement range and the index value.
[0149] It is understandable that the performance improvement can be carried through MAC CE or through physical layer signaling, and the embodiments of the present application do not specifically limit this.
[0150] Step 505: The first device adjusts the quantization accuracy based on the performance improvement sent by the second device.
[0151] Specifically, after the first device receives the performance improvement margin sent by the second device, the first device may adjust the quantization accuracy of the local model of the second device based on the performance improvement margin sent by the second device.
[0152] Exemplarily, if the performance improvement of the local model of any second device is small, the first device may improve the quantization accuracy of the local model of the second device; or,
[0153] If the performance improvement of the local model of any second device is small, the first device may improve the quantization accuracy of the local model of the second device.
[0154] In step 506, the first device sends the adjusted quantization precision to the corresponding second device. Correspondingly, the second device receives the adjusted quantization precision sent by the first device.
[0155] Specifically, each second device may send its corresponding performance improvement margin, and the first device may adjust the corresponding quantization precision based on the performance improvement margin of each second device, and send the adjusted quantization precision to the corresponding second device.
[0156] FIG6 is a flow chart of another embodiment of the model training method provided in this application, which specifically includes the following steps:
[0157] In step 601 , the second device obtains a local data set and trains a local model based on the local data set.
[0158] The specific implementation of step 501 can refer to the relevant description of step 301 in the above embodiment, which will not be repeated here.
[0159] In step 602, the second device sends a training parameter adjustment instruction to the first device based on the training result of this round. Correspondingly, the first device receives the training parameter adjustment instruction sent by the second device.
[0160] Specifically, the second device can obtain corresponding training results after each round of training.
[0161] The training result may be the degree of convergence of the local model in the second device, or the training result may be other preset indicators, which is not specifically limited in the embodiments of the present application.
[0162] After the second device obtains the training results of this round, it can send a training parameter adjustment instruction to the first device based on the training results of this round, to instruct the first device to adjust the training parameters of the local model of the second device to improve the performance of the local model in the second device.
[0163] Among them, the training parameter can be, for example, quantization accuracy, or the training parameter can also be other types of parameters in the local model, and the embodiments of the present application do not specifically limit this.
[0164] Taking the training result as the convergence degree of the local model as an example, if the second device determines that the convergence of the local model has slowed down, it can send a training parameter adjustment instruction to the first device; or,
[0165] If the second device determines that the local model has not experienced convergence slowdown, there is no need to send a training parameter adjustment instruction to the first device.
[0166] In some optional embodiments, the training parameter adjustment instruction may further include establishing a level of the adjusted training parameter, or the training parameter adjustment instruction may further include establishing an increment of the adjusted training parameter.
[0167] In some optional embodiments, the level of the training parameter or the increment of the training parameter can be represented by an index value, and the training parameter adjustment indication includes an index value corresponding to the level of the training parameter or the increment of the training parameter. The specific mapping method of the level of the training parameter or the increment of the training parameter and the index value can be referred to the relevant description in the above embodiments and will not be repeated here.
[0168] Step 603: The first device adjusts the training parameters based on the training parameter adjustment instruction, and sends the adjusted training parameters to the corresponding second device.
[0169] Specifically, after the first device receives the training parameter adjustment instruction from the second device, it can adjust the training parameters based on the training parameter adjustment instruction.
[0170] Taking the quantization accuracy as an example of a training parameter, after the first device receives the training parameter adjustment instruction, it can improve the quantization accuracy to improve the performance of the local model and accelerate the convergence of the local model.
[0171] It is understandable that after the first device adjusts the training parameters, the adjusted training parameters can be sent to the corresponding second device.
[0172] The specific manner in which the first device sends the adjusted training parameters may be referred to the relevant description in the above embodiment, which will not be repeated here.
[0173] FIG7 is a flow chart of another embodiment of the model training method provided by the present application, which specifically includes the following steps:
[0174] Step 701: The second device sends training overhead to the first device. Correspondingly, the first device receives the training overhead sent by the second device.
[0175] Specifically, the second device can obtain the training overhead during the training process of the local model.
[0176] Training overhead may include, but is not limited to, peak training power, average training power, remaining available power, computing resource utilization, duration that the overhead exceeds a threshold, etc. Computing resources may include central processing units (CPUs), graphics processing units (GPUs), embedded neural network processing units (NPUs), maximum number of threads, random access memory (RAM), cache, and other resources.
[0177] It is understandable that the training overhead may be based on the granularity of a single training task, or the training overhead may be based on the granularity of all training tasks, which is not specifically limited in the present embodiment.
[0178] After the second device obtains the training overhead, it can send the training overhead to the first device, so that the first device can adjust the scale of the model according to the training overhead of the second device to reduce the power consumption of the second device.
[0179] The specific manner in which the second device sends the training overhead to the first device may refer to the manner in which the second device sends the correlation coefficient in the above embodiment, which will not be described in detail here.
[0180] In some optional embodiments, the second device may also send a reduction amount relative to the current training overhead, so that the first device may make adjustments based on the reduction amount.
[0181] Step 702: The first device adjusts the local model of the second device based on the training overhead of the second device.
[0182] Specifically, the adjustment of the local model of the second device may be an adjustment of the scale of the local model.
[0183] The scale of the local model may include but is not limited to the number of neurons, the number of layers, the connection relationship, etc.
[0184] In some optional embodiments, the task period of the local model of the second device may also be adjusted.
[0185] The task cycle may include but is not limited to a training execution cycle, a prediction execution cycle, etc. Adjustment of the task cycle may include, for example, pausing, shutting down, shortening the task cycle, etc.
[0186] In step 703, the first device sends the adjusted local model to the second device. Correspondingly, the second device receives the adjusted local model sent by the first device.
[0187] Specifically, after the first device adjusts the local model, the adjusted local model may be sent to the second device.
[0188] The first device may directly send the adjusted local model to the second device. Or,
[0189] The first device may send the index value corresponding to the adjusted local model to the second device.
[0190] Taking the scale adjustment of the local model as an example, Table 3 exemplarily shows the mapping relationship between the scale of the adjusted local model and the index value.
[0191] It will be understood that the above example only shows four mapping relationships, but does not constitute a limitation on the embodiments of the present application. In some embodiments, more or fewer mapping relationships may be included.
[0192] Step 704: The second device performs training based on the adjusted local model.
[0193] Specifically, after the second device receives the adjusted local model sent by the first device, it can perform training based on the adjusted local model.
[0194] In some optional embodiments, knowledge distillation may be performed on the local model before adjustment, and the distilled knowledge may be integrated into the adjusted local model for subsequent training.
[0195] FIG8 is a schematic structural diagram of an embodiment of the model training device of the present application. As shown in FIG8 , the model training device 80 is applied to the first device. The model training device 80 may include: a receiving module 81 and an adjustment module 82; wherein,
[0196] Receiving module 81, used for receiving the training status sent by the second device;
[0197] The adjustment module 82 is configured to adjust the local model in the second device based on the training status sent by the second device.
[0198] In one possible implementation, the training state is represented by an index value.
[0199] In one possible implementation, the training status includes performance information of the local model in the second device, and the adjustment module 82 is further used to adjust the training parameters of the local model in the second device based on the training status sent by the second device.
[0200] In one possible implementation, the model training device 80 further includes:
[0201] a receiving module, configured to receive local parameters sent by the second device; wherein the local parameters are obtained by the second device after training the local model;
[0202] Calculating a global parameter based on the local parameter of the second device;
[0203] Based on the convergence status of the global parameters, it is determined to send a training status reporting instruction to the second device, where the training status reporting instruction is used to instruct the second device to send a training status.
[0204] In one possible implementation, the training parameters include at least one or more of a learning rate and a quantization accuracy.
[0205] In one possible implementation, the training state includes the training overhead of the second device, and the adjustment module 82 is further used to adjust the scale and / or task cycle of the local model in the second device based on the training state sent by the second device.
[0206] In one possible implementation manner, the first device is a network device, the second device is a mobile terminal, and the training status is carried via a media access control layer control element MAC CE or physical layer signaling.
[0207] In one possible implementation manner, the physical resources used to transmit the training status are indicated by the first device to the second device.
[0208] In one possible implementation manner, the receiving module is further configured to receive a training exit indication sent by the second device, where the training exit indication is used to indicate that the second device has exited training.
[0209] The model training device 80 provided in the embodiment shown in FIG8 can be used to execute the technical solution of the method embodiment shown in this application. Its implementation principle and technical effects can be further referred to the relevant description in the method embodiment.
[0210] FIG9 is a schematic structural diagram of an embodiment of the model training device of the present application. As shown in FIG9 , the model training device 90 is applied to the second device. The model training device 90 may include: a sending module 91, a receiving module 92 and an adjustment module 93; wherein,
[0211] A sending module 91, configured to send a training status to a first device;
[0212] A receiving module 92, configured to receive adjustment information for the local model in the second device sent by the first device;
[0213] The adjustment module 93 is configured to adjust the local model in the second device based on the adjustment information and perform training based on the adjusted local model.
[0214] In one possible implementation, the training state is represented by an index value.
[0215] In one possible implementation, the adjustment information is used to adjust the training parameters of the local model in the second device.
[0216] In one possible implementation, the sending module 91 is further configured to send local parameters to the first device; wherein the local parameters are obtained by the second device after training the local model;
[0217] The receiving module 92 is further configured to receive a training status reporting instruction sent by the first device, where the training status reporting instruction is used to instruct the second device to send a training status.
[0218] In one possible implementation, the training parameters include at least one or more of a learning rate and a quantization accuracy.
[0219] In one possible implementation manner, the adjustment information is used to adjust the scale and / or task period of the local model in the second device.
[0220] In one possible implementation manner, the first device is a network device, the second device is a mobile terminal, and the training status is carried via a media access control layer control element MAC CE or physical layer signaling.
[0221] In one possible implementation manner, the physical resources used to transmit the training status are indicated by the first device to the second device.
[0222] In one possible implementation, the sending module 91 is further configured to send a training exit instruction to the first device, where the training exit instruction is used to indicate that the second device has exited training.
[0223] The model training device 90 provided in the embodiment shown in FIG9 can be used to execute the technical solution of the method embodiment shown in this application. Its implementation principle and technical effects can be further referred to the relevant description in the method embodiment.
[0224] It should be understood that the division of the various modules of the model training device 80 shown in Figure 8 and the model training device 90 shown in Figure 9 is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also all be implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. For example, the detection module can be a separately established processing element, or it can be integrated in a chip of the terminal device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. In the implementation process, each step of the above method or each module above can be completed by the hardware integrated logic circuit in the processor element or the instructions in the form of software.
[0225] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), one or more microprocessors (DSPs), or one or more field programmable gate arrays (FPGAs). For another example, these modules may be integrated together to implement a system-on-a-chip (SOC).
[0226] In each of the above embodiments, the processor involved may include, for example, a CPU, a DSP, a microcontroller, or a digital signal processor, and may also include a GPU, an NPU, and an image signal processor (hereinafter referred to as: ISP). The processor may also include necessary hardware accelerators or logic processing hardware circuits, such as ASICs, or one or more integrated circuits for controlling the execution of the program of the technical solution of this application. In addition, the processor may have the function of operating one or more software programs, and the software programs may be stored in a storage medium.
[0227] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer-readable storage medium is run on a computer, the computer executes the method provided by the embodiment shown in the present application.
[0228] An embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program product is run on a computer, it enables the computer to execute the method provided by the embodiment shown in the present application.
[0229] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can represent: a, b, c, a and b, a and c, b and c or a and b and c, where a, b, c can be single or multiple.
[0230] Those skilled in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented using a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0231] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0232] In the several embodiments provided in this application, if any function 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 this application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of this application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory; hereinafter referred to as: ROM), random access memory (Random Access Memory; hereinafter referred to as: RAM), magnetic disk or optical disk, and other media that can store program code.
[0233] The above description is merely a specific embodiment of the present application. Any person skilled in the art may easily conceive of variations or substitutions within the technical scope disclosed in this application, and such variations or substitutions shall be within the scope of protection of this application. The scope of protection of this application shall be subject to the scope of protection of the claims.
Claims
1. A model training method, characterized in that: Applied to a first device, the method includes: receiving a training status sent by a second device; The local model in the second device is adjusted based on the training status sent by the second device.
2. The method according to claim 1, characterized in that The training state is represented by an index value.
3. The method according to claim 1 or 2, characterized in that: The training state includes performance information of the local model in the second device, and adjusting the local model in the second device based on the training state sent by the second device includes: The training parameters of the local model in the second device are adjusted based on the training status sent by the second device.
4. The method according to claim 3, characterized in that Before receiving the training status sent by the second device, the method further includes: Receiving local parameters sent by the second device; wherein the local parameters are obtained by the second device after training the local model; Calculate the global parameters based on the local parameters of the second device; Based on the convergence status of the global parameters, it is determined to send a training status reporting indication to the second device, where the training status reporting indication is used to instruct the second device to send a training status.
5. The method according to claim 3 or 4, characterized in that: The training parameters include at least one or more of a learning rate and a quantization accuracy.
6. The method according to claim 1 or 2, characterized in that: The training state includes the training overhead of the second device, and the adjusting the local model in the second device based on the training state sent by the second device includes: The scale and / or task period of the local model in the second device is adjusted based on the training status sent by the second device.
7. The method according to any one of claims 1 to 6, characterized in that: The first device is a network device, the second device is a mobile terminal, and the training state is carried via a media access control layer control element MAC CE or a physical layer signaling.
8. The method according to claim 7, characterized in that Physical resources for transmitting the training status are indicated by the first device to the second device.
9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: A training exit indication sent by the second device is received, where the training exit indication is used to indicate that the second device has exited training.
10. A model training method, characterized in that: Applied to the second device, the method includes: sending a training status to the first device; receiving adjustment information for a local model in the second device sent by the first device; The local model in the second device is adjusted based on the adjustment information, and training is performed based on the adjusted local model.
11. The method according to claim 10, characterized in that The training state is represented by an index value.
12. The method according to claim 10 or 11, characterized in that: The adjustment information is used to adjust the training parameters of the local model in the second device.
13. The method according to claim 12, characterized in that Before sending the training status to the first device, the method further includes: Sending local parameters to the first device; wherein the local parameters are obtained by the second device after training the local model; A training status reporting indication is received from the first device, where the training status reporting indication is used to instruct the second device to send a training status.
14. The method according to claim 12 or 13, characterized in that The training parameters include at least one or more of a learning rate and a quantization accuracy.
15. The method according to claim 10 or 11, characterized in that: The adjustment information is used to adjust the scale and / or task period of the local model in the second device.
16. The method according to any one of claims 10 to 15, characterized in that: The first device is a network device, the second device is a mobile terminal, and the training state is carried via a media access control layer control element MAC CE or a physical layer signaling.
17. The method according to claim 16, characterized in that Physical resources for transmitting the training status are indicated by the first device to the second device.
18. The method according to any one of claims 10 to 17, characterized in that: The method further comprises: A training exit indication is sent to the first device, where the training exit indication is used to indicate that the second device has exited training.
19. A first device, characterized in that: include: A processor and a memory, wherein the memory is used to store a computer program; the processor is used to run the computer program to implement the model training method as described in any one of claims 1 to 9.
20. A second device, characterized in that: include: A processor and a memory, wherein the memory is used to store a computer program; the processor is used to run the computer program to implement the model training method as described in any one of claims 10-18.
21. A model training system, characterized in that: Includes the first device as claimed in claim 19 and the second device as claimed in claim 20.
22. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed on a first device, implements the model training method as described in any one of claims 1 to 9; or, when executed on a second device, implements the model training method as described in any one of claims 10 to 18.
Citation Information
Patent Citations
Deep-neural-network-based acoustic model training method, hosts and system
CN103680496A
Model training method, system and device
CN105575389A
Model training method and device based on federated learning and server
CN110442457A
Edge computing distributed model training method, terminal and network side equipment
CN111030861A