An adaptive incremental training method for video recommendation model

Through the adaptive incremental training method of video recommendation model, the newly added content is strengthened and the parameters of the existing content are tuned, which solves the problems of low efficiency and poor results of incremental training in the existing technology, and achieves more efficient model updates and recommendation effects.

CN114254154BActive Publication Date: 2025-04-08WUXI YSTEN TECH
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202111331733.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-11
Publication Date
2025-04-08
Estimated Expiration
2041-11-11

AI Technical Summary

Technical Problem

When the existing video recommendation model faces millions of user data and hundreds of millions of scale model parameters, the incremental training efficiency is low and the effect is poor, resulting in the model being unable to be updated in time, affecting the recommendation effect.

Method used

Adaptive incremental training method of video recommendation model is adopted, and the relevant model parameters of the newly added content are strengthened based on the trained basic model, and the relevant parameters of the trained content are tuned. The training sample proportion and model training coefficient are dynamically adjusted through multiple repeated sub-training processes.

Benefits of technology

It realizes the advantages of shorter time to complete training, higher incremental training efficiency and relatively better results than full training, and can train better model results in less time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114254154B_ABST
    Figure CN114254154B_ABST
Patent Text Reader

Abstract

The present invention discloses an adaptive incremental training method for a video recommendation model. Based on a basic model, the newly added content is subjected to intensive training, and the existing content is optimized to obtain a final training result. The specific steps are as follows: extracting and dividing sample data, initializing relevant model parameters of the newly added content, and adaptive incremental training. The present invention designs an adaptively adjusted incremental training method, which can effectively reduce the amount of training data, take into account the prediction effects of the newly added content and the existing content, automatically find the best training results, dynamically adjust the number of sub-training repetitions according to the training status, and effectively shorten the training time. Compared with full training, the incremental training based on the trained model of the present invention has the advantages of shorter time consumption, higher efficiency and relatively better effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video content recommendation, in particular to a method for adaptive incremental training of a video recommendation model. Background Art

[0002] Video content recommendation technology mines users' viewing behaviors and interests to provide personalized content recommendations for each user, helping users find their favorite video content faster and better. In recent years, with the substantial improvement of computer computing power and storage capacity, deep learning technology has been increasingly studied and applied in the field of video recommendation.

[0003] Compared with traditional machine learning algorithms, deep learning has obvious advantages in recommendation effects based on massive data scale and complex model structure. At the same time, the training process of deep learning models also requires more hardware resources and time costs. With the continuous increase in user data and the continuous evolution of algorithm models, the cost of model training has become increasingly heavy. Therefore, how to save training costs and how to effectively perform incremental training have begun to receive more attention.

[0004] A user's historical viewing behavior fully reflects the user's preference for video content. Most video recommendation algorithm models are based on the collection of content that the user has watched historically, attempting to explore the content characteristics and the regularity of the user's viewing behavior, and then obtain the user's precise preferences and predict the next content the user wants to watch.

[0005] Patent publication number CN113268633A extracts the video click sequence of each sample user, splits it into historical click sequence and target video, and calculates the viewing depth of each user on the target video. Finally, a video recommendation model is constructed based on the sample user's target video, historical click sequence, user attribute characteristics, viewing depth and other feature data.

[0006] Patent No. CN113207010A extracts user preference features from the user's historical long-term playback records and extracts user real-time status features from recent playback records. The recommended candidate list is determined based on the matching degree between the user feature data and the live content features, and the user's feedback on the recommended candidate list is determined based on the user's historical behavior, thereby constructing a supervised learning model based on sorting.

[0007] Currently, most recommendation technologies focus on extracting more user data and building more complex models to achieve better recommendation results. Model training usually adopts a simple method of regular full updates. However, in actual industrial applications, faced with millions or even tens of millions of user data and tens of millions or even hundreds of millions of model parameters, each full model training takes a long time. Incremental training, as a solution for fast training of small amounts of data based on existing models, has high practical value.

[0008] Most of the existing incremental training-related patents are aimed at improving a specific recommendation algorithm.

[0009] Patent No. CN112437349A designs an incremental calculation method based on secondary matrix sampling for the matrix decomposition algorithm: first, the original scores related to the newly added users or items are extracted to form a sub-matrix with lower sparsity; then the popular items are sampled a second time to form a sub-matrix with lower dimension, which reduces the algorithm's time complexity and computational overhead and speeds up model training.

[0010] Patent No. CN110807153A proposes a general incremental training idea: reuse the content or user feature vectors that appeared in the previous training, only randomly initialize the new content or user data, and only use recent data instead of all data during training. Although this method can reduce the amount of calculation for incremental training, the effect is difficult to guarantee.

[0011] At present, there are not many studies on incremental training methods. Most recommendation algorithm models adopt the full training method, that is, all parameters of the model are initialized each time for training, and all sample data are used to train and update the model parameters. With the rapid growth of user data and the increasing complexity of models, each training takes hours or even days, resulting in the inability to update the model in time. New content or new interests of users cannot be reflected in the model in time, thus affecting the recommendation effect of the model.

[0012] In addition, the update rate of sample data is limited. For example, in the scenario of large-screen TV, there are only a few hundred new contents online every day, and most of the model parameters related to the contents have been completed in the previous training. If all parameters are re-initialized and re-trained every time, a lot of computing resources are actually wasted.

[0013] Although some technical solutions propose to randomly initialize only the newly added content or new user data and only use the recently added data for training, this solution has the following two disadvantages:

[0014] 1. Some parameters that are randomly initialized may have different distribution characteristics from the rest of the trained parameters in the model. During the secondary training process after merging, the model needs to spend more training cost to balance the distribution difference between the new and old parameters, resulting in reduced training efficiency.

[0015] 2. Using only newly added sample data for training can fully train the model parameters related to the newly added content, but it may also cause the model to be more "biased" towards new content, and the parameters related to the "old" content will be disturbed during incremental training, which will ultimately affect the overall recommendation effect.

[0016] Therefore, existing video recommendation models have the problems of long time-consuming full training, low efficiency and poor effect of incremental training. Summary of the invention

[0017] The purpose of the present invention is to provide a method for adaptive incremental training of a video recommendation model. The present invention has the advantages of shorter time consumption, higher efficiency and relatively better effect of incremental training based on a trained model compared with full training.

[0018] The technical solution of the present invention is a method for adaptive incremental training of a video recommendation model. Based on a trained basic model, the model parameters related to the newly added content are intensively trained, and the parameters related to the stock content that has been trained in the basic model are optimized, and finally the final training result is obtained. The specific steps are as follows:

[0019] A. Extract and divide sample data: Extract the full amount of sample data and divide the sample data into multiple subsets with different functions for subsequent training and testing;

[0020] B. Initializing model parameters related to the newly added content: Initializing model parameters related to the newly added content using auxiliary information including at least content tags;

[0021] C. Adaptive incremental training.

[0022] In the aforementioned video recommendation model adaptive incremental training method, the sample data is advanced and divided as described in step A, and its specific contents are as follows:

[0023] A1. Obtain full training sample data: extract all user video content information from TL to T-1, and summarize it at the user granularity; T is the current training date, and L is used to control the amount of data involved in the training according to actual adjustments;

[0024] A2. Divide the full amount of training sample data: Divide the full amount of sample data into four mutually exclusive data sets based on whether the user's playback history contains new content;

[0025] The four mutually exclusive data sets are as follows:

[0026] TestSet1: Randomly select a certain proportion P1 from all sample data containing new content as the first validation set to verify the prediction effect of the model on new content. 0 < P1 < 1, and generally P1 is not higher than 0.2;

[0027] TestSet2: Randomly select a certain proportion P2 from all sample data containing only existing content as the second validation set to measure whether the prediction effect of the model on existing content is stable. 0 < P2 < 1, and generally P2 is not higher than 0.2;

[0028] TrainSet1: The set of the remaining data in all sample data containing new content after excluding TestSet1;

[0029] TrainSet2: The set of the remaining data in all sample data containing only existing content after excluding TestSet2.

[0030] In the foregoing video recommendation model adaptive incremental training method, for the initialization of the model parameters related to new content described in step B, the model parameters related to existing content have been trained in the basic model, so the corresponding parameters in the basic model can be directly extracted as the initialization parameters of the incremental training model;

[0031] The model parameters related to existing content are related to a specific model structure. Taking the BERT4Rec model as an example, the model parameters related to content include: 1) The Embedding layer parameters of content IDs, and 2) The softmax parameters of the output layer of the interest distribution of all content by users;

[0032] The specific content of the initialization of the model parameters related to new content is as follows:

[0033] B1. Extract the labels of all content: Each new content has a large classification label and multiple theme labels; the theme labels are finer-grained and describe the video content in multiple dimensions based on a certain architecture (Google content classification system), including: the era when the story takes place, the type of emotion expressed, the age of the audience, the IP series to which it belongs, and several other dimensions; different content providers will build their own label systems according to the actual content characteristics;

[0034] B2. Screen out the candidate subset of each new content: For each new content, screen out all existing content with the same large classification label value as the candidate subset;

[0035] B3. Calculate the theme label overlap degree in the candidate subset: Calculate the theme label overlap degree between each content in the candidate subset and this new content. The calculation formula is same(x,y) represents the number of overlapping subject tags of two contents, and |x| and |y| represent the number of subject tags that the contents have;

[0036] B4. Obtaining a similar content set: Selecting K existing contents with the largest overlap of subject labels as a similar content set of the newly added content;

[0037] B5. Obtaining initialization parameters for the new content: extracting the corresponding parameters of the similar content set obtained in B4 in the basic model, calculating their average value, and using the average value as the initialization parameters for the new content.

[0038] In the aforementioned video recommendation model adaptive incremental training method, the adaptive incremental training described in step C is specifically as follows:

[0039] Incremental training consists of multiple repeated sub-training processes. Each round of sub-training process is completed by the cooperation of five parts: training sample extraction module, sample data processing module, model training module, model evaluation module, and training control module.

[0040] The execution flow of the sub-training process is as follows:

[0041] C1, training sample extraction module: input data sets TrainSet1 and TrainSet2 to extract training samples;

[0042] C2, sample data processing module;

[0043] C3. Model training module: The model training module is an algorithm model that meets the following requirements: 1. The model input feature is the user's historical viewing content, 2. The model output result is the predicted target content;

[0044] C4, model evaluation module: input data sets TestSet1 and TestSet2 for model evaluation, and output model evaluation results;

[0045] C5, training control module: execute the subsequent process according to the model evaluation result of C4. If re-training is required, execute step C1; if re-training is not required, execute step C6;

[0046] C6. Output the model and end.

[0047] In the aforementioned video recommendation model adaptive incremental training method, the training sample extraction module described in step C1 has the following specific contents:

[0048] Input TrainSet1 and TrainSet2 as candidate training sample sets into the training sample extraction module;

[0049] According to formula C TrainSet2=α*|TrainSet2| Sampling TrainSet2 at a certain ratio, α is the dynamically changing sampling ratio coefficient, the initial value of α is 0 and the maximum value is

[0050] Merge all TrainSet1 and partially sampled TrainSet2 data, shuffle and reorder them to ensure that the mixed training sample data is evenly distributed.

[0051] In the aforementioned video recommendation model adaptive incremental training method, the sample data processing module described in step C2 has the following specific contents:

[0052] Each sample data contains the user's viewing history sequence, which is sorted according to the playback time, denoted as V = {v1,v2,...,v N}, where N is the total number of contents watched by the user;

[0053] The sample data processing module extracts two parts, namely, the viewing feature and the target content, from each sample data: the viewing feature is a continuous content sequence V' = {v1, v2, ..., v x-1}, where 1<=x<=N; the target content is the first content v after the viewing feature sequence x ;

[0054] The recommendation algorithm builds a model based on the viewing feature sequence to predict the content that the user wants to watch next, and uses the target content to measure the deviation of the model; the sample data processing module extracts more new content as target content when processing each sample data, which strengthens the recommendation effect of the new content. The steps are as follows:

[0055] C2.1. Calculate the random value rand x , where 0 <rand x <1; if rand x > rand filter , then execute step 2; otherwise, execute step 5; 0 <rand filter <1; rand filter The smaller it is, the higher the proportion of new content as target content;

[0056] C2.2. Calculate the position of all new content in V Pos = {p1, p2, ..., p n};

[0057] C2.3. Filter p from Pos i >p min The subset Pos', where p min is the minimum viewing sequence length required for training;

[0058] C2.4. Randomly select a p from Pos' x , intercept As a viewing feature, As target content;

[0059] C2.5. For sample data containing only existing content and new content samples that do not require special processing, calculate the random integer value p x (p min <p x <=N), intercept As a viewing feature, as target content.

[0060] In the aforementioned video recommendation model adaptive incremental training method, the model training module described in C3 adopts the BERT4Rec model, and its specific contents are as follows:

[0061] C3.1. Split the merged training sample data extracted in step C2 into multiple sample subsets with a fixed size batch_size;

[0062] C3.2. Input the audience feature data in the first sample subset into the BERT4Rec model, and the model calculates and outputs the probability distribution P(V) of the user's preference for all content corresponding to each sample;

[0063] C3.3. Calculate the deviation between the preference probability distribution P(V) and the target content in the sample subset, using cross entropy as the loss function, is the target content in the sample subset;

[0064] C3.4. Use a certain learning rate ρ and use the Adam algorithm to optimize and adjust the relevant model parameters of all contents; the initial value of ρ is the empirical value 0.001, and the subsequent value of ρ is set by the training control module;

[0065] C3.5. Take the second sample subset and repeat steps C3.2-C3.4 until all sample subsets have been trained.

[0066] In the aforementioned video recommendation model adaptive incremental training method, the model evaluation module described in step C4 has the following specific contents:

[0067] TestSet1 and TestSet2 are used as test samples to input into the model evaluation module;

[0068] C4.1. Extract the audience features and target content from the test sample data:

[0069] The test sample data is the data after the TestSet data is processed by the training sample extraction module and the training data processing module;

[0070] a) For TestSet1, calculate the position p of the last new content in V x ,Pick As a viewing feature, As target content;

[0071] b) For TestSet2, the last content of the sequence is used as the target content, that is, V' = {v1, v2, ..., v N-1} as the viewing feature and vN as the target content, where N = |V|;

[0072] C4.2. Input the viewing feature data in the test sample into the current model to obtain the user's preference probability distribution on all contents, and select the TopK contents with the largest preference values ​​as the prediction result set of the model; if the target content of the test sample is included in the corresponding prediction result set, it means that the prediction of the sample is correct, otherwise it is wrong;

[0073] C4.3. Count the percentage of samples predicted correctly in TestSet1 and TrainSet2 respectively, and record them as Recall@S1 and Recall@S2 as prediction accuracy indicators; Recall@S1 represents the effect of the model in recommending new content, and Recall@S2 represents the effect of the model in recommending existing content data.

[0074] In the aforementioned video recommendation model adaptive incremental training method, the training control module described in step C5 adjusts the next sub-training process according to the result obtained by the model evaluation module, and the specific contents are as follows:

[0075] The training control module uses the tag value e to record the number of times the sub-training process has been repeated, and the initial value is 0;

[0076] C5.1.e<4, adjust the α coefficient of the next sub-training process α e+1 =α e +C base , add a certain proportion of the stock content training data (TrainSet1), skip all subsequent steps, and directly enter the next round of sub-training process; C base It is a fixed value greater than 0, which is used to adjust the rate of increase of the proportion of stock sample data;

[0077] C5.2.e≥4, set two flag values ​​with initial values ​​of 0 new and Flag sum Used for training status judgment:

[0078] a) When Recall@S1 e ≥Recall@S2 e +bias, indicating that the prediction effect of the new content has exceeded that of the existing content, set Flag new =Flag sum +1, and save the model result of the previous sub-training, recorded as Model new ; Bias can be adjusted based on the tolerance for the difference in recommendation effects between new content and existing content in actual applications;

[0079] b) When Recall@S1 e <Recall@S2 e +bias, set Flag new =0;

[0080] c) When Recall@S1 e+1 *w1+Recall@S2 e+1 *w2+

[0081] |Recall@S1 e+1 -Recall@S2 e+1 |*w3<Recall@S1 e *w1+

[0082] Recall@S2 e *w2+|Recall@S1 e -Recall@S2 e |*w3, represents the weighted comprehensive prediction index of the current model on the two test sets begins to decline, set Flag sum =Flag sum +1, and save the model result of the previous sub-training, recorded as Model sum ; w1, w2, and w3 are preset fixed weight values, which can be adjusted according to the preference of the recommendation effect of new content and existing content in actual applications, and the value range is between 0 and 1;

[0083] d) When Recall@S1 e+1 *w1+Recall@S2 e+1 *w2+

[0084] |Recall@S1 e+1 -Recall@S2 e+1 |*w3≥Recall@S1 e *w1+

[0085] Recall@S2 e *w2+|Recall@S1e -Recall@S2 e |*w3, set Flag sum =0, keep the model result of the current sub-training, recorded as Model sum ;

[0086] C5.3. Determine whether the next sub-training process is needed:

[0087] a) If Flag new ≥3, then stop training and take Model new As the final training result;

[0088] b) If Flag sum ≥3, then stop training and take Model sum As the final training result;

[0089] c) If e ≥ e max , then stop training and use Model sum As the final training result; e max The maximum number of repetitions for model sub-training that is preset can be adjusted based on the actual computing resources and training time requirements;

[0090] d) Otherwise, continue to step C5.4;

[0091] C5.4. Adjust the relevant training coefficients:

[0092] a) If Flag new =Flag sum =0, then set α e+1 =α e +C base , ρ = 0.001;

[0093] b) If 3>Flag new >0 or 3 > Flag sum >0, then set α e+1 =α e +0.5*C base , ρ = 0.0005;

[0094] c) Accumulate the number of sub-trainings currently completed, and set e=e+1.

[0095] Compared with the existing technology, an adaptive incremental training method is designed to effectively reduce the amount of training data, take into account the prediction effects of new content and existing content, automatically find the best training results, dynamically adjust the number of sub-training repetitions according to the training status, and effectively shorten the training time;

[0096] Based on the evaluation results of multiple test set data, the sample ratio, model training coefficient, and training iteration rounds can be automatically adjusted to take into account the prediction effects of new content and existing content, and better model results can be trained in less time.

[0097] With the help of auxiliary information such as labels, the model parameters related to the newly added content are initialized before incremental training. Compared with using random value initialization, this is more in line with the current model parameter distribution law and can improve the efficiency and effect of subsequent training.

[0098] Therefore, the incremental training based on the trained model in the present invention has the advantages of shorter time consumption, higher efficiency and relatively better effect compared with full training. BRIEF DESCRIPTION OF THE DRAWINGS

[0099] Figure 1 is a flow chart of the present invention;

[0100] Figure 2 It is a flow chart of the adaptive incremental training sub-training process of the present invention. DETAILED DESCRIPTION

[0101] The present invention is further described below in conjunction with the accompanying drawings and embodiments, but they are not intended to limit the present invention.

[0102] Embodiment. A video recommendation model adaptive incremental training method, such as Figure 1-2 As shown in the figure, based on the trained basic model, the model parameters related to the newly added content are strengthened and the parameters related to the stock content that have been trained in the basic model are optimized to obtain the final training results. The specific steps are as follows:

[0103] A. Extract and divide sample data: Extract the full amount of sample data and divide the sample data into multiple subsets with different functions for subsequent training and testing;

[0104] B. Initializing model parameters related to the newly added content: Initializing model parameters related to the newly added content using auxiliary information including at least content tags;

[0105] C. Adaptive incremental training.

[0106] In the aforementioned video recommendation model adaptive incremental training method, the sample data is advanced and divided as described in step A, and its specific contents are as follows:

[0107] A1. Obtaining full training sample data: extracting all user video content information played within TL to T-1, and summarizing it at user granularity; T is the current training date, L = 90;

[0108] The summary data of a user is a training sample; each sample data contains all the video contents played by the same user in a specified time period;

[0109] A2. Divide the full amount of training sample data: Divide the full amount of sample data into four mutually exclusive data sets based on whether the user's playback history contains new content;

[0110] The four mutually exclusive data sets are:

[0111] TestSet1: Randomly extract a certain proportion P1 from all sample data containing new content as the No. 1 validation set to verify the model's prediction effect on new content, P1 = 0.1;

[0112] TestSet2: Randomly extract a certain proportion P2 from all sample data containing only stock content as the second validation set to measure whether the prediction effect of the model on stock content is stable, P2 = 0.07;

[0113] TrainSet1: A collection of all sample data containing new content, excluding the rest of the data in TestSet1;

[0114] TrainSet2: A collection of sample data that contains only stock content, excluding the rest of the data in TestSet2.

[0115] The model parameters related to the initialization of the newly added content described in step B are as follows:

[0116] B1. Extracting labels of all contents: Each content has a large classification label and multiple subject labels; all contents are all video contents appearing in the training sample;

[0117] B1.1 Major classification labels include: movies, TV series, children, animation, variety shows, documentaries, sports, education, information, life, entertainment, music, finance, folk art, and e-sports;

[0118] B1.2 Theme tags include: urban, romance, puzzle, action, adventure, etc., with more than 800 specific tag values; each content will be assigned a different number of tags, usually between 1 and 10;

[0119] B2. Filter out candidate subsets for each new content: For each new content, filter out all existing content with the same major category label value as the candidate subset;

[0120] B3. Calculate the overlap of subject labels in the candidate subset: Calculate the overlap of subject labels of each content in the candidate subset and the newly added content. The calculation formula is: same(x,y) represents the number of overlapping subject tags of two contents, and |x| and |y| represent the number of subject tags that the contents have;

[0121] B4. Obtaining a similar content set: Selecting K existing contents with the largest overlap of subject labels as a similar content set of the newly added content;

[0122] B5. Obtaining initialization parameters for the new content: extracting the corresponding parameters of the similar content set obtained in B4 in the basic model, calculating their average value, and using the average value as the initialization parameters for the new content.

[0123] The specific contents of the adaptive incremental training described in step C are as follows:

[0124] Incremental training consists of multiple repeated sub-training processes. Each round of sub-training process is completed by the cooperation of five parts: training sample extraction module, sample data processing module, model training module, model evaluation module, and training control module.

[0125] The execution flow of the sub-training process is as follows:

[0126] C1, training sample extraction module: input data sets TrainSet1 and TrainSet2 to extract training samples;

[0127] C2, sample data processing module;

[0128] C3. Model training module: The model training module is an algorithm model that meets the following requirements: 1. The model input feature is the user's historical viewing content, 2. The model output result is the predicted target content;

[0129] C4, model evaluation module: input data sets TestSet1 and TestSet2 for model evaluation, and output model evaluation results;

[0130] C5, training control module: execute the subsequent process according to the model evaluation result of C4. If re-training is required, execute step C1; if re-training is not required, execute step C6;

[0131] C6. Output the model and end.

[0132] The specific contents of the training sample extraction module described in step C1 are as follows:

[0133] Input TrainSet1 and TrainSet2 as candidate training sample sets into the training sample extraction module;

[0134] According to formula C TrainSet2=α*|TrainSet2| Sampling TrainSet2 at a certain ratio, α is the dynamically changing sampling ratio coefficient, the initial value of α is 0 and the maximum value is

[0135] Merge all TrainSet1 and partially sampled TrainSet2 data, shuffle and reorder them to ensure that the mixed training sample data is evenly distributed.

[0136] The sample data processing module described in step C2 has the following specific contents:

[0137] Each sample data contains the user's viewing history sequence, which is sorted according to the playback time, denoted as V = {v1,v2,...,v N}, where N is the total number of contents watched by the user;

[0138] The sample data processing module extracts two parts, namely, the viewing feature and the target content, from each sample data: the viewing feature is a continuous content sequence V' = {v1, v2, ..., v x-1}, where 1<=x<=N; the target content is the first content v after the viewing feature sequence x ;

[0139] The sample data processing module extracts more new content as target content according to the following steps when processing each sample data:

[0140] C2.1. Calculate the random value rand x , where 0 <rand x <1; if rand x > rand filter , then execute step 2; otherwise, execute step 5; rand filter =0.3;

[0141] C2.2. Calculate the position of all new content in V Pos = {p1, p2, ..., p n};

[0142] C2.3. Filter p from Pos i > min The subset Pos', where p min is the minimum viewing sequence length required for training;

[0143] C2.4. Randomly select a p from Pos' x , intercept As a viewing feature, As target content;

[0144] C2.5. For sample data containing only existing content and new content samples that do not require special processing, calculate the random integer value p x (p min <p x <=N), intercept As a viewing feature, as target content.

[0145] The model training module described in C3 adopts the BERT4Rec model, and its specific contents are as follows:

[0146] C3.1. Split the merged training sample data extracted in step C2 into multiple sample subsets with a fixed size batch_size; the training sample data is the data processed by the training sample extraction module and the training data processing module of the Traiset data;

[0147] C3.2. Input the audience feature data in the first sample subset into the BERT4Rec model, and the model calculates and outputs the probability distribution P(V) of the user's preference for all content corresponding to each sample;

[0148] C3.3. Calculate the deviation between the preference probability distribution P(V) and the target content in the sample subset, using cross entropy as the loss function, is the target content in the sample subset;

[0149] C3.4. Use a certain learning rate ρ and use the Adam algorithm to optimize and adjust the relevant model parameters of all contents; the initial value of ρ is the empirical value 0.001, and the subsequent value of ρ is set by the training control module;

[0150] C3.5. Take the second sample subset and repeat steps C3.2-C3.4 until all sample subsets have been trained.

[0151] The model evaluation module described in step C4 has the following specific contents:

[0152] TestSet1 and TestSet2 are used as test samples to input into the model evaluation module;

[0153] C4.1. Extract the audience features and target content from the test sample data:

[0154] The test sample data is the data after the TestSet data is processed by the training sample extraction module and the training data processing module;

[0155] a) For TrainSet1, calculate the position p of the last new content in Vx ,Pick As a viewing feature, As target content;

[0156] b) For TestSet2, the last content of sequence V is used as the target content, that is, V' = {v1, v2, ..., v N-1} as the viewing feature and vN as the target content, where N = |V|;

[0157] C4.2. Input the viewing feature data in the test sample into the current model to obtain the user's preference probability distribution on all contents, and select the TopK contents with the largest preference values ​​as the prediction result set of the model; if the target content of the test sample is included in the corresponding prediction result set, it means that the prediction of the sample is correct, otherwise it is wrong;

[0158] C4.3. Count the percentage of samples predicted correctly in TestSet1 and TrainSet2 respectively, and record them as Recall@S1 and Recall@S2 as prediction accuracy indicators; Recall@S1 represents the effect of the model in recommending new content, and Recall@S2 represents the effect of the model in recommending existing content data.

[0159] The training control module described in step C5 adjusts the next sub-training process according to the results obtained by the model evaluation module, and the specific contents are as follows:

[0160] The training control module uses the tag value e to record the number of times the sub-training process has been repeated, and the initial value is 0;

[0161] C5.1.e<4, adjust the α coefficient of the next sub-training process α e+1 =α e +C base , increase a certain proportion of the stock content training data, skip all subsequent steps, and directly enter the next round of sub-training process; C base =0.4;

[0162] C5.2.e≥4, set two flag values ​​with initial values ​​of 0 new and Flag sum Used for training status judgment:

[0163] a) When Recall@S1 e ≥Recall@S2 e +bias, indicating that the prediction effect of the new content has exceeded that of the existing content, set Flag new =Flag sum +1, and save the model result of the previous sub-training, recorded as Model new; bias = 0.05;

[0164] b) When Recall@S1 e <Recall@S2 e +bias, set Flag new =0;

[0165] c) When Recall@S1 e+1 *w1+Recall@S2 e+1 *w2+

[0166] |Recall@S1 e+1 -Recall@S2 e+1 |*w3<Recall@S1 e *w1+

[0167] Recall@S2 e *w2+|Recall@S1 e -Recall@S2 e |*w3, represents the weighted comprehensive prediction index of the current model on the two test sets begins to decline, set Flag sum =Flag sum +1, and save the model result of the previous sub-training, recorded as Model sum ; w1=0.3, w2=0.7, w3=0.25;

[0168] d) When Recall@S1 e+1 *w1+Recall@S2 e+1 *w2+

[0169] |Recall@S1 e+1 -Recall@S2 e+1 |*w3≥Recall@S1 e *w1+

[0170] Recall@S2 e *w2+|Recall@S1 e -Recall@S2 e |*w3, set Flag sum =0, keep the model result of the current sub-training, recorded as Model sum ;

[0171] C5.3. Determine whether the next sub-training process is needed:

[0172] a) If Flag new ≥3, then stop training and take Model newAs the final training result;

[0173] b) If Flag sum ≥3, then stop training and take Model sum As the final training result;

[0174] c) If e ≥ e max , then stop training and use Model sum As the final training result; e max =12;

[0175] d) Otherwise, continue to step C5.4;

[0176] C5.4. Adjust the relevant training coefficients:

[0177] a) If Flag new =Flag sum =0, then set α e+1 =α e +C base , ρ = 0.001;

[0178] b) If 3>Flag new >0 or 3 > Flag sum >0, then set α e+1 =α e +0.5*C base , ρ = 0.0005;

[0179] c) Accumulate the number of sub-trainings currently completed, and set e=e+1.

[0180] The training control module adjusts the number and proportion of training samples as needed in each round of training based on the evaluation results of multiple test sets. This allows effective reinforcement training of new content with a small amount of data during initial training, while balancing the prediction effect of existing content in subsequent sub-training processes.

[0181] This module automatically controls multiple training correlation coefficients, slows down sample changes and model update rates when the training effect reaches a certain bottleneck, and automatically stops training when the specified conditions are met;

[0182] Based on the control module, the incremental training method of the present invention can reduce the amount of training data, shorten the training time, and obtain the best model results.

[0183] In practical applications, the above embodiment can shorten the training time to about 1 / 4 of the full training time, while also achieving a higher prediction accuracy.

[0184] The final training result of the video recommendation model of this application is a series of parameters trained for each video content.

[0185] Assume that the basic model is fully trained based on the data set S1 (full training means that all training starts from scratch and is only based on the training data set), and S1 contains three video contents V1 / V2 / V3, then the relevant parameters of these three contents will be trained. This is the stock content and its related parameters.

[0186] Incremental training is a simplified training based on the new data set S2 and some of the parameters that have been trained in the basic model. S2 will contain V1 / V2 / V3, as well as new content V4 / V5.

[0187] 1) For the newly added content V4 / V5, parameter training starts from 0 (parameters of similar content will be used for reference during initialization)

[0188] 2) For the existing content V1 / V2 / V3, although the relevant parameters have been trained on the basic model, further optimization can still be performed, and the amount of calculation required for optimization is much smaller than that for retraining.

Claims

1. A video recommendation model adaptive incremental training method, characterized by: Based on the trained basic model, the model parameters related to the newly added content are strengthened and the parameters related to the existing content that have been trained in the basic model are optimized to obtain the final training results. The specific steps are as follows: A. Extract and divide sample data: Extract the full amount of sample data and divide the sample data into multiple subsets with different functions for subsequent training and testing; B. Initializing model parameters related to the newly added content: Initializing model parameters related to the newly added content using auxiliary information including at least content tags; C. Adaptive incremental training, the specific contents are as follows: Incremental training consists of multiple repeated sub-training processes. Each round of sub-training process is completed by the cooperation of five parts: training sample extraction module, sample data processing module, model training module, model evaluation module, and training control module. The execution flow of the sub-training process is as follows: C1, training sample extraction module: input data sets TrainSet1 and TrainSet2 to extract training samples; C2, sample data processing module; C3. Model training module: The model training module is an algorithm model that meets the following requirements:

1. The model input feature is the user's historical viewing content, 2. The model output result is the predicted target content; C4, model evaluation module: input data sets TestSet1 and TestSet2 for model evaluation, and output model evaluation results; C5, training control module: execute the subsequent process according to the model evaluation result of C4, and if re-training is required, execute step C1; No need to train again, go to step C6; C6. Output the model and end.

2. The video recommendation model adaptive incremental training method according to claim 1, characterized in that ,The specific contents of extracting and dividing sample data as described in step A are as follows: A1. Obtain full training sample data: extract all user video content information from TL to T-1, and summarize it at the user granularity; T is the current training date, and L is used to control the amount of data involved in the training according to actual adjustments; A2. Divide the full amount of training sample data: Divide the full amount of sample data into four mutually exclusive data sets based on whether the user's playback history contains new content; The four mutually exclusive data sets are: TestSet1: Randomly extract a certain proportion P1 from all sample data containing new content as the first validation set to verify the prediction effect of the model on the new content. <P1<1; TestSet2: Randomly extract a certain proportion P2 from all sample data containing only stock content as the second validation set to measure whether the prediction effect of the model on stock content is stable. <P2<1; TrainSet1: A collection of all sample data containing new content, excluding the rest of the data in TestSet1; TrainSet2: A collection of sample data that contains only stock content, excluding the rest of the data in TestSet2.

3. The video recommendation model adaptive incremental training method according to claim 1, characterized in that: The specific contents of the model parameters related to the initialization of the newly added content described in step B are as follows: B1. Extract the tags of all content: Each content has a large category tag and multiple subject tags; B2. Filter out candidate subsets for each new content: For each new content, filter out all existing content with the same major category label value as the candidate subset; B3. Calculate the overlap of subject labels in the candidate subset: Calculate the overlap of subject labels of each content in the candidate subset and the newly added content. The calculation formula is: same(x,y) represents the number of overlapping subject tags of two contents, and |x| and |y| represent the number of subject tags that the contents have; B4. Obtaining a similar content set: Selecting K existing contents with the largest overlap of subject labels as a similar content set of the newly added content; B5. Obtaining initialization parameters for the new content: extracting the corresponding parameters of the similar content set obtained in B4 in the basic model, calculating their average value, and using the average value as the initialization parameters for the new content.

4. The video recommendation model adaptive incremental training method according to claim 1, characterized in that: The specific contents of the training sample extraction module described in step C1 are as follows: Input TrainSet1 and TrainSet2 as candidate training sample sets into the training sample extraction module; According to formula C TrainSet2 =α*|TrainSet2| Sampling TrainSet2 at a certain ratio, α is the dynamically changing sampling ratio coefficient, the initial value of α is 0 and the maximum value is Merge all TrainSet1 and partially sampled TrainSet2 data, shuffle and reorder them to ensure that the mixed training sample data is evenly distributed.

5. The video recommendation model adaptive incremental training method according to claim 1, characterized in that: The sample data processing module described in step C2 has the following specific contents: Each sample data contains the user's viewing history sequence, which is sorted according to the playback time, denoted as V = {v1,v2,...,v N }, where N is the total number of contents watched by the user; The sample data processing module extracts two parts, namely, the viewing feature and the target content, from each sample data: the viewing feature is a continuous content sequence V' = {v1, v2, ..., v x-1 }, where 1<=x<=N; the target content is the first content v after the viewing feature sequence x ; The sample data processing module extracts more new content as target content according to the following steps when processing each sample data: C2.

1. Calculate the random value rand x , where 0 <rand x <1; if rand x > rand filter , then execute step 2; otherwise, execute step 5; 0 <rand filter <1; C2.

2. Calculate the position of all new content in V Pos = {p 1, p2,...,p n }; C2.

3. Filter p from Pos i >p min The subset Pos', where p min is the minimum viewing sequence length required for training; C2.

4. Randomly select a p from Pos' x , intercept As a viewing feature, As target content; C2.

5. For sample data containing only existing content and new content samples that do not require special processing, calculate the random integer value p x (p min <p x <=N), intercept As a viewing feature, as target content.

6. The video recommendation model adaptive incremental training method according to claim 5, characterized in that: The model training module described in C3 adopts the BERT4Rec model, and its specific contents are as follows: C3.

1. Split the merged training sample data extracted in step C2 into multiple sample subsets with a fixed size batch_size; C3.

2. Input the audience feature data in the first sample subset into the BERT4Rec model, and the model calculates and outputs the probability distribution P(V) of the user's preference for all content corresponding to each sample; C3.

3. Calculate the deviation between the preference probability distribution P(V) and the target content in the sample subset, using cross entropy as the loss function, is the target content in the sample subset; C3.

4. Use a certain learning rate ρ and use the Adam algorithm to optimize and adjust the relevant model parameters of all contents; the initial value of ρ is the empirical value 0.001, and the subsequent value of ρ is set by the training control module; C3.

5. Take the second sample subset and repeat steps C3.2-C3.4 until all sample subsets have been trained.

7. The video recommendation model adaptive incremental training method according to claim 6, characterized in that: The model evaluation module described in step C4 has the following specific contents: TestSet1 and TestSet2 are used as test samples to input into the model evaluation module; C4.

1. Extract the audience features and target content from the test sample data: The test sample data is the data after the TestSet data is processed by the training sample extraction module and the training data processing module; a) For TestSet1, calculate the position p of the last new content in V x ,Pick As a viewing feature, As target content; b) For TestSet2, the last content of sequence V is used as the target content, that is, V' = {v1, v2, ..., v N-1 }As a viewing feature, v N As the target content, where N = |V|; C4.

2. Input the viewing feature data in the test sample into the current model to obtain the user's preference probability distribution on all contents, and select the TopK contents with the largest preference values ​​as the prediction result set of the model; if the target content of the test sample is included in the corresponding prediction result set, it means that the prediction of the sample is correct, otherwise it is wrong; C4.

3. Count the percentage of samples predicted correctly in TestSet1 and TrainSet2 respectively, and record them as Recall@S1 and Recall@S2 as prediction accuracy indicators; Recall@S1 represents the effect of the model in recommending new content, and Recall@S2 represents the effect of the model in recommending existing content data.

8. The video recommendation model adaptive incremental training method according to claim 7, characterized in that: The training control module described in step C5 adjusts the next sub-training process according to the results obtained by the model evaluation module, and the specific contents are as follows: The training control module uses the tag value e to record the number of times the sub-training process has been repeated, and the initial value is 0; C5.1.e<4, adjust the α coefficient of the next sub-training process α e+1 =α e +C base , increase a certain proportion of the stock content training data, skip all subsequent steps, and directly enter the next round of sub-training process; C base It is a fixed value greater than 0, which is used to adjust the rate of increase of the proportion of stock sample data; C5.2.e≥4, set two flag values ​​with initial values ​​of 0 new and Flag sum Used for training status judgment: a) When Recall@S1 e ≥Recall@S2 e +bias, indicating that the prediction effect of the new content has exceeded that of the existing content, set Flag new =Flag sum +1, and save the model result of the previous sub-training, recorded as Model new ; Bias can be adjusted based on the tolerance for the difference in recommendation effects between new content and existing content in actual applications; b) When Recall@S1 e <Recall@S2 e +bias, set Flag new =0; c) When Recall@S1 e+1 *w1+Recall@S2 e+1 *w2+|Recall@S1 e+1 -Recall@S2 e+1 |*w3<Recall@S1 e *w1+Recall@S2 e *w2+|Recall@S1 e -Recall@S2 e |*w3, represents the weighted comprehensive prediction index of the current model on the two test sets begins to decline, set Flag sum =Flag sum +1, and save the model result of the previous sub-training, recorded as Model sum ; w1, w2, and w3 are preset fixed weight values, which can be adjusted according to the preference of the recommendation effect of new content and existing content in actual applications, and the value range is between 0 and 1; d) When Recall@S1 e+1 *w1+Recall@S2 e+1 *w2+|Recall@S1 e+1 -Recall@S2 e+1 |*w3≥Recall@S1 e *w1+Recall@S2 e *w2+|Recall@S1 e -Recall@S2 e |*w3, set Flag sum =0, keep the model result of the current sub-training, recorded as Model sum ; C5.

3. Determine whether the next sub-training process is needed: a) If Flag new ≥3, then stop training and take Model new As the final training result; b) If Flag sum ≥3, then stop training and take Model sum As the final training result; c) If e ≥ e max , then stop training and use Model sum As the final training result; e max The maximum number of repetitions for model sub-training is preset, which can be adjusted according to the actual computing resources and training time requirements; d) Otherwise, continue with step C5.4; C5.

4. Adjust the relevant training coefficients: a) If Flag new =Flag sum =0, then set α e+1 =α e +C base , ρ = 0.001; b) If 3>Flag new >0 or 3 > Flag sum >0, then set α e+1 =α e +0.5*C base , ρ = 0.0005; c) Accumulate the number of sub-trainings currently completed, and set e=e+1.

Citation Information

Patent Citations

  • Recommendation method and device based on incremental updating, computer equipment and storage medium

    CN110807153A

  • Video stream recommendation method and related device

    CN112437349A

  • Model training method, live broadcast recommendation method, equipment and program product

    CN113207010A

  • Short video recommendation method

    CN113268633A

  • Recommendation system for providing personalized and mixed content on a user interface based on content and user similarity

    CA3074621A1