A video recommendation method and system based on mixed feedback and time series
By combining explicit and implicit feedback through the CAT-DIENRec model and utilizing Transformer and AUGRU models, the problem of bias in the depiction of user interests in existing technologies is solved, and the fine-grained capture of user interest states and accurate prediction of long-term and short-term interests are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHENGZHOU UNIVERSITY OF LIGHT INDUSTRY
- Filing Date
- 2024-09-23
- Publication Date
- 2026-05-19
AI Technical Summary
Existing video recommendation methods mainly rely on a single feedback mechanism, which leads to biases in the depiction of user interests and fails to accurately capture users' instantaneous and long-term changes in interests.
We employ the CAT-DIENRec model based on hybrid feedback and time series, combining explicit and implicit feedback. We use the Transformer model for cross-attention calculation and the AUGRU model for interest state evolution to improve feature extraction and long-distance dependency capabilities.
It enables more accurate capture of user interest states, improves the personalization effect of recommendation systems, and enhances the ability to understand and predict users' long-term and short-term interests.
Smart Images

Figure CN119357428B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of recommendation systems, and in particular to a video recommendation method and system based on hybrid feedback and time series. Background Technology
[0002] In recent years, short videos have gradually emerged and gained immense popularity. Platforms like TikTok and Kuaishou boast massive user bases and traffic. Given this huge user base and traffic, recommendation systems (RS) have become a key technology in this field. Researchers have developed various recommendation system methods in recent years, all aiming to build user profiles through user feedback to achieve better recommendations and fulfill platform goals.
[0003] Early recommendation models evolved from collaborative filtering (CF) and matrix factorization (TF) to logistic regression algorithms that integrate multiple features, leading to the development of deep learning-based methods, such as the AFM model, which was among the first to incorporate attention mechanisms. In recent years, researchers have proposed various new recommendation system models, including the Self-Attentive Sequential Recommendation (SASRec) model, the BERT4Rec model, and the Deep Interest Network (DIN) and Deep Interest Evolution Network (DIEN) models proposed by Alibaba. These recommendation models in the short video field aim to achieve the goals of short video platforms by interpreting user behavior, such as increasing user retention, engagement, and viewing time. The DIEN model, in particular, has gained widespread recognition for its approach of learning the evolution of user interests and predicting those interests. For example, W Xu et al. introduced a hierarchical attention network to propose a deep interest prediction model with a hierarchical attention network; Feng et al. introduced Bi-LSTM to propose a deep conversational interest network; and Shi et al. used neural networks to continuously model the evolution of interests, proposing a deep temporal flow framework.
[0004] In practical applications, users engage in feedback in two ways. One is through explicit feedback, provided by interactions such as likes, comments, and follows. This explicit feedback has been widely used as an indicator of user preferences. While effective in its immediate impact, it is somewhat random and offers limited insights into long-term user impressions. In some cases, it can mislead the assessment of content quality. For example, content with an eye-catching title but poor content quality might initially attract attention and receive positive feedback, but ultimately abuse user trust, leading to decreased user retention and engagement. This leads to another form of user feedback: implicit feedback, provided by the duration of video viewing. However, implicit feedback itself is not entirely reliable. For instance, watching a 60-second video for 20 seconds doesn't necessarily elicit a stronger preference than repeatedly watching a 5-second video for 15 seconds, even though the former involves more viewing time. Therefore, directly extracting preference information from user feedback as interest tags can create biases regarding user interests. Consequently, methods have emerged that attempt to optimize raw feedback to eliminate biases arising from its unreliability. However, these methods require significant manual work and may not align with platform goals.
[0005] Chinese patent application CN108875022B discloses a video recommendation method and apparatus. The method utilizes a trained deep learning model to ensure that the predicted click-through rate (CTR) of at least one first video in a test set of videos that have been exposed but not clicked by the user is greater than a preset CTR threshold. This first video, whose predicted CTR is greater than the threshold, is related to at least one second video in the test set of videos that have been exposed and clicked by the user, and the CTR of the first video is less than that of the second video. This allows the deep learning model to select both high-CTR and low-CTR videos from the candidate recommendation videos that align with the user's interests, and then recommend them to the user. Therefore, the video recommendation method provided in this application can both recommend videos that the user likes from the candidate recommendation videos and solve the cold start problem for new videos. However, this method only uses explicit feedback for recommendation and cannot accurately capture the user's interest state.
[0006] Human interests are diverse; at any given moment, a person may possess multiple different interests, a situation described as "interest states." Secondly, each interest is dynamic and undergoes its own evolutionary process. Thirdly, the development of interests has certain causes and consequences (preceding and subsequent connections). Finally, interests can drift; that is, at any given moment, a user's interest may translate into behavior—for example, watching basketball-related videos for a period of time and then suddenly switching to calligraphy-related videos. However, due to limitations in past models, they could only predict a user's overall preferences based on a large sequence of historical behaviors, rather than predicting the user's "next" preferences. Summary of the Invention
[0007] To address the technical problem that most video recommendation methods rely on single feedback, which can lead to biases in depicting user interests, this invention proposes a video recommendation method and system based on hybrid feedback and time series analysis. The invention proposes the model CAT-DIENRec (Cross Attention Transformer-Deep Interest Evolution Network Recommendation), which utilizes a hybrid approach of two feedback methods to construct user interest states. This improves the model's feature extraction and long-distance dependency capabilities, better capturing both instantaneous and long-term user interests.
[0008] To achieve the above objectives, the technical solution of the present invention is implemented as follows:
[0009] A video recommendation method based on hybrid feedback and time series analysis includes the following steps:
[0010] S1: Obtain candidate videos, user information, and user interaction behavior information. Based on the candidate videos, user information, and user interaction behavior information, extract user behavior features, platform goals, contextual features, and user profile features.
[0011] S2: Divide user behavior features into explicit feedback and implicit feedback, and encode explicit feedback and implicit feedback respectively using word embedding to obtain explicit feedback embedding vector and implicit feedback embedding vector respectively; encode platform goals, context features and user profile features respectively and convert them into corresponding embedding vectors.
[0012] S3: Based on the Transformer model using time series encoding, cross-attention calculation is performed on the explicit feedback embedding vector and the implicit feedback embedding vector to obtain the user's interest state;
[0013] S4: Calculate the attention score using the user's interest state and the platform's goal. Calculate the attention score and user interest state based on the AUGRU model to obtain the AUGRU model output interest state sequence.
[0014] S5: Integrate the interest state sequence output by the AUGRU model with the embedding vectors corresponding to the platform target, context features and user portrait features respectively to obtain the probability value of the user's interest in the candidate videos, and output the recommendation list based on the probability value of the user's interest in the candidate videos.
[0015] The method for obtaining explicit feedback embedding vectors and implicit feedback embedding vectors in step S2 is as follows: User behavior features are divided into explicit feedback b resulting from user interaction behavior. i =[b i (1),b i (2),...,b i (t),...,b i (T-1),b i (T)] and the implicit feedback brought by the user's viewing time b d =[b d (1),b d (2),...,b d (t),...,b d (T-1),b d (T)], based on the category, respectively, explicit feedback b i and implicit feedback b d Perform word embedding to obtain the explicit feedback word embedding vector e i =[e i (1),e i (2),...,e i (t),…,e i (T-1),e i [(T)] and implicit feedback word embedding vector e d =[e d (1),e d (2),...,e d (t),…,e d (T-1),e d (T)], where e i (t), e d (t) represents the explicit feedback word embedding vector and the implicit feedback word embedding vector at time t, respectively, and T represents the final time. The process of encoding the platform target, context features and user profile features is as follows: the platform target, context features and user profile features are one-hot encoded respectively and then directly encoded in the Embedding layer to be converted into embedding vectors.
[0016] The method for cross-attention calculation of explicit and implicit feedback embedding vectors based on the Transformer model using time series encoding, as described in step S3, is as follows: In the encoder part of the Transformer model, accurate time information is used to replace the original position encoding. First, accurate time features are extracted from the timestamps of user behavior features. The time features are periodically encoded. The extracted time features are then linearly transformed and compared with the explicit feedback word embedding vector e. i and implicit feedback word embedding vector e d The dimensions are matched, and the results are summed to obtain an explicit feedback embedding vector Te containing time series information. i and implicit feedback embedding vector Te with time series information d Then, after linear transformation, an explicit feedback embedding vector Te containing time series information is obtained. i Query Q i Key Ki and value V i And the implicit feedback embedding vector Te with time series information d Query Q d Key K d Sum V d ; will query Q i With query Q d To perform the exchange, respectively using query Q d Key K i Sum V i And query Q i Key K d Sum V d The input for multi-head attention in the encoder is processed by both the encoder and decoder to obtain the explicit feedback probability distribution Hi and the implicit feedback probability distribution Hd, respectively. A weighted sum of the explicit and implicit feedback probability distributions Hi and Hd is then performed to obtain the user interest state h. t .
[0017] The method for calculating attention scores using user interest states and platform goals, as described in step S4, is as follows: First, calculate the interest state h. t The correlation score e with the platform objective at time step t t :
[0018] e t =v T ·tanh(W3h t +W4q+b3)
[0019] Where q represents the embedding vector of the currently recommended platform target, W3 and W4 are the projected weight matrices, v is a learnable weight parameter, tanh represents the activation function, and b3 is the bias term;
[0020] Then, attention weight normalization is performed to obtain the attention score a. t :
[0021]
[0022] Exp(e t ) indicates that the relevance score is converted to a positive number, e j This represents the relevance score at the j-th time step.
[0023] The method for calculating attention scores and user interest states based on the AUGRU model in step S4 is as follows: First, the explicit feedback and implicit feedback at user time t are concatenated to obtain the current time step input x. t Update the gate by inputting x at the current time step. t interest state h at the previous time step t-1 Calculate the interest state h from the previous time step t-1 interest state h up to the current time step t Historical information that should be retained t Through external attention weights u t The update gate is dynamically adjusted based on the current time step input x. t interest state h at the previous time step t-1 Calculate candidate hidden state Based on candidate hidden state and historical information z t Calculate the output interest state h' t Finally, the interest state sequence h′=[h'1,h'2,...,h' is obtained. T ].
[0024] The current time step input x t The formula for calculating x is: t =Concat(b i ,b d The historical information z t The calculation formula is: z t =σ(W z [x t ,h t-1 ]+b z ), where W z and b z To update the weights and biases of the gate, σ is the activation function; the formula for dynamically adjusting the update gate is: Candidate hidden state The calculation formula is: Among them, W h and b h The weights and biases are calculated for the candidate hidden states, tanh is the activation function, and r is the weights and biases. t It's a reset door, r t =σ(W r [x t ,h t-1 ]+b r ), W r and b r To reset their weights and biases; the output interest state h' t The calculation formula is:
[0025] The method for integrating the output described in step S5 is as follows: The interest state sequence h′ obtained from the AUGRU model is encoded with the platform target, context features, and user portrait features to obtain embedding vectors. A concat operation is then performed to obtain a comprehensive feature vector representation x. This x is then passed to a fully connected layer where a linear transformation y2 = W5x + b4 is applied, where W5 is the weight matrix and b4 is the bias vector. The output y2 of the fully connected layer is then non-linearly transformed using the PReLU or Dice activation function. Finally, the output of the PReLU or Dice activation function is converted into a probability value indicating user interest in the candidate video using the Sigmoid function.
[0026] The PReLU activation function is:
[0027] y3 = max(0, y2) + αmin(0, y2)
[0028] The Dice activation function is:
[0029] y3=p·y2+(1-p)·w6y2
[0030] Where p is the activation probability and W6 is a learnable parameter.
[0031] A video recommendation system based on hybrid feedback and time series includes a behavior sequence layer, an interest extraction layer, an interest evolution layer and an output layer connected in sequence;
[0032] Behavior sequence layer: This layer is used to divide user behavior features into explicit feedback and implicit feedback. It uses word embeddings to encode explicit feedback and implicit feedback respectively, resulting in explicit feedback embedding vectors and implicit feedback embedding vectors. Platform goals, context features, and user profile features are encoded and converted into their respective embedding vectors.
[0033] Interest Extraction Layer: Used to perform cross-attention calculation on explicit and implicit feedback embedding vectors based on the Transformer model using time series encoding to obtain the user's interest state;
[0034] Interest Evolution Layer: Used to calculate attention scores by utilizing user interest states and platform goals. Based on the AUGRU model, the attention scores and user interest states are calculated to obtain the AUGRU model output interest state sequence.
[0035] Output layer: This layer integrates the interest state sequence output by the AUGRU model with the dense vectors corresponding to the platform target, context features, and user portrait features to obtain the probability that the user is interested in the candidate videos. Based on the probability that the user is interested in the candidate videos, a recommendation list is output.
[0036] The loss function L during the training process of the video recommendation system is:
[0037] L = L target +β*L aux
[0038] Among them, L target L is the cross-entropy loss after full connection. aux The auxiliary loss is defined as β, which is the weight of the auxiliary loss.
[0039] The cross-entropy loss is:
[0040]
[0041] Among them, y j These are real user behaviors. σ(y3) is the probability that the model predicts a user's interest in a candidate video, N is the sum of samples, and j = 1 to N represents all samples at this moment.
[0042] The auxiliary loss of the design is:
[0043]
[0044] in, This indicates the user's actual behavior in the next moment. The behavior obtained by negative sampling, where σ is the Sigmoid function.
[0045] The beneficial effects of this invention are as follows:
[0046] 1) To address the issue of limited feedback, this invention emphasizes the core role of a hybrid explicit and implicit feedback mechanism. This mechanism is crucial for constructing and refining user interest states. Explicit feedback, such as likes, comments, shares, and follows, directly reflects user preferences, but these responses are often immediate and superficial, potentially not fully representing long-term interests and deeper needs. In contrast, implicit feedback, such as viewing time, browsing path, and page dwell time, while not directly expressing user intent, provides more nuanced insights, reflecting potential user interests and habits.
[0047] 2) To improve the model's ability to handle long-range dependencies, this invention uses the Transformer structure, which has demonstrated excellent capabilities in processing complex sequence data. The core feature of the Transformer structure is its self-attention mechanism, which can effectively solve the long-range dependency problem encountered by traditional sequence processing models such as recurrent neural networks (RNNs) and long short-term memory networks (LSTMs) when processing long sequence data.
[0048] 3) To further refine the analysis of user behavior data and improve the accuracy of feature extraction, this invention incorporates a cross-attention mechanism into the model. This mechanism innovatively extends the traditional self-attention framework, enabling the model to focus more on the information most relevant to the current recommendation task when processing user behavior data. The introduction of the cross-attention mechanism is particularly suitable for complex recommendation system environments, where user behavior data often involves multiple types of interactions, each of which may have different importance to the prediction task. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 This is the overall framework diagram of the CAT-DIENRec model of the present invention.
[0051] Figure 2 This is a diagram of the Transformer architecture of the present invention.
[0052] Figure 3 This is a diagram illustrating the cross-attention mechanism architecture of the present invention.
[0053] Figure 4This is a structural diagram of the AUGRU (Attention-based Gated Recurrent Unit) module of the present invention.
[0054] Figure 5 This is a schematic diagram of the auxiliary loss structure of the present invention.
[0055] Figure 6 This invention presents a bar chart evaluating popular recommendation system models using four evaluation metrics: NDCG (Normally Distant Response Code), DS (Distance Time Used), IR (Interactive Rate), and PTR (Percentage of Retention). Detailed Implementation
[0056] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0057] like Figure 1 As shown, a video recommendation system based on hybrid feedback and time series includes: a behavior sequence layer, an interest extractor layer, an interest evolution layer, and an output layer connected in sequence.
[0058] The main function of the behavior sequence layer is to receive and organize users' historical behavior data into a time series. This data includes users' viewing, liking, and other behaviors. This layer is the basic input part of the model, used to obtain users' historical behavior sequences, and to provide basic data for subsequent interest extraction and evolutionary modeling.
[0059] The interest extraction layer processes the user's historical behavior sequence to extract the user's interest state at different times. The purpose is to capture the user's interest state on different items over a period of time, compressing the long-term behavior sequence into a more condensed interest state, which is convenient for subsequent layers to process.
[0060] The interest evolution layer captures the dynamic evolution of user interest states over time through further sequence modeling. This layer focuses on how user interest states change with time and new behavioral inputs. It can identify the direction and trend of changes in user interest states, helping the model predict the user's next behavior or point of interest.
[0061] The output layer's role is to fuse the user interest representation obtained from the interest evolution layer with other auxiliary features (such as user profiles, contextual information, etc.) and ultimately generate the output for prediction. These layers play a crucial role in the model's final prediction stage, responsible for mapping high-dimensional feature vectors to specific recommendation scores or categories.
[0062] like Figure 1 As shown, a video recommendation method based on hybrid feedback and time series analysis includes the following steps:
[0063] S1: Obtain candidate videos, user information, and user interaction behavior information. Based on the candidate videos, user information, and user interaction behavior information, extract user behavior features (duration and interaction), platform object, context features, and user profile features.
[0064] User behavior features include user behavior data within a specific time period, such as video viewing time, likes, comments, and other interactive behaviors. The duration feature calculates the time a user spends browsing a particular product or page. This duration feature is normalized or binned to form categorical or continuous features, while interaction features extract specific user interactions, such as click counts and purchase counts. These user behavior features can be directly used as elements in the behavior sequence. These features help the model understand the evolution of users' short-term and long-term interests. By processing these user behavior features through sequence models, the dynamic characteristics of user interests changing over time can be captured. By analyzing user behavior patterns, the model can predict content that users may be interested in in the future and make personalized recommendations.
[0065] The platform objective refers to the desired effect after the model attempts to make recommendations. Based on previous research on video recommendation, three metrics are used as the platform objectives: user usage time, user engagement, and user retention. The first two metrics are mainly derived from the total user viewing time and the number of user interactions, while the third metric is influenced by the user's interest in the recommended content.
[0066] Contextual features refer to environmental information related to the current behavior, such as time, location, and device type. After collecting contextual information when a user performs a behavior, including timestamps, geographical location, device type, and network status, it is encoded.
[0067] User profile features include static user information such as age, gender, and membership level. These features reflect users' long-term preferences and attributes. User profile data is collected from user registration information, historical behavior, and external data sources. This data is typically static or updated infrequently and is subsequently encoded.
[0068] S2: User behavior features are divided into explicit feedback and implicit feedback. Word embedding is used to encode explicit feedback and implicit feedback respectively, resulting in explicit feedback embedding vectors and implicit feedback embedding vectors respectively. Platform goals, context features, and user profile features are one-hot encoded and then directly encoded in the Embedding layer to be converted into embedding vectors.
[0069] In the behavior sequence layer of the CAT-DIENRec model, user behavior features are divided into explicit feedback b resulting from user interaction behavior. i =[b i (1),b i (2),...,b i (t),...,b i (T-1),b i (T)] and the implicit feedback brought by the user's viewing time b d =[b d (1),b d (2),...,b d (t),...,b d (T-1),b d (T)] respectively for explicit feedback b i and implicit feedback b d Word embedding is performed, specifically category embedding. For applications like recommendation systems, category features such as user ID and product ID are mapped to low-dimensional vectors through an embedding layer. This vector learns to represent the correlations between categories, resulting in an explicit feedback word embedding vector e. i =[e i (1),e i (2),...,e i (t),…,e i (T-1),e i [(T)] and implicit feedback word embedding vector e d =[e d (1),e d (2),...,e d (t),…,e d (T-1),e d (T)], where e i (t), e d(t) represents the explicit feedback word embedding vector and the implicit feedback word embedding vector at time t, respectively, and T represents the final time.
[0070] Explicit feedback b i and implicit feedback b d This represents two types of user behavior from time 1 to time T, namely, viewing duration and whether or not interaction occurs.
[0071] Explicit feedback word embedding vector e i and implicit feedback word embedding vector e d This represents the encoded vector obtained after encoding user behavior features from the first time point to the Tth time point.
[0072] S3: Based on the Transformer model using time series encoding, cross-attention calculation is performed on the explicit feedback embedding vector and the implicit feedback embedding vector to obtain the user's interest state.
[0073] The Transformer is a deep learning model whose core feature is the use of self-attention to process sequential data. This mechanism allows the model to process data without any recurrent neural networks (RNNs) or convolutional neural networks (CNNs). The input to a Transformer model is word embedding vectors, which are augmented with positional encoding to add positional information to the sequence. Positional encoding uses different frequencies of sine and cosine functions to encode positions, with these frequencies varying with position. The self-attention mechanism allows each position in the input sequence to pay attention to other positions. This process involves calculating the relationships between queries, keys, and values to determine the degree of influence between positions. The computation of self-attention includes dot products and a softmax function to generate the final attention weights. The Transformer model has an encoder and decoder structure. Each encoder consists of multiple encoding layers, and each decoder consists of multiple decoding layers. Each encoder layer comprises two main parts: a multi-head self-attention layer and a feedforward neural network. Each part is equipped with residual connections and layer normalization to help improve the stability and efficiency of training. In the multi-head attention mechanism, attention is divided into multiple heads, each processing a different part of the input data. This allows the model to simultaneously acquire information from different representation subspaces. Behind each multi-head attention layer is a feedforward neural network that processes the vector at each position independently. The decoder consists of layers similar to the encoder, but within each decoder layer, an encoder-decoder attention layer (the cross-attention layer in this invention) is added, which helps the decoder focus on the relevant parts of the encoder output. Finally, the output is processed, with the decoder's output transformed into a final probability distribution through a linear layer and a softmax layer, indicating the likelihood of the next word. Thus, the Transformer model optimizes parallel processing capabilities through these designs and significantly improves its ability to handle long-range dependencies. This architecture is particularly suitable for complex sequence processing tasks such as machine translation, text generation, and interest state prediction.
[0074] To accurately extract a user's interest state at each moment from their behavioral features, a Transformer network capable of processing time series data is needed. During training, the implicit feedback word embedding vector e obtained from the lower layer is first... d and explicit feedback word embedding vector e i The inputs are passed to the encoders of the Transformer model for learning, and a cross-attention mechanism is referenced when the self-attention mechanism of the encoders of the Transformer is passed to them, so that the query matrices generated by them are swapped.
[0075] The input to the Transformer model is an embedding vector, which adds positional information to the sequence through positional encoding. However, this invention eliminates the positional encoding of the Transformer and directly uses the correct time series encoding as a substitute.
[0076] In the Interest Extractor layer of the CAT-DIENRec model;
[0077] like Figure 2 As shown, the method for processing explicit and implicit feedback embedding vectors based on the Transformer model using time series encoding is as follows: In the encoder part of the Transformer model, accurate time information is used to replace the original position encoding. First, accurate time features are extracted from the timestamps of user behavior. These time features are periodically encoded. The extracted time features are then linearly transformed and combined with the explicit feedback word embedding vector e. i and implicit feedback word embedding vector e d The dimensions are matched, and then summed to obtain a new explicit feedback embedding vector Te with time series information. i and implicit feedback embedding vector Te with time series information d After linear transformation, explicit feedback embedding vectors Te containing time series information are obtained respectively. i Query Q i Key K i Sum V i And the implicit feedback embedding vector Te with time series information d Query Q d Key K d Sum V d ;like Figure 3 As shown, explicit feedback is embedded into vector e. i and implicit feedback embedding vector e d The queries Q generated after being passed to the Transformer model represent explicit feedback. i Query Q with implicit feedback d This exchange allows the Transformer to learn by simultaneously considering both user behaviors and their respective impacts on short-term and long-term interests, using query Q as a starting point. d Key K i Sum V i And query Q i Key K d Sum V d For input.
[0078] The subsequent computation process is the same in both Transformer models. Here, we take the subsequent computation of the explicit feedback embedding vector as an example.
[0079] First, the encoder part: In the first layer of encoding, the query Q is obtained. d Key K i Sum V i Next, multi-head attention computation is performed. Multi-head attention allows each position in the input sequence to pay attention to other positions. For the input matrix, different linear transformation matrices are used to project it into the query, key, and value spaces. This step generates separate query, key, and value vectors for each head.
[0080] Each head in multi-head attention is a self-attention computation, which goes through three steps: Scale, Softmax, and MatMul to calculate the attention output.
[0081] First, in the Scale operation, the query Q is... d and key K i The dot product result is scaled to prevent numerical instability caused by excessively large vector dimensions, thus keeping the attention score within a reasonable range. The formula is as follows:
[0082]
[0083] d k This is the dimension of the key, used to scale the size of the dot product and prevent excessively large values from causing the softmax function to enter regions with small gradients. Then, softmax (normalization) is performed to obtain the attention weights, whose formula is:
[0084] AttentionWeights i =Softmax(ScaledScores) i )
[0085] Finally, MatMul (matrix multiplication) combines the attention weights with the value V. i Multiplying these together yields the attention output for each head, using the following formula:
[0086] AttentionOutput i =AttentionWeights i ·V i
[0087] The above calculation process is the calculation process for multi-head attention computation:
[0088]
[0089] The multi-head attention then concatenates the outputs of all heads and maps them back to the model's original dimensions through a linear layer:
[0090] MultiHead(Q d ,K i V i )=Concat(head1,head2,...,head i ,...,head n W
[0091] W is the final linear transformation matrix, used to map the concatenated output back to the model's dimension.
[0092] The output of the multi-head attention is then residually concatenated with the original input, and layer normalization is performed to obtain the output O1:
[0093] O1 = LayerNorm(Te i +MultiHead(Q d ,K i V i ))
[0094] Residual connections facilitate the direct flow of information and prevent gradient vanishing, while layer normalization ensures the numerical stability of each layer.
[0095] Following the output of the multi-head attention mechanism, the Transformer model then proceeds to Feed-Forward Neural Network (FFN) layer I. FFN layer I performs independent nonlinear transformations on the vector at each position, further extracting features and enhancing the model's expressive power. In the feed-forward neural network, the first linear transformation is performed by applying the ReLU activation function to the output O1:
[0096] h = ReLu(W1O1 + b1)
[0097] Next, the vector h after the activation function is shrunk back to the original embedding dimension through a second linear transformation:
[0098] y1 = W2h + b2
[0099] Finally, perform Add & Norm (residual connectivity and layer normalization).
[0100] O2 = LayerNorm(O1 + y1)
[0101] After completing the above steps, the encoder output features are obtained through calculations by multiple coding layers. Then, the encoder output features are linearly transformed to obtain the query, key K1, and value V1 corresponding to the encoder output features, which are then input into the multi-head cross-attention layer of the decoder.
[0102] In the decoder section: In the first layer of the decoder, the features of the candidate videos (including the historical recommendations or generated sequences before the decoder) are embedded and time-encoded to obtain the decoder input features, which are then fed into the decoder. These embeddings help the decoder refer to information from different candidate videos during the prediction process. First, the decoder input features are linearly transformed to generate the query Q. z Key K z Sum V z This information is then fed into the computation of the masking multi-head algorithm. The computation of each decoding layer in the masking multi-head algorithm is similar to that of the multi-head attention mechanism, but a masking process is added after each self-attention scale.
[0103] Apply a mask as needed to conceal unnecessary parts, ensuring the model focuses on relevant content. The formula is as follows:
[0104]
[0105] MaskedScore=ScaledScores+Mask
[0106] d z It is key K z The attention weights are obtained by applying Softmax to the masked score matrix in the dimension of the query vector. These weights are used to measure the degree of attention the current query vector pays to other key vectors.
[0107] AttentionWeights=Softmax(MaskedScore)
[0108] And the attention weight matrix and the value vector matrix V z Multiplying these results in the attention output. This output reflects the weighted combination of different positions in the input sequence to obtain the attention output. Multiple heads (multiple independent attention calculations) perform the above steps in parallel, with each head obtaining an attention output. The outputs of all heads are concatenated, and an Add&Norm layer is used to transform the concatenated output into the final output.
[0109] Then, the query Q2 obtained from the result of the mask multi-head attention calculation and the key K1 and value V1 obtained from the encoder output features are used to perform multi-head cross-attention calculation between the encoder and decoder. The process of multi-head cross-attention calculation is the same as that of encoder multi-head attention calculation.
[0110] The output features of the multi-head cross-attention calculation are concatenated (Add) and normalized (Norm) and then residually connected to the result of the mask multi-head attention calculation. Then, they are passed through a feedforward neural network layer II and concatenated (Add) and normalized (Norm) and residually connected to the input of the feedforward neural network layer II. After multiple identical decoding layers, the probability distribution Hi is finally obtained through a linear layer and a softmax function.
[0111] Similarly, in the subsequent calculation of the implicit feedback embedding vector, a probability distribution Hd is obtained. Then, the two probability distributions Hd and Hi are weighted and averaged in a one-to-one ratio to synthesize an interest state h. t .
[0112] This invention utilizes a cross-attention mechanism on the input of the encoder in a Transformer model to allow explicit feedback to be embedded in the vector e. i and implicit feedback embedding vector e d The value Q generated after input represents explicit feedback. i The value Q represents implicit feedback. d This generates an exchange, thereby achieving cross-attention between the two feedback mechanisms. By utilizing the cross-attention mechanism, information from the two feedback forms is fused, enabling the simultaneous capture of both long-term and short-term interests during the extraction of user interest states, thus constructing a more accurate profile of the user's interest state.
[0113] S4: Calculate the attention score using the user's interest state and the platform's objective. Based on the AUGRU model, calculate the attention score and the user's interest state to obtain the AUGRU model output interest state sequence.
[0114] In the Interest Evolving layer, the method for calculating attention scores involves three steps:
[0115] First, calculate the interest state h. t The correlation score e with the platform objective at time step t t :
[0116] e t =v T ·tanh(W3h t +W4q+b3)
[0117] Where q refers to the embedding vector of the currently recommended platform target (e.g., video), representing the current recommended platform target; W3 and W4 are the projected weight matrices; v is the context vector used to map to the scalar, a learnable weight parameter; tanh represents the activation function, used to add non-linearity and capture complex relationships; and b3 is the bias term. Next, the attention weights are normalized to obtain the attention score:
[0118]
[0119] Here exp(e) t The correlation score e at time step t is the score of the correlation at time step t. t Convert to a positive number, e j This represents the relevance score at the j-th time step.
[0120] After obtaining the attention score, it needs to be added to the GRU, that is, the attention operation is embedded into the GRU update gate. This layer is used to more specifically simulate the interest evolution path related to the platform's goals. GRU is a type of recurrent neural network, and like LSTM networks, it was proposed to solve problems such as long-term memory and gradients in backpropagation. Compared to LSTM networks, using GRU networks can achieve comparable results and is easier to train, which can greatly improve training efficiency. Its structure is as follows: Figure 4 As shown.
[0121] The GRU with attentional input (AIGRU) network, as an improvement on the GRU network, directly incorporates the attention score a. t With interest state h t Multiplication is used as the input to the next layer, but the AIGRU network does not perform well because even if the input is reduced to 0, it can still change the hidden state of the GRU network. In other words, even very unrelated interests can affect the evolutionary state of interests.
[0122] Attention-based GRU (AGRU) networks, as an improvement on GRU networks, directly replace the update gate with attention scores. This can alleviate the problems of AIGRU, such as the loss of interest state h at a certain time step. t It has absolutely nothing to do with the platform's goals. That is, the attention score a. tThe value is 0. At this point, the AGRU network directly uses the hidden state from the previous time step. Similarly, if the interest state from the previous time step is also unrelated to the current candidate ad, then the state from the previous time step is used. This means that if the hidden state at a previous time step is related to the current platform goal (in extreme cases, highly related), then the AGRU network's hidden state is updated to this highly relevant interest. Through this mechanism, AGRU can ensure that it only focuses on the interest evolution process related to the current candidate ad. Its drawback lies in the attention score a. t Replacing the update gate ignores the importance of values across different dimensions, because the update gate is a vector whose dot product is the interest state h. t When multiplying by different dimensions, the coefficients will be different to maintain the importance of each dimension. However, when this is changed to a scalar, the attention score a... t It is a value, equivalent to the interest state h. t Each dimension is multiplied by the same coefficient, so the importance of different dimensions is ignored.
[0123] The AUGRU model of this invention retains the advantages of the AGRU network, enabling interests relevant to the current platform objective to evolve reasonably without being affected by irrelevant interests. It overcomes the deficiency of AGRU in ignoring the importance of interests across different dimensions because the AUGRU model does not change the vector dimensions of the update gates; they remain vectors, and each dimension still determines the importance of the interest in that dimension. The AUGRU model allows each step of local activation to strengthen the role of relevant interests, reduce the interference of interest drift, and helps simulate the interest evolution process relative to the platform objective.
[0124] In the AUGRU model, the update gate is dynamically adjusted, combined with the attention score a. t This allows the model to selectively update the user's interest state based on the relevance of the current objective. This mechanism enables the model to retain important historical information while paying sufficient attention to the latest inputs or changes, thus more accurately tracking and predicting changes in user interests. In this way, the AUGRU model can better capture the dynamic evolution of user interests and optimize the personalized experience of the recommender system.
[0125] During the calculation process:
[0126] First, concatenate the vectors of the two behaviors of the user at time t to obtain the current time step input x. t =Concat(b i ,b d );
[0127] Then the update gate of the AUGRU model is passed through the current time step input x. tinterest state h at the previous time step t-1 The calculation determines the interest state h from the previous time step. t-1 interest state h up to the current time step t The formula for determining how much historical information should be retained is:
[0128] z t =σ(W z [x t ,h t-1 ]+b z )
[0129] The AUGRU model uses external attention weights u t Dynamic adjustment and update gate:
[0130]
[0131] Then we also need a candidate hidden state. Candidate hidden states are crucial intermediate computations used to update the network's current hidden state. This mechanism enables these networks to maintain both long-term dependencies and short-term correlations of information when processing sequential data. Based on the current time step input x... t interest state h at the previous time step t-1 The gating combination calculation yields:
[0132]
[0133] r t It is a reset gate that determines whether the state of interest h from the previous time step should be used when calculating candidate states. t-1 The amount of information to retain is calculated as follows:
[0134] r t =σ(W r [x t ,h t-1 ]+b r )
[0135] σ represents the Sigmoid function, which compresses the linear combination of the update and reset gates to the range [0,1], and tanh represents the hyperbolic tangent activation function, which introduces nonlinearity to help the network capture complex patterns and relationships.
[0136] Based on the above formula, the state update of the AUGRU model can be expressed as:
[0137]
[0138] The final interest state sequence is obtained as h′=[h′1,h′2,...,h′] T ].
[0139] The interest state h' output by the AUGRU model t It is a vector that represents a high-dimensional representation of the user's interest state at a specific point in time, and has the following main meanings:
[0140] 1. Dynamic representation of user interests:
[0141] Each h' t These represent the user's state of interest in a specific goal at a given time point t. These states reflect how the user's interest changes over time based on their behavior and interactions.
[0142] 2. Target-sensitive interest adjustment:
[0143] Because the AUGRU model considers the relevance to the platform objective (via the attention score a) t The output interest status better reflects the user's level of attention and depth of interest in the current recommendation target. This allows the recommendation system to more accurately predict the user's acceptance of the recommended content.
[0144] 3. Input for personalized recommendations:
[0145] The interest state sequence output by the AUGRU model can be directly used as input for subsequent recommendation models to predict the probability of user click-through rates or other behaviors for recommended items, thereby supporting the generation of more personalized recommendation results.
[0146] S5: Integrate the interest state sequence output by the AUGRU model with the dense vectors corresponding to the platform target, context features and user portrait features respectively to obtain the probability value of the user's interest in the candidate videos, and output the recommendation list based on the probability value of the user's interest in the candidate videos.
[0147] The interest state sequence h′ obtained by the AUGRU model is concatenated with the embedding vectors of the platform target, context features, and user portrait features to obtain a comprehensive feature vector representation x. This representation more comprehensively reflects the user's current state and environment. The input feature vector representation x is then linearly transformed into a multi-layer fully connected layer (MLP).
[0148] y2=W5x+b4
[0149] W5 is the weight matrix, b4 is the bias vector, and y2 is the output vector.
[0150] Following the fully connected layer is an activation function to introduce non-linearity, allowing the model to learn and simulate more complex functions. This step uses either PReLU or Dice activation functions to perform a non-linear transformation on the output of the fully connected layer. PReLU provides a learnable parameter for each neuron, allowing adaptive gradient propagation when the input is less than zero. Dice activation functions, on the other hand, dynamically adjust the activation threshold to adapt to the distribution of the input data, making them particularly suitable for handling feature data with complex distributions.
[0151] PReLu:
[0152] y3 = max(0, y2) + αmin(0, y2)
[0153] α represents the learning rate. The Dice activation function calculates an activation probability p, and dynamically determines whether each neuron should be activated based on this probability p. The activation probability p is calculated based on statistical information of the data (such as mean and variance).
[0154] The Dice activation function is calculated in the following way:
[0155] y3=p·y2+(1-p)·w6y2
[0156] W6 is a learnable parameter.
[0157] Finally, the output of the PReLU or Dice activation function is converted to a value between 0 and 1 using the Sigmoid function, representing the predicted probability:
[0158]
[0159] Based on the probability values output by the model, all candidate videos are sorted, with items arranged from highest to lowest probability. Typically, the top k items (e.g., the top 10) are selected as recommendations to the user. User feedback on the recommendations is then collected to further train and optimize the model.
[0160] The overall loss of the model is:
[0161] L = L target +β*L aux
[0162] Where L target L is the cross-entropy loss after full connection. aux The auxiliary loss is designed, and β is the auxiliary loss weight used for leveling.
[0163] We need to balance the two losses. The formula for cross-entropy loss is:
[0164]
[0165] Where y j These are real user behaviors. σ(y3) is the probability that the model predicts a user's interest in a candidate video, and N is the sum of samples, where j = 1 to N represents all samples at that moment.
[0166] Auxiliary loss design: The overall loss of the entire network is L = L target +β*L aux This is because directly incorporating user time series data would introduce new problems. Therefore, a new concept is introduced: user behavior sequence. This treats user behavior as a sequence. However, user behavior sequences differ from text sequences. Text sequences have clear grammatical constraints; for example, "I am a good person" is a sentence with a clear meaning. Rearranging the order to "I am good" clearly loses its meaning. But user behavior sequences, such as the behavior sequences "jeans – harem pants – wide-leg pants" and "harem pants –> jeans," present different meanings.
[0167] The difference between "pants" and "wide-leg pants" is not significant, meaning that the sequence of user behavior is not actually very sensitive to the order.
[0168] So the first question is about the interest state h. t Simply capturing the dependencies in a user behavior sequence doesn't effectively reflect user interests. Secondly, user behavior feedback certainly reflects user interests. Relying solely on the loss function after the final fully connected layer only learns the user's overall final interest (because this overall interest led to the click), but the interest state h... t Effective supervisory signals are unavailable. This invention adds an auxiliary loss to the explicit user behavior feedback to guide the learning of intermediate states. Taking user interaction behavior as an example, its structure is shown in the figure. As can be seen from the figure, this is a binary classification model used to calculate the accuracy of interest extraction. It performs a binary classification and calculates the binary classification loss to determine whether the user will be interested in the video. The next moment's actual behavior will be... As a positive example, the behavior obtained from negative sampling is used as a negative example. The inner product is performed with the extracted interest h(t) respectively, and then input into the designed auxiliary network to obtain the prediction result, which is then expressed as log. loss Calculate an auxiliary loss by using the actual behavior at the next time step to supervise the accuracy of the state prediction at this time step.
[0169] The formula for auxiliary loss is:
[0170]
[0171] in, Let σ represent the inner product, σ be the Sigmoid function, N be the sum of the samples, and j = 1 to N represent all samples at this moment.
[0172] This loss design is intended to force the interest state h t (Hidden intermediate state) Fits user behavior, thereby better capturing user interests. When h t and The more similar they are, the larger their inner product becomes. It is close to 1. Then it tends towards 0; while It also tends towards 0, therefore the auxiliary loss L aux It tends towards 0. This satisfies the minimization of the auxiliary loss L. aux The goal. Conversely, if h t and Dissimilar It tends toward negative infinity. It also tends towards negative infinity, at which point the auxiliary loss L aux It tends toward positive infinity.
[0173] The purpose of designing the auxiliary loss is to extract the interest state at each time step. If only the last interest state is used for supervision, then all the states of the hidden layer serve the last state, and the extracted hidden layer states are obviously distorted.
[0174] Experiments: Extensive experiments were conducted in the examples to verify the effectiveness of the proposed method. First, the dataset used, experimental setup, baseline methods, and evaluation criteria are introduced. To verify the high performance of the proposed method, it is compared with existing methods. Finally, experimental results and performance analysis are presented.
[0175] Dataset: Extensive experiments were conducted on the real-world dataset KuaiRand, an unbiased sequential recommendation dataset collected from recommendation logs of the video-sharing mobile app Kuaishou. It is the first recommendation dataset to insert millions of randomly displayed items into a standard recommendation feed, making it the first dataset to insert random videos in a video sequence recommendation scenario. This dataset offers the following advantages:
[0176] This is the first sequential recommendation dataset containing intervention interactions of millions of randomly exposed items inserted into a standard recommendation source.
[0177] It has the most comprehensive additional information, including a clear user ID, interaction timestamps, and rich user and project features.
[0178] It has 15 policies, each targeting a specific recommendation scenario within the Kuaishou App.
[0179] This invention introduces 12 feedback signals (e.g., clicks, likes, viewing time) for each interaction to describe the user's overall feedback. Each user has an average of several thousand historical interactions.
[0180] The details of the evaluation dataset are shown in the table below:
[0181] Table 1: Statistical details of the evaluation dataset
[0182]
[0183] The statistics of the preprocessed dataset are shown in Table 1. The dataset is divided into three parts: the data from the first 10 days is the training set, the data from the middle 5 days is the test set, and the data from the last 3 days is the validation set. In addition, to enhance the display feedback, during the preprocessing of the dataset, the six display feedback items [whether clicked, whether liked, whether followed, whether commented, whether forwarded, whether clicked "not interested"] are merged into one item "clfcf". If "whether clicked "not interested" is 1, clfcf is 0, which means that the user actively chooses not to like it. If "whether clicked "not interested"" is 0, then if any two of the first five items are 1 (i.e., more than two interactive behaviors occur), it is judged that the user likes it, and clfcf is 1.
[0184] Experimental setup:
[0185] This invention sets the dimension of the Embedding layer in the CAT-DIENRec model to 128, then transforms it to 256 dimensions in the linear layers of the Transformer. The number of Transformer layers is set to 2, the number of heads to 4, and the dimension of each head to 64. The feedforward neural network has a dimension of 512. The ReLU activation function is chosen for the Transformer, and the drop rate is 0.1. The hidden layer dimension in the CAT-DIENRec model is 128, consistent with the model dimensions. Adam is selected as the optimizer in the CAT-DIENRec model to adjust the model's weights and parameters to minimize or minimize the model's performance. The loss function is optimized to allow the model to gradually improve its performance during training. The auxiliary loss weight β decays within the range of {1e-2, 1e-4, 1e-6, 0}, the search learning rate α ranges within the range of {1e-1, 1e-2, 1e-3, 1e-4}, the micro-batch size ranges within the range of {512, 1024, 2048}, and the adaptation parameters (learnable parameters designed in the model to adaptively adjust and improve performance, mainly used for the adaptive gating parameters of AUGRU mentioned above) range within the range of {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0], default = 0.5}. The training cycle consists of 10 epochs, using an early stopping strategy with a patience level of 5. (Early stopping is a technique to prevent overfitting in machine learning models and is also an effective resource-saving strategy. It dynamically determines when to stop training during the model training process, rather than executing a fixed number of training epochs. The core idea of early stopping is to stop training when the model's performance on the validation set no longer improves, thus avoiding overfitting on the training set and saving unnecessary training time and computational resources.) The hyperparameter k of the top-k list metric is set to 10 (as mentioned above, the CAT-DIENRec model ultimately obtains a user interest state and then selects the "several" videos most relevant to this interest state for recommendation; k is the specific number, usually 10).
[0186] Evaluation Metrics: To comprehensively evaluate the comparative methods, multiple metrics are needed to assess the model's performance in recommendation accuracy, user retention, engagement, and playtime. Firstly, for recommendation accuracy, this invention uses the NDCG@k metric, a recall metric widely used in recommendation systems: it's a measure of ranking quality, specifically used to evaluate the ranking results of recommendation systems. It considers the relevance of items in the recommendation list and their position within the list. Theoretically, highly relevant items should be ranked higher. NDCG values typically range from 0 to 1, with values close to 1 indicating very high recommendation quality and close to 0 indicating the opposite.
[0187] Since the purpose of this invention is to achieve platform goals, the three metrics used are: user usage time, user engagement, and user retention. Therefore, this invention has established three standards: DS (Duration Standard), IR (Interaction Ratio), and PTR (Play Time Ratio) as measurement criteria.
[0188] For retention objectives, the goal is to maximize diversity within the top k recommendation lists and project duration; therefore, standard deviation is used as a direct metric for evaluation. This invention primarily measures duration diversity, which reflects the degree of time bias removal, and this metric is denoted as Duration Std@k (DS@k).
[0189] For engagement, we aim to measure the proportion of user interaction with videos in the top k recommended lists. With a baseline of 1, a value greater than 1 indicates that the recommended content receives more interaction than the baseline, a positive sign indicating good user acceptance of the recommended content. This metric is denoted as Play Time Ratio@k (PTR@k).
[0190] For user playback time, the ratio of the playback time of videos in the user's top k recommended lists to the total playback time is used. The baseline is set to 1. A value greater than 1 indicates that the playback time of recommended content is usually above average, which may mean that the user is more interested in these recommended contents. This metric is denoted as Clfcf Ratio@k (CR@k).
[0191] Experimental Results and Analysis: This invention evaluates the overall performance of currently popular recommendation system models in this system, and the results are summarized below:
[0192] Table 2 Comparison of experimental results
[0193]
[0194] In all evaluation metrics, the CAT-DIENRec model demonstrated superior performance. The model achieved an NDCG@10 of 0.8343, the highest NDCG value among all models, indicating its superior performance in terms of the relevance and ranking quality of the recommendation list. A high NDCG value means the recommendation system can prioritize content that users are most likely to be interested in, which is crucial for user experience.
[0195] In the other three metrics, CAT-DIEN achieved a score of 77.2623 on the DS@10 metric, significantly higher than DIEN and DIN. This metric reflects the diversity of recommended content duration; CAT-DIEN's high score indicates that it can provide users with a wide range of content choices to meet different viewing preferences. This not only improves the user experience but also helps increase the overall user engagement time on the platform, directly reflecting content diversity and user satisfaction. Its PTR@10 score of 1.152 indicates that users interact with its recommended content more frequently compared to the baseline. This performance surpasses other models such as DIEN (1.118) and DIN (1.076), highlighting the CAT-DIENRec model's ability to stimulate user interaction. Higher interaction rates are generally associated with higher content quality and user satisfaction, indicating that CAT-DIENRec performs well in personalized content matching.
[0196] CAT-DIEN also performed best on the CR@10 metric, scoring 1.125. CR@10 measures the ratio of time users spend watching recommended content to total playback time; a score above 1 indicates that the recommended content is highly engaging and effectively encourages users to increase their viewing time. This demonstrates that CAT-DIENRec understands and satisfies users' deeper interests, and the recommended content continues to attract users, which is crucial for improving user engagement and platform retention.
[0197] These results are sufficient to verify two key points: 1. After introducing the Transformer model, the model's extraction and representation of user interests are more accurate. 2. Recommendations based on the user's next interest are more in line with the recommendation system and are also more conducive to expressing the platform's goals.
[0198] The overall advantage of the CAT-DIENRec model lies not only in its excellent numerical performance but also in the technology behind it—the effective combination of cross-attention and Transformer networks—which enables the model to excel in capturing long-range dependencies and understanding complex user behavior patterns. Furthermore, these results suggest future research directions: such as further optimizing the cross-attention mechanism to enhance the model's response speed to immediate user feedback, or introducing more contextual information into the model to enhance the personalization and accuracy of recommended content.
[0199] This invention proposes a video recommendation method and system based on hybrid feedback and time series analysis. A CAT-DIENRec model is designed, comprising a behavior sequence layer, an interest extraction layer, an interest evolution layer, and an output layer. First, in the behavior sequence layer, an embedding layer is used to encode the explicit and implicit user feedback under different time series. Then, a Transformer model is used to learn the features of these two types of feedback, and a cross-attention mechanism is used to fuse these features. A linear layer is then used to map and obtain a user interest state representing the user's interest state, enhancing the model's ability to depict user interests and improve recommendation accuracy. Second, an attention mechanism and platform objectives are used to obtain a user interest weight distribution that is highly correlated with the platform objectives, capturing the user interest states that contribute most to the platform objectives under different time series. Finally, an AUGRU model combined with an attention mechanism is used to predict the user's interest at the next time step, obtaining a global model for video recommendation, improving the long-distance dependency capability of the global model. This invention accurately depicts the user's interest state and exhibits excellent video recommendation performance.
[0200] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A video recommendation method based on hybrid feedback and time series, characterized in that, Includes the following steps: S1: Obtain candidate videos, user information, and user interaction behavior information. Based on the candidate videos, user information, and user interaction behavior information, extract user behavior features, platform goals, contextual features, and user profile features. S2: Divide user behavior features into explicit feedback and implicit feedback, and encode explicit feedback and implicit feedback respectively using word embedding to obtain explicit feedback embedding vector and implicit feedback embedding vector respectively; encode platform goals, context features and user profile features respectively and convert them into corresponding embedding vectors. S3: Based on the Transformer model using time series encoding, cross-attention calculation is performed on the explicit feedback embedding vector and the implicit feedback embedding vector to obtain the user's interest state; S4: Calculate the attention score using the user's interest state and the platform's goal. Calculate the attention score and user interest state based on the AUGRU model to obtain the interest state sequence output by the AUGRU model. S5: Integrate the interest state sequence output by the AUGRU model with the embedding vectors corresponding to the platform target, context features and user profile features respectively to obtain the probability value of the user's interest in the candidate video, and output the recommendation list based on the probability value of the user's interest in the candidate video. The method for cross-attention calculation of explicit and implicit feedback embedding vectors based on the Transformer model using time-series encoding, as described in step S3, is as follows: In the encoder part of the Transformer model, accurate time information is used to replace the original position encoding. First, accurate time features are extracted from the timestamps of user behavior features. The time features are periodically encoded. After linear transformation, the extracted time features are matched with the dimensions of the explicit and implicit feedback embedding vectors, respectively, and then summed to obtain the explicit feedback embedding vector with time-series information. and implicit feedback embedding vectors with time series information Then, after linear transformations, explicit feedback embedding vectors with time series information are obtained. Query Q i Key Ki and value V i and implicit feedback embedding vectors with time series information Query Q d Key K d Sum V d ; will query Q i With query Q d Perform the exchange, respectively using query Q d Key K i Sum V i And query Q i Key K d Sum V d The input for multi-head attention in the encoder is processed by both the encoder and decoder to obtain the explicit feedback probability distribution Hi and the implicit feedback probability distribution Hd, respectively. The explicit feedback probability distribution Hi and the implicit feedback probability distribution Hd are then weighted and summed to obtain the user interest state h. t .
2. The video recommendation method based on hybrid feedback and time series as described in claim 1, characterized in that, The method for obtaining explicit feedback embedding vectors and implicit feedback embedding vectors in step S2 is as follows: User behavior features are divided into explicit feedback resulting from user interaction behavior. Implicit feedback from user viewing time Explicit feedback based on category and implicit feedback Perform word embedding to obtain explicit feedback embedding vectors. and implicit feedback embedding vector ,in , Let T represent the explicit feedback embedding vector and the implicit feedback embedding vector at the t-th time step, respectively, and let T represent the sequence length. The process of encoding the platform target, context features, and user profile features is as follows: after performing one-hot encoding on the platform target, context features, and user profile features, they are directly encoded into embedding vectors in the Embedding layer.
3. The video recommendation method based on hybrid feedback and time series as described in claim 1, characterized in that, The method for calculating attention scores using user interest states and platform goals, as described in step S4, is as follows: First, calculate the interest state h. t Relevance score of the platform objective at time step t : ; Where q represents the embedding vector of the currently recommended platform target, W3 and W4 are the projected weight matrices, and v is a vector representing the learnable weight parameters. This indicates that the vector v is transposed, tanh represents the activation function, and b3 is the bias term; Then, attention weight normalization is performed to obtain the attention score. : ; Wherein, exp(e t ) indicates that the relevance score is converted to a positive number, e j This represents the relevance score at the j-th time step.
4. The video recommendation method based on hybrid feedback and time series as described in claim 3, characterized in that, The method for calculating attention scores and user interest states based on the AUGRU model in step S4 is as follows: First, the explicit and implicit feedback at time step t are concatenated to obtain the current time step input x. t Update the gate by inputting x at the current time step. t interest state h at the previous time step t-1 Calculate the interest state h from the previous time step t-1 interest state h up to the current time step t Historical information that should be retained t Through external attention weights The update gate is dynamically adjusted based on the current time step input x. t interest state h at the previous time step t-1 Calculate candidate hidden state Based on the candidate hidden state and historical information z t Calculate the output interest state Finally, the interest state sequence is obtained. T is the sequence length.
5. The video recommendation method based on hybrid feedback and time series as described in claim 4, characterized in that, The historical information z t The calculation formula is: ,in, and To update the weights and biases of the gates, The activation function is used; the formula for dynamically adjusting the update gate is: Candidate hidden state The calculation formula is: ,in, and The weights and biases are calculated for the candidate hidden states. The activation function is used to calculate the reset gate. , and To reset the weights and biases of the gate, To reset the gate output; the interest state of the output. The calculation formula is: .
6. The video recommendation method based on hybrid feedback and time series as described in claim 5, characterized in that, The current time step input x t The calculation formula is: The method for integrating and outputting the data in step S5 is as follows: The interest state sequence is obtained from the AUGRU model. After encoding the platform objectives, contextual features, and user profile features, embedding vectors are obtained respectively. The operation yields a comprehensive feature vector representation x, which is then fed into a fully connected layer to perform a linear transformation on the comprehensive feature vector representation x. W5 is the weight matrix, b4 is the bias vector, and the output of the fully connected layer is then activated by either the PReLU activation function or the Dice activation function. A nonlinear transformation is performed, and finally, the output of the PReLU activation function or the Dice activation function is converted into a probability value that the user is interested in the candidate video through the Sigmoid function. ; The PReLU activation function is: ; Where α represents the learning rate; The Dice activation function is: ; Where p is the activation probability. These are learnable parameters.
7. A video recommendation system based on hybrid feedback and time series, used in the video recommendation method based on hybrid feedback and time series as described in any one of claims 1-6, characterized in that, It includes a behavior sequence layer, an interest extraction layer, an interest evolution layer, and an output layer connected in sequence; Behavior sequence layer: This layer is used to divide user behavior features into explicit feedback and implicit feedback. It uses word embeddings to encode explicit feedback and implicit feedback respectively, resulting in explicit feedback embedding vectors and implicit feedback embedding vectors. It also encodes platform goals, context features, and user profile features and converts them into corresponding embedding vectors. Interest Extraction Layer: Used to perform cross-attention calculation on explicit and implicit feedback embedding vectors based on the Transformer model using time series encoding to obtain the user's interest state; Interest Evolution Layer: Used to calculate attention scores by utilizing user interest states and platform goals. Based on the AUGRU model, the attention scores and user interest states are calculated to obtain the interest state sequence output by the AUGRU model. Output layer: This layer integrates the interest state sequence output by the AUGRU model with the embedding vectors corresponding to the platform target, context features, and user profile features, respectively, to obtain the probability value of the user's interest in the candidate videos. Based on the probability value of the user's interest in the candidate videos, a recommendation list is output.
8. The video recommendation system based on hybrid feedback and time series as described in claim 7, characterized in that, The loss function L during the training process of the video recommendation system is: ; in, The cross-entropy loss after full connection is... As an auxiliary loss in the design, To assist in loss weighting; The cross-entropy loss is: ; in, These are real user behaviors. It is the model's prediction of the probability that a user is interested in candidate videos. N is the number of samples collected.
9. The video recommendation system based on hybrid feedback and time series as described in claim 8, characterized in that, The auxiliary loss of the design is: ; in, This indicates the user's actual behavior at the next time step. For negative sampling behavior, This is the Sigmoid function.