Training Method and Device for Target Model
By sending training instructions to the target server and receiving target model parameters, the problem that data of different service providers cannot be legally interoperable is solved, and the joint training and accuracy of user models are achieved.
Patent Information
- Application Number
- CN202210509927.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-11
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-05-11
AI Technical Summary
The data of different service providers cannot be legally interoperable, and the data sources of each service provider of the model are isolated from each other, resulting in the intelligent recommendation model being one-sided and has a low accuracy rate.
By sending training instructions to the target server, sending local user model parameters, receiving target model parameters sent by the target server, and adjusting parameters and continuing training of the local user model according to multiple model parameters until convergence.
Joint training of different user models is realized, user characteristics of each participant dimension are comprehensively integrated, and the accuracy of the local user model is improved.
Smart Images

Figure CN114996568B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and in particular, to a method and device for training a target model. Background Art
[0002] With the development of the Internet, users increasingly pursue an integrated service of booking tickets for travel and play, and are eager to enjoy noble rights and interests and a service with a sense of belonging. Banks have a complete transaction system and have transaction characteristics such as the frequency and amount of user transactions. However, there is less user life characteristic data in the bank's own database. Therefore, the user portrait ability of the bank's user model focuses more on the user portrait in the transaction dimension, and there is a relatively one-sided problem.
[0003] Currently, banks and various entertainment companies both have their own customer portrait data and customer portrait models. Most user portrait models are neural network models based on deep learning or models based on expert rules. Banks and various entertainment companies only complete intelligent services for users based on their own user portrait models.
[0004] However, the models in different fields can only cover one aspect of the user portrait and cannot describe users more richly. Therefore, related models such as everyone's customer portrait model and intelligent recommendation model have certain limitations.
[0005] In view of the problem that data of different service providers cannot be legally interconnected in the related art, data sources of each service provider of the model are isolated from each other, and the model for intelligent recommendation of users is relatively one-sided, resulting in a low model accuracy rate, no effective solution has been proposed yet. Summary of the Invention
[0006] This application provides a method and device for training a target model to solve the problem that data of different service providers cannot be legally interconnected in the related art, data sources of each service provider of the model are isolated from each other, and the model for intelligent recommendation of users is relatively one-sided, resulting in a low model accuracy rate.
[0007] According to one aspect of this application, a method for training a target model is provided. The method includes: sending a training initiation instruction to a target server, where the training initiation instruction is used to trigger the target server to initiate joint training; sending model parameters of a local user model to the target server, and receiving target model parameters sent by the target server, where the target server receives model parameters sent by multiple participating parties and determines target model parameters according to the multiple model parameters; adjusting parameters of the local user model according to the target model parameters and continuing training until the local user model converges.
[0008] Optionally, before sending the model parameters of the local user model to the target server and receiving the target model parameters sent by the target server, the method further includes: encrypting the model parameter data of the local user model, sending it to multiple parties participating in the joint training, and receiving the model parameters obtained by the multiple parties after double-encrypting the encrypted model parameter data; and / or, receiving the model parameter ciphertexts encrypted by the multiple parties participating in the joint training for the model parameter data of their respective corresponding user models, and performing double-encryption on the model parameter ciphertexts and returning them to the corresponding parties.
[0009] Optionally, the method further includes: decrypting the model parameter ciphertexts encrypted by the multiple parties to obtain the model parameters of the multiple parties, where the model parameters are used to continue training the user model.
[0010] Optionally, adjusting the parameters of the user model according to the target model parameters and continuing to train until the local user model converges includes: adjusting the parameters of the local user model according to the target model parameters; using the model parameters of the multiple parties to continue training the local user model; determining a loss value through the loss function of the local user model; and determining that the local user model converges when the loss value reaches a preset value.
[0011] Optionally, after adjusting the parameters of the local user model according to the target model parameters and continuing to train until the local user model converges, the method further includes: inputting user information into the local user model to generate user tags; and performing business push to the account of the user information according to the user tags, or generating business content that the user information is interested in.
[0012] According to another aspect of the present application, another method for training a target model is provided, and the method includes: sending a training request to multiple parties participating in the joint training, where each of the parties creates a user model of the same type according to the user data of its own authority; receiving multiple model parameters sent by the multiple parties in response to the training request, where the model parameters are the model parameters of the user models of each party; determining target model parameters according to the multiple model parameters; and sending the target model parameters to the multiple parties, where the parties adjust the parameters of the user model according to the received target model parameters and continue to train.
[0013] Optionally, the multiple parties include: an initiating party. Before sending a training request to the multiple parties, the method further includes: receiving an initiating training instruction sent by the initiating party; and in response to the initiating training instruction, performing the step of sending a training request to the multiple parties participating in the joint training.
[0014] According to another aspect of the present application, a training device for a target model is provided. The device includes: a first sending module, configured to send a training initiation instruction to a target server, where the training initiation instruction is used to trigger the target server to initiate joint training; a first receiving module, configured to send model parameters of a local user model to the target server and receive target model parameters sent by the target server, where the target server receives model parameters sent by multiple participating parties and determines target model parameters according to the multiple model parameters; and a training module, configured to adjust parameters of the local user model according to the target model parameters and continue training until the local user model converges.
[0015] According to another aspect of the present application, a server for training a target model is provided. The server includes: a second sending module, configured to send a training request to multiple participating parties in joint training, where each participating party creates a user model of the same type according to user data of its own authority; a second receiving module, configured to receive multiple model parameters sent by the multiple participating parties in response to the training request, where the model parameters are model parameters of the user models of each participating party; a determining module, configured to determine target model parameters according to the multiple model parameters; and a sending-down module, configured to send down the target model parameters to the multiple participating parties, where the participating parties adjust parameters of the user models according to the received target model parameters and continue training.
[0016] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is further provided. The non-volatile storage medium includes a stored program, where when the program runs, it controls a device where the non-volatile storage medium is located to execute a training method for a target model.
[0017] According to another aspect of an embodiment of the present invention, an electronic device is further provided, including a processor and a memory; the memory stores computer-readable instructions, and the processor is configured to run the computer-readable instructions, where when the computer-readable instructions run, they execute a training method for a target model.
[0018] Through this application, the following steps are adopted: sending a training initiation instruction to a target server, where the training initiation instruction is used to trigger the target server to initiate joint training; sending the model parameters of the local user model to the target server, and receiving the target model parameters sent by the target server, where the target server receives multiple model parameters sent by multiple participants and determines the target model parameters according to the multiple model parameters; adjusting the parameters of the local user model according to the target model parameters and continuing the training until the local user model converges, which solves the problem in the related art that data of different service parties cannot be legally interconnected, data sources of each service party of the model are isolated from each other, and the model for intelligent recommendation to users is relatively one-sided, resulting in a low model accuracy. Furthermore, the effect of combining the model data of different user models for joint training, comprehensively integrating user characteristics of each participant dimension, and improving the accuracy of the local user model is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings constituting a part of this application are used to provide a further understanding of this application. The schematic embodiments of this application and their descriptions are used to explain this application and do not constitute an improper limitation to this application. In the drawings:
[0020] Figure 1 is a flowchart of a method for training a target model according to an embodiment of this application;
[0021] Figure 2 is a flowchart of another method for training a target model according to an embodiment of this application;
[0022] Figure 3 is a schematic diagram of a three-party joint training architecture according to an embodiment of this application;
[0023] Figure 4 is a schematic diagram of a three-party joint training process according to an embodiment of this application;
[0024] Figure 5 is a schematic diagram of a device for training a target model according to an embodiment of this application;
[0025] Figure 6 is a schematic diagram of a server for training a target model according to an embodiment of this application;
[0026] Figure 7 is a schematic diagram of an electronic device according to an embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0027] It should be noted that, without conflict, the embodiments in this application and the features in the embodiments can be combined with each other. The following will refer to the drawings and describe this application in detail in combination with the embodiments.
[0028] To enable those skilled in the art to better understand the solution of this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned accompanying drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances for the embodiments of this application described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily need to be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or devices.
[0030] To solve the problem that data of different service providers in the related art cannot be legally interconnected, the data sources of each service provider of the model are isolated from each other, and the model for intelligent recommendation to users is relatively one-sided, resulting in a low model accuracy rate, this application provides a training method for a target model, which is as follows.
[0031] Figure 1 is a flowchart of the training method of the target model according to the embodiments of this application. As Figure 1 shown, the method includes the following steps:
[0032] Step S102, send a training instruction to the target server, where the training instruction is used to trigger the target server to initiate joint training;
[0033] Step S104, send the model parameters of the local user model to the target server, and receive the target model parameters sent by the target server, where the target server receives multiple model parameters sent by multiple participants and determines the target model parameters according to the multiple model parameters;
[0034] Step S106, adjust the parameters of the local user model according to the target model parameters and continue training until the local user model converges.
[0035] The execution entity of the above steps can be the server of the initiating party. Through the above steps, an initiation training instruction is sent to the target server, where the initiation training instruction is used to trigger the target server to initiate joint training; the model parameters of the local user model are sent to the target server, and the target model parameters sent by the target server are received, where the target server receives multiple model parameters sent by multiple participating parties and determines the target model parameters according to the multiple model parameters; the local user model is tuned according to the target model parameters and continues to be trained until the local user model converges, solving the problem in the related technology that data of different service parties cannot be legally interconnected, the data sources of each service party of the model are isolated from each other, and the model for intelligent recommendation of users is relatively one-sided, resulting in a low accuracy of the model. Furthermore, the effect of combining the model data of different user models for joint training, comprehensively integrating the user characteristics of each participating party dimension, and improving the accuracy of the local user model is achieved.
[0036] The above-mentioned initiating party can be a bank or other user-oriented system. Relative to the initiating party, there are also multiple participating parties in the joint training. Each participating party is similar to the initiating party, and the initiating party can also be regarded as one of the participating parties. The services provided by each participating party and the initiating party for users belong to different dimensions. For example, if the initiating party is a bank and provides financial services for users, the participating parties can include a travel party that provides online reservation of travel services for users, and a movie ticket party that can provide online movie ticket purchasing services for users. The dimensions of services provided by multiple parties in the joint training for users are different, and the dimensions of user behavior data they obtain are also different. Moreover, in the prior art, each participating party only creates a user model and constructs a user portrait for its own dimension of user data to infer user preferences or predict user behavior, which has great one-sidedness.
[0037] The above-mentioned target server can be understood as a third-party server independent of each participating party, providing a medium for the exchange of model parameters of the user models of multiple participating parties, and realizing the joint training of multiple participating parties by running the above steps.
[0038] During training, the initiator triggers the target server to initiate joint training by sending a training initiation instruction to the target server. After receiving the training initiation instruction, the target server sends a training request to multiple participants including the initiator. This training request is used to inform the multiple participants to start joint training. The multiple participants will send the model parameters of their respective user models to the target server. The target server determines the target model parameters of the final joint impact based on the model parameters of the multiple participants, and then sends the target model parameters to each participant. After receiving the target model parameters, each participant continues to train its respective user model until the training of each user model is completed. Thus, without direct interaction of user data, joint training of each participant is achieved, enabling the user models of each participant to have the data processing ability of other dimensions, further improving the user profile, and enhancing the accuracy of user behavior prediction or preference determination.
[0039] It should be noted that considering the variety of user models in machine learning and the many differences in their corresponding parameters and structures, in order for the model parameters of different user models to influence each other, the user models of the multiple participants in the above joint training are of the same type of user models or user models with the same structure.
[0040] The above model parameters may include gradients, losses, etc. Adjusting the parameters of the local user model according to the target model parameters and continuing training until the model converges can use the gradient parameters to adjust the parameters of the user model, and then continue training until the loss value of the model meets the loss requirements of the target model parameters. It should be noted that the above continued training can be carried out using the local user data of the system. In some other embodiments, it is also possible to exchange a small amount of user data with other participants to continue training the model, which can not only improve the convergence speed of the model, but also increase the diversity of training samples and further improve the accuracy of the generated model.
[0041] Optionally, before sending the model parameters of the local user model to the target server and receiving the target model parameters sent by the target server, the method further includes: encrypting the model parameter data of the local user model and sending it to the multiple participants in the joint training, and receiving the model parameters obtained after the multiple participants double-encrypt the encrypted model parameter data; and / or, receiving the encrypted model parameter ciphertext of the model parameters of their respective corresponding user models by the multiple participants in the joint training, and double-encrypting the model parameter ciphertext and returning it to the corresponding participant.
[0042] Before each participating party sends the model parameters of its respective user model to the target server, they can also interact in an encrypted manner. The main object of encryption is the user information features in the model parameters, including personal information such as the user's name, gender, ID, etc. After mutual encryption, even if intercepted, it cannot be easily decrypted to obtain user information, thus ensuring the security and privacy of user information and also ensuring the legality of data interaction in joint training. The server of the initiating party decrypts the ciphertexts of the model parameters encrypted by multiple participating parties to obtain the model parameters of multiple participating parties. Among them, the model parameters are used to continue training the user model.
[0043] Optionally, adjusting the parameters of the user model according to the target model parameters and continuing the training until the local user model converges includes: adjusting the parameters of the local user model according to the target model parameters; using the model parameters of multiple participating parties to continue training the local user model; determining the loss value through the loss function of the local user model; and determining that the local user model converges when the loss value reaches a preset value.
[0044] The above-mentioned continued training can also be carried out using the user data of the local system. In some other embodiments, the model can also be continuously trained by exchanging model parameters with other participating parties, which can not only improve the convergence speed of the model, but also increase the diversity of training samples and further improve the accuracy of the generated model.
[0045] Optionally, after adjusting the parameters of the local user model according to the target model parameters and continuing the training until the local user model converges, the method further includes: inputting user information into the local user model to generate user tags; and performing business push to the account of the user information according to the user tags, or generating business content of interest to the user information.
[0046] Based on the user model after joint training, more accurate services can be provided for users, a more accurate user portrait can be obtained, and the business content of interest to users can be more accurately predicted, thereby improving the service quality and performance of the local system.
[0047] Figure 2 It is a flowchart of another training method for the target model provided by an embodiment of the present application. As Figure 2 shown, according to another aspect of the present application, another training method for the target model is provided. The method includes:
[0048] Step S202, sending a training request to multiple participating parties in joint training, where each participating party creates a user model of the same type based on the user data within its own authority;
[0049] Step S204: Receive multiple model parameters sent by multiple participating parties in response to the training request, where the model parameters are the model parameters of the user models of each participating party.
[0050] Step S206: Determine the target model parameters based on the multiple model parameters.
[0051] Step S208: Send the target model parameters to the multiple participating parties. The participating parties adjust the parameters of the user model according to the received target model parameters and continue the training.
[0052] The execution subject of the above steps can be a third-party server, that is, the above target server. Through the above steps, send a training initiation instruction to the target server, where the training initiation instruction is used to trigger the target server to initiate joint training; send the model parameters of the local user model to the target server, and receive the target model parameters sent by the target server. The target server receives multiple model parameters sent by multiple participating parties and determines the target model parameters based on the multiple model parameters; adjust the parameters of the local user model according to the target model parameters and continue the training until the local user model converges, solving the problem in the related art that data of different service parties cannot be legally interconnected, the data sources of each service party of the model are isolated from each other, and the model for intelligent recommendation to users is relatively one-sided, resulting in a low model accuracy. Furthermore, it achieves the effect of combining the model data of different user models for joint training, comprehensively integrating the user characteristics of each participating party dimension, and improving the accuracy of the local user model.
[0053] Optionally, the multiple participating parties include: an initiating party. Before sending a training request to the multiple participating parties, the method further includes: receiving the training initiation instruction sent by the initiating party; in response to the training initiation instruction, execute the step of sending a training request to the multiple participating parties in the joint training.
[0054] The training method of the target model provided in the embodiment of the present application, by sending a training initiation instruction to the target server, where the training initiation instruction is used to trigger the target server to initiate joint training; sending the model parameters of the local user model to the target server, and receiving the target model parameters sent by the target server. The target server receives multiple model parameters sent by multiple participating parties and determines the target model parameters based on the multiple model parameters; adjust the parameters of the local user model according to the target model parameters and continue the training until the local user model converges, solving the problem in the related art that data of different service parties cannot be legally interconnected, the data sources of each service party of the model are isolated from each other, and the model for intelligent recommendation to users is relatively one-sided, resulting in a low model accuracy. Furthermore, it achieves the effect of combining the model data of different user models for joint training, comprehensively integrating the user characteristics of each participating party dimension, and improving the accuracy of the local user model.
[0055] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0056] In addition, this embodiment also provides an optional implementation mode, which is described in detail below.
[0057] Each model in different fields can only cover one aspect of the user portrait and cannot describe the user more richly. Therefore, everyone's customer portrait model and intelligent recommendation model and other related models have certain limitations. The most direct way is to merge user data from different fields to enrich the user portrait. However, in this case, the user's private data will be exposed and non-compliant. Therefore, it can be seen that data isolation and emphasis on data privacy are becoming the next challenge of artificial intelligence. Each company only has its own data, and even the one-stop service that can be achieved is not ideal. Therefore, it is necessary to unite multiple parties to build models together to create exclusive full-journey services for users.
[0058] Federated learning defines a machine learning framework in which different data owners can build a virtual shared model without exchanging data with each other. The effect of this virtual model is equivalent to the optimal model established by all parties by aggregating data together. In this way, the built models only serve local goals in their respective regions. Since the data itself does not move when building a virtual model, it will not leak user privacy or affect data specifications. Therefore, federated learning is a possible solution to the data island problem. In order to continue machine learning while protecting data privacy and meeting legal and compliance requirements, and to better use the federated learning method to solve the data island problem, this standard is specially formulated.
[0059] 2. In vertical federation, we hope that multiple parties can quickly build a neural network. The structure and search space of the neural network are very large. In the past, we needed one person to manually adjust the parameters, but now we can use some encryption methods to communicate the gradient and loss function values, so that both parties can automatically find the optimal network structure, such as Figure 3 Like the multiple systems shown above, they can be organically combined to achieve very good results. The general idea is that while we build the network shape topology, we can also let them exchange a certain amount of network data, gradients, and loss functions. When the modeling process can be automated, the effect achieved is very good.
[0060] The purpose of this embodiment is to enrich the user's customer portrait, provide user transfer customization services, extract features such as browsing travel and entertainment, travel, and assets based on the user data of banks and third-party companies, effectively utilize each other's strengths, automatically assign different tags to different users, so as to achieve accurate recommendation and "personalized customization". For example, in cooperation with a travel company (movie company, entertainment company, Internet short video), the travel company provides user characteristics and travel characteristics, and the bank provides asset characteristics, user characteristics, and a small amount of life characteristics. The two parties share model parameter factors. The travel company can provide different price and level travel projects to different users more accurately. The bank can negotiate with it to launch services such as discounts or rebates for consumption using the bank's bank cards, so that both parties can benefit together.
[0061] This embodiment creates a modeling of multi-party vertical federated learning. The travel software and movie ticket software (not limited to this example) use the public federated learning framework (FATE, TFF, etc.) and follow the unified agreement. The specific data characteristics are as Figure 3 shown Figure 3 It is a schematic diagram of the three-party joint training architecture provided according to the embodiment of the present application. Travel party: user accommodation, travel, and tourism characteristics. Movie ticket party: information of purchased tickets, categories, attributes, and user purchase frequency of movie tickets, etc.
[0062] Bank (initiator): Use the existing asset characteristics of the bank (asset level, inflow and outflow characteristics), transaction characteristics (transaction frequency, transaction amount, etc., transaction place, purchased products), user attribute characteristics (basic attributes: age, gender, whether mobile banking...; risk level; customer preference;), product characteristics (1. Mobile banking: characteristics of purchased products, such as wealth management product characteristics, fund product characteristics 2. Characteristics of the bank's life apps: movie ticket product characteristics, catering characteristics, clothing characteristics, etc.) to train the data.
[0063] Y label recommended by the bank: 1. If an advanced intelligent recommendation algorithm is used, this method can be used. For example, deepfm, the purchased products are positive samples as 1, and the randomly sampled ones that have not been purchased are 0. Because this method combines the advantages of high-dimensional features and two-dimensional features, it has good recommendation effect prediction ability, but the training speed is slow, especially when applied to the federated learning framework, the speed will be slower. 2. Or use a simple commodity collaborative filtering algorithm such as SVD for intelligent recommendation, which is faster. Then the Y label at this time: rating click count, the number of times the user clicks on the product is used as the label, and the negative examples are also sampled proportionally. For example:
[0064] U1, my customer service, 0;
[0065] U1, update ID card, 0;
[0066] U1, Immediate repayment, 0;
[0067] U1, Card application progress, 2;
[0068] U1, Card activation, 1;
[0069] U1, Life town, 2.
[0070] Federated training: Figure 4 It is a schematic diagram of the three - party joint training process provided according to the embodiments of the present application. As shown in Figure 4, the bank is the initiator (gest), the travel party and the movie ticket party are the participating parties. The bank initiates federated modeling, and multiple parties perform local modeling. The server (a third - party server) distributes public keys to each participating party. Then the bank uploads the model parameters, gradients, and loss (loss) to the server side, and other participating parties upload information such as model parameter gradients. The server will aggregate according to the model parameters of each participating party and then download it to each user side, and also download the loss (loss) information to the bank, and perform cyclic modeling until the loss (loss) converges.
[0071] After the training is completed, the bank can use this model for subsequent intelligent recommendation services to provide more user - friendly recommendation services.
[0072] By building a federated learning platform with third - party companies, etc., browsing information, ticket - purchasing information, etc. of users are obtained. Then, combined with the fund flow of bank users in the federated data, a user task portrait is jointly learned and constructed. Further, according to the user task portrait, personalized recommendation services are provided to create a "one - key access for travel, accommodation, and play" service for travel users. The launch of this service can not only attract new users and boost user activity, but also generate actual transaction revenues for the bank, with great long - term value potential.
[0073] The embodiments of the present application also provide a training device for a target model. It should be noted that the training device for the target model in the embodiments of the present application can be used to execute the training method for the target model provided in the embodiments of the present application. The following introduces the training device for the target model provided in the embodiments of the present application.
[0074] Figure 5 It is a schematic diagram of a training device for a target model according to an embodiment of the present application. As Figure 5 shown, the device includes: a first sending module 52, a first receiving module 54, and a training module 56. The following provides a detailed description of the device.
[0075] The first sending module 52 is configured to send a training initiation instruction to a target server, where the training initiation instruction is used to trigger the target server to initiate joint training; the first receiving module 54 is connected to the first sending module 52 and is configured to send the model parameters of the local user model to the target server and receive the target model parameters sent by the target server, where the target server receives the model parameters sent by multiple participants and determines the target model parameters according to the multiple model parameters; the training module 56 is connected to the first receiving module 54 and is configured to adjust the parameters of the local user model according to the target model parameters and continue training until the local user model converges.
[0076] With the above device, the first sending module 52 is used to send a training initiation instruction to the target server, where the training initiation instruction is used to trigger the target server to initiate joint training; the first receiving module 54 sends the model parameters of the local user model to the target server and receives the target model parameters sent by the target server, where the target server receives the model parameters sent by multiple participants and determines the target model parameters according to the multiple model parameters; the training module 56 adjusts the parameters of the local user model according to the target model parameters and continues training until the local user model converges, solving the problem in the related art that data of different service parties cannot be legally interconnected, the data sources of each service party of the model are isolated from each other, and the model for intelligent recommendation to users is relatively one-sided, resulting in a low model accuracy. Furthermore, the effect of jointly training by combining the model data of different user models, comprehensively integrating the user characteristics of each participating party dimension, and improving the accuracy of the local user model is achieved.
[0077] Optionally, in the training device of the target model provided in the embodiment of the present application, the device further includes: a first encryption module, configured to encrypt the model parameter data of the local user model and then send it to multiple participants in the joint training, and receive the model parameters obtained by the multiple participants after double-encrypting the encrypted model parameter data; and / or, a second encryption module, configured to receive the model parameter ciphertexts encrypted by the multiple participants in the joint training for the model parameter data of their respective corresponding user models, and double-encrypt the model parameter ciphertexts and return them to the corresponding participants.
[0078] Optionally, the device further includes: a decryption module, configured to decrypt the model parameter ciphertexts encrypted by the multiple participants to obtain the model parameters of the multiple participants, where the model parameters are used to continue training the user model.
[0079] Optionally, the training module includes: a parameter tuning unit for tuning the local user model according to the target model parameters; a training unit for continuously training the local user model using the model parameters of multiple parties; a loss unit for determining a loss value through the loss function of the local user model; and a convergence unit for determining that the local user model converges when the loss value reaches a preset value.
[0080] Optionally, the apparatus further includes: a generation module for inputting user information into the local user model to generate user tags; and a push module for performing service push to the account of the user information according to the user tags, or generating service content of interest to the user information.
[0081] Figure 6 is a schematic diagram of a server for training a target model according to an embodiment of the present application, as Figure 6 shown, according to another aspect of the present application, there is provided a server for training a target model, the server includes: a second sending module 62, a second receiving module 64, a determination module 66, and a distribution module 68. The server will be described in detail below.
[0082] The second sending module 62 is configured to send a training request to multiple parties participating in joint training, where each party creates a user model of the same type based on its own authorized user data; the second receiving module 64 is connected to the second sending module 62 and is configured to receive multiple model parameters sent by the multiple parties in response to the training request, where the model parameters are the model parameters of the user models of each party; the determination module 66 is connected to the second receiving module 64 and is configured to determine target model parameters based on the multiple model parameters; the distribution module 68 is connected to the determination module 66 and is configured to distribute the target model parameters to the multiple parties, where the parties tune the user models according to the received target model parameters and continue training.
[0083] Through the above server, the second sending module 62 is used to send training requests to multiple parties participating in the joint training. Each party creates a user model of the same type based on the user data of its own authority. The second receiving module 64 receives multiple model parameters sent by the multiple parties in response to the training requests, where the model parameters are the model parameters of the user models of each party. The determination module 66 determines the target model parameters according to the multiple model parameters. The distribution module 68 distributes the target model parameters to the multiple parties. The parties adjust the parameters of the user model according to the received target model parameters and continue training, solving the problem in the related art that the data of different service parties cannot be legally interconnected, the data sources of each service party of the model are isolated from each other, and the model for intelligent recommendation to users is relatively one-sided, resulting in a low model accuracy. Furthermore, the effect of combining the model data of different user models for joint training, comprehensively integrating the user characteristics of each participating party dimension, and improving the accuracy of the local user model is achieved.
[0084] The training device for the target model provided by the embodiment of the present application solves the problem in the related art that the data of different service parties cannot be legally interconnected, the data sources of each service party of the model are isolated from each other, and the model for intelligent recommendation to users is relatively one-sided, resulting in a low model accuracy through the first sending module 52, the first receiving module 54, and the training module 56. Furthermore, the effect of combining the model data of different user models for joint training, comprehensively integrating the user characteristics of each participating party dimension, and improving the accuracy of the local user model is achieved.
[0085] The above training device for the target model includes a processor and a memory. The first sending module 52, the first receiving module 54, the training module 56, etc. are all stored in the memory as program units, and the corresponding functions are implemented by the processor executing the above program units stored in the memory.
[0086] The processor contains a kernel, and the kernel retrieves the corresponding program units from the memory. One or more kernels can be set. By adjusting the kernel parameters, the model data of different user models are combined for joint training, and the user characteristics of each participating party dimension are comprehensively integrated.
[0087] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM), and / or non-volatile memory in the form of, for example, read-only memory (ROM) or flash RAM. The memory includes at least one memory chip.
[0088] The embodiment of the present application also provides a non-volatile storage medium. The non-volatile storage medium includes a stored program. When the program runs, it controls the device where the non-volatile storage medium is located to execute a training method for a target model.
[0089] An embodiment of the present invention provides a processor for running a program, wherein when the program runs, it executes a training method for the target model.
[0090] As Figure 7 shown, an embodiment of the present invention provides an electronic device 70, which includes a processor, a memory, and a program stored on the memory and executable on the processor. When the processor executes the program, the following steps are implemented:
[0091] Send a training initiation instruction to the target server, where the training initiation instruction is used to trigger the target server to initiate joint training; send the model parameters of the local user model to the target server, and receive the target model parameters sent by the target server, where the target server receives the model parameters sent by multiple participants and determines the target model parameters according to the multiple model parameters; adjust the parameters of the local user model according to the target model parameters and continue training until the local user model converges.
[0092] Optionally, before sending the model parameters of the local user model to the target server and receiving the target model parameters sent by the target server, the method further includes: encrypting the model parameter data of the local user model and sending it to multiple participants in the joint training, and receiving the model parameters obtained by the multiple participants after double-encrypting the encrypted model parameter data; and / or, receiving the encrypted model parameter ciphertexts of the model parameters of their respective corresponding user models by multiple participants in the joint training, and double-encrypting the model parameter ciphertexts and returning them to the corresponding participants.
[0093] Optionally, the method further includes: decrypting the encrypted model parameter ciphertexts received from multiple participants to obtain the model parameters of the multiple participants, where the model parameters are used to continue training the user model.
[0094] Optionally, adjusting the parameters of the user model according to the target model parameters and continuing training until the local user model converges includes: adjusting the parameters of the local user model according to the target model parameters; using the model parameters of multiple participants to continue training the local user model; determining the loss value through the loss function of the local user model; and determining that the local user model converges when the loss value reaches a preset value.
[0095] Optionally, after adjusting the parameters of the local user model according to the target model parameters and continuing training until the local user model converges, the method further includes: inputting user information into the local user model to generate user tags; and performing business push to the account of the user information according to the user tags, or generating business content of interest to the user information.
[0096] When the processor executes the program, the following steps can also be implemented: sending a training request to multiple participating parties in joint training, where each participating party creates a user model of the same type based on the user data within its own authority; receiving multiple model parameters sent by the multiple participating parties in response to the training request, where the model parameters are the model parameters of the user model of each participating party; determining target model parameters based on the multiple model parameters; and sending the target model parameters to the multiple participating parties, where the participating parties adjust the parameters of the user model according to the received target model parameters and continue the training.
[0097] Optionally, the multiple participating parties include: an initiating party. Before sending a training request to the multiple participating parties, the method further includes: receiving an initiate training instruction sent by the initiating party; and in response to the initiate training instruction, performing the step of sending a training request to the multiple participating parties in joint training.
[0098] The device in this article can be a server, a PC, a PAD, a mobile phone, etc.
[0099] This application also provides a computer program product, which, when executed on a data processing device, is adapted to execute a program initialized with the following method steps: sending an initiate training instruction to a target server, where the initiate training instruction is used to trigger the target server to initiate joint training; sending the model parameters of the local user model to the target server, and receiving the target model parameters sent by the target server, where the target server receives multiple model parameters sent by multiple participating parties and determines the target model parameters based on the multiple model parameters; adjusting the parameters of the local user model according to the target model parameters and continuing the training until the local user model converges.
[0100] Optionally, before sending the model parameters of the local user model to the target server and receiving the target model parameters sent by the target server, the method further includes: encrypting the model parameter data of the local user model and sending it to the multiple participating parties in joint training, and receiving the model parameters obtained after the multiple participating parties double-encrypt the encrypted model parameter data; and / or receiving the model parameter ciphertexts encrypted by the multiple participating parties for the model parameter data of their respective corresponding user models, and double-encrypting the model parameter ciphertexts and returning them to the corresponding participating parties.
[0101] Optionally, the method further includes: decrypting the model parameter ciphertexts encrypted by the multiple participating parties to obtain the model parameters of the multiple participating parties, where the model parameters are used to continue the training of the user model.
[0102] Optionally, adjust the parameters of the local user model according to the target model parameters and continue training until the local user model converges, including: adjusting the parameters of the local user model according to the target model parameters; continuing to train the local user model using the model parameters of multiple parties; determining the loss value through the loss function of the local user model; and determining that the local user model converges when the loss value reaches a preset value.
[0103] Optionally, after adjusting the parameters of the local user model according to the target model parameters and continuing training until the local user model converges, the method further includes: inputting user information into the local user model to generate user tags; and performing business push to the account of the user information according to the user tags, or generating business content of interest to the user information.
[0104] It is also possible to execute the program of the following method steps: sending a training request to multiple parties participating in the joint training, where each party creates a user model of the same type according to the user data within its own authority; receiving multiple model parameters sent by the multiple parties in response to the training request, where the model parameters are the model parameters of the user models of each party; determining the target model parameters according to the multiple model parameters; and sending the target model parameters to the multiple parties, where the parties adjust the parameters of the user model according to the received target model parameters and continue training.
[0105] Optionally, the multiple parties include: an initiating party. Before sending a training request to the multiple parties, the method further includes: receiving an initiating training instruction sent by the initiating party; and in response to the initiating training instruction, performing the step of sending a training request to the multiple parties participating in the joint training.
[0106] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can 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.) containing computer-usable program code.
[0107] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, as well as the combination of flows and / or blocks in the flowchart and / or block diagram. These computer program instructions can be provided to the processor of a general - purpose computer, a special - purpose computer, an embedded processor, or other programmable data - processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data - processing devices produce a means for implementing the functions specified in one or more of the flows Figure 1 one flow or multiple flows and / or blocks Figure 1 or a means for implementing the functions specified in one or more of the blocks.
[0108] These computer program instructions can also be stored in a computer - readable memory that can direct a computer or other programmable data - processing device to work in a specific manner, such that the instructions stored in the computer - readable memory produce a manufacture including an instruction means that implements the functions specified in one or more of the flows Figure 1 one flow or multiple flows and / or blocks Figure 1 or a means for implementing the functions specified in one or more of the blocks.
[0109] These computer program instructions can also be loaded onto a computer or other programmable data - processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer - implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more of the flows Figure 1 one flow or multiple flows and / or blocks Figure 1 or a means for implementing the functions specified in one or more of the blocks.
[0110] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0111] The memory may include non - permanent memory in the form of computer - readable media, random access memory (RAM), and / or non - volatile memory, such as read - only memory (ROM) or flash memory (flash RAM). The memory is an example of computer - readable media.
[0112] Computer readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. 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.
[0113] 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 presence of other identical elements in the process, method, commodity or device including the elements.
[0114] 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.
[0115] The above are only embodiments of the present application and are 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 within the scope of the claims of the present application.
Claims
1. A training method for a target model, characterized in that, Including: Sending a training initiation instruction to a target server, where the training initiation instruction is used to trigger the target server to initiate joint training; Sending the model parameters of the local user model to the target server and receiving the target model parameters sent by the target server, where the target server receives the model parameters sent by multiple participants and determines the target model parameters based on the multiple model parameters; Adjusting the parameters of the local user model according to the target model parameters and continuing the training until the local user model converges, where the data for continuing the training is the local user data or the local user data after exchanging a preset number of data with other participants; Adjusting the parameters of the local user model according to the target model parameters and continuing the training until the local user model converges includes: adjusting the parameters of the local user model according to the target model parameters; using the model parameters of the multiple participants to continue training the local user model; determining a loss value through the loss function of the local user model; and determining that the local user model converges when the loss value reaches a preset value; Inputting user information into the converged local user model to generate business push content.
2. The method according to claim 1, wherein Before sending the model parameters of the local user model to the target server and receiving the target model parameters sent by the target server, the method further includes: Encrypting the model parameter data of the local user model and sending it to multiple participants in the joint training, and receiving the model parameters obtained after the multiple participants perform secondary encryption on the encrypted model parameter data; Receiving the model parameter ciphertexts encrypted by multiple participants in the joint training for the model parameter data of their respective corresponding user models, and performing secondary encryption on the model parameter ciphertexts and returning them to the corresponding participants.
3. The method according to claim 2, wherein The method further includes: Decrypting the model parameter ciphertexts encrypted by multiple participants to obtain the model parameters of the multiple participants, where the model parameters are used to continue training the user model.
4. The method according to any one of claims 1 to 3, characterized in that After adjusting the parameters of the local user model according to the target model parameters and continuing the training until the local user model converges, the method further includes: Inputting user information into the local user model to generate user tags; Performing business push to the account of the user information according to the user tags, or generating business content of interest to the user information.
5. A method for training a target model, characterized in that Including: Sending a training request to multiple participants in the joint training, where each participant creates a user model of the same type based on the user data within its own authority; Receiving the model parameters sent by the multiple participants in response to the training request, where the model parameters are the model parameters of the user models of each participant; Determining the target model parameters based on the multiple model parameters; Send the target model parameters to the multiple participants. Among them, the participants adjust the parameters of the user model according to the received target model parameters and continue training. The data for continuous training is local user data or local user data after exchanging a preset number of data with other participants; The step that the participants adjust the parameters of the user model according to the received target model parameters and continue training includes: adjusting the parameters of the user model according to the target model parameters; using the model parameters of the multiple participants to continue training the user model; determining the loss value through the loss function of the user model; and determining that the user model converges when the loss value reaches a preset value; Input the user information into the converged user model to generate business push content.
6. The method according to claim 5, wherein The multiple participants include: an initiator. Before sending a training request to the multiple participants, the method further includes: Receiving the initiate training instruction sent by the initiator; Responding to the initiate training instruction and performing the step of sending a training request to the multiple participants for joint training.
7. A training device for a target model, characterized in that, Including: A first sending module, configured to send an initiate training instruction to a target server, where the initiate training instruction is used to trigger the target server to initiate joint training; A first receiving module, configured to send the model parameters of the local user model to the target server and receive the target model parameters sent by the target server. The target server receives the multiple model parameters sent by the multiple participants and determines the target model parameters according to the multiple model parameters; A training module, configured to adjust the parameters of the local user model according to the target model parameters and continue training until the local user model converges. The data for continuous training is local user data or local user data after exchanging a preset number of data with other participants; Adjusting the parameters of the local user model according to the target model parameters and continuing training until the local user model converges includes: adjusting the parameters of the local user model according to the target model parameters; using the model parameters of the multiple participants to continue training the local user model; determining the loss value through the loss function of the local user model; and determining that the local user model converges when the loss value reaches a preset value; Input the user information into the converged local user model to generate business push content.
8. A server for training a target model, characterized in that, Including: A second sending module, configured to send a training request to the multiple participants for joint training. Each participant creates a user model of the same type according to the user data within its own authority; A second receiving module, configured to receive the multiple model parameters sent by the multiple participants in response to the training request. The model parameters are the model parameters of the user models of each participant; A determining module, configured to determine the target model parameters according to the multiple model parameters; A distribution module, configured to distribute the target model parameters to the multiple participating parties, where the participating parties adjust the parameters of the user model according to the received target model parameters and continue training, and the data for continued training is local user data or local user data after exchanging a preset amount of data with other participating parties; The step that the participating parties adjust the parameters of the user model according to the received target model parameters and continue training includes: adjusting the parameters of the user model according to the target model parameters; using the model parameters of the multiple participating parties to continue training the user model; determining a loss value through the loss function of the user model; and determining that the user model converges when the loss value reaches a preset value; Input user information into the converged user model to generate business push content.
9. An electronic device, characterized in that, It includes one or more processors and a memory, and the memory is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Information recommendation model generation method and device
CN110189192A
Model training method and device based on federal learning system, and electronic equipment
CN113159327A