A model training method, information recommendation method and device
By minimizing the deviation between the historical and new training sample click rates in the recommendation model, the problem of knowledge forgetting is solved, the accuracy of recommended information and user preference perception are improved, and the recommendation model remains efficient during the update process.
Patent Information
- Application Number
- CN202111628245.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2041-12-28
AI Technical Summary
When the existing recommendation model is updated with new training samples, it is easy to cause the problem of knowledge forgetting, losing the training results of the early historical training samples on the recommendation model, and reducing the accuracy of the recommendation information.
By obtaining historical training samples and new training samples, the click-through rate is calculated in the preset historical recommendation model and recommendation model respectively, and with minimizing the deviation between the two as the optimization goal, the recommendation model is trained to ensure that the model The update process maintains the accuracy of earlier training results while adapting to changes in user preferences.
It effectively prevents the recommendation model from losing early training results, improves the accuracy of recommended information and user preference perception, and ensures that the recommendation model can continue to provide high-quality recommendation results during the update process.
Smart Images

Figure CN114297491B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a model training method, an information recommendation method and a device. Background Art
[0002] At present, in most recommendation scenarios, the incremental update method is usually used, which uses newly added training samples to train the recommendation model based on the recommendation model trained with historical training samples.
[0003] However, in practical applications, the method of training the recommendation model with newly added training samples may cause serious catastrophic forgetting problems in the recommendation model. That is, over time, this method will cause the recommendation model to lose the training results of the early historical training samples on the recommendation model, reducing the accuracy of the recommendation information determined by the recommendation model.
[0004] Therefore, how to improve the accuracy of recommendation information determined by the recommendation model is an urgent problem to be solved. Summary of the invention
[0005] This specification provides a model training method, device, storage medium and electronic device to partially solve the above-mentioned problems existing in the prior art.
[0006] This manual adopts the following technical solutions:
[0007] This manual provides a model training method, including:
[0008] Obtain historical training samples and newly added training samples, wherein the training samples contain user features and recommendation information;
[0009] For each historical training sample, the historical training sample is input into a preset historical recommendation model, and the click rate corresponding to the historical training sample in the historical recommendation model is determined as a first click rate, the historical training sample is input into the recommendation model, and the click rate corresponding to the historical training sample in the recommendation model is determined as a second click rate, and a newly added training sample corresponding to the historical training sample is input into the recommendation model, and the click rate corresponding to the newly added training sample is determined as a newly added click rate;
[0010] The recommendation model is trained with the optimization goal of minimizing the deviation between the first click rate and the second click rate, and the deviation between the newly added click rate and the label corresponding to the newly added training sample.
[0011] Optionally, historical training samples are obtained, including:
[0012] Acquire a training sample set, wherein the training samples in the training sample set include object data of business objects;
[0013] For each business object, according to the object data, determine the proportion of the number of training samples corresponding to the business object in the training sample set as the proportion corresponding to the business object;
[0014] According to the proportion corresponding to each business object, a training sample is selected from the training sample set as the acquired historical training sample.
[0015] Optionally, historical training samples are obtained, including:
[0016] Determine the business period corresponding to the acquired newly added training samples;
[0017] A training sample matching the business period is selected from the acquired training sample set as the acquired historical training sample.
[0018] Optionally, for each historical training sample, inputting the historical training sample into a preset historical recommendation model, determining a click rate corresponding to the historical training sample in the historical recommendation model as a first click rate, inputting the historical training sample into the recommendation model, determining a click rate corresponding to the historical training sample in the recommendation model as a second click rate, and inputting a newly added training sample corresponding to the historical training sample into the recommendation model, determining a click rate corresponding to the newly added training sample as a newly added click rate, specifically including:
[0019] For each training sample, determining the user feature corresponding to the training sample, the recommendation information feature corresponding to the recommendation information, and the environment feature corresponding to the environment data;
[0020] Combining the user feature, the recommendation information feature corresponding to the recommendation information, and the environment feature corresponding to the environment data to determine a comprehensive feature corresponding to the training sample;
[0021] For each historical training sample, the comprehensive features corresponding to the historical training sample are input into the preset historical recommendation model to determine the click-through rate of the historical training sample in the historical recommendation model as the first click-through rate, the comprehensive features corresponding to the historical training sample are input into the recommendation model to determine the click-through rate of the historical training sample in the recommendation model as the second click-through rate, and the comprehensive features of the newly added training samples corresponding to the historical training samples are input into the recommendation model to determine the click-through rate corresponding to the newly added training samples as the newly added click-through rate.
[0022] Optionally, the recommendation model is trained with minimizing the deviation between the first click rate and the second click rate, and the deviation between the newly added click rate and the label corresponding to the newly added training sample as an optimization goal, specifically including:
[0023] Taking the deviation between the first click rate and the second click rate as the first deviation, and taking the deviation between the newly added click rate and the label corresponding to the newly added training sample as the second deviation;
[0024] Determine, according to the number of training samples in the historical training samples and the number of training samples in the newly added training samples, a weight corresponding to the first deviation as the first weight, wherein the more the number of training samples in the newly added training samples is compared to the number of training samples in the historical training samples, the smaller the first weight is;
[0025] The recommendation model is trained according to the first deviation, the second deviation, and the first weight.
[0026] Optionally, the recommendation model is trained with minimizing the deviation between the first click rate and the second click rate, and the deviation between the newly added click rate and the label corresponding to the newly added training sample as an optimization goal, specifically including:
[0027] Taking the deviation between the first click rate and the second click rate as the first deviation, and taking the deviation between the newly added click rate and the label corresponding to the newly added training sample as the second deviation;
[0028] Determine, according to the number of business objects in the historical training sample and the number of business objects in the newly added training sample, a weight corresponding to the first deviation as the second weight, wherein the greater the number of business objects in the newly added training sample compared to the number of business objects in the historical training sample, the smaller the second weight;
[0029] The recommendation model is trained according to the first deviation, the second deviation, the first weight, and the second weight.
[0030] This specification provides an information recommendation method, including:
[0031] In response to an information recommendation request from a target user, obtaining user characteristics of the target user;
[0032] For each candidate recommendation information, the user features and the candidate recommendation information are input into a pre-trained recommendation model, and a click rate of the target user for the candidate recommendation information is predicted as the click rate corresponding to the candidate recommendation information, wherein the recommendation model is trained by the above-mentioned model training method;
[0033] According to the click rate corresponding to each candidate recommendation information, a recommended merchant to be recommended to the target user is determined as target recommendation information, and the target recommendation information is recommended to the target user.
[0034] This specification provides a model training device, including:
[0035] An acquisition module is used to acquire historical training samples and newly added training samples, wherein the training samples contain user features and recommendation information;
[0036] A determination module is used to input each historical training sample into a preset historical recommendation model, determine the click rate corresponding to the historical training sample in the historical recommendation model as a first click rate, input the historical training sample into the recommendation model, determine the click rate corresponding to the historical training sample in the recommendation model as a second click rate, and input a newly added training sample corresponding to the historical training sample into the recommendation model, determine the click rate corresponding to the newly added training sample as a newly added click rate;
[0037] A training module is used to train the recommendation model with the optimization goal of minimizing the deviation between the first click rate and the second click rate, and the deviation between the newly added click rate and the label corresponding to the newly added training sample.
[0038] This specification provides an information recommendation device, including:
[0039] An acquisition module, configured to acquire user characteristics of a target user in response to an information recommendation request of the target user;
[0040] A prediction module is used to input the user characteristics and the candidate recommendation information into a pre-trained recommendation model for each candidate recommendation information, and predict the click rate of the target user for the candidate recommendation information as the click rate corresponding to the candidate recommendation information, wherein the recommendation model is trained by the above-mentioned model training method;
[0041] The recommendation module is used to determine the recommended merchants to be recommended to the target user as target recommendation information according to the click-through rate corresponding to each candidate recommendation information, and recommend the target recommendation information to the target user.
[0042] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned model training method and information recommendation method.
[0043] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned model training method and information recommendation method when executing the program.
[0044] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0045] In the model training method provided in the present specification, historical training samples and newly added training samples are obtained, wherein the training samples contain user features and recommendation information. Secondly, for each historical training sample, the historical training sample is input into a preset historical recommendation model, and the click rate corresponding to the historical training sample in the historical recommendation model is determined as the first click rate. The historical training sample is input into the recommendation model, and the click rate corresponding to the historical training sample in the recommendation model is determined as the second click rate. The newly added training sample corresponding to the historical training sample is input into the recommendation model, and the click rate corresponding to the newly added training sample is determined as the newly added click rate. Finally, the recommendation model is trained with the optimization goal of minimizing the deviation between the first click rate and the second click rate, and the deviation between the newly added click rate and the label corresponding to the newly added training sample.
[0046] It can be seen from the above method that this method can minimize the deviation between the first click rate determined by the preset historical recommendation model and the second click rate determined by the recommendation model, and avoid the recommendation model losing the training results of the early historical training samples on the recommendation model. It also minimizes the deviation between the newly added click rate and the label corresponding to the newly added training sample, and ensures that the recommendation model can determine the changes in user preferences during the update process, thereby improving the accuracy of the recommendation information determined by the recommendation model. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:
[0048] Figure 1 A flowchart of a model training method provided in an embodiment of this specification;
[0049] Figure 2 A schematic diagram of a model structure provided in an embodiment of this specification;
[0050] Figure 3 A flowchart of a method for providing information recommendation for the embodiments of this specification;
[0051] Figure 4A schematic diagram of the structure of a device for model training provided in an embodiment of this specification;
[0052] Figure 5 A schematic diagram of the structure of a device recommended for providing information in the embodiments of this specification;
[0053] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0055] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0056] In the embodiments of this specification, when information recommendation is performed in response to the target user's information acquisition request, it is necessary to rely on a pre-trained recommendation model. Therefore, the following will first introduce the process of training the recommendation model. Figure 1 shown.
[0057] Figure 1 The flowchart of the model training method provided in the embodiment of this specification specifically includes the following steps:
[0058] S100: Obtain historical training samples and newly added training samples, wherein the training samples contain user features and recommendation information.
[0059] In the embodiments of the present specification, the execution entity for training the recommendation model may be a server or an electronic device such as a desktop computer. For ease of description, the training method of the recommendation model provided in the present specification is described below using the server as the execution entity.
[0060] In an embodiment of the present specification, the server may obtain historical training samples and newly added training samples, wherein the training samples include user features and recommendation information. The newly added training samples mentioned here may refer to training samples whose generation time is close to the time of the current training recommendation model. The historical training samples mentioned here may refer to training samples whose generation time is far away from the time of the current training recommendation model.
[0061] The user characteristics mentioned here may include basic information about the user, such as the user's age, gender, and geographic location, and may also include historical behavior data of the user, such as historical click information of the user, historical order information of the user, historical like information of the user, etc. The recommended information mentioned here may include recommended information in different business scenarios, such as product information and advertising information.
[0062] In practical applications, due to the excessive number of historical training samples, the server usually needs to select some historical training samples from the training sample set to train the recommendation model. In the process of selecting historical training samples, different business objects have different frequencies of occurrence. For example, if the business object is a merchant, the number of times a well-known merchant appears in the user's recommendation list is much greater than the number of times a small merchant appears in the user's recommendation list, so the number of training samples corresponding to the well-known merchant is also much greater than the number of training samples corresponding to the small merchant. Based on this, the server needs to select historical training samples from the training sample set according to the number of training samples of different business objects in the training sample set.
[0063] In an embodiment of the present specification, the server may obtain a training sample set, wherein the training samples in the training sample set include object data of a business object. The business object mentioned here may refer to a merchant or a user. The object data mentioned here may include basic information of the business object (name of the business object, type of the business object, etc.).
[0064] Secondly, the server can determine the proportion of the number of training samples corresponding to each business object in the training sample set according to the object data, as the proportion corresponding to the business object. Finally, the server can select training samples from the training sample set according to the proportion corresponding to each business object as the acquired historical training samples. The specific formula is as follows:
[0065]
[0066] In the above formula, m t,i It can be used to represent the number of historical training samples corresponding to the i-th business object that needs to be selected in the t-th round of training. N can be used to represent the number of historical training samples that need to be selected. |x, y = i∈E t-1 |It can be used to represent the number of training samples corresponding to the i-th business object in the t-1th round of training. |E t-1 | can be used to represent the number of historical training samples in the training sample set in the t-1th round of training, where the number of training samples selected in each round of training |E t-1 | is unchanged. m t,iIt can be used to represent the number of historical training samples corresponding to the i-th business object that needs to be selected in the t-th round of training. From the above formula, it can be seen that It can be used to represent the proportion of the number of training samples corresponding to the business objects in the t-1th round of training in the training sample set.
[0067] Furthermore, the server may select historical training samples and newly added training samples according to the proportions corresponding to each business object as training samples for training the recommendation model.
[0068] In actual applications, in the same business scenario, users have different preferences in different time periods. For example, in a takeaway scenario, users prefer fast food, simple meals and other categories of goods on weekdays, while users have a higher consumption desire on weekends and prefer more expensive foods. Based on this, the server can train the recommendation model through training samples from different time periods, so that the recommendation model can determine the user's preferences in different time periods.
[0069] In an embodiment of the present specification, the server may determine the business period corresponding to the acquired newly added training samples. Then, a training sample matching the business period is selected from the acquired training sample set as the acquired historical training sample. The business period mentioned here may refer to any period of the day, any day of the week, and the like. For example, the current time is Wednesday, and the business period corresponding to the acquired newly added training samples is Wednesday. The server may select a training sample with a business period of Wednesday from the acquired training sample set as the acquired historical training sample. The business period mentioned here may refer to holidays, set marketing activity dates, and the like. For example, the current date is the Spring Festival, and the business period corresponding to the acquired newly added training samples is the Spring Festival. The server may select a training sample with a business period of the Spring Festival from the acquired training sample set as the acquired historical training sample.
[0070] Of course, the server may select training samples that match the business period from the acquired training sample set, and further select training samples according to the corresponding proportions of each business object as the acquired historical training samples.
[0071] S102: For each historical training sample, input the historical training sample into a preset historical recommendation model, determine the click rate corresponding to the historical training sample in the historical recommendation model as the first click rate, input the historical training sample into the recommendation model, determine the click rate corresponding to the historical training sample in the recommendation model as the second click rate, and input the newly added training sample corresponding to the historical training sample into the recommendation model, determine the click rate corresponding to the newly added training sample as the newly added click rate.
[0072] In the embodiment of the present specification, the server inputs each historical training sample into a preset historical recommendation model, determines the click rate corresponding to the historical training sample in the historical recommendation model as the first click rate, and inputs the historical training sample into the recommendation model, determines the click rate corresponding to the historical training sample in the recommendation model as the second click rate.
[0073] At the same time, the server may input the newly added training sample corresponding to the historical training sample into the recommendation model, and determine the click rate corresponding to the newly added training sample as the newly added click rate.
[0074] Specifically, the server may determine, for each training sample, the user features corresponding to the training sample, the recommendation information features corresponding to the recommendation information, and the environment features corresponding to the environment data. The recommendation information features corresponding to the recommendation information mentioned here may include: features corresponding to the basic information of the recommendation information (name of the recommendation information, type of the recommendation information, etc.), features corresponding to the business information of the recommendation information (sales volume of the recommendation information, rating of the recommendation information, ranking of the recommendation information, scale of the recommendation information, etc.).
[0075] The environmental characteristics corresponding to the environmental data mentioned here may include: characteristics corresponding to weather conditions, characteristics corresponding to marketing activities, external factors such as the region where the user is located, etc.
[0076] Secondly, the user features, the recommended information features corresponding to the recommended information, and the environmental features corresponding to the environmental data are combined to determine the comprehensive features corresponding to the training sample. Specifically, the server can splice the user features, the recommended information features corresponding to the recommended information, and the environmental features corresponding to the environmental data to obtain the comprehensive features. The server can also determine the weights corresponding to each feature according to business needs, and perform weighted summation of the user features, the recommended information features corresponding to the recommended information, and the environmental features corresponding to the environmental data to obtain the comprehensive features.
[0077] For each historical training sample, the comprehensive features corresponding to the historical training sample are input into the preset historical recommendation model, and the click rate corresponding to the historical training sample in the historical recommendation model is determined as the first click rate. The comprehensive features corresponding to the historical training sample are input into the recommendation model, and the click rate corresponding to the historical training sample in the recommendation model is determined as the second click rate. In addition, the comprehensive features of the newly added training samples corresponding to the historical training samples are input into the recommendation model, and the click rate corresponding to the newly added training samples is determined as the newly added click rate. Figure 2 shown.
[0078] Figure 2 A schematic diagram of the model structure provided in the embodiments of this specification.
[0079] exist Figure 2 In the process, the server obtains the newly added training samples and the historical training samples from the training sample set. Secondly, the server inputs the same historical training sample into the historical recommendation model to determine the first click-through rate, and inputs the same historical training sample into the recommendation model to determine the second click-through rate. Then, the server inputs the newly added training samples into the recommendation model, determines the newly added click-through rate, and puts the newly added training samples into the training sample set for the next round of training of the recommendation model. Finally, the recommendation model is trained with the optimization goal of minimizing the deviation between the first click-through rate and the second click-through rate, and the deviation between the newly added click-through rate and the label corresponding to the newly added training sample.
[0080] Among them, the model structure of the historical recommendation model is the same as the model structure of the recommendation model, and the model parameters of the historical recommendation model are different from the model parameters of the recommendation model. In addition, the historical recommendation model is regularly trained through all the training samples in the training sample set. In other words, the historical recommendation model has been trained. During the training of the recommendation model, the model parameters of the historical recommendation model will not change and are only used to assist the training of the recommendation model.
[0081] S104: The recommendation model is trained with the optimization goal of minimizing the deviation between the first click rate and the second click rate, and the deviation between the newly added click rate and the label corresponding to the newly added training sample.
[0082] In practical applications, the method of training the recommendation model using only newly added training samples may cause the recommendation model to have serious knowledge forgetting problems. Over time, this method will cause the recommendation model to lose the training results of the early historical training samples on the recommendation model, reducing the accuracy of the recommended information determined by the recommendation model. Based on this, the server can make the click rate corresponding to the recommended information determined by the recommendation model close to the click rate corresponding to the recommended information determined by the historical recommendation model, so that the recommendation model retains the training results of the early historical training samples on the recommendation model.
[0083] At the same time, the server continues to train the recommendation model by adding new training samples to ensure that the recommendation model can determine the changing trend of user preferences during the update process, and further improve the accuracy of the recommendation information determined by the recommendation model.
[0084] In the embodiment of this specification, the server can train the recommendation model with the optimization goal of minimizing the deviation between the first click rate and the second click rate, and the deviation between the newly added click rate and the label corresponding to the newly added training sample. The specific formula is as follows:
[0085]
[0086] In the above formula, x can be used to represent the features corresponding to the historical training samples, and y can be used to represent the labels corresponding to the historical training samples. It can be used to characterize the click-through rate corresponding to the historical training samples determined by the historical recommendation model, that is, the first click-through rate. i It can be used to characterize the click-through rate corresponding to the historical training samples determined by the recommendation model, that is, the second click-through rate. As can be seen from the above formula, the server can improve the similarity between the first click-through rate corresponding to each historical training sample determined by the historical recommendation model and the second click-through rate corresponding to each historical training sample determined by the recommendation model, so that the recommendation model maintains the training results of the recommendation model by the early historical training samples.
[0087] Similarly, the server can train the recommendation model by minimizing the deviation between the new click rate and the label corresponding to the new training sample based on minimizing the deviation between the first click rate and the second click rate. The specific formula is as follows:
[0088]
[0089] In the above formula, |D t | can be used to represent the number of newly added training samples in the training sample set in the tth round of training. x can be used to represent the features corresponding to the newly added training samples. y can be used to represent the labels corresponding to the newly added training samples, with 1 for clicks and 0 for non-clicks. It can be used to characterize the click-through rate of the newly added training samples determined by the recommendation model. From the above formula, it can be seen that if y is 1, the closer the newly added click-through rate determined by the recommendation model by the server is to y (value is 1), the cross entropy loss function L CE (θ t ) is smaller. If y is 0, the closer the new click rate determined by the server through the recommendation model is to y (value is 0), the cross entropy loss function L CE (θ t ) is smaller. Therefore, the server can improve the recommendation model's ability to perceive the user's preferences at the current moment by minimizing the deviation between the newly added click-through rate and the labels corresponding to the newly added training samples.
[0090] In practical applications, the time of the newly added training samples obtained by the recommendation model is relatively close to the current moment. If there are many newly added training samples obtained in this round of training, in order for the recommendation model to determine the user's preference in the next period of time as quickly as possible, to ensure the accuracy of the recommended information determined by the recommendation model. The server can increase the influence of the deviation between the newly added click-through rate and the label corresponding to the newly added training sample in the training process of the recommendation model. If there are few newly added training samples obtained in this round of training, in order for the recommendation model not to lose the training results of the early historical training samples on the recommendation model. The server can increase the influence of the deviation between the first click-through rate and the second click-through rate in the training process of the recommendation model.
[0091] In an embodiment of the present specification, the server may use the deviation between the first click rate and the second click rate as the first deviation, and use the deviation between the newly added click rate and the label corresponding to the newly added training sample as the second deviation. Secondly, according to the number of training samples in the historical training samples and the number of training samples in the newly added training samples, determine the weight corresponding to the first deviation as the first weight, wherein the more the number of training samples in the newly added training samples is compared to the number of training samples in the historical training samples, the smaller the first weight. Finally, the recommendation model is trained according to the first deviation, the second deviation, and the first weight. The specific formula is as follows:
[0092] Loss = L CE +λ t L KD
[0093]
[0094] In the above formula, |D t |It can be used to represent the number of newly added training samples in the training sample set in the tth round of training. |E t-1 | can be used to represent the number of historical training samples in the training sample set in the t-1th round of training. t The generation time of new training samples of |E t-1 Compared with the generation time of historical training samples, |D t The generation time of the newly added training samples is closer to the current moment. KD It can be used to characterize the deviation between the first click rate and the second click rate, that is, the first deviation. CE It can be used to characterize the deviation between the newly added click-through rate and the label corresponding to the newly added training sample, that is, the second deviation. t It can be used to characterize the first weight corresponding to the tth round of training.
[0095] It can be seen from the above formula that the more the number of new training samples in the new training samples is compared to the number of historical training samples in the historical training samples, the smaller the first weight is. The server can reduce the influence of the first deviation in the training process of the recommendation model to increase the influence of the second deviation in the training process of the recommendation model, so that the recommendation model can quickly determine the user's preference changes through the new training samples.
[0096] In actual applications, new business objects will continue to appear in various business scenarios. However, there are fewer historical training samples for these newly added business objects. In order to quickly determine the user's preference for these newly added business objects and improve the accuracy of the click-through rate determined by the recommendation model, the server can increase the influence of the deviation between the newly added click-through rate and the label corresponding to the newly added training sample in the training process of the recommendation model.
[0097] In an embodiment of the present specification, the deviation between the first click rate and the second click rate is taken as the first deviation, and the deviation between the newly added click rate and the label corresponding to the newly added training sample is taken as the second deviation. Secondly, according to the number of business objects in the historical training samples and the number of business objects in the newly added training samples, the weight corresponding to the first deviation is determined as the second weight, wherein the more the number of business objects in the newly added training samples is compared to the number of business objects in the historical training samples, the smaller the second weight. Finally, the recommendation model is trained according to the first deviation, the second deviation, and the second weight. After multiple rounds of iterative training, the deviation can be continuously reduced and converged within a numerical range, thereby completing the training process of the recommendation model. The specific formula is as follows:
[0098] Loss = L CE +λ t L KD
[0099]
[0100] In the above formula, |I t |It can be used to represent the number of business objects in the newly added training samples in the tth round of training. |I t-1 | can be used to characterize the number of business objects in the historical training samples in the t-1th round of training. t It can be used to characterize the second weight corresponding to the tth round of training.
[0101] It can be seen from the above formula that the more business objects there are in the newly added training samples compared to the number of business objects in the historical training samples, the smaller the second weight. The server can reduce the influence of the first deviation in the training process of the recommendation model to increase the influence of the second deviation in the training process of the recommendation model, so that the recommendation model can quickly determine the user's preference for these newly added business objects through the newly added training samples.
[0102] Of course, the server can train the recommendation model according to the first deviation, the second deviation, the first weight, and the second weight. The specific formula is as follows:
[0103]
[0104] In the above formula, Can be used to characterize the second weight. It can be used to characterize the first weight. It can be seen from the above formula that the server can use the first weight and the second weight to make the recommendation model pay more attention to the training effect of the early historical training samples on the recommendation model when the number of new training samples is small or the number of business objects in the new training samples is small during the training of a new round of recommendation models. When the number of new training samples is large or the number of business objects in the new training samples is large during the training of a new round of recommendation models, the recommendation model can determine the user's preference in the next period of time as soon as possible to ensure the accuracy of the recommendation information determined by the recommendation model for the current data.
[0105] It should be noted that the framework used by the above-mentioned recommendation model can be an Enc-Dec network structure such as a fully connected forward propagation network (Feed Forward Network, FFN), a fully connected neural network (Fully Connected Neural Network, FCNN), a multi-head self-attention mechanism network (Multi-head Self-Attention, MSA), or other forms of neural network structures. This specification does not limit the specific form of the framework used by the recommendation model.
[0106] From the above process, it can be seen that this method can minimize the deviation between the first click rate determined by the preset historical recommendation model and the second click rate determined by the recommendation model, so as to avoid the recommendation model losing the training results of the early historical training samples on the recommendation model. It also minimizes the deviation between the newly added click rate and the labels corresponding to the newly added training samples, and ensures that the recommendation model can determine the changes in user preferences during the update process, thereby improving the accuracy of the recommendation information determined by the recommendation model.
[0107] After the training of the recommendation model is completed, the recommendation model can be used to recommend information to users. The specific process is as follows: Figure 3 shown.
[0108] Figure 3 A flowchart of a method for providing information recommendation for an embodiment of this specification.
[0109] S300: In response to an information recommendation request of a target user, obtaining user characteristics of the target user.
[0110] In the embodiments of the present specification, the server may obtain the user characteristics of the target user in response to the information recommendation request of the target user, where the target user refers to the user who is currently performing a specified business in a specified business scenario. The candidate recommended information may refer to the information that has been screened in the specified business scenario, or may refer to all the information in the specified business scenario.
[0111] S302: For each candidate recommendation information, the user features and the candidate recommendation information are input into a pre-trained recommendation model, and the click rate of the target user for the candidate recommendation information is predicted as the click rate corresponding to the candidate recommendation information. The recommendation model is trained by the above-mentioned model training method.
[0112] S304: Determine a recommended merchant to be recommended to the target user according to the click rate corresponding to each candidate recommendation information as target recommendation information, and recommend the target recommendation information to the target user.
[0113] In an embodiment of the present specification, the server may input the user features and the candidate recommendation information into a pre-trained recommendation model for each candidate recommendation information, and predict the click rate of the target user for the candidate recommendation information as the click rate corresponding to the candidate recommendation information.
[0114] Then, according to the click-through rate corresponding to each candidate recommendation information, a recommended merchant to be recommended to the target user is determined as the target recommendation information, and the target recommendation information is recommended to the target user.
[0115] Specifically, the server may determine the click rate corresponding to each candidate recommendation information, sort the candidate recommendation information in descending order of click rate, and use the candidate recommendation information ranked before the set ranking position as the target recommendation information output at the current moment.
[0116] From the above content, it can be seen that the server can improve the recommendation effect of recommending information to target users through the target recommendation information determined by the recommendation model.
[0117] The above is a method for model training provided in one or more embodiments of this specification. Based on the same idea, this specification also provides a corresponding model training device, such as Figure 5 shown.
[0118] Figure 4 The schematic diagram of the structure of the device for model training provided in the embodiment of this specification specifically includes:
[0119] An acquisition module 400 is used to acquire historical training samples and newly added training samples, wherein the training samples contain user features and recommendation information;
[0120] Determination module 402 is used for, for each historical training sample, inputting the historical training sample into a preset historical recommendation model, determining the click rate corresponding to the historical training sample in the historical recommendation model as a first click rate, inputting the historical training sample into the recommendation model, determining the click rate corresponding to the historical training sample in the recommendation model as a second click rate, and inputting a newly added training sample corresponding to the historical training sample into the recommendation model, determining the click rate corresponding to the newly added training sample as a newly added click rate;
[0121] The training module 404 is used to train the recommendation model with the optimization goal of minimizing the deviation between the first click rate and the second click rate, and the deviation between the newly added click rate and the label corresponding to the newly added training sample.
[0122] Optionally, the acquisition module 400 is specifically used to obtain a training sample set, the training samples in the training sample set containing object data of business objects, and for each business object, determining the proportion of the number of training samples corresponding to the business object in the training sample set based on the object data as the proportion corresponding to the business object, and selecting training samples from the training sample set according to the proportion corresponding to each business object as the acquired historical training samples.
[0123] Optionally, the acquisition module 400 is specifically configured to determine a business period corresponding to the acquired new training sample, and select a training sample matching the business period from the acquired training sample set as the acquired historical training sample.
[0124] Optionally, the determination module 402 is specifically used to, for each training sample, determine the user characteristics corresponding to the training sample, the recommendation information characteristics corresponding to the recommendation information, and the environmental characteristics corresponding to the environmental data, merge the user characteristics, the recommendation information characteristics corresponding to the recommendation information, and the environmental characteristics corresponding to the environmental data to determine the comprehensive characteristics corresponding to the training sample, and for each historical training sample, input the comprehensive characteristics corresponding to the historical training sample into a preset historical recommendation model, determine the click-through rate corresponding to the historical training sample in the historical recommendation model as the first click-through rate, input the comprehensive characteristics corresponding to the historical training sample into the recommendation model, determine the click-through rate corresponding to the historical training sample in the recommendation model as the second click-through rate, and input the comprehensive characteristics of the newly added training sample corresponding to the historical training sample into the recommendation model to determine the click-through rate corresponding to the newly added training sample as the newly added click-through rate.
[0125] Optionally, the determination module 402 is specifically used to take the deviation between the first click-through rate and the second click-through rate as the first deviation, and take the deviation between the new click-through rate and the label corresponding to the new training sample as the second deviation, and determine the weight corresponding to the first deviation as the first weight according to the number of historical training samples in the historical training samples and the number of new training samples in the new training samples, wherein the more the number of new training samples in the new training samples is compared to the number of historical training samples in the historical training samples, the smaller the first weight, and the recommendation model is trained according to the first deviation, the second deviation, and the first weight.
[0126] Optionally, the training module 404 is specifically used to take the deviation between the first click-through rate and the second click-through rate as the first deviation, and take the deviation between the newly added click-through rate and the label corresponding to the newly added training sample as the second deviation, and determine the weight corresponding to the first deviation as the second weight according to the number of business objects in the historical training samples and the number of business objects in the newly added training samples, wherein the greater the number of business objects in the newly added training samples compared to the number of business objects in the historical training samples, the smaller the second weight, and the recommendation model is trained according to the first deviation, the second deviation, the first weight, and the second weight.
[0127] Figure 5 The schematic diagram of the structure of the device recommended for providing information in the embodiments of this specification specifically includes:
[0128] The acquisition module 500 is used to acquire the user characteristics of the target user in response to the information recommendation request of the target user;
[0129] Prediction module 502, for each candidate recommendation information, inputting the user features and the candidate recommendation information into a pre-trained recommendation model, predicting the click rate of the target user for the candidate recommendation information as the click rate corresponding to the candidate recommendation information, wherein the recommendation model is trained by the above-mentioned model training method;
[0130] The recommendation module 506 is used to determine the recommended merchants to be recommended to the target user as target recommendation information according to the click-through rates corresponding to the candidate recommendation information, and recommend the target recommendation information to the target user.
[0131] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 The model training method provided and the above Figure 3 The information provided is the recommended method.
[0132] This manual also provides Figure 6 The structural diagram of the electronic device shown in FIG. Figure 6 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 The model training method and the above Figure 3 The information provided recommends the method. Of course, in addition to the software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0133] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0134] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0135] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0136] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0137] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0138] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0139] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0140] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0141] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0142] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0143] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic 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.
[0144] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0145] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0146] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0147] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0148] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.
Claims
1. A model training method, It is characterized in that include: Obtain historical training samples and newly added training samples, wherein the training samples contain user features and recommendation information; For each historical training sample, the historical training sample is input into a preset historical recommendation model, and the click rate corresponding to the historical training sample in the historical recommendation model is determined as a first click rate, the historical training sample is input into the recommendation model, and the click rate corresponding to the historical training sample in the recommendation model is determined as a second click rate, and a newly added training sample corresponding to the historical training sample is input into the recommendation model, and the click rate corresponding to the newly added training sample is determined as a newly added click rate; The recommendation model is trained with minimizing the deviation between the first click rate and the second click rate, and the deviation between the newly added click rate and the label corresponding to the newly added training sample as an optimization goal, wherein the label is used to characterize the actual click situation of the user on the recommended information in the newly added training sample; The recommendation model is trained with minimizing the deviation between the first click rate and the second click rate, and the deviation between the newly added click rate and the label corresponding to the newly added training sample as the optimization goal, specifically including: Taking the deviation between the first click rate and the second click rate as the first deviation, and taking the deviation between the newly added click rate and the label corresponding to the newly added training sample as the second deviation; Determine, according to the number of historical training samples in the historical training samples and the number of newly added training samples in the newly added training samples, a weight corresponding to the first deviation as the first weight, wherein the more the number of newly added training samples in the newly added training samples is compared to the number of historical training samples in the historical training samples, the smaller the first weight; Determine, according to the number of business objects in the historical training sample and the number of business objects in the newly added training sample, a weight corresponding to the first deviation as the second weight, wherein the greater the number of business objects in the newly added training sample compared to the number of business objects in the historical training sample, the smaller the second weight; The recommendation model is trained according to the first deviation, the second deviation, the first weight, and the second weight.
2. The method according to claim 1, It is characterized in that Obtain historical training samples, including: Acquire a training sample set, wherein the training samples in the training sample set include object data of business objects; For each business object, according to the object data, determine the proportion of the number of training samples corresponding to the business object in the training sample set as the proportion corresponding to the business object; According to the proportion corresponding to each business object, a training sample is selected from the training sample set as the acquired historical training sample.
3. The method according to claim 1 or 2, It is characterized in that Obtain historical training samples, including: Determine the business period corresponding to the acquired newly added training samples; A training sample matching the business period is selected from the acquired training sample set as the acquired historical training sample.
4. The method according to claim 1, It is characterized in that For each historical training sample, input the historical training sample into a preset historical recommendation model, determine the click rate corresponding to the historical training sample in the historical recommendation model as a first click rate, input the historical training sample into the recommendation model, determine the click rate corresponding to the historical training sample in the recommendation model as a second click rate, and input the newly added training sample corresponding to the historical training sample into the recommendation model, determine the click rate corresponding to the newly added training sample as a newly added click rate, specifically including: For each training sample, determining the user feature corresponding to the training sample, the recommendation information feature corresponding to the recommendation information, and the environment feature corresponding to the environment data; Combining the user feature, the recommendation information feature corresponding to the recommendation information, and the environment feature corresponding to the environment data to determine a comprehensive feature corresponding to the training sample; For each historical training sample, the comprehensive features corresponding to the historical training sample are input into the preset historical recommendation model to determine the click-through rate of the historical training sample in the historical recommendation model as the first click-through rate, the comprehensive features corresponding to the historical training sample are input into the recommendation model to determine the click-through rate of the historical training sample in the recommendation model as the second click-through rate, and the comprehensive features of the newly added training samples corresponding to the historical training samples are input into the recommendation model to determine the click-through rate corresponding to the newly added training samples as the newly added click-through rate.
5. A method for information recommendation, It is characterized in that include: In response to an information recommendation request from a target user, obtaining user characteristics of the target user; For each candidate recommendation information, input the user features and the candidate recommendation information into a pre-trained recommendation model, predict the click rate of the target user for the candidate recommendation information as the click rate corresponding to the candidate recommendation information, wherein the recommendation model is trained by the method according to any one of claims 1 to 4 above; According to the click rate corresponding to each candidate recommendation information, a recommended merchant to be recommended to the target user is determined as target recommendation information, and the target recommendation information is recommended to the target user.
6. A device for model training, It is characterized in that include: An acquisition module is used to acquire historical training samples and newly added training samples, wherein the training samples contain user features and recommendation information; A determination module is used to input each historical training sample into a preset historical recommendation model, determine the click rate corresponding to the historical training sample in the historical recommendation model as a first click rate, input the historical training sample into the recommendation model, determine the click rate corresponding to the historical training sample in the recommendation model as a second click rate, and input a newly added training sample corresponding to the historical training sample into the recommendation model, determine the click rate corresponding to the newly added training sample as a newly added click rate; a training module, configured to train the recommendation model by minimizing the deviation between the first click rate and the second click rate, and the deviation between the newly added click rate and the label corresponding to the newly added training sample as an optimization goal, wherein the label is used to characterize the actual click situation of the user on the recommended information in the newly added training sample; The recommendation model is trained with minimizing the deviation between the first click rate and the second click rate, and the deviation between the newly added click rate and the label corresponding to the newly added training sample as the optimization goal, specifically including: Taking the deviation between the first click rate and the second click rate as the first deviation, and taking the deviation between the newly added click rate and the label corresponding to the newly added training sample as the second deviation; Determine, according to the number of historical training samples in the historical training samples and the number of newly added training samples in the newly added training samples, a weight corresponding to the first deviation as the first weight, wherein the more the number of newly added training samples in the newly added training samples is compared to the number of historical training samples in the historical training samples, the smaller the first weight; Determine, according to the number of business objects in the historical training sample and the number of business objects in the newly added training sample, a weight corresponding to the first deviation as the second weight, wherein the greater the number of business objects in the newly added training sample compared to the number of business objects in the historical training sample, the smaller the second weight; The recommendation model is trained according to the first deviation, the second deviation, the first weight, and the second weight.
7. A device for recommending information, It is characterized in that include: An acquisition module, configured to acquire user characteristics of a target user in response to an information recommendation request of the target user; A prediction module, for each candidate recommendation information, inputting the user features and the candidate recommendation information into a pre-trained recommendation model, predicting the click rate of the target user for the candidate recommendation information as the click rate corresponding to the candidate recommendation information, wherein the recommendation model is trained by the method according to any one of claims 1 to 4 above; The recommendation module is used to determine the recommended merchants to be recommended to the target user as target recommendation information according to the click-through rate corresponding to each candidate recommendation information, and recommend the target recommendation information to the target user.
8. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1 to 4 or 5 is implemented.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the method described in any one of claims 1 to 4 or 5 is implemented.
Citation Information
Patent Citations
Recommendation method and device based on artificial intelligence, electronic equipment and storage medium
CN111291266A
Method and system for recommending content
CN111382346A
Meta-learning-based domain increment method
CN112308211A
Recommendation model training method and selection probability prediction method and device
CN112487278A
Voice recognition method and device thereof
CN113674745A
