A method and device for model training

By obtaining positive and negative samples, determining feature vectors and using similarity and contrast loss to optimize the target, the rough ranking model is trained, which solves the problem that existing technology cannot effectively capture feature dependencies in the field of information recommendation, and improves the rough ranking model extraction capabilities and recommendation accuracy.

CN114528931BActive Publication Date: 2025-01-24BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210138025.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-15
Publication Date
2025-01-24
Estimated Expiration
2042-02-15

Smart Images

  • Figure CN114528931B_ABST
    Figure CN114528931B_ABST
Patent Text Reader

Abstract

The present specification discloses a method and device for model training, which uses a coarse-rank model to screen out target samples from each initial training sample, and determines positive samples and negative samples from the target samples according to the screening results of the fine-rank model for the target samples, so as to train the coarse-rank model with the similarity between the fine-rank feature vector corresponding to the positive sample and the coarse-rank feature vector as the training target, compared with the similarity between the coarse-rank feature vector corresponding to the positive sample and the coarse-rank feature vector corresponding to any negative sample, so that the coarse-rank model can learn the dependency between each dimension of the fine-rank feature vector output by the fine-rank model during the training process while learning the capabilities of the fine-rank model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for model training. Background Art

[0002] In the homepage search module of each website and application (Application, APP), the homepage search function is usually divided into four stages: recall, coarse sorting, fine sorting, and re-ranking. Among them, the coarse sorting model is used to screen out hundreds of options that best match the search request from the thousands of options recalled in the recall stage, and input them into the subsequent fine sorting model for further screening and sorting. The coarse sorting model has similar functions to the fine sorting model, but the fine sorting model is more complex and the results are more accurate. Therefore, the output of the fine sorting model can be used as a supervisory signal to assist the training of the coarse sorting model, so that the output of the coarse sorting model with a simpler structure is closer to the output of the fine sorting model, thereby optimizing the coarse sorting model.

[0003] In the prior art, a knowledge distillation scheme is usually adopted, in which the refined ranking model is used as the large model and the coarse ranking model is used as the small model. The information of the refined ranking model is distilled into the coarse ranking model by minimizing the KL divergence of the output results of the coarse and refined ranking models. However, since the KL divergence adopted in the knowledge distillation scheme assumes that each dimension in the representation is independent, and the data in the field of information recommendation is usually highly structured, the existing knowledge distillation scheme cannot effectively capture the cross-dependencies between the features contained in the structured data in the field of information recommendation.

[0004] Therefore, if the coarse-grained model can learn the output of the fine-grained model more effectively, it will be of great help to the training of the coarse-grained model. Summary of the invention

[0005] This specification provides a model training method and 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 each positive sample and each negative sample, wherein the positive sample is screened out based on the predicted click-through rate corresponding to each target sample determined based on a preset fine ranking model, and the negative sample is other samples among the target samples except the positive sample, and each target sample is screened out based on the predicted click-through rate corresponding to each initial training sample determined based on the rough ranking model after each initial training sample is input into a preset rough ranking model;

[0009] For each positive sample, determine the feature vector determined by the coarse-ranking model for the positive sample as the coarse-ranking feature vector corresponding to the positive sample, and determine the feature vector determined by the fine-ranking model for the positive sample as the fine-ranking feature vector corresponding to the positive sample, and for each negative sample, determine the feature vector determined by the coarse-ranking model for the negative sample as the coarse-ranking feature vector corresponding to the negative sample;

[0010] The coarse-ordered model is trained with the similarity between the fine-ordered feature vector corresponding to the positive sample and the coarse-ordered feature vector corresponding to the positive sample being greater than the similarity between the coarse-ordered feature vector corresponding to the positive sample and the coarse-ordered feature vector corresponding to any negative sample as the optimization goal.

[0011] Optionally, the optimization target is the larger the similarity between the fine-ranked feature vector corresponding to the positive sample and the coarse-ranked feature vector corresponding to the positive sample is than the similarity between the coarse-ranked feature vector corresponding to the positive sample and the coarse-ranked feature vector corresponding to any negative sample, specifically including:

[0012] Determine the contrast loss according to the similarity between the fine-order feature vector corresponding to the positive sample and the coarse-order feature vector corresponding to the positive sample, and the similarity between the coarse-order feature vector corresponding to the positive sample and any coarse-order feature vector corresponding to the negative sample, wherein the greater the similarity between the fine-order feature vector corresponding to the positive sample and the coarse-order feature vector corresponding to the positive sample than the similarity between the coarse-order feature vector corresponding to the positive sample and any coarse-order feature vector corresponding to the negative sample, the smaller the contrast loss;

[0013] The coarse sorting model is trained with minimizing the contrast loss as the optimization goal.

[0014] Optionally, taking minimizing the contrast loss as the optimization goal, before training the coarse sorting model, the method further includes:

[0015] Determine the mutual information degree corresponding to the positive sample according to the fine-ranked feature vector corresponding to the positive sample and the coarse-ranked feature vector corresponding to the positive sample, wherein the smaller the mutual information degree is, the greater the correlation degree between the fine-ranked feature vector corresponding to the positive sample and the coarse-ranked feature vector corresponding to the positive sample is;

[0016] Taking minimizing the contrast loss as the optimization goal, the coarse sorting model is trained, specifically including:

[0017] The coarse sorting model is trained with the optimization goal of minimizing the contrast loss while the mutual information is not greater than the contrast loss.

[0018] Optionally, the coarse sorting model is trained with minimizing the contrast loss as an optimization goal, specifically including:

[0019] For each negative sample, the pairwise loss corresponding to the positive sample is determined according to the predicted click-through rate corresponding to the positive sample and the predicted click-through rate corresponding to the negative sample determined by the coarse ranking model, wherein if the predicted click-through rate corresponding to the positive sample is larger than the predicted click-through rate corresponding to the negative sample, the pairwise loss corresponding to the positive sample is smaller;

[0020] Determining a loss and a value based on the pairwise loss and the contrast loss;

[0021] The coarse-grained model is trained with minimizing the loss and value as the optimization goal.

[0022] This specification provides a method for information recommendation, including:

[0023] Responding to the user's information recommendation request, obtaining each candidate recommendation information;

[0024] For each candidate recommendation information, the candidate recommendation information is input into a pre-trained rough ranking model to determine the predicted click rate corresponding to the candidate recommendation information through the rough ranking model, wherein the rough ranking model is trained by the above-mentioned model training method;

[0025] According to the predicted click rate corresponding to each candidate recommendation information, the target recommendation information recommended to the user is determined, and the target recommendation information is sent to the user.

[0026] Optionally, determining the target recommendation information to be recommended to the user according to the predicted click-through rate corresponding to each candidate recommendation information specifically includes:

[0027] Screening out each preliminary screening recommendation information from each candidate recommendation information according to the predicted click rate corresponding to each candidate recommendation information;

[0028] For each preliminary screening recommendation information, the preliminary screening recommendation information is input into a preset refined ranking model, so as to determine the predicted click rate corresponding to the preliminary screening recommendation information through the refined ranking model;

[0029] According to the predicted click-through rate corresponding to each piece of initially screened recommended information, the target recommended information recommended to the user is determined.

[0030] This specification provides a model training device, including:

[0031] An acquisition module, used to acquire each positive sample and each negative sample, wherein the positive sample is screened out based on the predicted click-through rate corresponding to each target sample determined by a preset fine ranking model, and the negative sample is other samples among the target samples except the positive sample, and each target sample is screened out based on the predicted click-through rate corresponding to each initial training sample determined by the preset coarse ranking model after each initial training sample is input into the preset coarse ranking model;

[0032] A determination module, used to determine the feature vector determined by the coarse-ranking model for the positive sample as the coarse-ranking feature vector corresponding to the positive sample, determine the feature vector determined by the fine-ranking model for the positive sample as the fine-ranking feature vector corresponding to the positive sample, and for each negative sample, determine the feature vector determined by the coarse-ranking model for the negative sample as the coarse-ranking feature vector corresponding to the negative sample;

[0033] The execution module is used to train the coarse-ordered model with the similarity between the fine-ordered feature vector corresponding to the positive sample and the coarse-ordered feature vector corresponding to the positive sample being greater than the similarity between the coarse-ordered feature vector corresponding to the positive sample and the coarse-ordered feature vector corresponding to any negative sample as the optimization target.

[0034] This specification provides an information recommendation device, including:

[0035] An acquisition module, used to respond to a user's information recommendation request and acquire each candidate recommendation information;

[0036] A prediction module is used to input each candidate recommendation information into a pre-trained rough ranking model to determine the predicted click rate corresponding to the candidate recommendation information through the rough ranking model, wherein the rough ranking model is trained by the above-mentioned model training method;

[0037] The recommendation module is used to determine the target recommendation information to be recommended to the user according to the predicted click-through rate corresponding to each candidate recommendation information, and send the target recommendation information to the user.

[0038] This specification provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the above-mentioned model training method is implemented.

[0039] 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 when executing the program.

[0040] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:

[0041] In the model training method provided in the present specification, firstly, each positive sample and each negative sample are obtained, wherein the positive sample is screened out based on the predicted click-through rate corresponding to each target sample determined by a preset fine ranking model, and the negative sample is other samples in each target sample except the positive sample, and each target sample is screened out based on the predicted click-through rate corresponding to each initial training sample determined by the coarse ranking model after each initial training sample is input into a preset coarse ranking model, and then, for each positive sample, a feature vector determined by the coarse ranking model for the positive sample is determined as the coarse ranking feature vector corresponding to the positive sample, and a feature vector determined by the fine ranking model for the positive sample is determined as the fine ranking feature vector corresponding to the positive sample, and for each negative sample, a feature vector determined by the coarse ranking model for the negative sample is determined as the coarse ranking feature vector corresponding to the negative sample, and the coarse ranking model is trained with the similarity between the fine ranking feature vector corresponding to the positive sample and the coarse ranking feature vector corresponding to the positive sample being greater than the similarity between the coarse ranking feature vector corresponding to the positive sample and the coarse ranking feature vector corresponding to any negative sample as the optimization target.

[0042] It can be seen from the above method that in the process of continuously improving the similarity between the coarse ranking feature vector output by the coarse ranking model for the positive sample and the fine ranking feature vector output by the fine ranking model for the positive sample, the coarse ranking model can learn the dependency relationship between each dimension of the fine ranking feature vector output by the fine ranking model during the training process. In this way, when the coarse ranking model is deployed in actual application, it can more accurately extract the features of each recommended information, and then recommend more accurate information to users. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] 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:

[0044] Figure 1 A flowchart of a model training method provided in this specification;

[0045] Figure 2 A flowchart of a method for recommending a method for providing information in this specification;

[0046] Figure 3 A schematic diagram of a model training device provided in this specification;

[0047] Figure 4 A schematic diagram of a device recommended for providing information in this specification;

[0048] Figure 5A method corresponding to the Figure 1 Schematic diagram of an electronic device. DETAILED DESCRIPTION

[0049] 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.

[0050] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.

[0051] Figure 1 A flow chart of a model training method provided in this specification includes the following steps:

[0052] S101: Obtain each positive sample and each negative sample, wherein the positive sample is screened out based on the predicted click rate corresponding to each target sample determined based on a preset fine ranking model, and the negative sample is other samples among the target samples except the positive sample, and each target sample is screened out based on the predicted click rate corresponding to each initial training sample determined based on the coarse ranking model after each initial training sample is input into a preset coarse ranking model.

[0053] In the search module of each website or application (Application, APP), the search function is usually divided into four stages, namely, recall, rough sorting, fine sorting, and re-ranking. Among them, the rough sorting model in the rough sorting stage can screen out hundreds of candidate recommendation information from thousands of candidate recommendation information recalled in the recall stage according to the information recommendation request sent by the user, and input them into the fine sorting model after sorting, so as to realize the response of the rough sorting model to the user's information recommendation request. Before this, the rough sorting model needs to be trained before the above function can be realized. Therefore, it is necessary to select each initial training sample first, and train the model through each initial training sample. For example: Assuming that the rough sorting model in the search module of the food delivery platform needs to be trained, the merchant information recalled in the recall stage that meets the historical information recommendation request sent by the user can be selected as each initial training sample, and the rough sorting model can be trained through each initial training sample.

[0054] Furthermore, each initial training sample is input into the coarse ranking model, and for each initial training sample, the predicted click-through rate corresponding to the initial training sample is predicted by the coarse ranking model, so that each initial training sample is sorted according to the size of the predicted click-through rate corresponding to each initial training sample, and then the initial training samples with probability values ​​higher than the first preset threshold are screened out as target samples.

[0055] In this manual, in order to better train the coarse-ranking model and make the trained model have better generalization ability, it is also necessary to divide each target sample into positive samples and negative samples, and use the differences between positive samples and negative samples to enable the coarse-ranking model to better learn the output results of the fine-ranking model by comparing positive samples with negative samples.

[0056] Among them, the positive samples are determined by inputting each target sample into the refined ranking model, and based on the predicted click-through rate corresponding to each target sample output by the refined ranking model, screening out each target sample with a click-through rate higher than a second preset threshold as a positive sample, and taking other samples in each target sample except the positive samples as negative samples.

[0057] It can be understood that the target samples selected by the coarse ranking model from the initial training samples are input to the fine ranking model, and the fine ranking model selects positive samples from the target samples, and then the target samples selected by the fine ranking model from the target samples are taken as negative samples. In other words, positive samples can be understood as samples selected by both the coarse ranking model and the fine ranking model, while negative samples are samples selected by the coarse ranking model but not by the fine ranking model.

[0058] In this specification, the execution entity of the method for implementing model training may refer to a designated device such as a server set up on a business platform, or may refer to a designated device such as a desktop computer or a laptop computer. For the sake of ease of description, the following only takes the server as the execution entity as an example to illustrate the training method of the sorting model provided in this specification.

[0059] S102: For each positive sample, determine the feature vector determined by the coarse-ranking model for the positive sample as the coarse-ranking feature vector corresponding to the positive sample, and determine the feature vector determined by the fine-ranking model for the positive sample as the fine-ranking feature vector corresponding to the positive sample, and for each negative sample, determine the feature vector determined by the coarse-ranking model for the negative sample as the coarse-ranking feature vector corresponding to the negative sample.

[0060] In practical applications, since the coarse ranking model and the fine ranking model first encode and generate the feature vector corresponding to each input training sample, and then predict the predicted click-through rate corresponding to the training sample based on the feature vector corresponding to each training sample, and finally screen the training samples based on the predicted click-through rate, in order to enable the coarse ranking model to better learn the capabilities of the fine ranking model and reduce the difference between the output results of the coarse ranking model and the output results of the fine ranking model to a certain extent, it is necessary to let the coarse ranking model learn the feature vector of the positive sample output by the fine ranking, so that the feature vector corresponding to the positive sample output by the coarse ranking model can be consistent or approximate to the feature vector corresponding to the positive sample output by the fine ranking model.

[0061] In addition, since the data in the field of information recommendation are usually highly structured, that is, each dimensional feature corresponding to the data in the field of information recommendation has a high degree of dependency, and each dimensional feature has a complex cross-correlation relationship, therefore, in the above content, the server can enable the coarse ranking model to learn the dependency between each dimensional feature in the fine ranking feature vector output by the fine ranking model during the training process by continuously improving the overall similarity between the fine ranking feature vector corresponding to the positive sample and the coarse ranking feature vector corresponding to the positive sample.

[0062] In addition, the server can further improve the feature extraction capability of the coarse-sequence model by comparing the coarse-sequence feature vector corresponding to the positive sample with the coarse-sequence feature vector corresponding to each negative sample. In other words, incorporating the coarse-sequence feature vector corresponding to the negative sample into the entire training process actually enables the coarse-sequence model to better learn the difference between positive and negative samples, that is, to better learn the ability of the fine-sequence model to distinguish between positive and negative samples.

[0063] Specifically, the server can determine, for each positive sample, the feature vector output by the coarse-ranking model for the positive sample as the coarse-ranking feature vector corresponding to the positive sample, and determine the feature vector output by the fine-ranking model for the positive sample as the fine-ranking feature vector corresponding to the positive sample, and for each negative sample, determine the feature vector output by the coarse-ranking model for the negative sample as the coarse-ranking feature vector corresponding to the negative sample, so that the coarse-ranking model can be subsequently trained according to the determined fine-ranking feature vectors and coarse-ranking feature vectors corresponding to each positive sample and the coarse-ranking feature vector corresponding to each negative sample.

[0064] S103: The coarse-ordered model is trained with the similarity between the fine-ordered feature vector corresponding to the positive sample and the coarse-ordered feature vector corresponding to the positive sample being greater than the similarity between the coarse-ordered feature vector corresponding to the positive sample and the coarse-ordered feature vector corresponding to any negative sample as an optimization target.

[0065] After determining the fine-ranked feature vector and the coarse-ranked feature vector corresponding to each positive sample, and the coarse-ranked feature vector corresponding to each negative sample, the server can, for each positive sample, train the coarse-ranked model according to the similarity between the fine-ranked feature vector and the coarse-ranked feature vector corresponding to the positive sample, with the greater the similarity between the coarse-ranked feature vector corresponding to the positive sample and the coarse-ranked feature vector corresponding to any negative sample as the optimization goal, so that the coarse-ranked model can learn the output results of the fine-ranked model for the positive samples, and further enable the coarse-ranked model to output results that are similar to or consistent with the results output by the fine-ranked model.

[0066] Specifically, for each positive sample, the server can combine the fine-ranked feature vector and the coarse-ranked feature vector corresponding to the positive sample into a positive example pair, and combine the coarse-ranked feature vector corresponding to the positive sample and the coarse-ranked feature vector corresponding to any negative sample into a negative example pair, and further determine the similarity between the two feature vectors included in the positive example pair, as well as the similarity between the two feature vectors included in each negative example pair.

[0067] There are many methods for determining the similarity between two feature vectors included in a positive pair or a negative pair, which are not limited in this specification. For example, the vector dot product of the two feature vectors included in the positive pair or the negative pair is calculated, and the corresponding similarity is determined based on the calculated vector dot product. Another example is: by calculating the cosine value corresponding to the angle between the two feature vectors included in the positive pair or the negative pair, the higher the similarity between the two feature vectors is determined.

[0068] In this specification, the server can also determine the contrast loss between the coarse-ordered model and the fine-ordered model for each positive sample according to the similarity between the fine-ordered feature vector corresponding to the positive sample and the coarse-ordered feature vector corresponding to the positive sample, and the similarity between the coarse-ordered feature vector corresponding to the positive sample and the coarse-ordered feature vector corresponding to any negative sample. The smaller the determined contrast loss is, the greater the similarity between the fine-ordered feature vector and the coarse-ordered feature vector corresponding to the positive sample is compared to the similarity between the coarse-ordered feature vector corresponding to the positive sample and the coarse-ordered feature vector corresponding to any negative sample. Therefore, the server can train the coarse-ordered model with minimizing the contrast loss as the optimization goal, wherein the calculation method of the contrast loss can refer to the following formula:

[0069]

[0070] In the above formula, Q refers to the historical information recommendation request set, q refers to the historical information recommendation request of a user in the data set, {(x0,y0)|y0=1} represents the positive sample under the historical information recommendation request, {(x1,y1),(x2,y2),…,(x k,y k )|y 1,2,…,k =0} represents the K negative samples corresponding to the historical information recommendation request, is the coarse feature vector corresponding to the training sample x0, is the refined feature vector corresponding to the training sample x0, Represents the vector dot product of the coarse-ranked feature vector and the fine-ranked feature vector corresponding to the positive sample x0.

[0071] It can be seen from the above formula that the higher the similarity between the coarse-sequence feature vector and the fine-sequence feature vector corresponding to the positive sample x0, the larger the vector dot product between the coarse-sequence feature vector and the fine-sequence feature vector corresponding to the positive sample x0, and the larger the vector dot product between the coarse-sequence feature vector and the fine-sequence feature vector corresponding to the positive sample x0 compared to the vector dot product between the coarse-sequence feature vector corresponding to the positive sample x0 and the coarse-sequence feature vector corresponding to each negative sample, the corresponding loss L CKT The smaller.

[0072] Further, from the analysis of the above content, it can be seen that minimizing the contrast loss can essentially be understood as maximizing the consistency between the coarse and fine feature vectors corresponding to the positive sample, and the mutual information is used to characterize the mutual dependence between the two feature vectors (mutual information is the relative entropy between the two feature vectors. The higher the mutual information between the two feature vectors, the lower the uncertainty of the other feature vector after one feature vector is determined. It can be understood that after one feature vector is determined, the other feature vector can basically be determined). The greater the mutual information between the two feature vectors, the higher the degree of dependence between the two feature vectors. Therefore, maximizing the similarity between the coarse and fine feature vectors corresponding to the positive sample can be equivalent to maximizing the mutual information between the coarse and fine feature vectors corresponding to the positive sample. Accordingly, the mutual information between the coarse and fine feature vectors corresponding to the positive sample can be used as the lower bound of the contrast loss to train the coarse model. For details, please refer to the following formula:

[0073]

[0074] In the above formula, represents the mutual information between the coarse and fine feature vectors corresponding to the positive sample x0, It represents the mutual information between the coarse-ordered feature vector and the fine-ordered feature vector corresponding to the positive sample x0, where the greater the mutual information between the coarse-ordered feature vector and the fine-ordered feature vector corresponding to the positive sample x0, the smaller the mutual information between the coarse-ordered feature vector and the fine-ordered feature vector corresponding to the positive sample x0, and N is a natural number.

[0075] It can be seen from the above formula that when minimizing the mutual information between the coarse-ordered feature vector and the fine-ordered feature vector corresponding to the positive sample x0, the greater the mutual information corresponding to the positive sample x0, the smaller the lower bound of the contrast loss between the coarse-ordered feature vector and the fine-ordered feature vector corresponding to the positive sample x0. Therefore, the server can train the coarse-ordered model with the mutual information not greater than the contrast loss as the optimization goal while minimizing the contrast loss. In this way, after completing the training of the coarse-ordered model, for the same training sample, the feature vector extracted by the coarse-ordered model and the feature vector extracted by the fine-ordered model can be as close as possible.

[0076] In this specification, in order to enable the coarse-ranking model to obtain better training results, on the basis of minimizing the contrast loss as the training goal, the server can also determine the pairwise loss (Pairwise loss) corresponding to the positive sample for each negative sample according to the predicted click-through rate corresponding to the positive sample determined by the coarse-ranking model and the predicted click-through rate corresponding to the negative sample, wherein, if the predicted click-through rate corresponding to the positive sample is larger than the predicted click-through rate corresponding to the negative sample, the pairwise loss corresponding to the positive sample is smaller, and the calculation method of the pairwise loss can refer to the following formula:

[0077]

[0078] In the above formula, L pair is the pairwise loss, σ is a hyperparameter, si is the predicted click rate corresponding to the positive sample, sj is the predicted click rate corresponding to the negative sample. It can be seen from the above formula that the larger the predicted click rate corresponding to the positive sample is compared with the predicted click rate corresponding to the negative sample, the smaller the pairwise loss corresponding to the positive sample is.

[0079] Furthermore, since the pairwise loss is the loss calculated for one positive sample and one negative sample, and the contrastive loss is the loss calculated for one positive sample and multiple negative samples, the server can determine the loss and value based on the pairwise loss and the contrastive loss, and minimize the loss and value as the optimization goal to train the coarse-grained model. For details, please refer to the following formula:

[0080] L=λL pair +(1-λ)L CKT

[0081] In the above formula, λ is a hyperparameter used to balance the two losses, L pair is the pairwise loss, L CKT is the comparison loss, L is the loss and value. By training the coarse-ranking model with minimizing the loss and value as the optimization goal, the coarse-ranking model can learn the output results of the fine-ranking model more comprehensively, thereby enabling the coarse-ranking model to achieve better training results.

[0082] From the above content, it can be seen that the server can filter out target samples from each initial training sample through the coarse-ranking model, and determine positive samples and negative samples from the target samples according to the screening results of the fine-ranking model for the target samples, so as to train the coarse-ranking model with the similarity between the fine-ranking feature vector corresponding to the positive sample and the coarse-ranking feature vector as the training target, and then optimize the performance of the coarse-ranking model so that the coarse-ranking model can output a result that is similar to or the same as the result output by the fine-ranking model for the same positive sample.

[0083] It should be noted that all actions of acquiring signals, information or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where they are located, and with the authorization given by the owner of the corresponding device.

[0084] In order to further explain this specification, the following describes in detail the method for recommending information using the rough ranking model trained by the above method. Figure 2 shown.

[0085] Figure 2 A flowchart of a method for recommending information provided in this specification includes the following steps:

[0086] S201: Responding to a user's information recommendation request, obtaining each candidate recommendation information.

[0087] In this specification, the server can respond to the user's information recommendation request and recall each candidate recommendation information according to the information recommendation request sent by the user through the recall model corresponding to the recall stage. For example, when the user sends an information recommendation request for recommending a movie in the application (Application, App) provided by the video service platform, the server can use the recall model to select information about each movie that may be clicked by the user from a preset database according to the user's information recommendation request as each candidate recommendation information.

[0088] S202: For each candidate recommendation information, the candidate recommendation information is input into a pre-trained rough ranking model to determine the predicted click rate corresponding to the candidate recommendation information through the rough ranking model, wherein the rough ranking model is trained by the above-mentioned model training method.

[0089] S203: Determine the target recommendation information to be recommended to the user according to the predicted click rate corresponding to each candidate recommendation information, and send the target recommendation information to the user

[0090] After obtaining each candidate recommendation information, the server can input each candidate recommendation information into the coarse ranking model trained by the above method, so that the coarse ranking model predicts the predicted click-through rate corresponding to each candidate recommendation information according to the information recommendation request sent by the user, and returns each candidate recommendation information whose predicted click-through rate exceeds a preset threshold. When the server receives each candidate recommendation information returned by the coarse ranking model, it can directly recommend the candidate recommendation information to the user.

[0091] In this specification, the possible deviation between the results output by the coarse ranking model and the fine ranking model for the same candidate recommendation information due to the structural limitations of the coarse ranking model itself is taken into account, that is, the output results of the trained coarse ranking model are only approximate to the output results of the fine ranking model, and cannot be completely consistent.

[0092] Therefore, when the server receives the candidate recommendation information returned by the coarse ranking model, it can also use the candidate recommendation information output by the coarse ranking model as preliminary screening recommendation information, and input each preliminary screening recommendation information into the preset fine ranking model, so that the fine ranking model predicts the predicted click-through rate corresponding to each preliminary screening recommendation information, thereby returning each preliminary screening recommendation information whose predicted click-through rate exceeds the preset threshold as target recommendation information. After receiving the target recommendation information returned by the fine ranking model, the server can recommend each target recommendation information to the user.

[0093] The above is a model training method and an information recommendation method provided in one or more embodiments of this specification. Based on the same idea, this specification also provides a corresponding model training device and an information recommendation device, such as Figure 3 , 4 shown.

[0094] Figure 3 A schematic diagram of a model training device provided in this specification includes:

[0095] The acquisition module 301 is used to acquire each positive sample and each negative sample, wherein the positive sample is selected based on the predicted click-through rate corresponding to each target sample determined by a preset fine ranking model, and the negative sample is other samples among the target samples except the positive sample, and each target sample is selected based on the predicted click-through rate corresponding to each initial training sample determined by the preset coarse ranking model after each initial training sample is input into the preset coarse ranking model;

[0096] A determination module 302 is used to determine the feature vector determined by the coarse-ranking model for the positive sample as the coarse-ranking feature vector corresponding to the positive sample, determine the feature vector determined by the fine-ranking model for the positive sample as the fine-ranking feature vector corresponding to the positive sample, and for each negative sample, determine the feature vector determined by the coarse-ranking model for the negative sample as the coarse-ranking feature vector corresponding to the negative sample;

[0097] The execution module 303 is used to train the coarse-ordered model with the similarity between the fine-ordered feature vector corresponding to the positive sample and the coarse-ordered feature vector corresponding to the positive sample being greater than the similarity between the coarse-ordered feature vector corresponding to the positive sample and the coarse-ordered feature vector corresponding to any negative sample as an optimization target.

[0098] Optionally, the execution module 303 is specifically used to determine the contrast loss based on the similarity between the fine-order feature vector corresponding to the positive sample and the coarse-order feature vector corresponding to the positive sample, and the similarity between the coarse-order feature vector corresponding to the positive sample and the coarse-order feature vector corresponding to any negative sample, wherein if the similarity between the fine-order feature vector corresponding to the positive sample and the coarse-order feature vector corresponding to the positive sample is greater than the similarity between the coarse-order feature vector corresponding to the positive sample and the coarse-order feature vector corresponding to any negative sample, the contrast loss is smaller; and the coarse-order model is trained with minimizing the contrast loss as the optimization goal.

[0099] Optionally, the execution module 303 is specifically used to determine the mutual information corresponding to the positive sample based on the fine-ranked feature vector corresponding to the positive sample and the coarse-ranked feature vector corresponding to the positive sample, wherein the smaller the mutual information is, the greater the correlation between the fine-ranked feature vector corresponding to the positive sample and the coarse-ranked feature vector corresponding to the positive sample is; and the coarse-ranked model is trained with minimizing the contrast loss as the optimization goal, specifically including: training the coarse-ranked model with minimizing the contrast loss while the mutual information is not greater than the contrast loss as the optimization goal.

[0100] Optionally, the execution module 303 is specifically used to determine, for each negative sample, the pairwise loss corresponding to the positive sample based on the predicted click-through rate corresponding to the positive sample and the predicted click-through rate corresponding to the negative sample determined by the coarse-ranking model, wherein the larger the predicted click-through rate corresponding to the positive sample is compared to the predicted click-through rate corresponding to the negative sample, the smaller the pairwise loss corresponding to the positive sample; determine the loss and value based on the pairwise loss and the contrast loss; and train the coarse-ranking model with minimizing the loss and value as the optimization goal.

[0101] Figure 4 A schematic diagram of a device for providing information recommended for this specification, comprising:

[0102] The acquisition module 401 is used to respond to the user's information recommendation request and acquire each candidate recommendation information;

[0103] Prediction module 402, for inputting each candidate recommendation information into a pre-trained rough ranking model, so as to determine the predicted click rate corresponding to the candidate recommendation information through the rough ranking model, wherein the rough ranking model is trained by the above-mentioned model training method;

[0104] The recommendation module 403 is used to determine the target recommendation information to be recommended to the user according to the predicted click-through rate corresponding to each candidate recommendation information, and send the target recommendation information to the user.

[0105] Optionally, the recommendation module 403 is specifically used to screen out each preliminary screening recommendation information from the candidate recommendation information according to the predicted click-through rate corresponding to each candidate recommendation information; for each preliminary screening recommendation information, input the preliminary screening recommendation information into a preset refined ranking model to determine the predicted click-through rate corresponding to the preliminary screening recommendation information through the refined ranking model; and determine the target recommendation information recommended to the user according to the predicted click-through rate corresponding to each preliminary screening recommendation information.

[0106] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 A model training method is provided.

[0107] This manual also provides Figure 5 The one shown corresponds to Figure 1 A schematic diagram of the electronic device. Figure 5 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 described. 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 to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0108] 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.

[0109] 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.

[0110] 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.

[0111] 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.

[0112] 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.) that contain computer-usable program code.

[0113] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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.

[0114] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0115] 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.

[0116] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0117] 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.

[0118] 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.

[0119] 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.

[0120] 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.

[0121] 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.

[0122] 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.

[0123] 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, characterized in that: include: Obtain each positive sample and each negative sample, wherein the positive sample is screened out based on the predicted click-through rate corresponding to each target sample determined based on a preset fine ranking model, and the negative sample is other samples among the target samples except the positive sample, and each target sample is screened out based on the predicted click-through rate corresponding to each initial training sample determined based on the rough ranking model after each initial training sample is input into a preset rough ranking model; For each positive sample, determine the feature vector determined by the coarse-ranking model for the positive sample as the coarse-ranking feature vector corresponding to the positive sample, and determine the feature vector determined by the fine-ranking model for the positive sample as the fine-ranking feature vector corresponding to the positive sample, and for each negative sample, determine the feature vector determined by the coarse-ranking model for the negative sample as the coarse-ranking feature vector corresponding to the negative sample; The coarse-ordered model is trained with the similarity between the fine-ordered feature vector corresponding to the positive sample and the coarse-ordered feature vector corresponding to the positive sample being greater than the similarity between the coarse-ordered feature vector corresponding to the positive sample and the coarse-ordered feature vector corresponding to any negative sample as the optimization goal.

2. The method according to claim 1, characterized in that The optimization goal is to determine the similarity between the fine-ranked feature vector corresponding to the positive sample and the coarse-ranked feature vector corresponding to the positive sample, which is greater than the similarity between the coarse-ranked feature vector corresponding to the positive sample and the coarse-ranked feature vector corresponding to any negative sample. Specifically, the optimization goal includes: Determine the contrast loss according to the similarity between the fine-order feature vector corresponding to the positive sample and the coarse-order feature vector corresponding to the positive sample, and the similarity between the coarse-order feature vector corresponding to the positive sample and any coarse-order feature vector corresponding to the negative sample, wherein the greater the similarity between the fine-order feature vector corresponding to the positive sample and the coarse-order feature vector corresponding to the positive sample than the similarity between the coarse-order feature vector corresponding to the positive sample and any coarse-order feature vector corresponding to the negative sample, the smaller the contrast loss; The coarse-sequence model is trained with minimizing the contrast loss as the optimization goal.

3. The method according to claim 2, characterized in that Taking minimizing the contrast loss as the optimization goal, before training the coarse sorting model, the method further includes: Determine the mutual information degree corresponding to the positive sample according to the fine-ranked feature vector corresponding to the positive sample and the coarse-ranked feature vector corresponding to the positive sample, wherein the smaller the mutual information degree is, the greater the correlation degree between the fine-ranked feature vector corresponding to the positive sample and the coarse-ranked feature vector corresponding to the positive sample is; Taking minimizing the contrast loss as the optimization goal, the coarse sorting model is trained, specifically including: The coarse sorting model is trained with the optimization goal of minimizing the contrast loss while the mutual information is not greater than the contrast loss.

4. The method according to claim 2, characterized in that Taking minimizing the contrast loss as the optimization goal, the coarse sorting model is trained, specifically including: For each negative sample, the pairwise loss corresponding to the positive sample is determined according to the predicted click-through rate corresponding to the positive sample and the predicted click-through rate corresponding to the negative sample determined by the coarse ranking model, wherein if the predicted click-through rate corresponding to the positive sample is larger than the predicted click-through rate corresponding to the negative sample, the pairwise loss corresponding to the positive sample is smaller; Determining a loss and a value based on the pairwise loss and the contrast loss; The coarse-grained model is trained with minimizing the loss and value as the optimization goal.

5. A method for information recommendation, characterized in that: include: Responding to the user's information recommendation request, obtaining each candidate recommendation information; For each candidate recommendation information, the candidate recommendation information is input into a pre-trained rough ranking model to determine the predicted click rate corresponding to the candidate recommendation information through the rough ranking model, wherein the rough ranking model is trained by the method according to any one of claims 1 to 4 above; According to the predicted click rate corresponding to each candidate recommendation information, the target recommendation information recommended to the user is determined, and the target recommendation information is sent to the user.

6. The method according to claim 5, characterized in that Determining the target recommendation information recommended to the user according to the predicted click-through rate corresponding to each candidate recommendation information specifically includes: Screening out each preliminary screening recommendation information from each candidate recommendation information according to the predicted click rate corresponding to each candidate recommendation information; For each preliminary screening recommendation information, the preliminary screening recommendation information is input into a preset refined ranking model, so as to determine the predicted click rate corresponding to the preliminary screening recommendation information through the refined ranking model; According to the predicted click-through rate corresponding to each piece of initially screened recommended information, the target recommended information recommended to the user is determined.

7. A model training device, characterized in that: include: An acquisition module, used to acquire each positive sample and each negative sample, wherein the positive sample is screened out based on the predicted click-through rate corresponding to each target sample determined by a preset fine ranking model, and the negative sample is other samples among the target samples except the positive sample, and each target sample is screened out based on the predicted click-through rate corresponding to each initial training sample determined by the preset coarse ranking model after each initial training sample is input into the preset coarse ranking model; A determination module, used to determine the feature vector determined by the coarse-ranking model for the positive sample as the coarse-ranking feature vector corresponding to the positive sample, determine the feature vector determined by the fine-ranking model for the positive sample as the fine-ranking feature vector corresponding to the positive sample, and for each negative sample, determine the feature vector determined by the coarse-ranking model for the negative sample as the coarse-ranking feature vector corresponding to the negative sample; The execution module is used to train the coarse-ordered model with the similarity between the fine-ordered feature vector corresponding to the positive sample and the coarse-ordered feature vector corresponding to the positive sample being greater than the similarity between the coarse-ordered feature vector corresponding to the positive sample and the coarse-ordered feature vector corresponding to any negative sample as the optimization target.

8. An information recommendation device, characterized in that: include: An acquisition module, used to respond to a user's information recommendation request and acquire each candidate recommendation information; A prediction module, for inputting each candidate recommendation information into a pre-trained rough ranking model, so as to determine the predicted click rate corresponding to the candidate recommendation information through the rough ranking model, wherein the rough ranking model is trained by the method according to any one of claims 1 to 4 above; The recommendation module is used to determine the target recommendation information to be recommended to the user according to the predicted click-through rate corresponding to each candidate recommendation information, and send the target recommendation information to the user.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Multi-granularity answer sorting multi-document machine reading understanding method

    CN110647629A

  • Information recommendation method and device, server and computer readable storage medium

    CN112883265A