Method and device for training user behavior prediction model

By setting delayed state labels and weighted losses for the samples of the user behavior prediction model, the problem of label inaccuracies caused by delay in the user behavior prediction model is solved, the prediction accuracy and conversion rate are improved, and it is suitable for various sample streams.

CN118798953APending Publication Date: 2024-10-18ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410798704.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

The user behavior prediction model leads to inaccurate labels due to the delay of user-specific behavior, which affects the prediction accuracy, especially the problem of positive samples being incorrectly labeled as negative samples.

Method used

By setting two labels for each sample in the sample set, its delay state category is determined, and the comprehensive prediction loss is weighted according to the category, and the model parameters are adjusted to distinguish the importance of samples in different delay states.

Benefits of technology

It improves the accuracy of user behavior prediction, maximizes user conversion rate, and is suitable for any form of sample flow, providing a universal solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118798953A_ABST
    Figure CN118798953A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method and device for training a user behavior prediction model, in the training method, a sample set generated in a streaming mode is obtained, and any sample comprises a sample feature, a first label and a second label. And inputting the sample features of each sample into a user behavior prediction model to obtain a prediction result of whether the corresponding user makes a specific behavior. And according to the prediction result of each sample and the first label value, determining each corresponding prediction loss. And according to the first label value and the second label value of each sample, determining a sample category of the indication delay state to which each sample belongs, and based on the sample category, determining a weight value of each sample. And based on the weight value of each sample, performing weighted integration on each prediction loss corresponding to each sample, and adjusting parameters of the user behavior prediction model based on the obtained integrated loss.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the field of computer technology, and more particularly, to a method and apparatus for training a user behavior prediction model. Background Art

[0002] Service platforms usually recommend or push target objects such as user rights, products or advertising images to users. In order to effectively recommend target objects that meet users' needs and preferences, service platforms can use machine learning models to predict user behavior, that is, predict whether a user will take a specific action on a target object, and then determine whether to recommend a target object to a user based on the prediction results.

[0003] In most cases, in order to further improve the accuracy of predictions, the latest data generated in a short period of time is used to update (or train) the machine learning model. However, the time interval between the time when the user performs a specific behavior and the exposure time of the target object is uncertain. For example, it may be 1 minute, 1 hour, or even several days. In other words, there is a delay in the specific behavior performed by the user. This delay will cause the collected data used to update the model to be inaccurately labeled. For example, due to the delay in the user's specific behavior, some positive samples are mistakenly labeled as negative samples (hereinafter referred to as the positive sample delayed feedback problem), which will affect the accuracy of the machine learning model's prediction of user behavior.

[0004] Therefore, it is necessary to provide a solution that can effectively improve the accuracy of user behavior prediction. Summary of the invention

[0005] One or more embodiments of this specification describe a method and device for training a user behavior prediction model, which can improve the accuracy of user behavior prediction.

[0006] In a first aspect, a method for training a user behavior prediction model is provided, comprising:

[0007] Obtain a sample set generated by streaming, wherein any sample includes a sample feature, a first label, and a second label; the first label indicates whether the corresponding user has currently performed a specific behavior on the target object, and the second label indicates whether the specific behavior of the corresponding user is within a first time period from when the target object is exposed to the user;

[0008] Input the sample features of each sample into the user behavior prediction model to obtain the prediction result of whether the corresponding user performs a specific behavior;

[0009] Determine corresponding prediction losses according to the prediction results of each sample and the first label value;

[0010] Determine, according to the first label value and the second label value of each sample, a sample category indicating a delay state to which each sample belongs, and determine, based on the sample category, a weight value of each sample;

[0011] Based on the weight values ​​of the samples, the prediction losses corresponding to the samples are weighted and integrated, and the parameters of the user behavior prediction model are adjusted based on the obtained integrated loss.

[0012] In a second aspect, a device for training a user behavior prediction model is provided, comprising:

[0013] An acquisition unit is used to acquire a sample set generated by streaming, wherein any sample includes a sample feature, a first label and a second label; the first label indicates whether the corresponding user has currently performed a specific behavior on the target object, and the second label indicates whether the specific behavior of the corresponding user is within a first time period from when the target object is exposed to the user;

[0014] An input unit, used to input the sample features of each sample into the user behavior prediction model to obtain a prediction result of whether the corresponding user performs a specific behavior;

[0015] A determination unit, configured to determine corresponding prediction losses according to the prediction results of the samples and the first label value;

[0016] The determining unit is further configured to determine, according to the first label value and the second label value of each sample, a sample category indicating a delay state to which each sample belongs, and determine a weight value of each sample based on the sample category;

[0017] An adjustment unit is used to perform weighted synthesis of the prediction losses corresponding to the samples based on the weight values ​​of the samples, and adjust the parameters of the user behavior prediction model based on the obtained comprehensive losses.

[0018] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method of the first aspect.

[0019] In a fourth aspect, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method of the first aspect is implemented.

[0020] The method and device for training a user behavior prediction model provided by one or more embodiments of this specification first proposes to set two labels for each sample in the sample set, so that the sample category indicating the delay state to which each sample belongs can be determined. Secondly, it is proposed to perform weighted synthesis of the corresponding prediction losses according to the sample category of each sample, thereby achieving different importance considerations for samples with different delay states during the training process, which helps to improve the accuracy of user behavior prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0022] Figure 1 A schematic diagram of an implementation scenario of an embodiment disclosed in this specification;

[0023] Figure 2 A flow chart showing a method for training a user behavior prediction model according to one embodiment is shown;

[0024] Figure 3 A schematic diagram of a sample set in one example is shown;

[0025] Figure 4 A schematic diagram of a sample set in another example is shown;

[0026] Figure 5 A schematic diagram of a device for training a user behavior prediction model according to an embodiment is shown. DETAILED DESCRIPTION

[0027] The solution provided in this specification is described below in conjunction with the accompanying drawings.

[0028] In this specification, the sample set consisting of the latest data generated in real time is called a sample stream, and the machine learning model updated according to the sample stream built based on user behavior is called a user behavior prediction model.

[0029] It should be understood that each sample in the ideal sample stream only appears once, and the label of the sample can be accurately known. However, due to the existence of the delayed feedback problem of positive samples, there will inevitably be sample duplication and label errors in the actual sample stream. The difference in the distribution of the ideal sample stream and the actual sample stream can be corrected by importance sampling.

[0030] The general method of importance sampling is described below.

[0031] Use (x, y) to represent the data point, where x is the feature and y is the label. The ideal data distribution is p(x, y), and the actual data distribution is q(x, y). Use f θ (x) represents the probability that the model predicts that sample x is a conversion sample (i.e., the user performs a characteristic behavior). θ (x)) represents the loss function. The ideal loss function L idea The loss function L can be modified by importance weights iw estimate:

[0032]

[0033] It should be noted that the premise of the approximate equality in Formula 1 is: assuming that p(x)≈q(x). In addition, in Formula 1, is the importance weight of the sample.

[0034] It should be noted that by constructing different sample streams, the importance weights can be calculated for positive samples (i.e., users have taken specific actions) and negative samples (i.e., users have not taken specific actions). By bringing the importance weights back into the above formula, we can obtain the loss function L modified based on the importance weights: iw .

[0035] Here are several methods for calculating importance weights for positive and negative samples:

[0036] The first one is a computational method applicable to the sample flow constructed by the ESDFM method.

[0037] In the ESDFM method, a waiting time window is set, that is, for negative samples generated in real time, a waiting time window is set so that the negative samples wait for the generation of positive samples (that is, wait for specific user behaviors). Within the waiting time window, if a positive sample is received, the negative sample is replaced by the received positive sample and sent to the downstream for processing; if no positive sample is received, the negative sample is directly sent to the downstream for processing.

[0038] After constructing the above sample stream, two sub-models are trained to predict two probabilities p for each sample. dp and p rn , where p dp Indicates the probability that a user's specific behavior is delayed, p rn Indicates the probability that the user will not perform a specific behavior. Then, for the positive sample, its corresponding importance weight is set to: (1+p dp (x))p rn (x), and for negative samples, the corresponding importance weight is set to: 1+p dp (x).

[0039] This method is only applicable to sample streams constructed by the ESDFM method. In addition, this method requires training two sub-models and is highly dependent on the prediction effect of the sub-models.

[0040] The second method is applicable to the sample stream constructed by the Defer method.

[0041] In the Defer method, two waiting time windows are set: 1 and w 2 , where w 2 The length is greater than w 1 For negative samples generated in real time, first wait for w 1 Time. If w 1 If the corresponding positive sample is received within the time, the negative sample is replaced by the positive sample and sent to the downstream for processing; if the positive sample is not received, the negative sample is directly sent to the downstream for processing. 2 After time, the non-delayed samples (including w 1 The positive samples received in time and in w 2 The negative samples that have not received the positive samples after the time period are sent again.

[0042] After constructing the above sample stream, a sub-model is trained to predict the probability p for each sample dp In addition, using f θ (x) represents the probability predicted by the main model (i.e., the model used to predict whether the user will perform a specific behavior) for each sample. Then, for negative samples, the corresponding importance weight is set to: For positive samples, the corresponding importance weight is set to:

[0043] This method is only applicable to sample streams constructed with the Defer method.

[0044] The third method is applicable to any form of sample stream.

[0045] In this method, the random variable X is used to represent the feature, the random variable Y∈{0,1} is used to represent whether the sample has been transformed before entering the model training (1 for yes, 0 for no); the random variable C∈{0,1} represents whether the sample will eventually be transformed; the random variable S∈{0,1} represents whether the sample is correctly labeled. And the importance weight of the positive sample is set to: The importance weight of negative samples is set to: Finally, two models are trained to estimate P(S=1|C=1,X=x) and

[0046] This method requires the construction of two sub-models and is highly dependent on the prediction effect of the sub-models.

[0047] In view of the corresponding shortcomings of the above methods, the following improvements are proposed in the embodiments of this specification:

[0048] First, when constructing the sample set, a label is added to the sample to indicate whether there is a delay in a specific behavior performed by the user.

[0049] That is, in this scheme, two labels are set for each sample in the sample set, so that the sample category indicating the delay state can be determined for each sample, and then the corresponding prediction losses are weighted and combined according to the sample category of each sample. In this way, different importance considerations can be made for samples with different delay states during the training process, which helps to improve the accuracy of user behavior prediction.

[0050] Second, only one secondary model is trained to predict the probability of the final conversion of negative samples.

[0051] In both the first and second methods, a sub-model needs to be trained to predict the probability of a delay in a specific user behavior. However, in fact, it is possible to distinguish whether a specific user behavior has a delay, which means that there is no need to predict it.

[0052] Finally, samples with different delay states are assigned different importance weights.

[0053] The third improvement is described in detail below:

[0054] First, define some variables as follows:

[0055] X: represents sample characteristics.

[0056] Y∈{0,1}: represents a label, which indicates whether the user has currently performed a specific behavior.

[0057] C∈{0,1}: represents a label, which indicates whether the user finally performs a specific behavior.

[0058] T∈{0,1}: represents a label, which indicates whether the user performs a specific behavior in the first duration.

[0059] In a sample stream, the three tags have the following relationship:

[0060]

[0061] For a given sample stream, label C is not observable, only Y can be observed. However, calculating the loss function based on label Y will cause errors, but it is impossible to directly calculate the loss function based on label C. By referring to the above importance sampling method, this solution will calculate the ideal loss function L according to the following formula idea :

[0062]

[0063] As can be seen from the above formula 2, as long as the importance weight of each sample is calculated: The ideal loss function L can be estimated based on the label Y idea .

[0064] The above is an introduction to the inventive concept of this scheme, and the following is a detailed description of this scheme.

[0065] Figure 1 A schematic diagram of an implementation scenario of an embodiment disclosed in this specification. Figure 1 In the example, a sample set is generated by streaming, including multiple samples corresponding to multiple users, each sample includes two tags, one of which (hereinafter referred to as the first tag) is added when the target business generates samples in real time, indicating whether the corresponding user has currently performed a specific behavior on the target object, and the other tag (hereinafter referred to as the second tag) is additionally added by this solution, indicating whether the specific behavior of the corresponding user is within the first time length since the target object was exposed to the first user. It should be noted that for any sample, based on the two tag values ​​of the sample, the sample category indicating the delay state to which the sample belongs can be determined.

[0066] Figure 1 In the example, after inputting the sample features of each sample in the sample set into the user behavior prediction model, the prediction result of each sample indicating whether the corresponding user performs a specific behavior can be obtained. Then, based on the prediction result of each sample and the first label value, the prediction loss of each sample can be obtained. Finally, based on the sample category to which each sample belongs, the weight value of each sample is determined, and based on the weight value of each sample, the prediction loss of each sample is weighted and integrated, and the parameters of the user behavior prediction model are adjusted based on the obtained integrated loss.

[0067] Figure 2 A flowchart of a method for training a user behavior prediction model according to an embodiment is shown. It should be noted that the method involves multiple rounds of iterative updates of the user behavior prediction model. Figure 2The steps included in any round of iterative update are shown in FIG. It can be understood that by repeatedly executing the steps shown therein, multiple rounds of iterative updates of the user behavior prediction model can be achieved, and then the user behavior prediction model obtained after the last round of iterative updates is used as the final use model.

[0068] like Figure 2 As shown, the method may include the following steps:

[0069] Step S202, obtaining a sample set generated by streaming.

[0070] The above sample set may include multiple samples corresponding to multiple users, and the multiple samples may be generated within a specific period of time (for example, 1 day or 1 week from the current time, etc.). Any of the samples includes sample features, a first label, and a second label. The sample features may include user features and object features of the target object. Of course, in practice, the above sample features may also include only user features.

[0071] The above-mentioned user characteristics may include: basic attribute characteristics of the user, such as user identification, hobbies, registration time, education level, recent browsing history, recent shopping history, etc.; and may also include time-related characteristics, such as the execution time of a specific behavior (which will be explained later), etc. The above-mentioned target objects are different in different scenarios, and the corresponding object characteristics are also different. For example, in the case where the target object is user rights and interests, the object characteristics may include the amount of user rights and interests (such as the face value of a coupon), the channel for using user rights and interests (such as payment through a certain bank card), the scope of use of user rights and interests, etc. In the case where the target object is a commodity, the object characteristics may include the category, sales volume, price, etc. of the commodity. In the case where the target object is an advertising picture, the object characteristics may include picture pixels and text content in the picture, etc. In addition, object characteristics may also include object identification and time-related characteristics, such as the exposure time of the target object, etc.

[0072] In addition, the above-mentioned first tag indicates whether the corresponding user has currently (i.e., within a specific period of time) performed a specific behavior on the target object, which can be added when the target business generates samples in real time. Taking the target object as user rights as an example, the specific behavior here can refer to click behavior; taking the target object as a commodity as an example, the specific behavior here can indicate purchase behavior; taking the target object as an advertising picture as an example, the specific behavior here can refer to click behavior. Of course, in practice, depending on the target object, the characteristic behavior can also include registration behavior, login behavior, and attention behavior.

[0073] The second tag is additionally added through the present solution, and indicates whether the specific behavior of the corresponding user is within the first duration from when the target object is exposed to the user.

[0074] It should be noted that the above sample set can be generated by streaming. The streaming generation process of the sample set is described below.

[0075] In one embodiment, for a target sample generated in real time by a target business, if the first tag value of the target sample indicates that the corresponding user has not performed a specific behavior (i.e., the target sample is a negative sample), the target sample is added to the cache pool and an expiration time of a first time length (e.g., 10 minutes or 15 minutes) from the current time is set for it. If the first tag value indicates that the corresponding user has performed a specific behavior (i.e., the target sample is a positive sample), a matching sample with the same target sample characteristics and not expired is searched in the cache pool, and its second tag is determined according to the search result and then added to the sample set.

[0076] In a more specific embodiment, if the search result indicates that a matching sample is found, a second tag with a first value is added to the target sample and added to the sample set, and the matching sample is removed from the cache pool, and the first value of the second tag indicates that the specific behavior is within the first time period. If the search result indicates that no matching sample is found, a second tag with a second value is added to the target sample and added to the sample set, and the second value of the second tag indicates that the specific behavior is not within the first time period.

[0077] In addition, the expiration time of each sample in the cache pool can be monitored. In response to reaching the expiration time of any sample, a default second tag is added to the sample (hereinafter referred to as the expired sample) and then added to the sample set. Of course, in practice, after the expired sample is added to the sample set, the expired sample can be removed from the cache pool, so that only non-expired samples are stored in the cache pool. In addition, in practice, the default value of the second tag is usually the first value.

[0078] It should be noted that the above-mentioned target sample features may refer to time-independent features of the sample features, such as user identification, object identification, etc. In addition, the above-mentioned target business generates corresponding samples in response to business events. The business event may include a first event in which the target object is exposed to the corresponding user, or a second event in which the user performs a predetermined behavior on the target object. It should be noted that both the above-mentioned first event and the second event occur within the above-mentioned specific time period.

[0079] In the embodiments of this specification, the sample generated in response to the first event is called a negative sample, that is, its first label value indicates that the corresponding user has not performed a specific behavior. The sample generated in response to the second event is called a positive sample, that is, its first label value indicates that the user has performed a specific behavior.

[0080] Furthermore, in the embodiments of the present specification, the positive sample after adding the second label assigned to the first value is called a non-delayed positive sample, the positive sample after adding the second label assigned to the second value is called a delayed positive sample, and the negative sample after adding the default second label is called a current negative sample. It should be understood that the current negative sample here means that it is a negative sample within the above-mentioned specific time period, which may be converted into a positive sample (that is, the user performs a specific behavior after a specific time period), or it may be a final negative sample.

[0081] In summary, the above sample set can include three types of samples: non-delayed positive samples, which indicate that the user performs a specific behavior within the first time period; delayed positive samples, which indicate that the user performs a specific behavior after the first time period; and current negative samples, which indicate that the user has not yet performed a specific behavior.

[0082] For example, assuming that there are 100 negative samples stored in the buffer pool, and further assuming that 30 positive samples are received, and 20 of the positive samples have matching negative samples in the buffer pool, and 10 positive samples do not have matching negative samples, so that the 20 positive samples can be added to the sample set as non-delayed positive samples, 10 positive samples can be added to the sample set as delayed positive samples, and the remaining 80 negative samples (i.e., the negative samples in the 100 negative samples except those matching the 20 samples) can be added to the sample set as current negative samples, so that the generated sample set can be as follows Figure 3 shown. Figure 3 In , the sample set includes 80 current negative samples, 20 non-delayed positive samples and 10 delayed positive samples, that is, 110 samples.

[0083] In another embodiment, in addition to generating a sample set based on the above-mentioned first duration, a second duration is also set. The second duration has the same starting point as the first duration, and the length of the second duration is greater than the first duration, which can be, for example, 24 hours. Specifically, when any sample is added to the cache pool, a second duration is configured for the sample at the same time, and the second duration can be monitored. If the second duration is reached, the sample is added to the sample set again. In addition, for non-delayed positive samples, the second duration can also be monitored, and after the second duration is reached, the non-delayed positive sample is also added to the sample set again.

[0084] It should be noted that in order to realize monitoring for the second time period, the expired samples (i.e., the current negative samples) removed from the cache pool and the received non-delayed positive samples can be stored in the target storage unit so that they can be added to the sample set again when the second time period arrives.

[0085] Of course, in other implementations, the expired samples in the buffer pool may not be removed first, but removed from the buffer pool after the second time period has arrived. It should be understood that in this case, it is not necessary to add the current negative sample to the target storage unit, but only the non-delayed positive sample needs to be added to the target storage unit.

[0086] It should be understood that adding the current negative samples and the non-delayed positive samples to the sample set again helps to maintain a balanced distribution of samples of different categories.

[0087] In the above example, 80 current negative samples and 20 non-delayed positive samples can be added to the sample set again, so that the resulting sample set can be as follows: Figure 4 shown. Figure 4 In , the sample set includes,two 80 current negative samples, two 20 non-delayed positive samples and 10 delayed positive samples.

[0088] In another embodiment, it is also possible to add all received samples to the sample set without waiting for the above-mentioned first duration and second duration. In this way, for any received target sample, if the first label value indicates that the corresponding user has not performed a specific behavior, a default second label is added to the target sample and then added to the sample set. If the first label value indicates that the corresponding user has performed a specific behavior, a second label with a second value assigned to the target sample is added to the sample set. Thus, the sample set only includes two types of samples: current negative samples and delayed positive samples.

[0089] It can be seen that this solution can support sample streams in any form, which greatly improves the flexibility of this solution.

[0090] Step S204: input the sample features of each sample into the user behavior prediction model to obtain a prediction result of whether the corresponding user performs a specific behavior.

[0091] Among them, the above-mentioned user behavior prediction model can be implemented as a deep neural network DNN model, a convolutional neural network CNN model or a logistic regression LR model, etc.

[0092] In a specific example, the user behavior prediction model may include a feature processing layer and a classification layer. The feature processing layer first processes the user features of any sample into a first embedding vector and the object features into a second embedding vector; then performs pooling on the first embedding vector and the second embedding vector to obtain a first pooling vector and a second pooling vector; finally, the first pooling vector and the second pooling vector are merged into a feature vector. The classification layer obtains the prediction result of the sample based on the feature vector.

[0093] Step S206: Determine the corresponding prediction losses according to the prediction results of each sample and the first label value.

[0094] Specifically, the MAE loss function or the MSE loss function can be used to calculate the corresponding prediction losses based on the prediction results of each sample and the first label value.

[0095] Step S208: Determine the sample category indicating the delay state to which each sample belongs according to the first label value and the second label value of each sample, and determine the weight value of each sample based on the sample category.

[0096] The sample categories here may include: non-delayed positive samples, which indicate that the user performs a specific behavior within the first time period; delayed positive samples, which indicate that the user performs a specific behavior after the first time period; and current negative samples, which indicate that the user has not yet performed a specific behavior.

[0097] Specifically, the sample category of the sample can be determined based on the first label value and the second label value of the sample. More specifically, if the first label value of any sample indicates that the corresponding user has currently performed a specific behavior, and the second label value indicates that the specific behavior is within the first time length, then the sample is determined to be a non-delayed positive sample; if the first label value of any sample indicates that the corresponding user has currently performed a specific behavior, and the second label value indicates that the specific behavior is not within the first time length, then the sample is determined to be a delayed positive sample; if the first label value of any sample indicates that the corresponding user has not yet performed a specific behavior, then the sample is determined to be a current negative sample.

[0098] Similarly, the sample category to which each sample belongs can be determined.

[0099] Then, for any sample belonging to a non-delayed positive sample, the first value can be used as the weight value of the any sample. In one example, the first value here is 1. For any sample belonging to a delayed positive sample, the second value can be used as the weight value of the any sample. The second value is greater than the first value. In one example, the second value is 2. For any sample belonging to the current negative sample, the classification model is used to predict the probability that the sample is the final negative sample, and the probability is used as the weight value of the any sample.

[0100] The reason why the first value can be set to 1 is explained below:

[0101] As mentioned before, in order to estimate the ideal loss function L based on the label Y idea , need to be based on importance weights: Correct the prediction loss of each sample. Where Y is the first label, T is the second label, X is the sample feature, and C is the conversion label (which indicates whether the user finally takes a specific action).

[0102] It should be understood that for non-delayed positive samples, Furthermore, since the non-delayed samples are always transformed samples, the numerator and denominator of the formula are equal, so

[0103] The reason why the second value can be set to 2 is explained below:

[0104] For delayed positive samples, Since the delayed positive samples are not used to replace the negative samples in the process of generating the sample stream, each delayed positive sample has a corresponding negative sample, and these two correspond to the same user. Therefore, for a certain user, the number of samples marked as delayed positive samples is only half, that is, the denominator of the formula is equal to 1 / 2. Therefore,

[0105] Finally, regarding the above-mentioned classification model, it can be implemented in various forms such as tree model, deep neural network DNN, etc. The tree model specifically includes, for example, PS-Smart tree model, GBDT tree, etc.

[0106] It should be noted that the classification model can be a pre-trained model, that is, the classification model has been trained before the user behavior prediction model is trained. Of course, in practice, the classification model can also be trained together with the user behavior prediction model. When the classification model and the user behavior prediction model are trained together, the parameter adjustment frequency of the two can be different.

[0107] For example, after training the user behavior prediction model for several iterations, the final negative samples can be screened out from the sample set and used as positive samples, and non-delayed samples can be screened out as negative samples. Then, the classification model is trained based on the positive samples and negative samples.

[0108] In summary, this solution only needs to train one sub-model to predict the probability of the final negative sample, thereby saving training resources.

[0109] Of course, in practice, the first value and the second value may also be set to other values. For example, the first value is set to n and the second value is set to 2n, as long as the second value is greater than the first value.

[0110] In addition, for the current negative sample, its corresponding weight value may also be set to a fixed value, which is not limited in this specification.

[0111] Step S210, based on the weight value of each sample, the prediction losses corresponding to each sample are weighted and integrated, and the parameters of the user behavior prediction model are adjusted based on the obtained integrated loss.

[0112] Specifically, the weight value of each sample can be used as the weight value of each corresponding prediction loss, and each prediction loss can be weighted summed or weighted averaged to obtain a comprehensive loss. Then, based on the comprehensive loss, the existing gradient back propagation method is used to adjust the parameters of the user behavior prediction model.

[0113] In summary, the method for training a user behavior prediction model provided in the embodiments of this specification can improve the prediction accuracy of the user behavior prediction model. In addition, since the prediction accuracy of the user behavior prediction model is improved, the user conversion rate can be maximized. Finally, since this solution can be applied to any form of sample stream, this solution is a more general and more effective method for solving the problem of delayed feedback of positive samples.

[0114] Corresponding to the above method for training a user behavior prediction model, an embodiment of the present specification also provides a device for training a user behavior prediction model, such as Figure 5 As shown, the device may include:

[0115] The acquisition unit 502 is used to acquire a sample set generated by streaming, wherein any sample includes a sample feature, a first label and a second label, wherein the first label indicates whether the corresponding user has currently performed a specific behavior on the target object, and the second label indicates whether the specific behavior of the corresponding user is within a first time length from the exposure of the target object to the user.

[0116] The input unit 504 is used to input the sample features of each sample into the user behavior prediction model to obtain a prediction result of whether the corresponding user performs a specific behavior.

[0117] The determination unit 506 is used to determine the corresponding prediction losses according to the prediction results of each sample and the first label value.

[0118] The determination unit 506 is further configured to determine the sample category indicating a delay state to which each sample belongs according to the first label value and the second label value of each sample, and determine the weight value of each sample based on the sample category.

[0119] The integration unit 508 is used to perform weighted integration of the prediction losses corresponding to the samples based on the weight values ​​of the samples, and adjust the parameters of the user behavior prediction model based on the obtained integrated losses.

[0120] In one embodiment, the sample category includes any one of the following:

[0121] Non-delayed positive samples, which indicate that the user performed a specific behavior in the first duration;

[0122] Delayed positive samples, which indicate that the user performs a specific behavior after the first duration;

[0123] Current negative samples, which indicate that the user has not yet performed a specific behavior.

[0124] In one embodiment, the determining unit 506 is specifically configured to:

[0125] If the first label value of any first sample indicates that a specific behavior has been performed, and the second label value indicates that the specific behavior is within the first time length, then the first sample is determined to be a non-delayed positive sample;

[0126] If the first label value of any first sample indicates that a specific behavior has been performed, and the second label value indicates that the specific behavior is not within the first time length, then the first sample is determined to be a delayed positive sample;

[0127] If the first label value of any first sample indicates that a specific behavior has not been performed, it is determined that the first sample belongs to the current negative sample.

[0128] In one embodiment, the determining unit 506 is further configured to:

[0129] In the case where any first sample is a non-delayed positive sample, using the first value as a weight value of the first sample;

[0130] In the case where any first sample is a delayed positive sample, the second value is used as the weight value of the first sample, and the second value is greater than the first value.

[0131] In the case where any first sample is a current negative sample, the classification model is used to predict the probability that the first sample is a final negative sample, and the probability is used as the weight value of the first sample.

[0132] In one embodiment, the apparatus further comprises:

[0133] A training unit 510, configured to use the final negative sample as a positive sample, and the delayed positive sample as a negative sample, and train a classification model based on the positive sample and the negative sample;

[0134] Among them, the positive sample has a positive label, which indicates that the corresponding sample is the final negative sample. The negative sample has a negative label, which indicates that the corresponding sample is not the final negative sample.

[0135] In one embodiment, the acquisition unit 502 includes:

[0136] A receiving submodule 5022, configured to receive a target sample generated in real time by a target service, which has only a first label;

[0137] Adding submodule 5024, used for adding the target sample to the cache pool and setting an expiration time of the first length from the current time for the target sample if the first tag value of the target sample indicates that no specific behavior has been performed;

[0138] Adding submodule 5024 is used to search for a matching sample with the same target sample characteristics and not expired in the cache pool if the first tag value of the target sample indicates that a specific behavior has been performed; and determine its second tag based on the search result and add it to the sample set.

[0139] In one embodiment, the adding submodule 5024 is specifically used for:

[0140] If a matching sample is found, a second tag assigned a first value is added to the target sample and then added to the sample set, and the matching sample is removed from the cache pool, wherein the first value of the second tag indicates that the specific behavior is within the first duration;

[0141] If no matching sample is found, a second label with a second value assigned to it is added to the target sample and then added to the sample set, where the second value of the second label indicates that the specific behavior is not within the first duration.

[0142] In one embodiment, the acquisition unit 502 further includes:

[0143] The monitoring submodule 5026 is used to monitor the expiration time of each sample in the cache pool. In response to reaching the expiration time of the first sample, a default second tag is added to the first sample and then the sample is added to the sample set, and the first sample is removed from the cache pool.

[0144] In one embodiment, the adding submodule 5024 is further specifically configured to: after removing the first sample from the cache pool, add the first sample to the target storage unit, and after waiting for a second time period, add the first sample to the sample set again.

[0145] In one embodiment, the target business generates a corresponding sample in response to a business event, wherein the business event includes a first event in which the target object is exposed to a corresponding user, or a second event in which the user performs a predetermined action on the target object.

[0146] In one embodiment, the integration unit 508 is specifically configured to:

[0147] The weight value of each sample is used as the weight value of the corresponding prediction loss, and the weighted sum or weighted average of each prediction loss is performed to obtain the comprehensive loss.

[0148] The functions of the functional units of the device in the above-mentioned embodiment of this specification can be implemented through the steps of the above-mentioned method embodiment. Therefore, the specific working process of the device provided by one embodiment of this specification will not be repeated here.

[0149] An embodiment of the present specification provides a device for training a user behavior prediction model, which can improve the accuracy of user behavior prediction.

[0150] According to another embodiment, there is also provided a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute a combination of Figure 2 The method described.

[0151] According to another embodiment of the present invention, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the Figure 2 The method described.

[0152] 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 medium or device 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.

[0153] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0154] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of this specification. It should be understood that the above description is only the specific implementation method of this specification and is not intended to limit the protection scope of this specification. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of this specification should be included in the protection scope of this specification.

Claims

1. A method for training a user behavior prediction model, comprising: Obtain a sample set generated by streaming, wherein any sample includes a sample feature, a first label, and a second label; The first tag indicates whether the corresponding user has currently performed a specific behavior on the target object, and the second tag indicates whether the specific behavior of the corresponding user is within a first time period from when the target object was exposed to the user; Input the sample features of each sample into the user behavior prediction model to obtain the prediction result of whether the corresponding user performs a specific behavior; Determine corresponding prediction losses according to the prediction results of each sample and the first label value; Determine, according to the first label value and the second label value of each sample, a sample category indicating a delay state to which each sample belongs, and determine, based on the sample category, a weight value of each sample; Based on the weight values ​​of the samples, the prediction losses corresponding to the samples are weighted and integrated, and the parameters of the user behavior prediction model are adjusted based on the obtained integrated loss.

2. The method according to claim 1, wherein: The sample categories include: Non-delayed positive samples, which indicate that the user performed a specific behavior in the first duration; Delayed positive samples, which indicate that the user performs a specific behavior after the first duration; Current negative samples, which indicate that the user has not yet performed a specific behavior.

3. The method according to claim 2, wherein: The determining the sample category indicating the delay state to which each sample belongs includes: If the first label value of any first sample indicates that a specific behavior has been performed, and the second label value indicates that the specific behavior is within the first time period, then the first sample is determined to belong to the non-delayed positive sample; If the first label value of any first sample indicates that a specific behavior has been performed, and the second label value indicates that the specific behavior is not within the first time length, then it is determined that the first sample belongs to the delayed positive sample; If the first label value of any first sample indicates that a specific behavior has not been performed, it is determined that the first sample belongs to the current negative sample.

4. The method according to claim 2, wherein: Determining the weight value of each sample includes: In the case where any first sample is the non-delayed positive sample, using the first value as the weight value of the first sample; In the case where any first sample is the delayed positive sample, a second value is used as a weight value of the first sample; the second value is greater than the first value; In the case where any first sample is the current negative sample, the classification model is used to predict the probability that the first sample is the final negative sample, and the probability is used as the weight value of the first sample.

5. The method according to claim 4, further comprising: The final negative sample is used as a positive sample, and the delayed positive sample is used as a negative sample, and the classification model is trained based on the positive sample and the negative sample.

6. The method according to claim 1, wherein: The method of obtaining a sample set generated by streaming includes: receiving a target sample generated in real time by a target business, which has only the first label; If the first tag value of the target sample indicates that no specific behavior has been performed, the target sample is added to the cache pool, and an expiration time of the first length from the current time is set for it; If the first tag value of the target sample indicates that a specific behavior has been performed, search the cache pool for a matching sample that has the same target sample characteristics and has not expired; and determine its second tag based on the search result and add it to the sample set.

7. The method according to claim 6, wherein: Determining the second label according to the search result and adding it to the sample set includes: If the matching sample is found, a second tag having a first value assigned to the target sample is added to the sample set, and the matching sample is removed from the cache pool; the first value of the second tag indicates that the specific behavior is within a first duration; If the matching sample is not found, a second tag with a second value is added to the target sample and then added to the sample set, wherein the second value of the second tag indicates that the specific behavior is not within the first duration.

8. The method according to claim 6, wherein obtaining the sample set generated by streaming further comprises: The expiration time of each sample in the cache pool is monitored, and in response to reaching the expiration time of a first sample therein, a default second tag is added to the first sample and then the first sample is added to the sample set, and the first sample is removed from the cache pool.

9. The method according to claim 8, wherein obtaining the sample set generated by streaming further comprises: After removing the first sample from the buffer pool, the first sample is added to the target storage unit, and after waiting for a second time period, the first sample is added to the sample set again.

10. The method according to claim 6, wherein: The target business generates corresponding samples in response to a business event; the business event includes a first event in which the target object is exposed to a corresponding user, or a second event in which the user performs a predetermined action on the target object.

11. The method according to claim 1, wherein: The weighted integration of the prediction losses corresponding to the samples includes: The weight value of each sample is used as the weight value of each corresponding prediction loss, and the prediction losses are weighted summed or weighted averaged to obtain the comprehensive loss.

12. A device for training a user behavior prediction model, comprising: An acquisition unit, used for acquiring a sample set generated by streaming, wherein any sample includes a sample feature, a first label and a second label; The first tag indicates whether the corresponding user has currently performed a specific behavior on the target object, and the second tag indicates whether the specific behavior of the corresponding user is within a first time period from when the target object was exposed to the user; An input unit, used to input the sample features of each sample into the user behavior prediction model to obtain a prediction result of whether the corresponding user performs a specific behavior; A determination unit, configured to determine the corresponding prediction losses according to the prediction results of the samples and the first label value; the determination unit is further configured to determine the sample category indicating the delay state to which the samples belong according to the first label value and the second label value of the samples, and determine the weight value of the samples based on the sample category; The synthesis unit is used to perform weighted synthesis of the prediction losses corresponding to the samples based on the weight values ​​of the samples, and adjust the parameters of the user behavior prediction model based on the obtained comprehensive losses.

13. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed in a computer, the computer is caused to execute the method according to any one of claims 1 to 11.

14. A computing device comprising a memory and a processor, wherein: The memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 11 is implemented.