Large model training method, device and equipment
By replacing the network layer and adjusting parameters in the pre-trained large model, the simulation model is generated for cross-domain fine-tuning, which solves the problems of data privacy leakage and resource consumption in large model training, and achieves efficient and safe model training.
Patent Information
- Application Number
- CN202410743580.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-06-07
AI Technical Summary
During large model training, how to avoid data privacy leaks and reduce resource consumption while ensuring model performance?
By obtaining the importance information of each network layer in the pre-trained large model, replacing the less important network layer with a lightweight network layer, and allowing the parameters of the more important network layer to be adjusted, a simulation model is generated and cross-domain Fine-tuning prevents data owners from obtaining the complete model structure and reduces resource consumption.
It improves the accuracy of business data processing results of the target large model, ensures data privacy and security, and reduces resource consumption in the model training process.
Smart Images

Figure CN118586284A
Abstract
Description
Technical Field
[0001] The present application relates to the field of large model technology, and in particular to a large model training method, device and equipment. Background Art
[0002] With the continuous development of science and technology, the application of big model technology in various industries is becoming more and more extensive. At present, in order to further improve the performance of big models when applied in business, the model provider usually sends the pre-trained big model to the data owner. The data owner can use his own business data to fine-tune the pre-trained big model; or, the data owner can also send his own business data to the model provider so that the model provider can use the business data to fine-tune the pre-trained big model, thereby failing to meet the needs of all parties for data to stay in the domain. In addition, since big models usually have a large number of parameters, when fine-tuning the pre-trained big model directly using business data, it often requires a lot of resources.
[0003] Based on this, how to avoid data privacy leakage during the training of large models and reduce the resources consumed in the model training process while ensuring that the trained large models have good performance has become a technical problem that needs to be solved at present. Summary of the invention
[0004] The embodiments of this specification provide a large model training method, device and equipment, which can avoid data privacy leakage during the large model training process while ensuring that the trained large model has good performance, and can also reduce the resources consumed in the model training process.
[0005] To solve the above technical problems, the embodiments of this specification are implemented as follows:
[0006] A large model training method provided in an embodiment of this specification includes:
[0007] Obtain the importance information of each preset network layer in the pre-trained large model;
[0008] According to the importance information, setting processing is performed on the first network layer and the second network layer in the preset network layer to obtain a simulation model of the pre-trained large model; wherein the setting processing is used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer;
[0009] Sending the simulation model to a device of a data owner;
[0010] receiving adjusted parameter data of the second network layer fed back by the device of the data owner; the adjusted parameter data of the second network layer is obtained by training the simulation model using the business data at the data owner;
[0011] Generate a target large model based on the adjusted parameter data of the second network layer and the pre-trained large model.
[0012] A large model training method provided in an embodiment of this specification includes:
[0013] Acquire a simulation model of a pre-trained large model from a device of a model provider; wherein the simulation model is obtained by setting and processing a first network layer and a second network layer in the preset network layer according to the importance information of each preset network layer in the pre-trained large model; the setting and processing is used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer;
[0014] Using the business data at the data owner to train the simulation model, and obtain adjusted parameter data of the second network layer;
[0015] Sending the adjusted parameter data of the second network layer to the device of the model provider; the device of the model provider is used to generate a target large model according to the adjusted parameter data of the second network layer and the pre-trained large model.
[0016] A large model training device provided in an embodiment of this specification includes:
[0017] The first acquisition module is used to obtain the importance information of each preset network layer in the pre-trained large model;
[0018] A setting module, used for performing setting processing on the first network layer and the second network layer in the preset network layer according to the importance information, to obtain a simulation model of the pre-trained large model; wherein the setting processing is used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer;
[0019] A first sending module, used for sending the simulation model to a device of a data owner;
[0020] A receiving module, used for receiving adjusted parameter data of the second network layer fed back by the device of the data owner; the adjusted parameter data of the second network layer is obtained by training the simulation model using the business data at the data owner;
[0021] A generation module is used to generate a target large model based on the adjusted parameter data of the second network layer and the pre-trained large model.
[0022] A large model training device provided in an embodiment of this specification includes:
[0023] An acquisition module is used to acquire a simulation model of a pre-trained large model from a device provided by a model provider; wherein the simulation model is obtained by setting and processing a first network layer and a second network layer in the preset network layer according to the importance information of each preset network layer in the pre-trained large model; the setting and processing is used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer;
[0024] A training module, used to train the simulation model using the business data at the data owner to obtain adjusted parameter data of the second network layer;
[0025] The first sending module is used to send the adjusted parameter data of the second network layer to the device of the model provider; the device of the model provider is used to generate a target large model according to the adjusted parameter data of the second network layer and the pre-trained large model.
[0026] A large model training device provided in an embodiment of this specification includes:
[0027] at least one processor; and a memory in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0028] Obtain the importance information of each preset network layer in the pre-trained large model;
[0029] According to the importance information, setting processing is performed on the first network layer and the second network layer in the preset network layer to obtain a simulation model of the pre-trained large model; wherein the setting processing is used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer;
[0030] Sending the simulation model to a device of a data owner;
[0031] receiving adjusted parameter data of the second network layer fed back by the device of the data owner; the adjusted parameter data of the second network layer is obtained by training the simulation model using the business data at the data owner;
[0032] Generate a target large model based on the adjusted parameter data of the second network layer and the pre-trained large model.
[0033] A large model training device provided in an embodiment of this specification includes:
[0034] at least one processor; and a memory in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0035] Acquire a simulation model of a pre-trained large model from a device of a model provider; wherein the simulation model is obtained by setting and processing a first network layer and a second network layer in the preset network layer according to the importance information of each preset network layer in the pre-trained large model; the setting and processing is used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer;
[0036] Using the business data at the data owner to train the simulation model, and obtain adjusted parameter data of the second network layer;
[0037] Sending the adjusted parameter data of the second network layer to the device of the model provider; the device of the model provider is used to generate a target large model according to the adjusted parameter data of the second network layer and the pre-trained large model.
[0038] At least one embodiment provided in this specification can achieve the following beneficial effects:
[0039] The model provider can change the first network layer with lower importance to a preset lightweight network layer according to the importance information of each preset network layer in the pre-trained large model, and allow the adjustment of the parameters of the second network layer with higher importance, so as to obtain a simulation model of the pre-trained large model. Subsequently, after the data owner uses the business data to train the simulation model and feeds back the adjusted parameter data for the second network layer, the model provider can generate the target large model by combining the adjusted parameter data of the second network layer and the pre-trained large model. This is beneficial to improve the accuracy of the processing results of the target large model for the business data of the data owner, and can also avoid the leakage of the complete pre-trained large model of the model provider and the business data of the data owner, and ensure the data privacy and security when fine-tuning the large model across domains. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0041] Figure 1 A schematic diagram of an application scenario of a large model training method provided in an embodiment of this specification;
[0042] Figure 2 A flowchart of a large model training method provided in an embodiment of this specification;
[0043] Figure 3 A flowchart of another large model training method provided in an embodiment of this specification;
[0044] Figure 4 The embodiments of this specification provide corresponding to Figure 2 and Figure 3 A swimlane flow diagram of the large model training method in ;
[0045] Figure 5 The embodiments of this specification provide corresponding to Figure 2 A schematic diagram of the structure of a large model training device;
[0046] Figure 6 The embodiments of this specification provide corresponding to Figure 3 A schematic diagram of the structure of a large model training device;
[0047] Figure 7 The embodiments of this specification provide corresponding to Figure 2 A schematic diagram of the structure of a large model training device;
[0048] Figure 8 The embodiments of this specification provide corresponding to Figure 3 A schematic diagram of the structure of a large model training device. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solutions and advantages of one or more embodiments of this specification clearer, the technical solutions of one or more embodiments of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of one or more embodiments of this specification.
[0050] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0051] In the prior art, the traditional fine-tuning methods of pre-trained large models are mainly divided into two types: closed-source fine-tuning method and open-source fine-tuning method. Among them, the closed-source fine-tuning method usually requires the data owner to send its business data to the model provider, and then the model provider uses these business data to fine-tune the pre-trained large model provided by it. This method often cannot guarantee the security and privacy of the business data of the data owner. The open-source fine-tuning method usually requires the model provider to send the pre-trained large model to the data owner, so that the data owner can use his own business data to fine-tune the pre-trained large model. However, this method often allows criminals to master the complete pre-trained large model structure, making the pre-trained large model more vulnerable to white-box attacks, thereby posing a threat to the security of the pre-trained large model. At the same time, since the pre-trained large model provided by the model provider often has a huge number of parameters ranging from hundreds of billions to trillions, it often requires a lot of resources to fine-tune the complete pre-trained large model using business data.
[0052] At present, some model providers will first delete half of the network layers in the pre-trained large model through lossy compression technology, thereby converting the pre-trained large model into an emulator, which will then be passed to the data holder. The data owner can train a specific adapter based on the emulator and its own business data, and feed the trained adapter back to the model provider, so that the model provider can plug the adapter into the pre-trained large model to complete the entire fine-tuning process. However, since the emulator obtained by the data owner has undergone lossy compression, the performance of the fine-tuned pre-trained large model generated based on this emulator is poor.
[0053] Based on this, how to avoid the privacy leakage of both business data and big models while ensuring that the trained big models have good performance, and reduce the resources consumed in the model training process, has become a technical problem that needs to be solved at present.
[0054] In order to solve the defects in the prior art, this solution provides the following embodiments:
[0055] Figure 1 A schematic diagram of an application scenario of a large model training method provided in an embodiment of this specification.
[0056] like Figure 1 As shown, when the model provider needs to provide services related to the big model to the data owner, the model provider can use the model provider's device 101 to obtain the importance information of each preset network layer in the pre-trained big model; then, according to the importance information, the first network layer and the second network layer in the preset network layer are set and processed to obtain a simulation model of the pre-trained big model; wherein the setting process can be used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer. Subsequently, the model provider's device 101 can send the simulation model to the data owner's device 102.
[0057] After the data owner's device 102 obtains the simulation model of the pre-trained large model from the model provider's device 101, the data owner's device 102 can use the business data at the data owner to train the simulation model so as to obtain the adjusted parameter data of the second network layer; by sending the adjusted parameter data of the second network layer to the model provider's device 101, the model provider's device 101 can generate the target large model based on the adjusted parameter data of the second network layer and the pre-trained large model.
[0058] Next, a large model training method provided in the embodiment of the specification will be specifically described with reference to the accompanying drawings:
[0059] Figure 2 The following is a flow chart of a large model training method provided in the embodiment of this specification. From the program perspective, the execution subject of the process can be the device of the model provider, or the application program on the device of the model provider. Figure 2 As shown, the process may include the following steps:
[0060] Step 202: Obtain importance information of each preset network layer in the pre-trained large model.
[0061] In the embodiments of this specification, a large model may refer to a machine learning model with a large number of parameters and a complex structure. Since the large model has a large number of parameters and can process massive amounts of data, the large model can be applied to process large-scale data and complex problems. The pre-trained large model may refer to a large model that is pre-trained based on an unsupervised or self-supervised learning method using a large amount of training data to store a large amount of knowledge. The pre-trained large model can usually have a strong generalization ability, so it can be applied to various downstream business tasks through simple fine-tuning operations.
[0062] In practical applications, depending on the structure and function of the big model, the big model can include but is not limited to a large language model (LLM), a computer vision (CV) big model, an automatic speech recognition (ASR) big model, a recommendation system big model, a reinforcement learning (RL) big model, a generative adversarial network (GAN) big model, a dialogue system big model, etc.
[0063] In the embodiments of this specification, the pre-trained large model often has multiple preset network layers, and the degree of influence of different preset network layers on the performance of the pre-trained large model often varies. Generally, the greater the influence of the preset network layer on the performance of the pre-trained large model, the higher the importance of the preset network layer in the pre-trained large model. Based on this, importance information reflecting the importance of each preset network layer in the pre-trained large model can be determined for use in adjusting the model structure of the pre-trained large model and generating its simulation model.
[0064] Step 204: According to the importance information, setting processing is performed on the first network layer and the second network layer in the preset network layer to obtain a simulation model of the pre-trained large model; wherein the setting processing is used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer.
[0065] In the embodiments of this specification, it is necessary to avoid providing the pre-trained large model with a complete structure to the data owner to ensure the security of the pre-trained large model. Therefore, it is necessary to modify the structure of the pre-trained large model to generate a simulation model of the pre-trained large model. Specifically, in order to ensure that the performance of the simulation model is close to that of the pre-trained large model and reduce the resource consumption when the data owner subsequently uses business data to train the simulation model, the preset network layer with a lower importance (for example, the first network layer) can be replaced with a preset lightweight network layer, and the data owner is allowed to adjust the parameters of the preset network layer with a higher importance (for example, the second network layer), and the data owner is prohibited from adjusting the parameters of other preset network layers to obtain a simulation model of the pre-trained large model. Among them, the parameter amount of the preset lightweight network layer is usually less than the parameter amount of the first network layer, so as to reduce the parameter amount of the simulation model, thereby reducing the consumption of resources required for the data owner to train the simulation model and improve the model training efficiency.
[0066] In practical applications, the second network layer and the first network layer are usually different preset network layers. However, if the number of preset network layers of the pre-trained large model is limited, it is also possible that the same preset network layer is used as both the first network layer and the second network layer. In this case, the preset network layer can usually be replaced with a preset lightweight network layer, and then the data owner is allowed to adjust the parameters of the preset lightweight network layer. There is no specific limitation on this.
[0067] Step 206: Send the simulation model to the device of the data owner.
[0068] Step 208: receiving the adjusted parameter data of the second network layer fed back by the device of the data owner; the adjusted parameter data of the second network layer is obtained by training the simulation model using the business data at the data owner.
[0069] In the embodiments of this specification, the business data used by the data owner when training the simulation model can be set according to actual needs. The business data is usually related to the business needs that the data owner subsequently calls the target large model to process. Therefore, the specific type and content of the business data are not limited. For ease of understanding, an example is given to illustrate this. For example, assuming that the data owner needs to use the target large model to determine the emotional type to which the user's comment data belongs, the business data may include the user's historical comment data and data reflecting the emotional type to which it belongs. Alternatively, if the data owner needs to use the target large model to determine whether the ID image submitted by the user is a forged image, the business data may include the user's historical ID image data and data reflecting whether it is a forged image. Alternatively, if the data owner needs to use the target large model to automatically generate comment information based on the article information, the business data may also include historical article information and corresponding historical article comment information, etc. Due to the subsequent Figure 3 The solution in the specification will explain in detail the implementation principle of the data owner obtaining the adjusted parameter data of the second network layer, so it will not be repeated here.
[0070] Step 210: Generate a target large model based on the adjusted parameter data of the second network layer and the pre-trained large model.
[0071] In the embodiments of the present specification, the pre-trained big model usually has historical parameter data of the second network layer. Since the historical parameter data of the second network layer usually does not carry knowledge data of the business data of the data owner, the adjusted parameter data of the second network layer that has learned the knowledge of the business data and the pre-trained big model can be combined to generate a target big model to improve the processing performance of the target big model for the business data of the data owner.
[0072] Figure 2 The method in the embodiment of the present invention, by using a preset lightweight network layer to replace the less important network layer in the pre-trained large model as a simulation model, can not only improve the consistency of the structure and performance of the simulation model and the pre-trained large model, but also reduce the number of parameters of the simulation model, thereby reducing the amount of resources required for the model training process, and improving the effectiveness of the adjusted parameter data of the second network layer with a higher degree of importance generated based on the simulation model, so as to ensure that the target large model generated according to the adjusted parameter data of the second network layer and the pre-trained large model has good performance. In addition, since the model provider cannot obtain the business data of the data owner, and the data owner cannot obtain the pre-trained large model with a complete structure, the privacy leakage of both the business data and the large model can be avoided, and the data privacy and security when fine-tuning the large model across domains can be ensured.
[0073] based on Figure 2 The method in this specification also provides some specific implementation plans of the method, which are described below.
[0074] For ease of understanding, an implementation method for obtaining the importance information of the preset network layers in the pre-trained large model is provided here. Specifically, step 202: obtaining the importance information of each preset network layer in the pre-trained large model may include:
[0075] A reinforcement learning algorithm is used to determine a reinforcement learning reward value for implementing a first action strategy for the pre-trained large model; wherein the first action strategy is used to indicate the use of a preset lightweight network layer to replace a third network layer in a preset network layer within the pre-trained large model, and the reinforcement learning reward value is positively correlated with a loss value generated by the pre-trained large model processing the first sample data after implementing the first action strategy.
[0076] According to the reinforcement learning reward value, the historical importance score of the third network layer is updated to obtain the target importance score of each preset network layer in the pre-trained large model; wherein the reinforcement learning reward value is positively correlated with the target importance score of the third network layer.
[0077] In the embodiments of this specification, reinforcement learning (RL) is one of the paradigms and methodologies of machine learning, which is used to describe and solve the problem of an agent (agent) learning a strategy to maximize rewards or achieve a specific goal during the interaction with the environment. Reinforcement learning regards learning as a trial and evaluation process. The agent selects an action for the environment. The state of the environment changes after accepting the action, and a reinforcement signal (reward or punishment) is generated and fed back to the agent. The agent selects the next action based on the reinforcement signal and the current state of the environment. The principle of selection is to increase the probability of receiving positive reinforcement (reward). The selected action not only affects the immediate reinforcement value, but also affects the state of the environment at the next moment and the final reinforcement value.
[0078] Based on this, when it is necessary to determine the importance information of each preset network layer in the pre-trained large model, the preset lightweight network layer can be used to replace part of the preset network layers (i.e., the third network layer) in the pre-trained large model as the first action strategy to be implemented in the reinforcement learning algorithm, and the reinforcement learning reward value corresponding to the first action strategy can be calculated in combination with the loss value generated during the operation of the pre-trained large model after the implementation of the first action strategy, so as to update the importance score of the replaced preset network layer (i.e., the third network layer) involved in the first action strategy based on the reinforcement learning reward value, so as to use the target importance score of the preset network layer as the importance information of the preset network layer.
[0079] In practical applications, the loss value (Loss Value) generated by the pre-trained large model processing the first sample data after implementing the first action strategy can be: an indicator that measures the difference between the model prediction result and the true label of the first sample data. The level of the loss value reflects the degree of fit of the model to the training data under the current parameters. Generally speaking, the lower the loss value, the smaller the difference between the model's prediction result and the true label, and the better the performance of the model, which can more accurately predict the target variable. In practical applications, there can be many types of loss values, for example, loss values calculated based on L1 norm loss, mean square error loss (MSELoss), cross entropy loss (CrossEntropyLoss), KL divergence loss (KLDivLoss), etc., and there is no specific limitation on this.
[0080] In the embodiment of the present specification, if the loss value generated by the pre-trained large model processing the first sample data after implementing the first action strategy is small, it can be said that the replaced third network layer corresponding to the first action strategy has a small impact on the performance of the pre-trained large model, that is, the importance of the third network layer is low, and the target importance score of the third network layer can be made smaller. Obviously, there can be a positive correlation between the loss value and the target importance score of the third network layer. Because it is necessary to avoid replacing the preset network layer with a high target importance score with a preset lightweight network layer, that is, it is necessary to avoid executing the corresponding first action strategy with a smaller loss value, therefore, there can also be a positive correlation between the loss value and the reinforcement learning reward value corresponding to the first action strategy. Based on this, there can also be a positive correlation between the reinforcement learning reward value and the target importance score of the third network layer.
[0081] For ease of understanding, a specific implementation method for calculating the reinforcement learning reward value corresponding to the first action strategy is provided herein.
[0082] In the embodiment of this specification, the number of the first action strategies may generally be greater than 1. Correspondingly, using a reinforcement learning algorithm to determine the reinforcement learning reward value of implementing the first action strategy for the pre-trained large model may include:
[0083] Based on the historical importance scores of each preset network layer in the pre-trained large model, a first number of third network layers that need to be replaced by preset lightweight network layers are screened out from the preset network layers to obtain a first action strategy; wherein the probability of the preset network layer being screened as the third network layer is negatively correlated with the historical importance score of the preset network layer.
[0084] The first sample data is processed using the pre-trained large model after implementing the first action strategy to obtain a loss value corresponding to the first action strategy.
[0085] Based on the loss values corresponding to each of the first action strategies, according to the first formula, the reinforcement learning reward values for implementing each of the first action strategies for the pre-trained large model are calculated.
[0086] Wherein, the first formula may be:
[0087]
[0088] r i is the reinforcement learning reward value for implementing the i-th first action strategy for the pre-trained large model, loss i is the loss value corresponding to the first action strategy of the i-th j is the loss value corresponding to the jth first action strategy, T is the number of the first action strategies, and the value of j is a positive integer in the range of 1 to T. -loss for e i Power.
[0089] In the embodiments of this specification, in order to better compare and measure the importance of different preset network layers, multiple first action strategies are usually generated during the execution of a reinforcement learning algorithm. In practical applications, the number of third network layers that need to be replaced indicated by different first action strategies is usually consistent. If there are multiple third network layers that need to be replaced indicated by each first action strategy, the third network layers corresponding to different first action strategies are usually not completely consistent, but different first action strategies can have one or more identical third network layers, which is flexible.
[0090] In the embodiments of this specification, it is usually necessary to avoid replacing a preset network layer with a higher degree of importance with a preset lightweight network model to ensure the performance of the large model. Therefore, the probability that the preset network layer is screened as the third network layer to be replaced can be negatively correlated with the historical importance score of the preset network layer. It is worth noting that the higher the historical importance score of the preset network layer, the lower the probability of it being selected as the third network layer, but it is not equal to 0. Therefore, a preset network layer with a higher degree of importance may also be selected as the third network layer, and its historical importance score can be continuously updated.
[0091] In practical applications, there are multiple ways to implement the selection of the third network layer from each preset network layer based on the historical importance scores of each preset network layer. For example, the sampling probability pi for any preset network layer mi can be: the absolute value of the difference between a value randomly selected from the range of 0 to sigmoid (si) and 1, where si can be the historical importance score of the preset network layer mi, and sigmoid (si) is an S-shaped growth curve, whose value range is 0 to 1. Since the higher the historical importance score si of the preset network layer mi, the larger the value of sigmoid (si), the higher the possibility that the value randomly selected from the range of 0 to sigmoid (si) is too large, which leads to the possibility that the absolute value of the difference between 1 and sigmoid (si) is too small, that is, the probability of selecting the preset network layer mi as the third network layer will be too small. Obviously, at this time, the probability of the preset network layer being selected as the third network layer can have a negative correlation with the historical importance score of the preset network layer. Alternatively, the historical importance score of each preset network layer may be mapped to a value between 0 and 1, and the difference between 1 and the normalized historical importance score of each preset network layer may be used as the probability of it being screened as the third network layer. In this case, the probability of the preset network layer being screened as the third network layer may also have a negative correlation with the historical importance score of the preset network layer. Of course, there may be other implementation methods, which are not specifically limited.
[0092] In practical applications, the probability of each preset network layer being screened as the third network layer may be the same. In this case, whether each preset network layer is screened as the third network layer may not be related to the historical importance score of the preset network layer, and no specific limitation is made to this.
[0093] In the embodiments of this specification, for each first action strategy, it is necessary to process the first sample data after implementing the first action strategy once on the pre-trained large model, so as to obtain the loss value at the pre-trained large model that implements the first action strategy. That is, each first action strategy has a corresponding loss value. Among them, the first sample data can be data with strong versatility that can be obtained by the model provider, and therefore, the specific content and meaning of the first sample data are not limited. It can be understood that after the loss value is obtained by processing the first sample data using the pre-trained large model after implementing the first action strategy, the parameters of the preset lightweight network layer currently in the pre-trained large model can be updated based on the loss value instead of the loss value, and the parameters of the preset lightweight network layer can be updated based on the loss value, and there is no specific limitation on this.
[0094] In the embodiment of this specification, since the reinforcement learning reward values for implementing each first action strategy for the pre-trained large model can be calculated according to the above-mentioned first formula, they are not described in detail here.
[0095] For ease of understanding, a specific implementation method for determining the target importance score of each preset network layer in the pre-trained large model based on the reinforcement learning reward value corresponding to each first action strategy is provided herein.
[0096] Specifically, updating the historical importance score of the third network layer according to the reinforcement learning reward value to obtain the target importance score of each preset network layer in the pre-trained large model may include:
[0097] For any of the third network layers, based on the reinforcement learning reward value and the historical importance score of the third network layer, a target importance score of the third network layer is calculated according to a second formula.
[0098] Wherein, the second formula is:
[0099] s cd =s hd +∑r q ,
[0100] s cd is the target importance score of the third network layer, s hd is the historical importance score of the third network layer, r q is a reinforcement learning reward value corresponding to the first action strategy for indicating replacement of the third network layer.
[0101] In the embodiments of this specification, the reinforcement learning reward value corresponding to each first action strategy is usually only related to the third network layer that is indicated to be replaced by the first action strategy, and is not related to other preset network layers that are not replaced. And according to the previous analysis, it can be known that the reinforcement learning reward value corresponding to each first action strategy is positively correlated with the target importance score of the third network layer that is indicated to be replaced by the first action strategy. Therefore, for each of the third network layers, the historical importance score of the third network layer can be added to the reinforcement learning reward value corresponding to each first action strategy that indicates the replacement of the third network layer to obtain the target importance score of the third network layer.
[0102] In practical applications, if there are multiple first action strategies that all indicate replacing the same third network layer, the maximum value, minimum value or average value of the reinforcement learning reward values corresponding to the above multiple first action strategies can also be added to the historical importance score of the third network layer to obtain the target importance score of the third network layer, and no specific limitation is given to this.
[0103] It can be understood that, since the preset network layers other than the third network layer are not replaced during the processing of the reinforcement learning algorithm, the reinforcement learning reward values corresponding to each first action strategy do not affect the importance scores of the above-mentioned other preset network layers, so that there is no need to update the historical importance scores of the preset network layers other than the third network layer, but their historical importance scores can be directly used as the target importance scores, thereby obtaining the target importance scores of all preset network layers, which will not be elaborated on.
[0104] In the embodiments of this specification, in order to further improve the performance of the target large model obtained through training, the pre-trained large model and the second sample data can be combined to pre-train the preset lightweight network layers required for generating the simulation model of the pre-trained large model, so as to ensure that each preset lightweight network layer can learn knowledge of a large amount of sample data.
[0105] Based on this, Figure 2 The method may further include:
[0106] Based on the target importance scores of each preset network layer in the pre-trained large model, a second number of fourth network layers that need to be replaced by lightweight network layers are screened out from the preset network layers to obtain a second action strategy; wherein the probability of the preset network layer being screened as the fourth network layer is negatively correlated with the target importance score of the preset network layer.
[0107] Based on the second action strategy, a lightweight network layer in the lightweight network layer set that has a unique correspondence with the fourth network layer is used to replace the fourth network layer in the pre-trained large model, so as to obtain the pre-trained large model after implementing the second action strategy; wherein, each lightweight network layer contained in the lightweight network layer set corresponds one-to-one to each preset network layer.
[0108] The second sample data is processed using the pre-trained large model after implementing the second action strategy to obtain a loss value corresponding to the second action strategy.
[0109] Based on the loss value corresponding to the second action strategy, the parameters of the lightweight network layer in the pre-trained large model after the implementation of the second action strategy are adjusted to obtain a preset lightweight network layer that has a unique correspondence with the fourth network layer.
[0110] The lightweight network layer in the lightweight network layer set corresponding to the other preset network layers is determined as a preset lightweight network layer having a unique corresponding relationship with the other preset network layers.
[0111] Among them, the setting processing is specifically used to change the first network layer to a preset lightweight network layer that has a unique corresponding relationship with the first network layer; the first action strategy is specifically used to instruct to change the third network layer to a preset lightweight network layer that has a unique corresponding relationship with the third network layer.
[0112] In the embodiments of this specification, a lightweight network layer that has learned rich knowledge and has a unique corresponding relationship can usually be trained for each preset network layer in the pre-trained large model. For ease of understanding, the pre-trained large model can be recorded as G = {g1, g2..., g n}, where g i The i-th preset network layer can be represented. And the lightweight network layer set can be recorded as H = {h1, h2..., h n}, where h i It can represent the i-th lightweight network layer or the preset lightweight network layer, wherein the i-th lightweight network layer and the i-th preset lightweight network layer are essentially the same network layer before and after the parameter update, h i With g i There is a unique correspondence between them. In practical applications, whether it is the reinforcement learning algorithm processing process, the deep learning process, or the simulation model generation process, usually only h is used. i To replace g i , thereby ensuring the effectiveness of the model training process. In addition, the target importance scores of each preset network layer in the pre-trained large model can be recorded as S = {s1, s2…, sn}, where s i It can represent the target importance score of the i-th preset network layer.
[0113] Because when generating a simulation model of a pre-trained large model, it is necessary to give priority to using a preset lightweight network layer to replace a preset network layer with a lower degree of importance, therefore, in the deep learning process, it is also possible to give priority to optimizing the parameters of the preset lightweight network layer corresponding to the preset network layer with a lower degree of importance. Based on this, the probability that the preset network layer is the fourth network layer that needs to be replaced can be negatively correlated with the target importance score of the preset network layer. In practical applications, the fourth number of preset network layers with the lowest target importance score can be simply used as the fourth network layer, or other methods can be used to screen out the preset network layers that need to be used as the fourth network layer, without specific limitation. At this point, a second action strategy can be generated to instruct each fourth network layer to be replaced with a corresponding lightweight network layer.
[0114] For ease of understanding, an example is given to explain this. Assume that the second action strategy indicates that g x With g y Replace with h x With h y , then the preset network layer g in the pre-trained large model x Replaced with lightweight network layer h x , and set the preset network layer g y Replaced with lightweight network layer h y After that, the pre-trained large model after the second action strategy is implemented can be obtained. Subsequently, after the second sample data is processed by the pre-trained large model after the second action strategy is implemented to obtain the loss value, the goal of deep learning can be to minimize the loss value. x With h y Adjust the parameters and use the adjusted lightweight network layer h x With h y As the preset network layer g x and y Preset lightweight network layers with unique correspondence.
[0115] In practical applications, usually only one second action strategy can be generated in each deep learning process. In order to ensure the efficiency of model training, multiple deep learning processes can be performed continuously, and the fourth network layer corresponding to the second action strategy generated in each deep learning process can be consistent or different, and there is no specific limitation on this.
[0116] In practical applications, the above-mentioned deep learning process and reinforcement learning process can often be executed crosswise, which is conducive to ensuring the good performance of the final generated preset lightweight network layer and the accuracy of the target importance score of the preset network layer. Figure 2 The method may further include:
[0117] Get a pre-trained large model, a set of importance scores for each preset network layer, and a set of lightweight network layers.
[0118] Determine the type of processing that currently needs to be performed on the pre-trained large model, where the processing type includes: reinforcement learning processing or deep learning processing.
[0119] If deep learning processing is currently required for the pre-trained large model, the deep learning processing can be performed according to the implementation method provided in the above embodiment, and the lightweight network layer set can be updated using the obtained preset lightweight network layer. Subsequent reinforcement learning processing can be implemented based on the latest version of the lightweight network layer set.
[0120] If it is currently necessary to perform reinforcement learning processing on the pre-trained large model, the reinforcement learning processing can be performed according to the implementation method provided in the above embodiment, and the importance score set can be updated using the obtained target importance score. Subsequent deep learning processing can be implemented based on the latest version of the importance score set.
[0121] In practical applications, the target number of executions of the reinforcement learning process and / or deep learning process to be performed can be preset, and after reaching the above target number of executions, the importance information of each preset network layer in step 202 is generated according to the latest version of the importance score set, and the simulation model of the pre-trained large model is generated using the latest version of the lightweight network layer set. Alternatively, when the latest version of the importance score set is evaluated to have good accuracy and / or the latest version of the lightweight network layer set has good performance, the reinforcement learning process and the deep learning process can be stopped, thereby generating a simulation model of the pre-trained large model based on the latest version of the importance score set and the lightweight network layer set, which will not be described in detail.
[0122] In the embodiment of this specification, step 204: according to the importance information, setting and processing are performed on the first network layer and the second network layer in the preset network layer to obtain the simulation model of the pre-trained large model, which may specifically include:
[0123] According to the importance information, the third number of the preset network layers with the highest importance in the pre-trained large model are screened out to obtain the second network layer.
[0124] Based on the second network layer, an adapter of the pre-trained large model is generated; wherein the parameters of the adapter are allowed to be adjusted.
[0125] According to the importance information, the fourth number of preset network layers with the lowest importance in the pre-trained large model are screened out to obtain the first network layer.
[0126] The first network layer is replaced by using a preset lightweight network layer to obtain a simulation model carrying an adapter.
[0127] Correspondingly, step 208: receiving the adjusted parameter data of the second network layer fed back by the device of the data owner may specifically include: receiving the adjusted parameter data for the adapter fed back by the device of the data owner.
[0128] In the embodiment of this specification, the adapter is a module that can be trained, which can be used to plug in the pre-trained large model or the simulation model of the pre-trained large model. Based on this, when the data owner needs to fine-tune the pre-trained large model, an adapter can be generated according to the third number of preset network layers (i.e., the second network layer) with the highest importance in the pre-trained large model, so that the data owner can adjust the parameters of the adapter. In addition, it is also necessary to replace the fourth number of preset network layers (i.e., the first network layer) with the lowest importance with a preset lightweight network layer. At this point, the compression processing for the pre-trained large model has been completed, and the obtained simulation model is the one carrying the adapter. Subsequently, after the data owner trains the simulation model carrying the adapter, the adjusted parameter data for the adapter can be fed back to the model provider, which is convenient and fast. In practical applications, the third number and the fourth number can be set according to actual needs. For example, if the model performance requirements are high, the third number can be set to a larger value, and / or the fourth number can be set to a smaller value. If the training efficiency of the model is required to be higher, the fourth number may be set to be larger, etc., which will not be elaborated herein.
[0129] The step of generating the adapter of the pre-trained large model based on the second network layer may specifically include:
[0130] The adapter is generated according to the second network layer that is granted parameter adjustment authority; or, a plug-in for fine-tuning the pre-trained large model is set for the second network layer to obtain the adapter.
[0131] Correspondingly, the adjusted parameter data for the adapter fed back by the device receiving the data owner may specifically include:
[0132] Receive the adjusted parameter data for the second network layer that is granted parameter adjustment authority, fed back by the device of the data owner; or receive the adjusted parameter data for the plug-in, fed back by the device of the data owner.
[0133] Correspondingly, step 210: generating a target large model according to the adjusted parameter data of the second network layer and the pre-trained large model may specifically include:
[0134] The historical parameter data of the second network layer in the pre-trained large model is replaced by the adjusted parameter data of the second network layer that is granted parameter adjustment authority to obtain the target large model; or, the target large model is generated by combining the adjusted parameter data for the plug-in with the historical parameter data of the pre-trained large model.
[0135] In the embodiments of this specification, various implementation methods of the adapter are given. For example, the second network layer can be directly used as the network layer in the adapter, so that the data owner can directly adjust the parameters of the second network layer. Subsequently, the model provider will use the second network layer with updated parameters to replace the second network layer in the pre-trained large model, so as to obtain the target large model, which is convenient and fast. Alternatively, a plug-in with adjustable parameters can be additionally provided for the second network layer to use the plug-in as an adapter. At this time, the data owner will not directly adjust the parameters of the second network layer, but will adjust the parameters in the additional plug-in. Subsequently, the model provider can obtain the target large model by directly connecting the plug-in with adjusted parameters to the pre-trained large model, which is flexible.
[0136] In practical applications, the emulator can be a small model obtained by the model provider after pre-training the large model through lossy compression. The emulator will imitate the input and output behavior of the pre-trained large model, but the performance is biased. And the model provider will provide the emulator and the adapter to the data owner respectively to facilitate the operation of the data owner. Therefore, the emulator and the adapter can constitute a simulation model with an adapter. Specifically, if the second network layer is directly used as an adapter, the emulator can include the network layer structure in the simulation model except the second network layer. If the plug-in with adjustable parameters that is additionally set for the second network layer is used as an adapter, the emulator will include the second network layer, the preset lightweight network layer and other preset network layers in the simulation model, but will not include the plug-in that is additionally set for the second network layer, which will not be elaborated.
[0137] In the embodiment of the present specification, step 210: after generating the target large model according to the adjusted parameter data of the second network layer and the pre-trained large model, the method may further include:
[0138] A call request from the data owner for the target large model is obtained; the call request carries the business data to be processed at the data owner.
[0139] The target large model is used to process the business data to be processed to obtain a business data processing result.
[0140] The business data processing result is sent to the device of the data owner.
[0141] In an embodiment of the present specification, the business data to be processed carried in the call request of the data owner can be consistent with the business data used when generating the adjusted parameter data of the second network layer, so that the target large model can generate business data processing results with better accuracy based on the business data to be processed. In practical applications, the types and meanings of the business data to be processed and the business data processing results can be set according to actual business needs. For example, the business data to be processed and the business data processing results can be: user comment data to be subjected to emotion recognition, and the emotion type to which the user comment data is identified; or they can be: user ID images to be subjected to authenticity recognition, and the authenticity recognition results of the user ID images; or they can be: article data to generate comment information, and the comment information generated for the article data, etc.
[0142] Based on Figure 2 With the same idea as the solution shown in , the embodiments of this specification also provide another large model training method. Figure 3 This is a flow chart of another large model training method provided in the embodiments of this specification. The execution subject of this process can be the device of the data owner, or the application installed on the device of the data owner. Figure 3 As shown, the process may include:
[0143] Step 302: Obtain a simulation model of the pre-trained large model from a device provided by a model provider; wherein the simulation model is obtained by performing setting processing on a first network layer and a second network layer in the preset network layer according to importance information of each preset network layer in the pre-trained large model; the setting processing is used to change the first network layer to a preset lightweight network layer, and to indicate that parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer.
[0144] In the embodiment of this specification, the simulation model of the pre-trained large model obtained in step 302 can be based on Figure 2 And the embodiments thereof are generated, which will not be described in detail.
[0145] Step 304: Train the simulation model using the business data at the data owner to obtain adjusted parameter data of the second network layer.
[0146] In an embodiment of the present specification, minimizing the loss value generated by the simulation model can be used as a training goal to utilize the business data at the data owner to train and optimize the parameters related to the second network layer that are allowed to be adjusted in the simulation model to obtain the adjusted parameter data of the second network layer.
[0147] Step 306: Send the adjusted parameter data of the second network layer to the device of the model provider; the device of the model provider is used to generate a target large model according to the adjusted parameter data of the second network layer and the pre-trained large model.
[0148] In the embodiment of this specification, the adjusted parameter data of the second network layer sent to the device of the model provider in step 302 is Figure 2 The adjusted parameter data of the second network layer received in step 208 will not be described in detail.
[0149] Figure 3 The method in the paper uses a preset lightweight network layer to replace the less important network layer in the pre-trained large model as a simulation model, which can not only improve the consistency of the structure and performance of the simulation model and the pre-trained large model, but also reduce the amount of resources consumed in the model training process, which is conducive to ensuring that the target large model generated according to the adjusted parameter data of the second network layer and the pre-trained large model can have good performance. In addition, the core data of the data owner and the model provider are not out of the domain, so as to ensure the data privacy and security when fine-tuning the large model across domains.
[0150] In the embodiment of this specification, the simulation model may carry an adapter generated based on the second network layer; and the parameters of the adapter are allowed to be adjusted.
[0151] Correspondingly, step 304: training the simulation model using the business data at the data owner to obtain the adjusted parameter data of the second network layer may specifically include:
[0152] The simulation model is used to process the business data at the data owner to obtain a loss value corresponding to the simulation model; the parameter data of the adapter is adjusted according to the loss value corresponding to the simulation model to obtain adjusted parameter data for the adapter.
[0153] The adjusting the parameter data of the adapter according to the loss value corresponding to the simulation model to obtain the adjusted parameter data for the adapter may specifically include:
[0154] If the adapter is generated by using the second network layer that is granted parameter adjustment authority, then according to the loss value corresponding to the simulation model, the parameter data of the second network layer that is granted parameter adjustment authority is adjusted to obtain adjusted parameter data for the adapter; or,
[0155] If the adapter is generated based on a plug-in for fine-tuning the pre-trained large model set for the second network layer, the parameter data of the plug-in is adjusted according to the loss value corresponding to the simulation model to obtain adjusted parameter data for the adapter.
[0156] In the present embodiment of the specification, due to Figure 2 The structure of the adapter and the training optimization principle have been explained in the embodiments, so they will not be repeated here.
[0157] In the embodiment of this specification, after step 306: sending the adjusted parameter data of the second network layer to the device of the model provider, the method may further include:
[0158] A call request for the target large model is sent to the device of the model provider; the call request carries the business data to be processed at the data owner.
[0159] The business data processing result obtained by processing the business data to be processed using the target large model is received as feedback from the device of the model provider.
[0160] In the embodiments of this specification, the business data to be processed and the business data of the training simulation model in step 304 can usually be consistent, so that the target large model can generate business data processing results with better accuracy for the business data to be processed, which will not be elaborated on.
[0161] Figure 4 The embodiments of this specification provide corresponding to Figure 2 and Figure 3 A swimlane flow diagram of the large model training method in . Figure 4 As shown, the large model training process may involve execution entities such as the equipment of the model provider and the equipment of the data owner.
[0162] During the model training phase, the model provider's device can, on the one hand, screen out the third network layer that needs to be replaced by the preset lightweight network layer from the preset network layer based on the historical importance score of the preset network layer of the pre-trained large model, and obtain the first action strategy. The first sample data is processed using the pre-trained large model after implementing the first action strategy to obtain the loss value corresponding to the first action strategy. Based on the loss values corresponding to each first action strategy, the reinforcement learning reward value for implementing each first action strategy is determined. In order to update the historical importance score of the third network layer according to the reinforcement learning reward value, and combine the historical importance scores of other preset network layers to obtain the target importance scores of each preset network layer.
[0163] On the other hand, the device of the model provider can also filter out the fourth network layer to be replaced by the preset lightweight network layer from the preset network layer based on the target importance score of the preset network layer to obtain a second action strategy. The second sample data is processed using the pre-trained large model after the implementation of the second action strategy to obtain the loss value corresponding to the second action strategy. Based on the loss value, the parameters of the lightweight network layer in the pre-trained large model after the implementation of the second action strategy are adjusted to obtain a preset lightweight network layer that has a unique correspondence with the fourth network layer. And, the lightweight network layer whose parameters have not been adjusted corresponding to other preset network layers is determined as a preset lightweight network layer that has a unique correspondence with other preset network layers. Thereby, a preset lightweight network layer that has a unique correspondence with each preset network layer is obtained.
[0164] Subsequently, the device of the model provider can perform setting processing on the first network layer and the second network layer in the preset network layer of the pre-trained large model according to the target importance score, obtain a simulation model of the pre-trained large model, and send the simulation model to the device of the data owner; wherein, the setting processing is used to change the first network layer to a preset lightweight network layer with a unique corresponding relationship, and to indicate that the parameters of the second network layer are allowed to be adjusted, and the importance of the second network layer is usually higher than that of the first network layer.
[0165] The data owner's device can use the data owner's business data to train the simulation model, obtain and feed back the adjusted parameter data of the second network layer to the model provider's device, so that the model provider's device can generate a target large model based on the adjusted parameter data of the second network layer and the pre-trained large model.
[0166] During the model calling stage, the data owner's device can generate and send a call request for the target big model carrying the data owner's business data to be processed to the model provider's device. After the model provider's device uses the target big model to process the business data to be processed and obtains the business data processing result, it can send the business data processing result to the data owner's device, thereby meeting the data owner's business processing needs.
[0167] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method. Figure 5 The embodiments of this specification provide corresponding to Figure 2 A schematic diagram of the structure of a large model training device. Figure 5 As shown, the device may include:
[0168] The first acquisition module 502 is used to obtain the importance information of each preset network layer in the pre-trained large model.
[0169] The setting module 504 is used to perform setting processing on the first network layer and the second network layer in the preset network layer according to the importance information to obtain a simulation model of the pre-trained large model; wherein the setting processing is used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer.
[0170] The first sending module 506 is used to send the simulation model to the device of the data owner.
[0171] The receiving module 508 is used to receive the adjusted parameter data of the second network layer fed back by the device of the data owner; the adjusted parameter data of the second network layer is obtained by training the simulation model using the business data at the data owner.
[0172] The generation module 510 is used to generate a target large model according to the adjusted parameter data of the second network layer and the pre-trained large model.
[0173] based on Figure 5 The present specification also provides some specific implementation schemes of the device, which are described below.
[0174] Optionally, the first acquisition module 502 may include:
[0175] A determination unit is used to determine, by using a reinforcement learning algorithm, a reinforcement learning reward value for implementing a first action strategy for the pre-trained large model; wherein the first action strategy is used to indicate replacing a third network layer in a preset network layer in the pre-trained large model with a preset lightweight network layer, and the reinforcement learning reward value is positively correlated with a loss value generated by the pre-trained large model processing the first sample data after implementing the first action strategy.
[0176] An updating unit is used to update the historical importance score of the third network layer according to the reinforcement learning reward value to obtain the target importance score of each preset network layer in the pre-trained large model; wherein the reinforcement learning reward value is positively correlated with the target importance score of the third network layer.
[0177] Optionally, the number of the first action strategies may be greater than 1. Correspondingly, the determination unit may be specifically used to: based on the historical importance scores of the various preset network layers in the pre-trained large model, screen out a first number of third network layers that need to be replaced with preset lightweight network layers from the various preset network layers to obtain a first action strategy; wherein the probability of the preset network layer being screened as the third network layer is negatively correlated with the historical importance score of the preset network layer.
[0178] The first sample data is processed using the pre-trained large model after implementing the first action strategy to obtain a loss value corresponding to the first action strategy.
[0179] Based on the loss values corresponding to each of the first action strategies, according to the first formula, the reinforcement learning reward values for implementing each of the first action strategies for the pre-trained large model are calculated.
[0180] Wherein, the first formula may be:
[0181]
[0182] r i is the reinforcement learning reward value for implementing the i-th first action strategy for the pre-trained large model, loss i is the loss value corresponding to the first action strategy of the i-th j is the loss value corresponding to the jth first action strategy, and T is the number of the first action strategies.
[0183] The updating unit may be specifically used for:
[0184] For any of the third network layers, based on the reinforcement learning reward value and the historical importance score of the third network layer, a target importance score of the third network layer is calculated according to a second formula;
[0185] The second formula may be:
[0186] s cd =s hd +∑r q ,
[0187] s cd is the target importance score of the third network layer, s hd is the historical importance score of the third network layer, r q is a reinforcement learning reward value corresponding to the first action strategy for indicating replacement of the third network layer.
[0188] Optionally, the setting module may include:
[0189] The first screening unit is used to screen out the third number of the preset network layers with the highest importance in the pre-trained large model according to the importance information, and obtain the second network layer.
[0190] The first generating unit is used to generate an adapter of the pre-trained large model based on the second network layer; wherein the parameters of the adapter are allowed to be adjusted.
[0191] The second screening unit is used to screen out the fourth number of preset network layers with the lowest importance in the pre-trained large model according to the importance information to obtain the first network layer.
[0192] The replacement unit is used to replace the first network layer with a preset lightweight network layer to obtain a simulation model carrying the adapter.
[0193] Optionally, the receiving module may include:
[0194] The receiving unit is used to receive the adjusted parameter data for the adapter fed back by the device of the data owner.
[0195] Optionally, the first generating unit can be specifically used to: generate the adapter according to the second network layer that is granted parameter adjustment authority; or, set a plug-in for fine-tuning the pre-trained large model for the second network layer to obtain the adapter.
[0196] The receiving unit may be specifically used to: receive adjusted parameter data for the second network layer granted parameter adjustment authority fed back by the device of the data owner; or receive adjusted parameter data for the plug-in fed back by the device of the data owner.
[0197] Optionally, the generating module may include:
[0198] A second generating unit is configured to replace the historical parameter data of the second network layer in the pre-trained large model with the adjusted parameter data of the second network layer for which the parameter adjustment authority is granted, so as to obtain a target large model; or
[0199] The third generating unit is used to generate a target large model by combining the adjusted parameter data for the plug-in with the historical parameter data of the pre-trained large model.
[0200] Optional, Figure 5 The device may also include:
[0201] A screening module is used to screen out a second number of fourth network layers that need to be replaced with lightweight network layers from each preset network layer based on the target importance scores of each preset network layer in the pre-trained large model, and obtain a second action strategy; wherein the probability of the preset network layer being screened as the fourth network layer is negatively correlated with the target importance score of the preset network layer.
[0202] A replacement module is used to replace the fourth network layer in the pre-trained large model based on the second action strategy by using a lightweight network layer in the lightweight network layer set that has a unique correspondence with the fourth network layer, so as to obtain the pre-trained large model after implementing the second action strategy; wherein each lightweight network layer included in the lightweight network layer set corresponds one-to-one to each preset network layer.
[0203] The sample data processing module is used to process the second sample data using the pre-trained large model after implementing the second action strategy to obtain the loss value corresponding to the second action strategy.
[0204] A parameter adjustment module is used to adjust the parameters of the lightweight network layer in the pre-trained large model after the implementation of the second action strategy based on the loss value corresponding to the second action strategy, so as to obtain a preset lightweight network layer that has a unique correspondence with the fourth network layer.
[0205] A determination module, configured to determine the lightweight network layer in the lightweight network layer set corresponding to the other preset network layers as a preset lightweight network layer having a unique corresponding relationship with the other preset network layers;
[0206] The setting process is specifically used to change the first network layer to a preset lightweight network layer that has a unique correspondence with the first network layer;
[0207] The first action strategy is specifically used to instruct to change the third network layer to a preset lightweight network layer that has a unique correspondence with the third network layer.
[0208] Optional, Figure 5 The device may further include:
[0209] The second acquisition module is used to obtain a call request from the data owner for the target large model; the call request carries the business data to be processed at the data owner.
[0210] The business data processing module is used to process the business data to be processed using the target large model to obtain a business data processing result.
[0211] The second sending module is used to send the business data processing result to the device of the data owner.
[0212] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method. Figure 6 The embodiments of this specification provide corresponding to Figure 3 A schematic diagram of the structure of a large model training device. Figure 6 As shown, the device may include:
[0213] Acquisition module 602 is used to acquire a simulation model of a pre-trained large model from a device provided by a model provider; wherein the simulation model is obtained by setting and processing the first network layer and the second network layer in the preset network layer according to the importance information of each preset network layer in the pre-trained large model; the setting and processing is used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer.
[0214] The training module 604 is used to train the simulation model using the business data at the data owner to obtain the adjusted parameter data of the second network layer.
[0215] The first sending module 606 is used to send the adjusted parameter data of the second network layer to the device of the model provider; the device of the model provider is used to generate a target large model according to the adjusted parameter data of the second network layer and the pre-trained large model.
[0216] based on Figure 6The present specification also provides some specific implementation schemes of the device, which are described below.
[0217] Optionally, the simulation model may carry an adapter generated based on the second network layer; the parameters of the adapter are allowed to be adjusted. Correspondingly, the training module may include:
[0218] The business data processing unit is used to process the business data at the data owner by using the simulation model to obtain the loss value corresponding to the simulation model.
[0219] The parameter adjustment unit is used to adjust the parameter data of the adapter according to the loss value corresponding to the simulation model to obtain the adjusted parameter data for the adapter.
[0220] The parameter adjustment unit may specifically include:
[0221] A first adjustment subunit is configured to adjust the parameter data of the second network layer that is granted the parameter adjustment authority according to the loss value corresponding to the simulation model to obtain the adjusted parameter data for the adapter if the adapter is generated by using the second network layer that is granted the parameter adjustment authority; or
[0222] The second adjustment subunit is used to adjust the parameter data of the plug-in according to the loss value corresponding to the simulation model to obtain the adjusted parameter data for the adapter if the adapter is generated based on a plug-in for fine-tuning the pre-trained large model set for the second network layer.
[0223] Optional, Figure 6 The device may further include:
[0224] The second sending module is used to send a call request for the target large model to the device of the model provider; the call request carries the business data to be processed at the data owner.
[0225] The receiving module is used to receive the business data processing result obtained by processing the business data to be processed using the target large model, which is fed back by the device of the model provider.
[0226] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method.
[0227] Figure 7 The embodiments of this specification provide corresponding to Figure 2 A schematic diagram of the structure of a large model training device. Figure 7As shown, the device 700 may include: at least one processor 710; and a memory 730 communicatively connected to the at least one processor; wherein the memory 730 stores instructions 720 executable by the at least one processor 710, and the instructions are executed by the at least one processor 710 to enable the at least one processor 710 to:
[0228] Get the importance information of each preset network layer in the pre-trained large model.
[0229] According to the importance information, setting processing is performed on the first network layer and the second network layer in the preset network layer to obtain a simulation model of the pre-trained large model; wherein the setting processing is used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer.
[0230] The simulation model is sent to a device of a data owner.
[0231] The adjusted parameter data of the second network layer fed back by the device of the receiving data owner is obtained by training the simulation model with the business data of the data owner.
[0232] Generate a target large model based on the adjusted parameter data of the second network layer and the pre-trained large model.
[0233] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method.
[0234] Figure 8 The embodiments of this specification provide corresponding to Figure 3 A schematic diagram of the structure of a large model training device. Figure 8 As shown, the device 800 may include: at least one processor 810; and a memory 830 communicatively connected to the at least one processor; wherein the memory 830 stores instructions 820 executable by the at least one processor 810, and the instructions are executed by the at least one processor 810 to enable the at least one processor 810 to:
[0235] A simulation model of a pre-trained large model is obtained from a device provided by a model provider; wherein the simulation model is obtained by setting and processing the first network layer and the second network layer in the preset network layer according to the importance information of each preset network layer in the pre-trained large model; the setting and processing is used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer.
[0236] The simulation model is trained using the business data at the data owner to obtain adjusted parameter data of the second network layer.
[0237] Sending the adjusted parameter data of the second network layer to the device of the model provider; the device of the model provider is used to generate a target large model according to the adjusted parameter data of the second network layer and the pre-trained large model.
[0238] Each embodiment in this specification is described in a progressive manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. Figure 7 and Figure 8 As for the device shown, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0239] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0240] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0241] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0242] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0243] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0244] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0245] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0246] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0247] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0248] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0249] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0250] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0251] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0252] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0253] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A large model training method, comprising: Obtain the importance information of each preset network layer in the pre-trained large model; According to the importance information, setting processing is performed on the first network layer and the second network layer in the preset network layer to obtain a simulation model of the pre-trained large model; wherein the setting processing is used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer; Sending the simulation model to a device of a data owner; receiving adjusted parameter data of the second network layer fed back by the device of the data owner; the adjusted parameter data of the second network layer is obtained by training the simulation model using the business data at the data owner; Generate a target large model based on the adjusted parameter data of the second network layer and the pre-trained large model.
2. The method according to claim 1, wherein obtaining the importance information of each preset network layer in the pre-trained large model specifically comprises: Determine, by using a reinforcement learning algorithm, a reinforcement learning reward value for implementing a first action strategy for the pre-trained large model; wherein the first action strategy is used to indicate replacing a third network layer in a preset network layer in the pre-trained large model with a preset lightweight network layer, and the reinforcement learning reward value is positively correlated with a loss value generated by the pre-trained large model processing the first sample data after implementing the first action strategy; According to the reinforcement learning reward value, the historical importance score of the third network layer is updated to obtain the target importance score of each preset network layer in the pre-trained large model; wherein the reinforcement learning reward value is positively correlated with the target importance score of the third network layer.
3. The method according to claim 2, wherein the number of the first action strategies is greater than 1; The step of using a reinforcement learning algorithm to determine a reinforcement learning reward value for implementing the first action strategy for the pre-trained large model specifically includes: Based on the historical importance scores of each preset network layer in the pre-trained large model, a first number of third network layers that need to be replaced by preset lightweight network layers are screened out from each preset network layer to obtain a first action strategy; wherein the probability of the preset network layer being screened as the third network layer is negatively correlated with the historical importance score of the preset network layer; Processing the first sample data using the pre-trained large model after implementing the first action strategy to obtain a loss value corresponding to the first action strategy; Based on the loss values corresponding to each of the first action strategies, according to the first formula, the reinforcement learning reward values respectively possessed by implementing each of the first action strategies for the pre-trained large model are calculated; Among them, the first formula is: r i is the reinforcement learning reward value for implementing the i-th first action strategy for the pre-trained large model, loss i is the loss value corresponding to the first action strategy of the i-th j is the loss value corresponding to the jth first action strategy, and T is the number of the first action strategies.
4. The method according to claim 3, wherein the historical importance score of the third network layer is updated according to the reinforcement learning reward value to obtain the target importance score of each preset network layer in the pre-trained large model, specifically comprising: For any of the third network layers, based on the reinforcement learning reward value and the historical importance score of the third network layer, a target importance score of the third network layer is calculated according to a second formula; Wherein, the second formula is: s cd =s hd +∑r q , s cd is the target importance score of the third network layer, s hd is the historical importance score of the third network layer, r q is a reinforcement learning reward value corresponding to the first action strategy for indicating replacement of the third network layer.
5. The method according to any one of claims 2 to 4, further comprising: Based on the target importance scores of the respective preset network layers in the pre-trained large model, a second number of fourth network layers that need to be replaced with lightweight network layers are screened out from the respective preset network layers to obtain a second action strategy; wherein the probability that the preset network layer is screened as the fourth network layer is negatively correlated with the target importance score of the preset network layer; Based on the second action strategy, a lightweight network layer in the lightweight network layer set that has a unique correspondence with the fourth network layer is used to replace the fourth network layer in the pre-trained large model, so as to obtain the pre-trained large model after the second action strategy is implemented; wherein each lightweight network layer included in the lightweight network layer set corresponds one-to-one to each preset network layer; Processing the second sample data using the pre-trained large model after implementing the second action strategy to obtain a loss value corresponding to the second action strategy; Based on the loss value corresponding to the second action strategy, adjusting the parameters of the lightweight network layer in the pre-trained large model after the second action strategy is implemented, to obtain a preset lightweight network layer that has a unique corresponding relationship with the fourth network layer; Determine the lightweight network layer in the lightweight network layer set corresponding to the other preset network layers as the preset lightweight network layer having a unique corresponding relationship with the other preset network layers; The setting process is specifically used to change the first network layer to a preset lightweight network layer that has a unique correspondence with the first network layer; The first action strategy is specifically used to instruct to change the third network layer to a preset lightweight network layer that has a unique correspondence with the third network layer.
6. The method according to claim 1, wherein the first network layer and the second network layer in the preset network layer are set and processed according to the importance information to obtain a simulation model of the pre-trained large model, specifically comprising: According to the importance information, a third number of the preset network layers with the highest importance in the pre-trained large model are screened out to obtain the second network layer; Based on the second network layer, generating an adapter of the pre-trained large model; wherein the parameters of the adapter are allowed to be adjusted; According to the importance information, a fourth number of the preset network layers with the lowest importance in the pre-trained large model are screened out to obtain the first network layer; The first network layer is replaced by a preset lightweight network layer to obtain a simulation model carrying the adapter; The receiving the adjusted parameter data of the second network layer fed back by the device of the data owner specifically includes: Receive the adjusted parameter data for the adapter fed back by the device of the data owner.
7. The method according to claim 6, wherein generating an adapter of the pre-trained large model based on the second network layer specifically comprises: generating the adapter according to the second network layer to which the parameter adjustment authority is granted; or, Setting a plug-in for fine-tuning the pre-trained large model for the second network layer to obtain the adapter; The adjusted parameter data for the adapter fed back by the device of the data owner specifically includes: Receiving adjusted parameter data for the second network layer for which parameter adjustment authority is granted, fed back by the device of the data owner; or, Receive the adjusted parameter data for the plug-in fed back by the device of the data owner.
8. The method according to claim 7, wherein generating a target large model according to the adjusted parameter data of the second network layer and the pre-trained large model specifically comprises: Using the adjusted parameter data of the second network layer for which parameter adjustment authority is granted, the historical parameter data of the second network layer in the pre-trained large model is replaced to obtain a target large model; or, The adjusted parameter data for the plug-in is combined with the historical parameter data of the pre-trained large model to generate a target large model.
9. The method according to claim 1, after generating the target large model according to the adjusted parameter data of the second network layer and the pre-trained large model, further comprises: Obtaining a call request from the data owner for the target large model; The call request carries the business data to be processed by the data owner; Processing the to-be-processed business data using the target large model to obtain a business data processing result; The business data processing result is sent to the device of the data owner.
10. A large model training method, comprising: Acquire a simulation model of a pre-trained large model from a device of a model provider; wherein the simulation model is obtained by setting and processing a first network layer and a second network layer in the preset network layer according to the importance information of each preset network layer in the pre-trained large model; the setting and processing is used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer; Using the business data at the data owner to train the simulation model, and obtain adjusted parameter data of the second network layer; Sending the adjusted parameter data of the second network layer to the device of the model provider; the device of the model provider is used to generate a target large model according to the adjusted parameter data of the second network layer and the pre-trained large model.
11. The method according to claim 10, wherein the simulation model carries an adapter generated based on the second network layer; and the parameters of the adapter are allowed to be adjusted; The using the business data at the data owner to train the simulation model to obtain the adjusted parameter data of the second network layer specifically includes: Processing the business data at the data owner by using the simulation model to obtain a loss value corresponding to the simulation model; According to the loss value corresponding to the simulation model, the parameter data of the adapter is adjusted to obtain adjusted parameter data for the adapter.
12. The method according to claim 11, wherein adjusting the parameter data of the adapter according to the loss value corresponding to the simulation model to obtain the adjusted parameter data for the adapter specifically comprises: If the adapter is generated by using the second network layer that is granted parameter adjustment authority, adjusting the parameter data of the second network layer that is granted parameter adjustment authority according to the loss value corresponding to the simulation model to obtain adjusted parameter data for the adapter; or, If the adapter is generated based on a plug-in for fine-tuning the pre-trained large model set for the second network layer, the parameter data of the plug-in is adjusted according to the loss value corresponding to the simulation model to obtain adjusted parameter data for the adapter.
13. The method according to claim 10, after sending the adjusted parameter data of the second network layer to the device of the model provider, further comprising: Sending a call request for the target large model to the device of the model provider; The call request carries the business data to be processed by the data owner; The business data processing result obtained by processing the business data to be processed using the target large model is received as feedback from the device of the model provider.
14. A large model training device, comprising: The first acquisition module is used to obtain the importance information of each preset network layer in the pre-trained large model; A setting module, used for performing setting processing on the first network layer and the second network layer in the preset network layer according to the importance information, to obtain a simulation model of the pre-trained large model; wherein the setting processing is used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer; A first sending module, used for sending the simulation model to a device of a data owner; A receiving module, used for receiving adjusted parameter data of the second network layer fed back by the device of the data owner; the adjusted parameter data of the second network layer is obtained by training the simulation model using the business data at the data owner; A generation module is used to generate a target large model based on the adjusted parameter data of the second network layer and the pre-trained large model.
15. The device according to claim 14, wherein the first acquisition module comprises: A determination unit is used to determine, using a reinforcement learning algorithm, a reinforcement learning reward value for implementing a first action strategy for the pre-trained large model; wherein the first action strategy is used to indicate replacing a third network layer in a preset network layer in the pre-trained large model with a preset lightweight network layer, and the reinforcement learning reward value is positively correlated with a loss value generated by the pre-trained large model processing the first sample data after implementing the first action strategy; An updating unit is used to update the historical importance score of the third network layer according to the reinforcement learning reward value to obtain the target importance score of each preset network layer in the pre-trained large model; wherein the reinforcement learning reward value is positively correlated with the target importance score of the third network layer.
16. The apparatus of claim 15, wherein the number of the first action strategies is greater than 1; The determining unit is specifically configured to: Based on the historical importance scores of each preset network layer in the pre-trained large model, a first number of third network layers that need to be replaced with preset lightweight network layers are screened out from the preset network layers to obtain a first action strategy; wherein, The probability that the preset network layer is screened as the third network layer is negatively correlated with the historical importance score of the preset network layer; Processing the first sample data using the pre-trained large model after implementing the first action strategy to obtain a loss value corresponding to the first action strategy; Based on the loss values corresponding to each of the first action strategies, according to the first formula, the reinforcement learning reward values respectively possessed by implementing each of the first action strategies for the pre-trained large model are calculated; Among them, the first formula is: r i is the reinforcement learning reward value for implementing the i-th first action strategy for the pre-trained large model, loss i is the loss value corresponding to the first action strategy of the i-th j is the loss value corresponding to the jth first action strategy, and T is the number of the first action strategies; The updating unit is specifically used for: For any of the third network layers, based on the reinforcement learning reward value and the historical importance score of the third network layer, a target importance score of the third network layer is calculated according to a second formula; Wherein, the second formula is: s cd =s hd +∑r q , s cd is the target importance score of the third network layer, s hd is the historical importance score of the third network layer, r q is a reinforcement learning reward value corresponding to the first action strategy for indicating replacement of the third network layer.
17. The apparatus according to any one of claims 14 to 16, further comprising: A screening module is used to screen out a second number of fourth network layers that need to be replaced with lightweight network layers from each preset network layer based on the target importance score of each preset network layer in the pre-trained large model, and obtain a second action strategy; wherein the probability of the preset network layer being screened as the fourth network layer is negatively correlated with the target importance score of the preset network layer; A replacement module, configured to replace the fourth network layer in the pre-trained large model with a lightweight network layer in the lightweight network layer set that has a unique correspondence with the fourth network layer based on the second action strategy, so as to obtain the pre-trained large model after the second action strategy is implemented; wherein each lightweight network layer included in the lightweight network layer set corresponds one-to-one to each preset network layer; A sample data processing module, used to process the second sample data using the pre-trained large model after implementing the second action strategy to obtain a loss value corresponding to the second action strategy; A parameter adjustment module, configured to adjust the parameters of the lightweight network layer in the pre-trained large model after the implementation of the second action strategy based on the loss value corresponding to the second action strategy, so as to obtain a preset lightweight network layer having a unique corresponding relationship with the fourth network layer; A determination module, configured to determine the lightweight network layer in the lightweight network layer set corresponding to the other preset network layers as a preset lightweight network layer having a unique corresponding relationship with the other preset network layers; The setting process is specifically used to change the first network layer to a preset lightweight network layer that has a unique correspondence with the first network layer; The first action strategy is specifically used to instruct to change the third network layer to a preset lightweight network layer that has a unique correspondence with the third network layer.
18. The device according to claim 14, wherein the setting module comprises: A first screening unit is used to screen out a third number of the preset network layers with the highest importance in the pre-trained large model according to the importance information, to obtain the second network layer; A first generating unit, configured to generate an adapter of the pre-trained large model based on the second network layer; wherein parameters of the adapter are allowed to be adjusted; A second screening unit is used to screen out a fourth number of the preset network layers with the lowest importance in the pre-trained large model according to the importance information to obtain the first network layer; A replacement unit, configured to replace the first network layer with a preset lightweight network layer to obtain a simulation model carrying the adapter; The receiving module comprises: The receiving unit is used to receive the adjusted parameter data for the adapter fed back by the device of the data owner.
19. The device according to claim 18, wherein the first generating unit is specifically configured to: generating the adapter according to the second network layer to which parameter adjustment authority is granted; or, Setting a plug-in for fine-tuning the pre-trained large model for the second network layer to obtain the adapter; The receiving unit is specifically used for: receiving adjusted parameter data for the second network layer granted parameter adjustment authority fed back by the device of the data owner; or, Receiving adjusted parameter data for the plug-in fed back by the device of the data owner; The generating module comprises: A second generating unit is used to replace the historical parameter data of the second network layer in the pre-trained large model with the adjusted parameter data of the second network layer for which the parameter adjustment authority is granted, so as to obtain a target large model; or, The third generating unit is used to generate a target large model by combining the adjusted parameter data for the plug-in with the historical parameter data of the pre-trained large model.
20. The apparatus of claim 14, further comprising: A second acquisition module is used to acquire a call request from the data owner for the target large model; The call request carries the business data to be processed by the data owner; A business data processing module, used to process the business data to be processed using the target large model to obtain a business data processing result; The second sending module is used to send the business data processing result to the device of the data owner.
21. A large model training device, comprising: An acquisition module is used to acquire a simulation model of a pre-trained large model from a device provided by a model provider; wherein the simulation model is obtained by setting and processing a first network layer and a second network layer in the preset network layer according to the importance information of each preset network layer in the pre-trained large model; the setting and processing is used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer; A training module, used to train the simulation model using the business data at the data owner to obtain adjusted parameter data of the second network layer; The first sending module is used to send the adjusted parameter data of the second network layer to the device of the model provider; the device of the model provider is used to generate a target large model according to the adjusted parameter data of the second network layer and the pre-trained large model.
22. The apparatus of claim 21, wherein the simulation model carries an adapter generated based on the second network layer; The parameters of the adapter are allowed to be adjusted; The training module comprises: A business data processing unit, used to process the business data at the data owner by using the simulation model to obtain a loss value corresponding to the simulation model; A parameter adjustment unit, configured to adjust the parameter data of the adapter according to the loss value corresponding to the simulation model to obtain adjusted parameter data for the adapter; Wherein, the parameter adjustment unit specifically includes: A first adjustment subunit is configured to adjust the parameter data of the second network layer that is granted the parameter adjustment authority according to the loss value corresponding to the simulation model to obtain the adjusted parameter data for the adapter if the adapter is generated by using the second network layer that is granted the parameter adjustment authority; or The second adjustment subunit is used to adjust the parameter data of the plug-in according to the loss value corresponding to the simulation model to obtain the adjusted parameter data for the adapter if the adapter is generated based on a plug-in for fine-tuning the pre-trained large model set for the second network layer.
23. The apparatus of claim 21, further comprising: A second sending module is used to send a call request for the target large model to the device of the model provider; The call request carries the business data to be processed by the data owner; The receiving module is used to receive the business data processing result obtained by processing the business data to be processed using the target large model, which is fed back by the device of the model provider.
24. A large model training device, comprising: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Obtain the importance information of each preset network layer in the pre-trained large model; According to the importance information, setting processing is performed on the first network layer and the second network layer in the preset network layer to obtain a simulation model of the pre-trained large model; wherein the setting processing is used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer; Sending the simulation model to a device of a data owner; receiving adjusted parameter data of the second network layer fed back by the device of the data owner; the adjusted parameter data of the second network layer is obtained by training the simulation model using the business data at the data owner; Generate a target large model based on the adjusted parameter data of the second network layer and the pre-trained large model.
25. A large model training device, comprising: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Acquire a simulation model of a pre-trained large model from a device of a model provider; wherein the simulation model is obtained by setting and processing a first network layer and a second network layer in the preset network layer according to the importance information of each preset network layer in the pre-trained large model; the setting and processing is used to change the first network layer to a preset lightweight network layer, and to indicate that the parameters of the second network layer are allowed to be adjusted; the importance of the second network layer is higher than that of the first network layer; Using the business data at the data owner to train the simulation model, and obtain adjusted parameter data of the second network layer; Sending the adjusted parameter data of the second network layer to the device of the model provider; the device of the model provider is used to generate a target large model according to the adjusted parameter data of the second network layer and the pre-trained large model.
Citation Information
Patent Citations
Neural network training and image processing method and device, electronic equipment and medium
CN110929836A
Efficient fine tuning method and system for parameters of medical model
CN117077541A
Model training method and device, task execution method and device, storage medium and equipment
CN117194992A
Warning system and control method of a vehicle
KR1020230061858A
Pre-training method of neural network model, electronic device and medium
US20220129753A1
Cited By
Method and device for performing parameter fine adjustment on pre-trained large model
CN119721176A
Method and apparatus for fine-tuning parameters of pre-trained large model
WO2026124006A1
