Model processing method, device, electronic device and storage medium
By acquiring the model training task and determining the model to be trained based on the task identification, the problem of low model prediction performance in the prior art is solved, and more efficient model training and prediction performance improvement is achieved.
Patent Information
- Application Number
- CN202210233983.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-09
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2042-03-09
AI Technical Summary
The existing vertical federated learning framework is difficult to unite different tenants to train models uniformly, resulting in lower prediction performance of the model.
By obtaining the model training task, determining the model to be trained based on the task identification, and training the model based on the training data and model training method to obtain the target model. The method may include training and updating of multiple sub-models, building a model to be trained using the scene sub-model and preset sub-models, and updating model parameters according to the training results.
It realizes training of training models for different model training tasks, thereby obtaining the target model corresponding to the model training task, and improving the prediction performance of the model.
Smart Images

Figure CN114595833B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of machine learning technology, and further to the field of federated learning technology, and specifically to a model processing method, and in particular to a model processing method, device, electronic device, and storage medium. Background Art
[0002] At present, there are many open source vertical federated learning frameworks on the market. Some vertical federated learning frameworks can use multi-party secure computing and homomorphic encryption technology to protect data privacy, and some vertical federated learning frameworks can support multiple tenants by creating multiple computing entities. However, it is difficult to unify the training model of different tenants, resulting in low prediction performance of the model. Summary of the invention
[0003] The present disclosure provides a model processing method, device, electronic device and storage medium to at least solve the technical problem of low prediction performance of the model in the related art.
[0004] According to one aspect of the present disclosure, a model processing method is provided, including: obtaining at least one model training task, wherein each model training task in the at least one model training task includes at least training data and a task identifier; determining a model to be trained corresponding to the model training task based on the task identifier of each model training task; training the model to be trained corresponding to the model training task based on the training data of each model training task and the model training method corresponding to the model training task, to obtain a target model.
[0005] Optionally, the model to be trained includes: at least one sub-model. After obtaining at least one model training task, the method further includes: receiving a model training mode corresponding to each model training task in at least one model training task, wherein the model training mode is used to determine the sub-model to be trained in at least one sub-model of the model to be trained and / or determine the sub-model whose model parameters need to be updated in the sub-model to be trained.
[0006] Optionally, the model to be trained corresponding to the model training task is determined based on the task identifier of each model training task, including: determining the scene sub-model corresponding to the model training task based on the task identifier of each model training task, wherein the scene sub-model is used to represent a sub-model that can realize the scene corresponding to the model training task; and constructing the model to be trained based on the scene sub-model and the preset sub-model.
[0007] Optionally, different model training tasks correspond to different scene sub-models, and different model training tasks correspond to the same preset sub-models.
[0008] Optionally, the model to be trained corresponding to the model training task is trained based on the training data of each model training task and the model training method corresponding to the model training task to obtain a target model, including: in response to the model training method corresponding to the model training task being the first training method, using the training data of the model training task to train the scene sub-model and the preset sub-model in the model to be trained corresponding to the model training task, and updating the model parameters of the scene sub-model based on the training results.
[0009] Optionally, the model to be trained corresponding to the model training task is trained based on the training data of each model training task and the model training method corresponding to the model training task to obtain a target model, including: in response to the model training method corresponding to the model training task being the second training method, using the training data of the model training task to train the scene sub-model and the preset sub-model in the model to be trained corresponding to the model training task, and updating the model parameters of the scene sub-model and the model parameters of the preset sub-model based on the training results.
[0010] Optionally, the model to be trained corresponding to the model training task is trained based on the training data of each model training task and the model training method corresponding to the model training task to obtain a target model, including: in response to the model training method corresponding to the model training task being the third training method, using the training data of the model training task to train the scene sub-model in the model to be trained corresponding to the model training task, and updating the model parameters of the scene sub-model based on the training results.
[0011] Optionally, constructing a model to be trained based on a scene sub-model and a preset sub-model includes: in response to a plug-in / plug-out status between an output end of the scene sub-model and an input end of the preset sub-model, generating a model to be trained based on the scene sub-model and the preset sub-model, wherein the plug-in / plug-out status is used to indicate whether the input end of the preset sub-model is connected to the output end of the scene sub-model.
[0012] Optionally, in response to the plug-in and unplugging status between the output end of the scene sub-model and the input end of the preset sub-model, a model to be trained is generated, including: in response to the plug-in and unplugging status that the input end of the preset sub-model is connected to the output end of the scene sub-model, generating the model to be trained based on the scene sub-model and the preset sub-model; in response to the plug-in and unplugging status that the input end of the preset sub-model is not connected to the output end of the scene sub-model, generating the model to be trained based on the scene sub-model.
[0013] According to a second aspect of the present disclosure, a model processing device is provided, including: an acquisition module, used to acquire at least one model training task, wherein each model training task in the at least one model training task includes at least training data and a task identifier; a determination module, used to determine a model to be trained corresponding to the model training task based on the task identifier of each model training task; and a training module, used to train the model to be trained corresponding to the model training task based on the training data of each model training task and the model training method corresponding to the model training task, so as to obtain a target model.
[0014] Optionally, the model to be trained includes: at least one sub-model, and the device also includes: a receiving module, used to receive a model training method corresponding to each model training task in at least one model training task, wherein the model training method is used to determine the sub-model to be trained in at least one sub-model of the model to be trained and / or determine the sub-model whose model parameters need to be updated in the sub-model to be trained.
[0015] Optionally, the determination module includes: a determination unit, used to determine the scene sub-model corresponding to the model training task based on the task identifier of each model training task, wherein the scene sub-model is used to represent a sub-model that can realize the scene corresponding to the model training task; and a construction unit, used to construct the model to be trained based on the scene sub-model and the preset sub-model.
[0016] Optionally, different model training tasks correspond to different scene sub-models, and different model training tasks correspond to the same preset sub-models.
[0017] Optionally, the training module includes: a first training unit, used to train the scene sub-model and preset sub-model in the model to be trained corresponding to the model training task using the training data of the model training task in response to the model training mode corresponding to the model training task being the first training mode, and update the model parameters of the scene sub-model based on the training results.
[0018] Optionally, the training module includes: a second training unit, which is used to train the scene sub-model and the preset sub-model in the model to be trained corresponding to the model training task using the training data of the model training task in response to the model training mode corresponding to the model training task being the second training mode, and update the model parameters of the scene sub-model and the model parameters of the preset sub-model based on the training results.
[0019] Optionally, the training module includes: a third training unit, used to train the scene sub-model in the model to be trained corresponding to the model training task using the training data of the model training task in response to the model training mode corresponding to the model training task being the third training mode, and update the model parameters of the scene sub-model based on the training results.
[0020] Optionally, the construction unit includes: a construction sub-unit, which is used to generate a model to be trained based on the scene sub-model and the preset sub-model in response to the plug-in and unplug-out status between the output end of the scene sub-model and the input end of the preset sub-model, wherein the plug-in and unplug-out status is used to indicate whether the input end of the preset sub-model is connected to the output end of the scene sub-model.
[0021] Optionally, a sub-unit is constructed, including: a first generating sub-unit, used to generate a model to be trained based on the scene sub-model and the preset sub-model in response to the plug-in state that the input end of the preset sub-model is connected to the output end of the scene sub-model; and a second generating unit, used to generate a model to be trained based on the scene sub-model in response to the plug-in state that the input end of the preset sub-model is not connected to the output end of the scene sub-model.
[0022] According to the third aspect of the embodiments of the present disclosure, there is also provided an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any one of the model processing methods in the above embodiments.
[0023] According to a fourth aspect of the embodiments of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is also provided, wherein the computer instructions are used to enable a computer to execute any one of the model processing methods in the above embodiments.
[0024] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, including a computer program, and the computer program executes any one of the model processing methods in the above embodiments when a processor is used.
[0025] In the present disclosure, at least one model training task is first obtained, wherein each model training task in the at least one model training task includes at least training data and a task identifier; based on the task identifier of each model training task, a to-be-trained model corresponding to the model training task is determined; based on the training data and the model training method of each model training task, the to-be-trained model corresponding to the model training task is trained to obtain a target model, wherein the model training method is a model training method corresponding to the model training task, and training of the to-be-trained model for different model training tasks is achieved, thereby obtaining a target model corresponding to the model training task, and since the target model is obtained by training the to-be-trained model corresponding to the model training task, the accuracy of the target model is higher, thereby improving the prediction performance of the model.
[0026] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0028] Figure 1 is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a model processing method according to an embodiment of the present disclosure;
[0029] Figure 2 is a flow chart of a model processing method according to an embodiment of the present disclosure;
[0030] Figure 3 is a schematic diagram of a model to be trained according to an embodiment of the present disclosure;
[0031] Figure 4 is a design diagram of a feasible multi-tenant vertical federated learning system according to an embodiment of the present disclosure;
[0032] Figure 5 is a deployment architecture diagram according to an embodiment of the present disclosure;
[0033] Figure 6 It is a structural block diagram of a model processing device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0034] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0036] As machine learning technology becomes more mature, more and more practical problems are being or will be solved by machine learning models. Data is the most important part of machine learning, but data sources usually exist in the form of isolated islands. Due to industry competition, privacy and security, data integration between different data sources faces many obstacles. Today, when attention to data privacy and security has become a global trend, in order to enable machine learning systems to efficiently and accurately use their own data for training, a federated learning solution is needed.
[0037] Based on the distribution characteristics of isolated data, federated learning solutions are divided into three categories: horizontal federated learning (the user features of the two data sets overlap more, but the user overlap is smaller), vertical federated learning (the user features of the two data sets overlap more, but the user features overlap less), and federated transfer learning (the user and user features of the two data sets overlap less). Based on the privacy protection scheme, federated learning solutions are divided into three categories: data protection based on differential privacy, encryption calculation methods based on secret sharing, and encryption calculation methods based on homomorphic encryption.
[0038] Some open source frameworks in related technologies use multi-party secure computing and homomorphic encryption technology to protect data privacy, but this method has too low computing efficiency and is difficult to use in industrial areas. Others can support multiple tenants by creating multiple computing entities, but it is difficult to combine different tenants for unified training.
[0039] In order to solve the above problems, the present application can jointly train the model through multiple model training tasks to obtain a model with better accuracy.
[0040] According to an embodiment of the present disclosure, a model processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0041] The method embodiments provided by the embodiments of the present disclosure can be executed in a mobile terminal, a computer terminal or a similar electronic device. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein. Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing the model processing method is shown.
[0042] like Figure 1 As shown, the computer terminal 100 includes a computing unit 101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 102 or a computer program loaded from a storage unit 108 into a random access memory (RAM) 103. In the RAM 103, various programs and data required for the operation of the computer terminal 100 can also be stored. The computing unit 101, the ROM 102, and the RAM 103 are connected to each other via a bus 104. An input / output (I / O) interface 105 is also connected to the bus 104.
[0043] A number of components in the computer terminal 100 are connected to the I / O interface 105, including: an input unit 106, such as a keyboard, a mouse, etc.; an output unit 107, such as various types of displays, speakers, etc.; a storage unit 108, such as a disk, an optical disk, etc.; and a communication unit 109, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 109 allows the computer terminal 100 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0044] The computing unit 101 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 101 performs the model processing method described herein. For example, in some embodiments, the model processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 108. In some embodiments, part or all of the computer program may be loaded and / or installed on the computer terminal 100 via the ROM 102 and / or the communication unit 109. When the computer program is loaded into the RAM 103 and executed by the computing unit 101, one or more steps of the model processing method described herein may be performed. Alternatively, in other embodiments, the computing unit 101 may be configured to perform the model processing method in any other appropriate manner (e.g., by means of firmware).
[0045] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0046] It should be noted that, in some optional embodiments, the above Figure 1 The electronic device shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the electronic devices described above.
[0047] Under the above operating environment, the present disclosure provides Figure 2 The model processing method shown in Figure 1 The computer terminal or similar electronic device or server shown is used for execution. Figure 2 is a flow chart of a model processing method provided according to an embodiment of the present disclosure. Figure 2 As shown, the method may include the following steps:
[0048] Step S202: Obtain at least one model training task.
[0049] Among them, each model training task in at least one model training task includes at least a task identifier and training data.
[0050] The training data may include a user identifier and a reverse gradient during the training process.
[0051] The above-mentioned model training tasks may be training tasks for models in different scenarios, such as advertising, recommendation, etc.
[0052] In an optional embodiment, multiple model training tasks may be acquired, including but not limited to model training for the advertising business of Company A, model training for the recommendation business of Company B, and the like.
[0053] The above-mentioned task identifier can be used to represent the training scenario corresponding to the model training task. For example, identifier 1 can be used to identify the advertising business scenario of company A, and identifier 2 can be used to identify the recommendation business scenario of company B.
[0054] The above-mentioned user identification can be used to represent a specific user and to retrieve the user portrait data of the corresponding user on the passive side.
[0055] The reverse gradient in the above training process is used to complete the model training process, and its purpose is to complete the model training without sharing the training data.
[0056] Step S204: determine the to-be-trained model corresponding to the model training task based on the task identifier of each model training task.
[0057] The model to be trained may include at least one sub-model.
[0058] In an optional embodiment, the to-be-trained model that needs to be trained for the model training task can be determined according to the task identifier of each model training task.
[0059] The above-mentioned model to be trained may include two sub-models, one of which may be a public pre-trained model, that is, a pre-trained model that can be used for all model training tasks, and the other sub-model may be a scene sub-model corresponding to the task identifier. The scene sub-model may be a model corresponding to a specific business scenario, such as the recommendation business scenario of Company A and the advertising business scenario of Company B.
[0060] In another optional embodiment, the model to be trained corresponding to each model training task can be determined according to the task identifier of each model training task, and the models to be trained corresponding to multiple model training tasks can be trained simultaneously.
[0061] Step S206: Based on the training data of each model training task and the model training method corresponding to the model training task, the to-be-trained model corresponding to the model training task is trained to obtain a target model.
[0062] Among them, the model training method is a model training method corresponding to the model training task.
[0063] The above-mentioned model training method can be set according to user needs.
[0064] In an optional embodiment, the model to be trained corresponding to each model training task can be trained according to the model training method of each model training task to obtain a target model, wherein the target model can include a common pre-trained model, wherein the common pre-trained model can be jointly trained with each model training task to update parameters, and the target model can also include a scene sub-model corresponding to each model training task, wherein the scene sub-model can be targetedly trained with each model training task to update parameters.
[0065] Through the above steps, at least one model training task is first obtained, wherein each model training task in the at least one model training task includes at least a task identifier and training data, and the model to be trained corresponding to each model training task is determined based on the task identifier of each model training task, wherein the model to be trained includes at least one sub-model, and the model to be trained corresponding to each model training task is trained based on the model training method of each model training task to obtain a target model, so that in the process of completing different model training tasks, the models commonly included in the models to be trained can be trained, which can make the adaptation range of the trained model wider, thereby improving the prediction performance of the model.
[0066] Optionally, the model to be trained includes: at least one sub-model. After obtaining at least one model training task, the method further includes: receiving a model training mode corresponding to each model training task in the at least one model training task.
[0067] Among them, the model training method is used to determine the sub-model to be trained in at least one sub-model of the model to be trained and / or determine the sub-model whose model parameters need to be updated in the sub-model to be trained.
[0068] The above sub-models used for training need to use the model structure to obtain training results, but the model parameters of the original model structure are not necessarily updated. For example, there are model A and model B in the models to be trained, and the user only wants to train model A. This can be determined in the model training method.
[0069] The above-mentioned sub-model that needs to update model parameters can be the sub-model whose model parameters need to be updated in the sub-model used for training. For example, if the user wants to update the parameters of model A during the training process of this model, but does not want to update the parameters of model B, it can be limited in the model training method.
[0070] In an optional embodiment, after obtaining at least one model training task, the user can be reminded to select the model training method corresponding to each model training task in at least one model training task. Optionally, the user can determine the sub-models that need to be trained and the sub-models whose model parameters need to be updated in the model to be trained, so as to train the model required by the user.
[0071] In another optional embodiment, the model training task may be to train the preset sub-model and the scene sub-model in the model to be trained, and update the model parameters of these two parts. Since the preset sub-model is obtained by training multiple model training tasks together, the model accuracy of the preset sub-model can be higher and the adaptability of the preset sub-model can be wider. The model training task may also be to use the preset sub-model and the scene sub-model for forward calculation, but only perform reverse parameter update on the model of the scene sub-model. It can be selected whether to update the parameters of the preset sub-model according to user needs, thereby increasing the flexibility of model training. The model training task may also be to train only the scene sub-model in the model to be trained, and update the model parameters of the scene sub-model, so as to obtain model parameters that can be applicable to the scene corresponding to the model training task, thereby making the model more accurate.
[0072] Optionally, the model to be trained corresponding to each model training task is determined based on the task identifier of each model training task, including: determining the scene sub-model corresponding to the model training task based on the task identifier of each model training task, wherein the scene sub-model is used to represent a sub-model that can realize the scene corresponding to the model training task; and constructing the model to be trained based on the scene sub-model and the preset sub-model.
[0073] The above-mentioned scene sub-model may be a specific scene sub-model, and the above-mentioned preset sub-model may be a pre-trained model.
[0074] In an alternative embodiment, Figure 3 is a schematic diagram of a model to be trained according to an embodiment of the present disclosure, such as Figure 3 The left side shows a pre-trained model built by the passive party in advance. This part is used as the base model to build specific models according to the scenario requirements of different tenants. Specific models can be built based on specific scenario sub-models and pre-trained models, such as Figure 3 The active party on the right can be a tenant, who holds a part of the complete model and connects to the model built by the passive party through an interface to complete the model training together. The active party can choose whether to use / update the pre-trained model according to needs.
[0075] In another optional embodiment, when constructing the model to be trained based on the scene sub-model and the pre-trained model, the model to be trained can be constructed as a pluggable hierarchical model mechanism, and the pre-trained model and scene sub-model of the passive party can be graded. Based on this, the active party can more flexibly choose whether to use the pre-trained model, whether to update the model parameters of the pre-trained model according to the training results, that is, it can choose whether the pre-trained model participates in multi-party joint optimization. Thereby, the flexibility of the constructed model to be trained can be improved, and it is convenient for users to make choices.
[0076] Optionally, different model training tasks correspond to different scene sub-models, and different model training tasks correspond to the same preset sub-models.
[0077] In an optional embodiment, each model training task has its corresponding scene sub-model, which is only applicable to the scene corresponding to the model training task. Each model training task corresponds to a preset sub-model. The preset sub-model is trained through multiple model training tasks, and the model parameters of the preset sub-model are updated. This can make the preset sub-model applicable to a variety of scenarios, thereby expanding the scope of use of the preset sub-model.
[0078] Optionally, the model to be trained corresponding to the model training task is trained based on the training data of each model training task and the model training method corresponding to the model training task to obtain a target model, including: in response to the model training method corresponding to the model training task being the first training method, using the training data of the model training task to train the scene sub-model and the preset sub-model in the model to be trained corresponding to the model training task, and updating the model parameters of the scene sub-model based on the training results.
[0079] The first training method mentioned above can be to train the scene sub-model and the preset sub-model in the training model at the same time, and update the model parameters of the scene sub-model and the preset sub-model at the same time according to the training results.
[0080] In an optional embodiment, when the model training method is the first training method, after the passive party simultaneously trains the scene sub-model and the preset sub-model, after using the training results to update the model parameters of the scene sub-model, it can continue to propagate the gradient to the preset sub-model, so as to simultaneously update the model parameters of the scene sub-model and the preset sub-model.
[0081] Through the above steps, multiple tenants can update the same preset sub-model through the training data in different model training tasks, which not only enables the tenants to obtain the trained scene sub-model, but also can train a preset sub-model that can adapt to various scenarios through the training data of multiple parties, so that the preset sub-model in the active party can obtain the gains of multiple parties, thereby obtaining better prediction performance.
[0082] Optionally, the model to be trained corresponding to the model training task is trained based on the training data of each model training task and the model training method corresponding to the model training task to obtain a target model, including: in response to the model training method corresponding to the model training task being the second training method, using the training data of the model training task to train the scene sub-model and the preset sub-model in the model to be trained corresponding to the model training task, and updating the model parameters of the scene sub-model and the model parameters of the preset sub-model based on the training results.
[0083] The second training method mentioned above can be to train the scene sub-model and the preset sub-model in the training model at the same time, but not to update the model parameters of the preset sub-model.
[0084] In an optional embodiment, when the model training method is the second training method, after the passive party trains the scene sub-model and the preset sub-model at the same time, the passive party can clone a training result of the preset sub-model, and after using the training result to update the model parameters of the scene sub-model, the gradient will no longer continue to propagate to the preset sub-model, so as to only update the model parameters of the scene sub-model and not update the model parameters of the preset sub-model.
[0085] Through the above steps, when the tenant uses the passive party's model to be trained for training, he can flexibly choose not to update the model parameters of the preset sub-model, and only obtain the corresponding scene sub-model. The preset sub-model can be trained to obtain the corresponding training results, but the model parameters of the preset sub-model are not updated to meet the user's model training needs. At the same time, the speed of model training can be accelerated and the efficiency of model training can be improved.
[0086] Optionally, the model to be trained corresponding to the model training task is trained based on the training data of each model training task and the model training method corresponding to the model training task to obtain a target model, including: in response to the model training method corresponding to the model training task being the third training method, using the training data of the model training task to train the scene sub-model in the model to be trained corresponding to the model training task, and updating the model parameters of the scene sub-model based on the training results.
[0087] The third training method mentioned above can be to train the scene sub-model in the model to be trained, and update the model parameters of the scene sub-model according to the training results, but not to train the preset sub-model in the model to be trained.
[0088] In an optional embodiment, when the model training method is the third training method, only the scene sub-model can be selected for training. If the user does not need a preset sub-model with multiple gains, the third training method can speed up the model training and improve the efficiency of model training.
[0089] Optionally, constructing a model to be trained based on a scene sub-model and a preset sub-model includes: obtaining the plug-in status between the output end of the preset sub-model and the input end of the scene sub-model; generating the model to be trained based on the plug-in status, the scene sub-model and the preset sub-model, wherein the plug-in status is used to indicate whether the input end of the scene sub-model is connected to the output end of the preset sub-model.
[0090] In an optional embodiment, the user can determine the plug-in and unplug status based on whether the preset sub-model needs to be trained. If the user does not need to train through the model architecture of the preset sub-model, the input end of the scene sub-model can be unplugged from the output end of the preset sub-model, so that the target model can be obtained by training only the scene sub-model. If the user needs to train through the model architecture of the preset sub-model, the input end of the scene sub-model can be connected to the output end of the preset sub-model, so that the target model can be obtained by combining the model structure training of the preset sub-model, so that the target model can have higher accuracy.
[0091] Optionally, in response to the plug-in and unplugging status between the output end of the scene sub-model and the input end of the preset sub-model, a model to be trained is generated, including: in response to the plug-in and unplugging status that the input end of the preset sub-model is connected to the output end of the scene sub-model, generating the model to be trained based on the scene sub-model and the preset sub-model; in response to the plug-in and unplugging status that the input end of the preset sub-model is not connected to the output end of the scene sub-model, generating the model to be trained based on the scene sub-model.
[0092] In an optional embodiment, when the input end of the preset sub-model is connected to the output end of the scene sub-model in the plug-in state, the model to be trained can be directly generated according to the scene sub-model and the preset sub-model, so that the model to be trained can be trained to obtain a target model with higher accuracy. When the input end of the preset sub-model is not connected to the output end of the scene sub-model in the plug-in state, the model to be trained can be directly generated according to the scene sub-model, so as to train to obtain a target model that can be applied to the scene.
[0093] like Figure 4The figure shows a design diagram of a feasible multi-tenant vertical federated learning system according to an embodiment of the present disclosure. The whole system consists of two parts: a passive party and an active party. The passive party is a server. The passive party is mainly used to build a model to be trained according to the scene sub-model and the preset sub-model, and train the model to be trained according to the needs of the active party to obtain the target model. The active party is a client, and the client can obtain the model parameters of the trained target model. The active party requests the passive party to create a task and specifies whether to use a pre-trained model (that is, the preset sub-model mentioned above). If it is determined to use the pre-trained model, it will choose whether to update the pre-trained model parameters with label data and participate in multi-party joint optimization. After the passive party receives the request, it starts the training service according to the configuration of the active party to start training. When the active party detects that the model indicators have met the requirements, it requests the passive party to create a prediction service. After the passive party starts the prediction service, the active party can use the software development kit (SDK) to access the prediction service.
[0094] Figure 5 Shown Figure 4 Corresponding deployment architecture diagram, the passive party provides multi-tenant services based on the distributed computing framework (Ray) computing cluster. Different tenants can use the same pre-trained model service to achieve the purpose of multi-party joint optimization. That is, different tenants can train the same preset sub-model while completing the corresponding training tasks, so as to achieve the purpose of joint optimization of the same preset sub-model. That is, different tenants can also use the preset sub-model during training, but do not update the parameters of the preset sub-model.
[0095] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0096] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present disclosure.
[0097] A model processing device is also provided in the present disclosure, and the device is used to implement the above-mentioned embodiments and preferred embodiments, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0098] Figure 6 is a structural block diagram of a model processing device according to one embodiment of the present disclosure, such as Figure 6 As shown, a model processing device 600 includes: an acquisition module 602 , a determination module 604 , and a training module 606 .
[0099] An acquisition module, used to acquire at least one model training task, wherein each model training task in the at least one model training task includes at least training data and a task identifier;
[0100] A determination module, used to determine a to-be-trained model corresponding to the model training task based on a task identifier of each model training task;
[0101] The training module is used to train the to-be-trained model corresponding to each model training task based on the training data and model training method of the model training task to obtain a target model, wherein the model training method is the model training method corresponding to the model training task.
[0102] Optionally, the device also includes: a receiving module, used to receive a model training method corresponding to each model training task in at least one model training task, wherein the model training method is used to determine a sub-model to be trained in at least one sub-model of the model to be trained and / or determine a sub-model whose model parameters need to be updated in the sub-model to be trained.
[0103] Optionally, the determination module includes: a determination unit, used to determine the scene sub-model corresponding to the model training task based on the task identifier of each model training task, wherein the scene sub-model is used to represent a sub-model that can realize the scene corresponding to the model training task; and a construction unit, used to construct the model to be trained based on the scene sub-model and the preset sub-model.
[0104] Optionally, different model training tasks correspond to different scene sub-models, and different model training tasks correspond to the same preset sub-models.
[0105] Optionally, the training module includes: a first training unit, used to train the scene sub-model and preset sub-model in the model to be trained corresponding to the model training task using the training data of the model training task in response to the model training mode corresponding to the model training task being the first training mode, and update the model parameters of the scene sub-model based on the training results.
[0106] Optionally, the training module includes: a second training unit, which is used to train the scene sub-model and the preset sub-model in the model to be trained corresponding to the model training task using the training data of the model training task in response to the model training mode corresponding to the model training task being the second training mode, and update the model parameters of the scene sub-model and the model parameters of the preset sub-model based on the training results.
[0107] Optionally, the training module includes: a third training unit, used to train the scene sub-model in the model to be trained corresponding to the model training task using the training data of the model training task in response to the model training mode corresponding to the model training task being the third training mode, and update the model parameters of the scene sub-model based on the training results.
[0108] Optionally, the construction unit includes: a construction sub-unit, which is used to generate a model to be trained based on the scene sub-model and the preset sub-model in response to the plug-in and unplug-out status between the output end of the scene sub-model and the input end of the preset sub-model, wherein the plug-in and unplug-out status is used to indicate whether the input end of the preset sub-model is connected to the output end of the scene sub-model.
[0109] Optionally, a sub-unit is constructed, including: a first generating sub-unit, used to generate a model to be trained based on the scene sub-model and the preset sub-model in response to the plug-in state that the input end of the preset sub-model is connected to the output end of the scene sub-model; and a second generating unit, used to generate a model to be trained based on the scene sub-model in response to the plug-in state that the input end of the preset sub-model is not connected to the output end of the scene sub-model.
[0110] According to another aspect of an embodiment of the present disclosure, an electronic device is also provided, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any one of the model processing methods in the above-mentioned embodiments.
[0111] According to another aspect of the embodiments of the present disclosure, a computer-readable storage medium is further provided, the computer-readable storage medium including a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the model processing methods in the above embodiments.
[0112] According to another aspect of the embodiments of the present disclosure, a computer program product is provided, including a computer program, and the computer program executes any one of the model processing methods in the above embodiments when a processor is used to execute the computer program.
[0113] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0114] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, including a memory and at least one processor, wherein the memory stores computer instructions, and the processor is configured to run the computer instructions to execute the steps in any one of the above method embodiments.
[0115] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0116] Optionally, in the present disclosure, the processor may be configured to execute the following steps through a computer program:
[0117] S1, obtaining at least one model training task, wherein each model training task in the at least one model training task includes at least training data and a task identifier;
[0118] S2, determining a to-be-trained model corresponding to the model training task based on the task identifier of each model training task;
[0119] S3: Based on the training data of each model training task and the model training method corresponding to the model training task, the to-be-trained model corresponding to the model training task is trained to obtain a target model.
[0120] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0121] According to an embodiment of the present disclosure, the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions are configured to execute the steps of any of the above method embodiments when running.
[0122] Optionally, in this embodiment, the non-volatile storage medium may be configured to store a computer program for performing the following steps:
[0123] S1, obtaining at least one model training task, wherein each model training task in the at least one model training task includes at least training data and a task identifier;
[0124] S2, determining a to-be-trained model corresponding to the model training task based on the task identifier of each model training task;
[0125] S3: Based on the training data of each model training task and the model training method corresponding to the model training task, the to-be-trained model corresponding to the model training task is trained to obtain a target model.
[0126] Optionally, in this embodiment, the non-transitory computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the above. More specific examples of readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0127] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product. The program code for implementing the audio processing method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as an independent software package and partially on a remote machine, or entirely on a remote machine or server.
[0128] In the above embodiments of the present disclosure, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0129] In the several embodiments provided in the present disclosure, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0130] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0131] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0132] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program codes.
[0133] The above is only a preferred embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present disclosure. These improvements and modifications should also be regarded as the scope of protection of the present disclosure.
Claims
1. A model processing method, wherein: include: Acquire at least one model training task, wherein each of the at least one model training task includes at least training data and a task identifier, and the training data includes a user identifier and a reverse gradient in a training process; Determine a to-be-trained model corresponding to each model training task based on a task identifier of the model training task; Based on the training data of each model training task and the model training method corresponding to the model training task, the to-be-trained model corresponding to the model training task is trained to obtain a target model, wherein the model training task includes at least one of the following: a recommendation business scenario and an advertising business scenario; Wherein, determining the to-be-trained model corresponding to the model training task based on the task identifier of each model training task includes: Determine a scene sub-model corresponding to the model training task based on a task identifier of each model training task, wherein the scene sub-model is used to represent a sub-model capable of realizing the scene corresponding to the model training task; Constructing the model to be trained based on the scene sub-model and the preset sub-model; Among them, the scene sub-models corresponding to different model training tasks are different, and the preset sub-models corresponding to different model training tasks are the same.
2. The method according to claim 1, wherein: The model to be trained includes: at least one sub-model. After obtaining the at least one model training task, the method further includes: Receive a model training method corresponding to each model training task in the at least one model training task, wherein the model training method is used to determine a sub-model to be trained in the at least one sub-model of the model to be trained and / or determine a sub-model whose model parameters need to be updated in the sub-model to be trained.
3. The method according to claim 1, wherein: Based on the training data of each model training task and the model training method corresponding to the model training task, the to-be-trained model corresponding to the model training task is trained to obtain a target model, including: In response to the model training mode corresponding to the model training task being the first training mode, the scene sub-model and the preset sub-model in the model to be trained corresponding to the model training task are trained using the training data of the model training task, and the model parameters of the scene sub-model are updated based on the training results.
4. The method according to claim 1, wherein: Based on the training data of each model training task and the model training method corresponding to the model training task, the to-be-trained model corresponding to the model training task is trained to obtain a target model, including: In response to the model training mode corresponding to the model training task being the second training mode, the scene sub-model and the preset sub-model in the model to be trained corresponding to the model training task are trained using the training data of the model training task, and the model parameters of the scene sub-model and the model parameters of the preset sub-model are updated based on the training results.
5. The method according to claim 1, wherein: Based on the training data of each model training task and the model training method corresponding to the model training task, the to-be-trained model corresponding to the model training task is trained to obtain a target model, including: In response to the model training mode corresponding to the model training task being the third training mode, the scene sub-model in the model to be trained corresponding to the model training task is trained using the training data of the model training task, and the model parameters of the scene sub-model are updated based on the training results.
6. The method according to claim 1, wherein: Constructing the model to be trained based on the scene sub-model and the preset sub-model includes: Acquire the plug-in / plug-out status between the output end of the preset sub-model and the input end of the scene sub-model; The model to be trained is generated based on the plug-in status, the scene sub-model and the preset sub-model, wherein the plug-in status is used to indicate whether the input end of the scene sub-model is connected to the output end of the preset sub-model.
7. The method according to claim 6, wherein: Generating the model to be trained based on the plug-in state, the scene sub-model and the preset sub-model includes: In response to the plug-in state being that the input end of the scene sub-model is connected to the output end of the preset sub-model, generating the model to be trained based on the scene sub-model and the preset sub-model; In response to the plug-in state being that the input end of the scene sub-model is not connected to the output end of the preset sub-model, the model to be trained is generated based on the scene sub-model.
8. A model processing device, wherein: include: An acquisition module, used to acquire at least one model training task, wherein each of the at least one model training task includes at least training data and a task identifier; A determination module, used to determine a to-be-trained model corresponding to the model training task based on a task identifier of each model training task; A training module, used to train the to-be-trained model corresponding to each model training task based on the training data of the model training task and the model training method corresponding to the model training task, to obtain a target model, wherein the model training task includes at least one of the following: a recommendation business scenario, an advertising business scenario; Among them, determine the module, including: A determination unit, configured to determine a scene sub-model corresponding to each model training task based on a task identifier of the model training task, wherein the scene sub-model is used to represent a sub-model capable of realizing the scene corresponding to the model training task; A construction unit, used to construct the model to be trained based on the scene sub-model and the preset sub-model; Among them, the scene sub-models corresponding to different model training tasks are different, and the preset sub-models corresponding to different model training tasks are the same.
9. The device according to claim 8, wherein: The model to be trained includes: at least one sub-model, and the device also includes: A receiving module is used to receive a model training method corresponding to each model training task in the at least one model training task, wherein the model training method is used to determine the sub-model to be trained in the at least one sub-model of the model to be trained and / or determine the sub-model whose model parameters need to be updated in the sub-model to be trained.
10. The device according to claim 8, wherein: Training modules include: A first training unit is used to, in response to the model training mode corresponding to the model training task being the first training mode, train the scene sub-model and the preset sub-model in the model to be trained corresponding to the model training task using the training data of the model training task, and update the model parameters of the scene sub-model based on the training results.
11. The device according to claim 8, wherein: Training modules include: A second training unit is used to, in response to the model training mode corresponding to the model training task being the second training mode, train the scene sub-model and the preset sub-model in the model to be trained corresponding to the model training task using the training data of the model training task, and update the model parameters of the scene sub-model and the model parameters of the preset sub-model based on the training results.
12. The device according to claim 8, wherein: Training modules include: A third training unit is used to, in response to the model training mode corresponding to the model training task being the third training mode, train the scene sub-model in the model to be trained corresponding to the model training task using the training data of the model training task, and update the model parameters of the scene sub-model based on the training results.
13. The device according to claim 8, wherein: Building blocks, including: A sub-unit is constructed, which is used to generate the model to be trained based on the scene sub-model and the preset sub-model in response to the plug-in and unplug-out status between the output end of the scene sub-model and the input end of the preset sub-model, wherein the plug-in and unplug-out status is used to indicate whether the input end of the preset sub-model is connected to the output end of the scene sub-model.
14. The device according to claim 13, wherein: Construct subunits, including: A first generating sub-unit, configured to generate the model to be trained based on the scene sub-model and the preset sub-model in response to the plug-in state that the input end of the preset sub-model is connected to the output end of the scene sub-model; The second generating unit is used to generate the model to be trained based on the scene sub-model in response to the plug-in state being that the input end of the preset sub-model is not connected to the output end of the scene sub-model.
15. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.
17. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Training method and device of service prediction system
CN113902473A
Joint learning training method and device
CN114118275A