Training method and device of collaborative filtering model, readable medium and system

By using the sample buffer and score prediction variance to select negative samples during the training process of the collaborative filtering model, the problem of difficult negative sample selection is solved and the robustness of the model and the accuracy of the recommendation system are improved.

CN112085093BActive Publication Date: 2024-09-24THE FOURTH PARADIGM BEIJING TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202010936001.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-08
Publication Date
2024-09-24
Estimated Expiration
2040-09-08

AI Technical Summary

Technical Problem

During the training process of the collaborative filtering model, how to effectively select negative samples is a key issue. The existing uniform sampling method may lead to poor performance of negative samples, causing the model gradient to return to zero too quickly, thus affecting the accuracy of the model.

Method used

The sample cache mechanism is used to dynamically update negative samples, and select high-quality negative samples through scoring and prediction variance to ensure that the model always uses high-scoring and high-variance negative samples during the training process.

Benefits of technology

Effective sampling of high-quality negative samples enhances the robustness of the collaborative filtering model and improves the accuracy and efficiency of recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112085093B
    Figure CN112085093B
Patent Text Reader

Abstract

A training method and device, a readable medium and a system for a collaborative filtering model are provided. The training method comprises: setting a sample buffer, wherein the sample buffer stores a portion of samples in a sample space, wherein the portion of samples comprises S1 negative samples, and S1 is a positive integer; in each iterative training process of at least part of the iterative training process of training the collaborative filtering model: first updating the sample buffer, and then selecting negative samples participating in the collaborative filtering model training from the updated sample buffer, or first selecting negative samples participating in the collaborative filtering model training from the sample buffer, and then updating the sample buffer. The technical solution disclosed in the present invention can sample high-quality negative samples, thereby realizing efficient and robust collaborative filtering training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer application technology, and more specifically, to a collaborative filtering model training method and device, a readable medium and a system. Background Art

[0002] Recommendation systems are widely used in various scenarios. For example, recommendation systems can use e-commerce websites to provide customers with product information and suggestions, help users decide what products to buy, and simulate sales staff to help customers complete the purchase process. Personalized recommendations are to recommend information and products that users are interested in based on their interests and purchasing behaviors. The objects that can be recommended include products, advertisements, news, music, etc.

[0003] Collaborative filtering (CF) is a key technology for personalized recommendation systems, focusing on learning user preferences from observed user-item interactions. Current recommendation systems also focus on implicit user feedback, such as shopping on e-commerce websites or watching on online video platforms. Implicit user feedback is easier to collect than explicit user feedback (such as ratings). In the implicit CF model scenario, we can only obtain what the user clicked. What the user did not click does not mean that the user did not like it, but such feedback data cannot be obtained. Therefore, when performing CF, it is necessary to put the known observed (user, item) pairs in front of the unknown pairs. However, due to the huge number of unknown observed pairs, sampling a part of such (user, item) pairs is a necessary way to train the implicit CF model. Therefore, in the training process of the CF model, how to find suitable negative samples is a very critical issue. All unlabeled or unobserved pairs can be used as negative samples, so the number of potential negative samples is huge. How to select effective negative samples will not only affect the efficiency of the CF algorithm, but also effective negative samples can significantly improve the effect of collaborative CF.

[0004] In the prior art, uniform random sampling is often used to extract negative samples. The CF model is then trained based on the extracted negative samples. However, the uniform random sampling method used in the prior art may extract negative samples with poor performance, and the evaluation function may give it a low score. When such negative samples are used to train the CF model, the gradient of the CF model will return to zero too quickly, and the training of the CF model will be terminated prematurely, resulting in poor accuracy of the trained CF model. Summary of the invention

[0005] According to an exemplary embodiment of the present disclosure, a training method for a collaborative filtering model is provided, and the training method may include: setting a sample buffer, wherein the sample buffer stores a portion of samples in a sample space, the portion of samples including S1 negative samples, and S1 is a positive integer; in each iterative training process of at least part of the iterative training process of training the collaborative filtering model: first updating the sample buffer, and then selecting negative samples participating in the collaborative filtering model training from the updated sample buffer, or first selecting negative samples participating in the collaborative filtering model training from the sample buffer, and then updating the sample buffer.

[0006] The sample space may include a positive sample space and a negative sample space, and the samples therein are pairs related to user-item interactions, and the collaborative filtering model may recommend corresponding items to the user.

[0007] The step of setting a sample buffer may include: uniformly sampling S1 negative samples from the negative sample space and placing them into the sample buffer; or selecting S1 negative samples with higher scores from the negative sample space based on an evaluation function and placing them into the sample buffer.

[0008] The step of updating the sample buffer may include: uniformly sampling S2 negative samples from a specified sample space, where S2 is a positive integer; selecting S1 negative samples from the S1 negative samples already in the sample buffer and the sampled S2 negative samples; and updating the sample buffer using the selected S1 negative samples.

[0009] The step of selecting S1 negative samples from the S1 negative samples already in the sample buffer and the sampled S2 negative samples may include: using an evaluation function to calculate the scores of S1+S2 negative samples for each positive sample batch sampled from the positive sample space; and selecting S1 negative sample from the S1+S2 negative samples according to the scores of the S1+S2 negative samples.

[0010] The step of selecting S1 negative samples according to the scores of the S1+S2 negative samples may include: selecting the first S1 negative samples with the highest scores from the S1+S2 negative samples; or for each negative sample in the S1+S2 negative samples, calculating the extraction probability of each negative sample based on the scores of the S1+S2 negative samples, and extracting S1 negative samples from the S1+S2 negative samples in sequence according to the extraction probabilities corresponding to each of the S1+S2 negative samples.

[0011] The step of selecting negative samples for participating in the collaborative filtering model training may include: calculating the prediction variance of each negative sample in the sample buffer; and selecting negative samples with high prediction variance from the sample buffer as negative samples for participating in the collaborative filtering model training according to the calculated prediction variance of each negative sample.

[0012] The step of calculating the prediction variance of each negative sample in the sample buffer may include: obtaining the scores of each negative sample in the sample buffer at different training times or the probability that each negative sample is a positive sample; and calculating the prediction variance of each negative sample based on the scores of each negative sample in the sample buffer at different training times or the probability that each negative sample is a positive sample.

[0013] According to another exemplary embodiment of the present disclosure, a training device for a collaborative filtering model is provided, and the training device may include: an initialization module for setting a sample buffer, wherein the sample buffer stores a portion of samples in a sample space, the portion of samples includes S1 negative samples, and S1 is a positive integer; and a training module for, in each iterative training process of at least part of the iterative training process of training the collaborative filtering model: first updating the sample buffer, and then selecting negative samples participating in the collaborative filtering model training from the updated sample buffer, or first selecting negative samples participating in the collaborative filtering model training from the sample buffer, and then updating the sample buffer.

[0014] The sample space may include a positive sample space and a negative sample space, and the samples therein are pairs related to user-item interactions, and the collaborative filtering model may recommend corresponding items to the user.

[0015] The initialization module may uniformly sample S1 negative samples from the negative sample space and place them into the sample buffer; or may select S1 negative samples with higher scores from the negative sample space based on the evaluation function and place them into the sample buffer.

[0016] The training module can uniformly sample S2 negative samples from the specified sample space, where S2 is a positive integer; select S1 negative samples from the existing S1 negative samples in the sample buffer and the sampled S2 negative samples; and use the selected S1 negative samples to update the sample buffer.

[0017] The training module may calculate scores of S1+S2 negative samples using an evaluation function for each positive sample batch sampled from the positive sample space; and select S1 negative samples from the S1+S2 negative samples according to the scores of the S1+S2 negative samples.

[0018] The training module can select the first S1 negative samples with the highest scores from the S1+S2 negative samples; or for each negative sample in the S1+S2 negative samples, calculate the extraction probability of each negative sample based on the scores of the S1+S2 negative samples; and extract S1 negative samples from the S1+S2 negative samples in sequence according to the extraction probabilities corresponding to each of the S1+S2 negative samples.

[0019] The training module can calculate the prediction variance of each negative sample in the sample buffer; and select negative samples with high prediction variance from the sample buffer as negative samples participating in the collaborative filtering model training according to the calculated prediction variance of each negative sample.

[0020] The training module can obtain the scores of each negative sample in the sample buffer at different training times or the probability that each negative sample is a positive sample; and calculate the prediction variance of each negative sample based on the scores of each negative sample in the sample buffer at different training times or the probability that each negative sample is a positive sample.

[0021] According to another exemplary embodiment of the present disclosure, a computer-readable storage medium storing instructions is provided, wherein when the instructions are executed by at least one computing device, the at least one computing device is prompted to perform the training method as described above.

[0022] According to another exemplary embodiment of the present disclosure, a system including at least one computing device and at least one storage device storing instructions is provided, wherein when the instructions are executed by the at least one computing device, the at least one computing device is prompted to perform the training method as described above.

[0023] By applying the training method and apparatus according to the exemplary embodiments of the present disclosure, high-quality negative samples can be effectively sampled, and the robustness of the collaborative filtering model can be enhanced, thereby improving the accuracy and efficiency of recommendations. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The above and other aspects, features and advantages of certain embodiments of the present disclosure will become more apparent from the following description taken in conjunction with the accompanying drawings, in which:

[0025] Figure 1 is a flow chart illustrating a collaborative filtering model training method according to an exemplary embodiment of the present disclosure;

[0026] Figure 2 is a block diagram illustrating a collaborative filtering model training apparatus according to an exemplary embodiment of the present disclosure.

[0027] Throughout the drawings, it should be noted that like reference numbers are used to depict the same or similar elements, features, and structures. DETAILED DESCRIPTION

[0028] The following description with reference to the accompanying drawings is provided to assist in a comprehensive understanding of the embodiments of the present disclosure as defined by the claims and their equivalents. Various specific details are included to assist in understanding, but these details are considered to be exemplary only. Therefore, one of ordinary skill in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. In addition, descriptions of well-known functions and structures are omitted for clarity and brevity.

[0029] It should be noted that the phrase "at least one of the items" in the present disclosure includes three types of parallel situations: "any one of the items", "a combination of any number of the items", and "all of the items". For example, "including at least one of A and B" includes the following three types of parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "executing at least one of step 1 and step 2" which means the following three types of parallel situations: (1) executing step 1; (2) executing step 2; (3) executing step 1 and step 2.

[0030] Training an implicit collaborative filtering model generally includes three main steps, namely selecting the scoring function r, the objective function L, and the negative sample distribution p. ns The scoring function r(p u ,q i ,β) uses the learning parameter β to embed the vector p of user u∈U u ∈R F and the embedding vector q of item i∈I i ∈R F To calculate the association / interaction between user u and item i. The scoring function can be selected from matrix factorization (MF), multi-layer sensing machine (MLP) or graph neural network (GNN). The scoring function r(p u ,q i ,β) is larger, the more interested user u is in item i. For simplicity, we will use the scoring function r(p u ,q i ,β) Calculate the association between user u and item i and represent it as r ui .

[0031] For each observed user u and item i∈R u The samples of the interactions can be regarded as positive samples, and for the remaining unobserved interactions, that is, The probability that (u,j) is a negative sample can be expressed by the following equation (1):

[0032] P neg (j|u,i)=sigmoid(r ui -r uj ) (1)

[0033] Among them, when r ui Much larger than r uj When P neg (j|u,i) is close to 1. In other words, when learning user preferences in implicit CF, more attention is paid to the pairwise association between an observed interaction (u,i) and another unobserved interaction (u,j) rather than r ui and r uj The absolute value of .

[0034] The goal of learning can be formulated as minimizing the following loss function (i.e., objective function), which can be expressed as the following equation (2):

[0035]

[0036] Among them, negative samples (u, j) can be distributed according to the specified distribution p ns (j|u) is sampled. Commonly used p ns (j|u) is a uniform distribution. Learning the above goal is equivalent to observing such a pairing relationship r ui >r uj The possibility of maximizing . Other objective functions in the implicit CF problem can be used to replace the above objective function.

[0037] Uniform random sampling is the most commonly used negative sample sampling method. In addition, the prior art also discloses a Generative Adversarial Network (GAN) that is used to replace uniform sampling and achieves better embedding effects. Among them, the most important observation is that "most negative samples have very small scores (scores obtained from the scoring function)". Therefore, in uniform sampling, the negative samples extracted are likely to have very small scores, which will result in only low-quality negative samples being sampled during the training of the CF model, and will cause the gradient to return to zero too quickly when it should not return to zero during the training of the CF model, thereby terminating the training of the CF model algorithm prematurely. GAN solves this problem by training a generator constructed by a neural network while training the original model. In particular, the generator will give a score distribution of negative samples, and negative samples will be extracted based on this. The generator can simulate the distribution of negative samples very well, and therefore can effectively give negative samples with higher scores, thereby avoiding the problem of uniform sampling. Although GAN can extract negative samples with higher scores, it cannot robustly handle false negative samples because the scores of false negative samples may also be high. In addition, the selection of negative samples is a discrete optimization problem, and reinforcement learning must be used to train the GAN-based CF model; and reinforcement learning itself is very unstable and slow to train, so the GAN-based method is also difficult to train.

[0038] In addition, existing work has also overlooked the problem that it does not need to model the complex overall distribution of negative samples. Especially in the later stages of training, only the negative samples with large scores are useful, and these only account for a small proportion of all negative samples. GAN can model the overall distribution, but at the same time, it spends a lot of time and parameters on useless small-score negative samples. Therefore, the GAN-based model is inefficient.

[0039] Considering the above problems, this paper mainly studies the following three aspects to design a more robust and simple negative sampling method:

[0040] 1. How to obtain the dynamic distribution of true negative samples with a simple model. In the implicit CF problem, true negative samples are hidden in a large amount of unobserved / unlabeled data together with false negative samples. Although negative samples in other fields follow a skewed distribution and can be modeled by simple models, it is not known whether the existing technology can be applied to the implicit CF problem where only true negative samples are expected.

[0041] 2. How to reliably measure the quality of negative samples. Given the risk of introducing false negative samples, a more reliable way to measure the quality of negative samples is needed, that is, to design a discrimination standard that can accurately identify true negative samples with high quality.

[0042] 3. How to effectively sample high-quality true negative samples. Although general machine learning methods (such as sample quadratic weighting methods) can learn effective information from unlabeled and noisy data, these methods are not suitable for implicit CF. This is because a large number of unlabeled user-item interactions need to be effectively modeled.

[0043] Based on the above problems and analysis, the present disclosure proposes a cache-based model to simply capture the dynamic distribution of true negative samples. For example, a computer cache will be used to retain only high-scoring negative samples, and then high-quality negative samples will be selected from the computer cache, thereby achieving effective and high-speed learning of the CF model. In particular, a cache mechanism will be established for each user. This cache will be dynamically updated during the algorithm iteration process during model training, and negative samples will be extracted from this cache. At the same time, considering that negative samples with high variance are of high quality and more effective, negative samples with high variance are sampled when extracting negative samples from this cache, thereby avoiding the noise of false negative samples.

[0044] The training scheme of the CF model disclosed in the present invention is generated under the above background. The specific implementation method can refer to the records of the following embodiments.

[0045] Figure 1 1 is a flowchart showing a collaborative filtering model training method according to an exemplary embodiment of the present disclosure. The CF model training method of this embodiment may be performed by a CF model training device, which may be an electronic device with a physical entity. In addition, the CF model training device of this embodiment may be a software integrated application.

[0046] Reference Figure 1 In step S101, a sample buffer is set, wherein the sample buffer stores a portion of samples in the sample space, wherein the portion of samples includes S1 negative samples, where S1 is a positive integer. The sample space may include a positive sample space and a negative sample space, and the samples in the sample space are pairs related to user-item interactions.

[0047] When initializing the sample buffer, S1 negative samples may be uniformly sampled from the negative sample space and placed in the sample buffer. Optionally, S1 negative samples with higher scores may be selected from the negative sample space based on the evaluation function and placed in the sample buffer. For example, the above equations (1) and (2) may be used to select S1 negative samples and place them in the sample buffer to initialize the sample buffer.

[0048] As an example, a sample buffer M of size S1 may be allocated to each user u. u , sample buffer M u The negative samples used for sampling are stored in M u ={(u,k1),(u,k2),...,(u,kS1)}, where S1 can be a hyperparameter.

[0049] In addition, to improve efficiency, all positive samples of the same user u can be designed as a shared sample buffer M u .

[0050] In step S102, in each iterative training process of at least part of the iterative training process of training the collaborative filtering model: first update the sample buffer, and then select the negative samples participating in the collaborative filtering model training from the updated sample buffer, or first select the negative samples participating in the collaborative filtering model training from the sample buffer, and then update the sample buffer.

[0051] Since the collaborative filtering model keeps changing during the training process, it is necessary to dynamically update M u To obtain the desired candidate samples for negative sampling. Specifically, S2 negative samples can be uniformly sampled from the specified sample space, where S2 is a positive integer; S1 negative samples are selected from the S1 negative samples already in the sample buffer and the sampled S2 negative samples; and the sample buffer is updated using the selected S1 negative samples. Here, the specified sample space can be a space including negative samples with scores recorded at different training times (such as multiple epochs) for subsequent prediction variance calculation. For example, M can be first u Expand to in, It can include S2 candidate samples that are uniformly sampled, and then Select S1 hard candidate samples to obtain new M u . Wherein, S2 may be a hyperparameter. For example, S2 negative samples selected from the specified sample space may have scores from the first five rounds of training, so that the prediction variance of the corresponding negative samples can be calculated.

[0052] In order to ensure that the sample buffer M u Only samples that provide useful information are retained in M, and a score-based update strategy can be used to dynamically update M. u , so that M uIncluding more difficult negative samples. Specifically, the evaluation function can be used to calculate the scores of S1+S2 negative samples for each positive sample sampled from the positive sample space, and then S1 negative samples are selected from the S1+S2 negative samples according to the scores of the S1+S2 negative samples. For example, the scores of S1+S2 negative samples can be calculated according to the above equation (1). However, the above example is only exemplary and the present disclosure is not limited thereto.

[0053] When selecting S1 negative samples from S1+S2 negative samples, the first S1 negative samples with the highest scores can be selected from the S1+S2 negative samples. Optionally, for each negative sample in the S1+S2 negative samples, the extraction probability of each negative sample is calculated based on the score of the S1+S2 negative samples, and S1 negative samples are sequentially extracted from the S1+S2 negative samples according to the extraction probabilities corresponding to the S1+S2 negative samples, so as to achieve M u Updates.

[0054] For example, M can be updated by sampling S1 negative samples according to the following probability distribution (3): u :

[0055]

[0056] Among them, the temperature coefficient τ∈(0,+∞) can make the extraction probability Pay more attention to samples with large scores.

[0057] In addition, oversampling hard-to-classify negative samples may increase the risk of introducing false negative samples, thereby weakening the robustness of the above score-based update strategy. To solve this problem, considering the low variance characteristics of false negative samples, a robust sampling strategy can be adopted, that is, by selecting negative samples with high variance to effectively avoid such noise.

[0058] The present disclosure selects a sample buffer M from which S1 candidates with high performance are stored according to a criterion based on high variance. u Specifically, the prediction variance of each negative sample in the sample buffer is calculated, and negative samples with high prediction variance are selected from the sample buffer as negative samples participating in the collaborative filtering model training according to the calculated prediction variance of each negative sample.

[0059] Assume there is a positive sample (u,i) and a sample buffer M of user u u , for sample buffer M u Each negative sample (u,k)∈M u , the following equation (4) is used to select valid negative samples as negative samples for participating in the training of the collaborative filtering model:

[0060]

[0061] Among them, [P pos (k|u,i)] represents the set of probabilities that the negative samples (u,k) are positive samples relative to the positive samples (u,i) at different training times, α t is a hyperparameter used to control the importance of high variance in the tth round of training. mean represents the value used to calculate P pos (k|u,i) is relative to the mean of the t-th round of training, and std is used to calculate [P pos (k|u,i)].

[0062] The step of calculating the prediction variance of each negative sample in the sample buffer may include: obtaining the scores of each negative sample in the sample buffer at different training times or the probability that each negative sample is a positive sample; and calculating the prediction variance of each negative sample based on the scores of each negative sample in the sample buffer at different training times or the probability that each negative sample is a positive sample. In the present disclosure, different training times may indicate different epochs.

[0063] As an example, for the sample buffer M u The prediction variance std[P pos (k|u,i)] can be calculated using the scores or probabilities of the negative samples (u,k) in the last five rounds of training. For example, it can be calculated using the following equations (5) and (6):

[0064]

[0065]

[0066] With this setting, the calculation results can be made more stable and the cost for each sampling operation can be kept constant.

[0067] According to an embodiment of the present disclosure, sample uncertainty may be determined based on the last five rounds of training. However, the above number of rounds is only exemplary, and the present disclosure is not limited thereto.

[0068] In actual data experiments, the data set is very large. If the prediction probability / score is calculated for all user-item pairs in each training epoch, it is very time-consuming. Therefore, in the present disclosure, for each user's sample buffer update process, the item space can be pruned to avoid recording the prediction probability / score of all items. Specifically, randomly sample from the item set generated in the (t-5)th round of training. At the same time, for the items in the item set generated in the (t-5) round of training, record the P in the last 5 rounds of training. pos(k|u,i). Therefore, the prediction results from the previous iteration can be used directly without any additional forward or backward propagation of r.

[0069] In the sample buffer M of user u u In addition to the previous items retained from the previous training, the newly added items also have P pos In the history of the last 5 training rounds, the above variance calculation can be achieved.

[0070] The training method of the CF model of this embodiment can be performed according to the small batch data mode.

[0071] Based on the above Figure 1 As described in the embodiment shown, based on the sample buffer M described above u , the algorithm is iterated according to the algorithm flow shown in Table 1. Specifically, the algorithm is iterated T times as a whole. In each iteration, a batch of sample data R with a size of B is first selected. batch (Step 4), then for each batch The positive samples in are negatively sampled based on the sample buffer (steps 6-7); then the sample buffer is updated (steps 8-9); finally, the user embedding vector and the item embedding vector as well as the learning parameters are updated.

[0072] Table 1

[0073]

[0074]

[0075] In the algorithm flow shown in Table 1 above, in each iteration process, negative samples are first selected from the sample buffer for this iteration training, and then the sample buffer is updated. However, in another embodiment of the present invention, in each iteration process, the sample buffer may be updated first, and then negative samples are selected from the sample buffer for this iteration training.

[0076] Through the above scheme, updating the sample buffer can retain negative samples with higher corresponding scores in the sample buffer, and then selecting negative samples with high variance from the updated sample buffer to participate in the training of the CF model. In this way, the CF model can be trained using negative samples with high scores and variances, thereby improving the training efficiency and robustness of the CF model.

[0077] Figure 2 is a block diagram showing a collaborative filtering model training apparatus according to an exemplary embodiment of the present disclosure. Figure 2, the training device 200 may include an initialization module 201 and a training module 202. Each module in the training device 200 may be implemented by one or more modules, and the name of the corresponding module may vary according to the type of the module. In various embodiments, some modules in the training device 200 may be omitted, or additional modules may be included. In addition, the modules / elements according to various embodiments of the present disclosure may be combined to form a single entity, and thus may equivalently perform the functions of the corresponding modules / elements before the combination.

[0078] The initialization module 201 can be used to set a sample buffer, wherein the sample buffer stores a portion of samples in the sample space, wherein the portion of samples includes S1 negative samples, where S1 is a positive integer. For example, the initialization module 201 can uniformly sample S1 negative samples from the negative sample space and put them into the sample buffer, or can select S1 negative samples with higher scores from the negative sample space based on the evaluation function and put them into the sample buffer.

[0079] The training module 202 may, in each iterative training process of at least part of the iterative training process of training the collaborative filtering model: first update the sample buffer, and then select negative samples participating in the collaborative filtering model training from the updated sample buffer, or first select negative samples participating in the collaborative filtering model training from the sample buffer, and then update the sample buffer.

[0080] The training module 202 may uniformly sample S2 negative samples from the specified sample space, where S2 is a positive integer; select S1 negative samples from the existing S1 negative samples in the sample buffer and the sampled S2 negative samples; and use the selected S1 negative samples to update the sample buffer.

[0081] The training module 202 may calculate the scores of S1+S2 negative samples using an evaluation function for each positive sample batch sampled from the positive sample space, and select S1 negative samples from the S1+S2 negative samples according to the scores of the S1+S2 negative samples.

[0082] The training module can select the first S1 negative samples with the highest scores from the S1+S2 negative samples, or for each negative sample in the S1+S2 negative samples, calculate the extraction probability of each negative sample based on the scores of the S1+S2 negative samples; according to the extraction probabilities corresponding to each of the S1+S2 negative samples, extract S1 negative samples from the S1+S2 negative samples in turn, thereby completing the update of the sample buffer.

[0083] The training module 202 may calculate the prediction variance of each negative sample in the sample buffer; and select negative samples with high prediction variance from the sample buffer according to the calculated prediction variance of each negative sample as negative samples participating in the collaborative filtering model training.

[0084] The training module 202 can obtain the scores of each negative sample in the sample buffer at different training times or the probability that each negative sample is a positive sample, and then calculate the prediction variance of each negative sample based on the scores of each negative sample in the sample buffer at different training times or the probability that each negative sample is a positive sample.

[0085] The CF model training device of this embodiment, by adopting the above-mentioned modules to realize the implementation principle and technical effect of CF model training is the same as that of the above-mentioned related method embodiments. For details, please refer to the records of the above-mentioned related method embodiments, which will not be repeated here.

[0086] Reference above Figure 1 to Figure 2 The training method and apparatus of the CF model according to the exemplary embodiments of the present disclosure are described. However, it should be understood that the devices shown in the drawings may be configured separately as software, hardware, firmware, or any combination of the above items to perform specific functions. For example, these devices may correspond to dedicated integrated circuits, pure software codes, or modules that combine software and hardware. In addition, one or more functions implemented by these devices may also be uniformly performed by components in physical entity devices (e.g., processors, clients, or servers, etc.).

[0087] In addition, the above method may be implemented by instructions recorded on a computer-readable storage medium. For example, according to an exemplary embodiment of the present disclosure, a computer-readable storage medium storing instructions may be provided, wherein, when the instructions are executed by at least one computing device, the at least one computing device is prompted to perform the following steps: setting a sample buffer, wherein the sample buffer stores a portion of samples in the sample space, the portion of samples includes S1 negative samples, and S1 is a positive integer; in each iterative training process of at least part of the iterative training process of training the collaborative filtering model: first updating the sample buffer, and then selecting negative samples participating in the collaborative filtering model training from the updated sample buffer, or first selecting negative samples participating in the collaborative filtering model training from the sample buffer, and then updating the sample buffer.

[0088] The instructions stored in the computer-readable storage medium can be executed in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. It should be noted that the instructions can also be used to perform additional steps in addition to the above steps or perform more specific processing when performing the above steps. The contents of these additional steps and further processing have been described in reference to Figure 1 to Figure 2 It is mentioned in the description of the related method, so it will not be repeated here to avoid repetition.

[0089] It should be noted that the CF model training method and device according to the exemplary embodiments of the present disclosure can completely rely on the operation of computer programs or instructions to realize the corresponding functions, that is, each device corresponds to each step in the functional architecture of the computer program, so that the entire system is called through a special software package (for example, lib library) to realize the corresponding functions.

[0090] On the other hand, when Figure 2 When the device shown is implemented in software, firmware, middleware or microcode, the program code or code segment for performing the corresponding operation may be stored in a computer-readable medium such as a storage medium, so that at least one processor or at least one computing device can perform the corresponding operation by reading and running the corresponding program code or code segment.

[0091] For example, according to an exemplary embodiment of the present disclosure, a system including at least one computing device and at least one storage device storing instructions may be provided, wherein the instructions, when executed by the at least one computing device, prompt the at least one computing device to perform the following steps: setting a sample buffer, wherein the sample buffer stores a portion of samples in a sample space, wherein the portion of samples includes S1 negative samples, where S1 is a positive integer; in each iterative training process of at least part of the iterative training process of training a collaborative filtering model: first updating the sample buffer, and then selecting negative samples participating in the collaborative filtering model training from the updated sample buffer, or first selecting negative samples participating in the collaborative filtering model training from the sample buffer, and then updating the sample buffer.

[0092] Specifically, the above-mentioned device and system can be deployed in a server or client, or can be deployed on a node in a distributed network environment. In addition, the system can be a PC computer, a tablet device, a personal digital assistant, a smart phone, a web application or other device capable of executing the above-mentioned instruction set. In addition, the system can also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.). In addition, all components of the system can be connected to each other via a bus and / or a network.

[0093] Here, the system is not necessarily a single system, but may be any collection of devices or circuits that can execute the above instructions (or instruction sets) individually or jointly. The system may also be part of an integrated control system or system manager, or may be configured as a portable electronic device that is interconnected with a local or remote (e.g., via wireless transmission) interface.

[0094] In the system, the at least one computing device may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller or a microprocessor. As an example and not limitation, the at least one computing device may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc. The computing device may run instructions or codes stored in one of the storage devices, wherein the storage device may also store data. Instructions and data may also be sent and received over a network via a network interface device, wherein the network interface device may use any known transmission protocol.

[0095] The storage device may be integrated with the computing device, for example, RAM or flash memory is arranged within an integrated circuit microprocessor, etc. In addition, the storage device may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The storage device and the computing device may be operatively coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the computing device can read instructions stored in the storage device.

[0096] The above describes various exemplary embodiments of the present disclosure, and it should be understood that the above description is only exemplary and not exhaustive, and the present disclosure is not limited to the disclosed exemplary embodiments. Without departing from the scope and spirit of the present disclosure, many modifications and changes are obvious to those of ordinary skill in the art. Therefore, the scope of protection of the present disclosure should be based on the scope of the claims.

Claims

1. A collaborative filtering model training method, comprising: A sample buffer is set, wherein the sample buffer stores a portion of samples in a sample space, wherein the sample space includes a positive sample space and a negative sample space, and the portion of samples includes S1 negative samples, where S1 is a positive integer; In each iterative training process of at least part of the iterative training process of training the collaborative filtering model: first update the sample buffer, then select the negative sample participating in the collaborative filtering model training from the updated sample buffer, or first select the negative sample participating in the collaborative filtering model training from the sample buffer, and then update the sample buffer; Based on at least part of the iterative training process, obtaining the collaborative filtering model; The steps of selecting negative samples for collaborative filtering model training include: Calculate the prediction variance of each negative sample in the sample buffer; According to the calculated prediction variance of each negative sample, negative samples with high prediction variance are selected from the sample buffer as negative samples participating in the collaborative filtering model training. The positive samples represent samples of observed user-item interactions, and the negative samples represent samples of unobserved user-item interactions. The collaborative filtering model is used to recommend corresponding items to users.

2. The method according to claim 1, wherein: The steps to set up the sample buffer include: Uniformly sample S1 negative samples from the negative sample space and put them into the sample buffer; or Based on the evaluation function, S1 negative samples with higher scores are selected from the negative sample space and put into the sample buffer.

3. The method according to claim 1, wherein: The steps to update the sample buffer include: Uniformly sample S2 negative samples from the specified sample space, where S2 is a positive integer; Select S1 negative samples from the S1 negative samples already in the sample buffer and the sampled S2 negative samples; The sample buffer is updated using the selected S1 negative samples.

4. The method according to claim 3, wherein: The step of selecting S1 negative samples from the existing S1 negative samples in the sample buffer and the sampled S2 negative samples includes: For each positive sample sampled from the positive sample space, the evaluation function is used to calculate the score of S1+S2 negative samples; S1 negative samples are selected from the S1+S2 negative samples according to the scores of the S1+S2 negative samples.

5. The method according to claim 4, wherein: The step of selecting S1 negative samples according to the scores of the S1+S2 negative samples includes: Select the first S1 negative samples with the highest scores from the S1+S2 negative samples; or For each negative sample in the S1+S2 negative samples, the extraction probability of each negative sample is calculated based on the scores of the S1+S2 negative samples, and S1 negative samples are extracted from the S1+S2 negative samples in sequence according to the extraction probabilities corresponding to each of the S1+S2 negative samples.

6. The method according to claim 1, wherein: The step of calculating the prediction variance of each negative sample in the sample buffer comprises: Obtaining scores of each negative sample in the sample buffer at different training times or probabilities that each negative sample is a positive sample; The prediction variance of each negative sample is calculated based on the scores of each negative sample in the sample buffer at different training times or the probability that each negative sample is a positive sample.

7. A training device for a collaborative filtering model, comprising: An initialization module, used for setting a sample buffer, wherein the sample buffer stores a portion of samples in a sample space, wherein the sample space includes a positive sample space and a negative sample space, wherein the portion of samples includes S1 negative samples, and S1 is a positive integer; A training module, used for, in each iterative training process of at least part of the iterative training process of training the collaborative filtering model: first updating the sample buffer, then selecting negative samples participating in the collaborative filtering model training from the updated sample buffer, or first selecting negative samples participating in the collaborative filtering model training from the sample buffer, and then updating the sample buffer; Based on at least part of the iterative training process, obtaining the collaborative filtering model; The steps of selecting negative samples for collaborative filtering model training include: Calculate the prediction variance of each negative sample in the sample buffer; According to the calculated prediction variance of each negative sample, negative samples with high prediction variance are selected from the sample buffer as negative samples participating in the collaborative filtering model training. The positive samples represent samples of observed user-item interactions, and the negative samples represent samples of unobserved user-item interactions. The collaborative filtering model is used to recommend corresponding items to users.

8. The device according to claim 7, wherein: The initialization module is used to: Uniformly sample S1 negative samples from the negative sample space and put them into the sample buffer; or Based on the evaluation function, S1 negative samples with higher scores are selected from the negative sample space and put into the sample buffer.

9. The device according to claim 7, wherein: The training module is used to: Uniformly sample S2 negative samples from the specified sample space, where S2 is a positive integer; Select S1 negative samples from the S1 negative samples already in the sample buffer and the sampled S2 negative samples; The sample buffer is updated using the selected S1 negative samples.

10. The device according to claim 9, wherein: The training module is used to: For each positive sample sampled from the positive sample space, the evaluation function is used to calculate the score of S1+S2 negative samples; S1 negative samples are selected from the S1+S2 negative samples according to the scores of the S1+S2 negative samples.

11. The device according to claim 10, wherein: The training module is used to: Select the first S1 negative samples with the highest scores from the S1+S2 negative samples; or For each negative sample in the S1+S2 negative samples, the extraction probability of each negative sample is calculated based on the scores of the S1+S2 negative samples; and S1 negative samples are extracted from the S1+S2 negative samples in sequence according to the extraction probabilities corresponding to each of the S1+S2 negative samples.

12. The device according to claim 7, wherein: The training module is used to: Obtaining scores of each negative sample in the sample buffer at different training times or probabilities that each negative sample is a positive sample; The prediction variance of each negative sample is calculated based on the scores of each negative sample in the sample buffer at different training times or the probability that each negative sample is a positive sample.

13. A computer-readable storage medium storing instructions, wherein: When the instructions are executed by at least one computing device, the at least one computing device is prompted to perform the method according to any one of claims 1 to 6.

14. A system comprising at least one computing device and at least one storage device storing instructions, wherein: When the instructions are executed by the at least one computing device, the at least one computing device is prompted to perform the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Content identification method, content distribution method, device, and electronic device

    CN109086345A

  • A recommendation model training method and a related device

    CN109902708A

  • Commodity recommendation method, device and system, computer equipment and storage medium

    CN110889747A

  • User risk assessment method and device, electronic equipment and storage medium

    CN111080123A

  • Graph embedding model training method and device, computing equipment and readable medium

    CN111324776A