Content recommendation model training method and device, content recommendation method and device and vehicle

By using a large language model to process the user's positive feedback and negative feedback sequences in content recommendation, semantic representations are generated and noise interference is eliminated, the problem of low diversity of recommended content caused by ignoring negative feedback in the prior art is solved, and higher recommendation accuracy and diversity are achieved.

CN119848356APending Publication Date: 2025-04-18CHONGQING CHANGAN TECH CO LTD

Patent Information

Application Number
CN202510074978.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The prior art ignores the negative feedback behavior of users in content recommendation, resulting in low diversity in recommended content.

Method used

By identifying the user's positive and negative feedback sequences, large language models are input to generate semantic representations and eliminate noise interference to generate more accurate and representative data sets for training content recommendation models.

Benefits of technology

Improve the accuracy and diversity of recommendations, enhance the generalization ability and robustness of the model, and ensure the diversity of recommended content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848356A_ABST
    Figure CN119848356A_ABST
Patent Text Reader

Abstract

The invention relates to a training method of a content recommendation model, a content recommendation method and device and a vehicle, and the method comprises the steps: recognizing an original positive feedback sequence and an original negative feedback sequence in interaction data of a user for an item; inputting the original positive feedback sequence and the original negative feedback sequence into a large language model, wherein the large language model outputs positive feedback semantic representation, negative feedback semantic representation, user features and item features; eliminating noise interference of the original positive feedback sequence and the original negative feedback sequence according to the positive feedback semantic representation and the negative feedback semantic representation, and generating a data set according to the positive feedback sequence and the negative feedback sequence after noise interference elimination, the user features and the item features; and training the content recommendation model by using the data set. Therefore, the problem that in the prior art, content recommendation is carried out on the user based on positive feedback, the negative feedback effect is ignored, and the diversity of the recommended content is low is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Recommendation systems can alleviate the problem of information overload and allow users to efficiently obtain information of interest. However, most existing recommendation methods are based on predictions based on users' positive feedback behaviors (such as user clicks and purchases), ignoring the rich information contained in users' negative feedback behaviors (such as users not clicking), making it difficult to accurately and comprehensively model user interests. However, since users' negative feedback behaviors do not fully represent the content that users do not like, the lack of utilization of users' negative feedback behaviors makes the recommendation system only focus on the content that users like, but not the content that users do not like, resulting in a large amount of homogeneous content being recommended to users, resulting in low diversity of recommendations.

[0003] Related technology 1, "CN117932149A-Comparative learning recommendation method, device and storage medium based on large model semantics", uses the Llama2 pre-trained model to process text data and align the semantic information of the text with other signal information. The difference is that this article converts the text semantic information into an embedded vector for enhanced representation learning, and the core recommendation method is a negative feedback-based recommendation method composed of two groups of multi-head attention modules and attention units; Related technology 2, "CN118193683A-A text recommendation method and system based on a large language model", also uses LLM, specifically based on Transformer combined with Bahdanau attention mechanism to process text. Summary of the invention

[0004] One of the objects of the present invention is to provide a training method for a content recommendation model to solve the problem that the prior art recommends content to users based on positive feedback, ignoring the role of negative feedback, resulting in low diversity of recommended content; the second object is to provide a content recommendation method; the third object is to provide a training device for a content recommendation model; the fourth object is to provide a content recommendation device; the fifth object is to provide a vehicle; the sixth object is to provide a computer-readable storage medium; the seventh object is to provide a computer program product.

[0005] In order to achieve the above object, the technical solution adopted by the present invention is as follows:

[0006] A training method for a content recommendation model comprises the following steps: identifying original positive feedback sequences and original negative feedback sequences in user interaction data for a project; inputting the original positive feedback sequences and original negative feedback sequences into a large language model, and the large language model outputs positive feedback semantic representations, negative feedback semantic representations, user features, and project features; removing noise interference from the original positive feedback sequences and original negative feedback sequences according to the positive feedback semantic representations and negative feedback semantic representations, and generating a data set according to the positive feedback sequences and negative feedback sequences after removing noise interference, as well as user features and project features; and using the data set to train the content recommendation model.

[0007] According to the above-mentioned technical means, the original positive feedback sequence and the original negative feedback sequence in the user's interaction data for the project can be input into a large language model. Through the deep semantic understanding ability of the large language model, high-quality positive feedback semantic representation, negative feedback semantic representation, as well as user characteristics and project characteristics can be generated, and positive and negative feedback can be taken into comprehensive consideration. By eliminating noise interference, the generated data set is ensured to be more accurate and representative, which helps the model to learn the characteristics of users and projects more accurately, improve the accuracy and diversity of recommendations, enhance generalization ability and robustness, and thereby improve the diversity of content recommended by subsequent models.

[0008] Furthermore, noise interference of the original positive feedback sequence and the original negative feedback sequence is eliminated according to the positive feedback semantic representation and the negative feedback semantic representation, including: calculating multiple conditional probability indicators of positive and negative feedback according to the positive feedback semantic representation and the negative feedback semantic representation, and identifying a target conditional probability indicator among the multiple conditional probability indicators of positive and negative feedback; and determining the positive feedback sequence and the negative feedback sequence after noise interference is eliminated from the original positive feedback sequence and the original negative feedback sequence based on the target conditional probability indicator.

[0009] According to the above technical means, noise interference can be eliminated from the original positive feedback sequence and the original negative feedback sequence according to the target conditional probability index, and the effective positive feedback and negative feedback can be retained to improve the robustness of the subsequent model.

[0010] Furthermore, the calculation formula of the target conditional probability index is:

[0011]

[0012] in, s′ is the negative feedback semantic representation of the item, s is the positive feedback semantic representation of the item, f(s′,e) is the correlation between the user's negative feedback semantic representation s′ and the original feedback sequence e, f(s,e) is the correlation between the user's positive feedback semantic representation s and the original feedback sequence e, I(s,e) is used to measure the degree of dependence between the positive feedback semantic representation s and the original feedback sequence e, is the relative size of the correlation between the negative feedback semantic representation s′ and the positive feedback semantic representation s in the user feedback sequence e, and E is the expected value.

[0013] Furthermore, in the process of training the content recommendation model using the data set, it also includes: calculating the training loss value using the reweighted cross entropy loss function; and updating the model parameters of the content recommendation model according to the training loss value.

[0014] According to the above technical means, a re-weighted cross entropy loss function is introduced to adaptively slow down the interaction of pseudo-negative sample data and reduce the impact of noise feedback on modeling user interests.

[0015] Furthermore, the reweighted cross entropy loss function is:

[0016] L R-CE (u,i)=ω(u,i)L CE (u,i);

[0017] Among them, L R-CE is the reweighted cross entropy loss, ω is the weight function, u is each user, i is the item, L CE is the second-order cross entropy loss.

[0018] Furthermore, the content recommendation model includes: an embedding network and a recommendation network, wherein the data set is input into the embedding network, and the embedding network outputs first to fourth embedding vectors, wherein the first to fourth embedding vectors are respectively the positive feedback sequence and the negative feedback sequence after removing noise interference, and the embedding vectors corresponding to the user features and the project features; the first to fourth embedding vectors are input into the recommendation network, and the recommendation network outputs the recommended content of the project that the user is interested in.

[0019] According to the above technical means, the content recommendation model is divided into an embedding network and a recommendation network, one for calculating the embedding vector and the other for outputting the recommended content of the items that the user is interested in.

[0020] Furthermore, the embedding network includes a first position encoding branch and a second position encoding branch, wherein the first position encoding branch is used to encode the positive feedback sequence and the negative feedback sequence after removing noise interference into a first embedding vector and a second embedding vector, and the second position encoding branch is used to encode the user features and the project features into a third embedding vector and a fourth embedding vector.

[0021] Furthermore, the first position encoding branch includes a first position encoding layer, a first multi-head attention layer, a second multi-head attention layer, a first normalization and addition layer, a feedforward neural network layer and a second normalization and addition layer, and the second position encoding branch includes a second position encoding layer.

[0022] According to the above technical means, the first position encoding branch includes a two-layer multi-head attention mechanism to obtain different aspects of user interest in user positive and negative feedback, and the second position encoding branch includes two position encoding layers.

[0023] Furthermore, the recommendation network includes a self-attention layer, a linear layer and a loss function layer, wherein the self-attention layer fuses the first to fourth embedding vectors to obtain a fused vector, and the linear layer predicts the recommended content of the user's items of interest based on the fused vector.

[0024] According to the above technical means, the network self-attention layer, linear layer and loss function layer are recommended, and the self-attention layer can adaptively match the user interests most relevant to the item to be predicted.

[0025] Furthermore, the attention mechanism of the self-attention layer includes: obtaining target weights of the first embedding vector and the second embedding vector respectively; and fusing the first to fourth embedding vectors according to the target weights.

[0026] Further, obtaining target weights of the first embedding vector and the second embedding vector respectively includes: identifying different interest types of users; and determining target weights of the first embedding vector and the second embedding vector respectively according to the different interest types of users.

[0027] According to the above technical means, the importance of different interest types of users can be adjusted according to the different interest types of users, so that subsequent content recommendations can be more accurate and in line with the interests of users.

[0028] A content recommendation method comprises the following steps: identifying original positive feedback sequences and original negative feedback sequences in user interaction data for a project; inputting the original positive feedback sequences and original negative feedback sequences into a large language model, and the large language model outputs positive feedback semantic representations, negative feedback semantic representations, user features, and project features; removing noise interference from the original positive feedback sequences and original negative feedback sequences according to the positive feedback semantic representations and negative feedback semantic representations; inputting the positive feedback sequences and negative feedback sequences after removing noise interference, as well as user features and project features into a content recommendation model, and the content recommendation model outputs project recommendation content that the user is interested in, wherein the content recommendation model is trained by the training method of the content recommendation model in the above-mentioned embodiment.

[0029] According to the above technical means, the original positive feedback sequence and the original negative feedback sequence in the user's interaction data for the project can be input into a large language model, and the deep semantic understanding ability of the large language model can be used to generate high-quality positive feedback semantic representation, negative feedback semantic representation, user characteristics and project characteristics. The positive feedback semantic representation, negative feedback semantic representation, user characteristics and project characteristics after noise interference is eliminated are input into the content recommendation model to recommend diversified content of interest to users through the content recommendation model.

[0030] A training device for a content recommendation model comprises: a first recognition module for recognizing original positive feedback sequences and original negative feedback sequences in user interaction data for a project; a first input module for inputting the original positive feedback sequences and original negative feedback sequences into a large language model, and the large language model outputs positive feedback semantic representations, negative feedback semantic representations, user features, and project features; a generation module for eliminating noise interference of the original positive feedback sequences and original negative feedback sequences according to the positive feedback semantic representations and negative feedback semantic representations, and generating a data set according to the positive feedback sequences and negative feedback sequences after eliminating noise interference, as well as user features and project features; and a training module for training the content recommendation model using the data set.

[0031] Furthermore, the generation module is further used to: calculate multiple conditional probability indicators of positive and negative feedback based on the positive feedback semantic representation and the negative feedback semantic representation, and identify the target conditional probability indicator among the multiple conditional probability indicators of positive and negative feedback; determine the positive feedback sequence and the negative feedback sequence after removing noise interference from the original positive feedback sequence and the original negative feedback sequence based on the target conditional probability indicator.

[0032] Furthermore, the calculation formula of the target conditional probability index is:

[0033]

[0034] in, s′ is the negative feedback semantic representation of the item, s is the positive feedback semantic representation of the item, f(s′,e) is the correlation between the user's negative feedback semantic representation s′ and the original feedback sequence e, f(s,e) is the correlation between the user's positive feedback semantic representation s and the original feedback sequence e, I(s,e) is used to measure the degree of dependence between the positive feedback semantic representation s and the original feedback sequence e, is the relative size of the correlation between the negative feedback semantic representation s′ and the positive feedback semantic representation s in the user feedback sequence s, and E is the expected value.

[0035] Furthermore, it also includes: an updating module, which is used to calculate the training loss value using the reweighted cross entropy loss function during the process of training the content recommendation model using the data set; and update the model parameters of the content recommendation model according to the training loss value.

[0036] Furthermore, the reweighted cross entropy loss function is:

[0037] L R-CE (u,i)=ω(u,i)L CE (u,i);

[0038] Among them, L R-CEis the reweighted cross entropy loss, ω is the weight function, u is each user, i is the item, L CE is the second-order cross entropy loss.

[0039] Furthermore, the content recommendation model includes: an embedding network and a recommendation network, wherein the data set is input into the embedding network, and the embedding network outputs first to fourth embedding vectors, wherein the first to fourth embedding vectors are respectively the positive feedback sequence and the negative feedback sequence after removing noise interference, and the embedding vectors corresponding to the user features and the project features; the first to fourth embedding vectors are input into the recommendation network, and the recommendation network outputs the recommended content of the project that the user is interested in.

[0040] Furthermore, the embedding network includes a first position encoding branch and a second position encoding branch, wherein the first position encoding branch is used to encode the positive feedback sequence and the negative feedback sequence after removing noise interference into a first embedding vector and a second embedding vector, and the second position encoding branch is used to encode the user features and the project features into a third embedding vector and a fourth embedding vector.

[0041] Furthermore, the first position encoding branch includes a first position encoding layer, a first multi-head attention layer, a second multi-head attention layer, a first normalization and addition layer, a feedforward neural network layer and a second normalization and addition layer, and the second position encoding branch includes a second position encoding layer.

[0042] Furthermore, the recommendation network includes a self-attention layer, a linear layer and a loss function layer, wherein the self-attention layer fuses the first to fourth embedding vectors to obtain a fused vector, and the linear layer predicts the recommended content of the user's items of interest based on the fused vector.

[0043] Furthermore, the attention mechanism of the self-attention layer includes: obtaining target weights of the first embedding vector and the second embedding vector respectively; and fusing the first to fourth embedding vectors according to the target weights.

[0044] Further, obtaining target weights of the first embedding vector and the second embedding vector respectively includes: identifying different interest types of users; and determining target weights of the first embedding vector and the second embedding vector respectively according to the different interest types of users.

[0045] A content recommendation device comprises: a second recognition module, used to recognize original positive feedback sequences and original negative feedback sequences in user interaction data for a project; a second input module, used to input the original positive feedback sequences and original negative feedback sequences into a large language model, and the large language model outputs positive feedback semantic representation, negative feedback semantic representation, user features and project features; a removal module, used to remove noise interference of the original positive feedback sequences and original negative feedback sequences according to the positive feedback semantic representation and negative feedback semantic representation; a third input module, used to input the positive feedback sequences and negative feedback sequences after the noise interference is removed, as well as the user features and project features into the content recommendation model, and the content recommendation model outputs project recommendation content of interest to the user, wherein the content recommendation model is trained by the training device of the content recommendation model of the above-mentioned embodiment.

[0046] A vehicle includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a training method for a content recommendation model as in the above-mentioned embodiment, or a content recommendation method as in the above-mentioned embodiment.

[0047] A computer-readable storage medium stores a computer program or instruction thereon, and the computer program or instruction is executed by a processor to implement a training method for a content recommendation model as described in the above embodiment, or a content recommendation method as described in the above embodiment.

[0048] A computer program product includes a computer program or instructions. When the computer program or instructions are executed, the content recommendation model training method or the content recommendation method described in the above embodiment is implemented.

[0049] Beneficial effects of the present invention:

[0050] (1) The original positive feedback sequence and the original negative feedback sequence in the user's interaction data for the project can be input into a large language model. Through the deep semantic understanding ability of the large language model, high-quality positive feedback semantic representation, negative feedback semantic representation, as well as user characteristics and project characteristics are generated, and positive feedback and negative feedback are comprehensively taken into consideration. By eliminating noise interference, the generated data set is ensured to be more accurate and representative, which helps the model to learn the characteristics of users and projects more accurately, improve the accuracy and diversity of recommendations, enhance generalization ability and robustness, and thus improve the diversity of content recommended by subsequent models.

[0051] (2) According to the target conditional probability index, noise interference can be removed from the original positive feedback sequence and the original negative feedback sequence, and the effective positive feedback and negative feedback can be retained to improve the robustness of the subsequent model.

[0052] (3) By introducing a reweighted cross-entropy loss function, we can adaptively mitigate the interaction of pseudo-negative sample data and reduce the impact of noise feedback on modeling user interests.

[0053] (4) The content recommendation model is divided into an embedding network and a recommendation network, one for calculating the embedding vector and the other for outputting the recommended content of items that the user is interested in.

[0054] (5) The first position encoding branch includes a two-layer multi-head attention mechanism to obtain different aspects of user interests in positive and negative feedback, and the second position encoding branch includes a two-position encoding layer.

[0055] (6) Recommendation network self-attention layer, linear layer and loss function layer. The self-attention layer can adaptively match the user interests that are most relevant to the item to be predicted.

[0056] (7) The importance of different interest types of users can be adjusted according to their different interest types, so that subsequent content recommendations can be more accurate and in line with the interests of users. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 A flowchart of a method for training a content recommendation model of the present invention;

[0058] Figure 2 is an output flow chart of the large language model of the present invention;

[0059] Figure 3 A flowchart for training a content recommendation model of the present invention;

[0060] Figure 4 A flowchart of the content recommendation method of the present invention;

[0061] Figure 5 A schematic diagram of a training device for a content recommendation model of the present invention;

[0062] Figure 6 is a schematic diagram of a content recommendation device of the present invention;

[0063] Figure 7 It is a schematic structural diagram of a vehicle of the present invention. DETAILED DESCRIPTION

[0064] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.

[0065] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0066] Specifically, Figure 1 The present invention is a flowchart of a method for training a content recommendation model according to an embodiment of the present invention.

[0067] like Figure 1 As shown, the training method of the content recommendation model includes the following steps:

[0068] In step S101, original positive feedback sequences and original negative feedback sequences in user interaction data for a project are identified.

[0069] Among them, the original positive feedback sequence S pos is a sequence obtained based on the user's positive feedback behavior, such as user clicks, purchases, etc., that is, the sequence of items that the user has clicked, purchased or browsed within a period of time; the original negative feedback sequence S neg It is a sequence obtained based on the user's negative feedback behavior. Negative feedback behavior, for example, the user did not click, that is, the sequence of items that were exposed to the user in the same time period but not clicked, purchased or browsed.

[0070] In step S102, the original positive feedback sequence and the original negative feedback sequence are input into a large language model, and the large language model outputs positive feedback semantic representation, negative feedback semantic representation, user features, and item features.

[0071] Among them, user characteristics include some basic attributes of users, such as user ID, age, occupational characteristics, etc.; project characteristics include some basic attributes of projects, such as project ID, project category, project price, etc.

[0072] It is understandable that the embodiment of the present invention can input the original positive feedback sequence and the original negative feedback sequence into LLM (Large Language Model), use LLM to perform in-depth analysis on the user's behavior, and output the positive feedback semantic representation s i , negative feedback semantic representation s j 、User characteristics user and project features item .

[0073] It should be noted that, compared with models such as recurrent neural network (RNN) and long short-term memory (LSTM), LLM can more effectively capture the relationship between each item in the sequence and maintain the context order. It has been proven to have good performance in various sequence tasks. Therefore, the present invention uses LLM to process the sequence to obtain a better sequence representation.

[0074] In step S103, noise interference of the original positive feedback sequence and the original negative feedback sequence is removed according to the positive feedback semantic representation and the negative feedback semantic representation, and a data set is generated according to the positive feedback sequence and the negative feedback sequence after the noise interference is removed, as well as the user features and the project features.

[0075] It can be understood that the embodiments of the present invention can remove the noise of the original positive feedback sequence and the original negative feedback sequence according to the positive feedback semantic representation and the negative feedback semantic representation, and generate a data set based on the positive feedback sequence and the negative feedback sequence after the noise interference is removed, as well as the user characteristics and the project characteristics, to improve the data quality of the data set so that it can be used for subsequent training of the content recommendation model. The specific method for removing noise interference is as follows.

[0076] In an embodiment of the present invention, noise interference of an original positive feedback sequence and an original negative feedback sequence is eliminated according to a positive feedback semantic representation and a negative feedback semantic representation, including: calculating a plurality of conditional probability indicators of positive and negative feedback according to the positive feedback semantic representation and the negative feedback semantic representation, and identifying a target conditional probability indicator among the plurality of conditional probability indicators of positive and negative feedback; and determining a positive feedback sequence and a negative feedback sequence after noise interference is eliminated from the original positive feedback sequence and the original negative feedback sequence based on the target conditional probability indicator.

[0077] Among them, the calculation formula of the target conditional probability index is:

[0078]

[0079] in, s′ is the negative feedback semantic representation of the item, s is the positive feedback semantic representation of the item, f(s′,e) is the correlation between the user's negative feedback semantic representation s′ and the original feedback sequence e, f(s,e) is the correlation between the user's positive feedback semantic representation s and the original feedback sequence e, I(s,e) is used to measure the degree of dependence between the positive feedback semantic representation s and the original feedback sequence e, is the relative size of the correlation between the negative feedback semantic representation s′ and the positive feedback semantic representation s in the user feedback sequence e, E is the expected value, and the completion ratio is calculated. Then sum the I(s,e) values ​​of all users and all items, and then calculate the logarithm to widen the value range for subsequent processing, and then calculate the expected E.

[0080] It can be understood that the embodiments of the present invention can calculate the conditional probability indicators of positive and negative feedback based on the positive feedback semantic representation and the negative feedback semantic representation, and identify the target conditional probability indicator therefrom, and determine the positive feedback sequence and the negative feedback sequence after removing the noise interference from the original positive feedback sequence and the original negative feedback sequence based on the target conditional probability indicator.

[0081] Specifically, the process of outputting positive feedback semantic representation, negative feedback semantic representation, user features and project features based on a large language model in the embodiment of the present invention is as follows: Figure 2 As shown, including:

[0082] The user's original positive feedback sequence and negative feedback sequence are S pos , S neg .

[0083] z(Hidden Prior Belief)): This is a theoretical construct used to represent potential prior knowledge that is beneficial for recommendation systems. It helps the model identify which user-item interactions are true positive samples.

[0084] e (CF-Side Rational Representation): This is the representation learned by the recommendation system through user-item interaction data. It reflects the characteristics of users and items, but may contain noise. This article refers to S pos 、s neg .

[0085] s(LLMs-Enhanced Semantic Representation): This is the semantic representation of users and items extracted from text information through large language models. It captures the semantic aspects of user preferences and behaviors.

[0086] Both e and s contain shared information related to user-item interactions, which indicates that they contain aspects that are beneficial for recommendation, consistent with the prior belief z. The goal is to find the optimal value of e * , is to accurately classify S pos , S neg , which is achieved by maximizing the conditional probability p(z,s|e). This is done to ensure that the representation e obtains purer information from the prior belief z and shares more information with the text representation s. Through a series of derivations, it is proved that maximizing p(z,s|e) is equivalent to maximizing the mutual information I(e,s) between e and s. This is because the probability p(s) of the text information s is fixed during the learning process. By optimizing the mutual information I(e,s), it is actually trying to maximize the correlation between e and s. This helps to mitigate the impact of noise and ensure that the signal captured by the representation e is relevant to the recommendation.

[0087] In order to learn the optimal value e representing e * , the formula for maximizing conditional probability and its derivation are as follows:

[0088]

[0089] I(e,s) is defined as the degree of dependence between e and s, so we can get:

[0090] I(e i ,s i )=I(s i ,e i );

[0091] From I(s i ,e i ) for derivation.

[0092] First, using I(s i ,e i )=I(s i ,e i )-log(N), where N is the number of samples, we get:

[0093]

[0094] Then, we can further deduce that:

[0095]

[0096] Further deduction, introducing the negative sample set S neg (i.e. except for S pos All samples except ), we get:

[0097]

[0098] Since f(s i ,e i )∝p(s i ∣e i ) / p(s i ), we obtain a lower bound of the following form:

[0099]

[0100] From the above formula, we can see that the density ratio f(s i ,e i ) is used to measure user i’s attitude towards item e i Preferences i With all its other possible preferences j function of the difference between . This ratio expresses the user i's preference for item e. j The relative strength of a person's preference relative to all possible preferences.

[0101] To sum up, MAX(I(e,s)) is the conditional probability indicator that eliminates the noise interference in positive and negative feedback and distinguishes positive and negative feedback.

[0102] In step S104, the content recommendation model is trained using the data set.

[0103] It is understandable that the embodiments of the present invention can use the data set to train the content recommendation model.

[0104] It should be noted that in order to more accurately capture the user and item descriptions of user interaction preferences, the embodiment of the present invention also sets up a profiling paradigm enabled by a large language model. Considering that the data set usually contains more text descriptions about item attributes, the item-to-user generation paradigm is adopted. For the generation of item descriptions, a prompt template is manually designed to guide the large language model to summarize the item features that attract users. Specifically, a set of features of a user or item is mapped to an embedding matrix where N is the number of features in a set of features and d represents the size of the embedding.

[0105] In addition, a prerequisite for using the dataset for training is to further refine the low-dimensional dense vectors of the user's positive and negative feedback sequences to obtain a more accurate representation of the positive and negative feedback sequences.

[0106] In an embodiment of the present invention, in the process of training a content recommendation model using a data set, it also includes: calculating a training loss value using a reweighted cross entropy loss function; and updating model parameters of the content recommendation model according to the training loss value.

[0107] Since the loss value of noise feedback during training will be higher than that of true feedback, in order to reduce the impact of noise feedback on modeling user interests, the embodiment of the present invention uses a loss function that adaptively slows down the interaction of pseudo-negative sample data during the model training process, namely, the reweighted cross entropy loss (R-CE). Specifically, the training loss value is calculated using the reweighted cross entropy loss function, and the model parameters of the content recommendation model are updated according to the training loss value.

[0108] Among them, the reweighted cross entropy loss function is:

[0109] L R-CE (u,i)=ω(u,i)L CE (u,i);

[0110] L is the second-order cross entropy loss commonly used in click-through rate prediction tasks, and ω is a weight function that can dynamically adjust the weight of noise interaction during training. The meaning of the whole formula is that for each user u and item i, the loss value L R-CE (u,i) is the basic cross entropy loss L CE (u,i) is multiplied by a dynamically adjusted weight factor ω(u,i), which can be adjusted based on whether the prediction result is correct (i.e. is equal to 1) and some other factors (such as s i and e i ) to make adjustments. The function is defined as:

[0111]

[0112] Where y is the predicted probability of the output, and β is a hyperparameter used to control the weight range. When y is close to 1 (i.e., the prediction is correct), the weight ω is small, which means that a small weight is given to the correct positive sample; and when y is close to 0 (i.e., the prediction is wrong), the weight ω is large, which means that a larger weight is given to the wrong negative sample. In this way, the model will pay more attention to those samples that are predicted incorrectly during the training process, thereby improving the robustness of the model. f(s i ,e i ) is the density ratio of positive feedback samples. The larger the density ratio of positive feedback samples, the smaller the weight is given, so that the model pays more attention to negative feedback samples.

[0113] In an embodiment of the present invention, a content recommendation model includes: an embedding network and a recommendation network, wherein a data set is input into the embedding network, and the embedding network outputs first to fourth embedding vectors, wherein the first to fourth embedding vectors are respectively positive feedback sequences and negative feedback sequences after noise interference is eliminated, and embedding vectors corresponding to user features and project features respectively; the first to fourth embedding vectors are input into the recommendation network, and the recommendation network outputs recommended content of projects of interest to the user.

[0114] It can be understood that the content recommendation model of the embodiment of the present invention includes an embedding network and a recommendation network, wherein a data set is input into the embedding network, and the embedding network outputs first to fourth embedding vectors, wherein the first to fourth embedding vectors are respectively positive feedback sequences and negative feedback sequences after noise interference is eliminated, and embedding vectors corresponding to user features and project features, respectively, and the first to fourth embedding vectors are input into the recommendation network, and the recommendation network outputs recommended content of projects of interest to the user.

[0115] In an embodiment of the present invention, the embedding network includes a first position coding branch and a second position coding branch, wherein the first position coding branch is used to encode the positive feedback sequence and the negative feedback sequence after removing noise interference into a first embedding vector and a second embedding vector, and the second position coding branch is used to encode the user features and the project features into a third embedding vector and a fourth embedding vector.

[0116] In an embodiment of the present invention, the embedding network includes a first position encoding branch and a second position encoding branch. The first position encoding branch is used to encode the positive feedback sequence and the negative feedback sequence after removing noise interference into a first embedding vector and a second embedding vector. The second position encoding branch is used to encode user features and project features into a third embedding vector and a fourth embedding vector. The position encoding branch can better capture the position information of the sequence and the feature and enhance the expressive power of the model.

[0117] In an embodiment of the present invention, the first position encoding branch includes a first position encoding layer, a first multi-head attention layer, a second multi-head attention layer, a first normalization and addition layer, a feedforward neural network layer and a second normalization and addition layer, and the second position encoding branch includes a second position encoding layer.

[0118] It can be understood that the first position coding branch of the embodiment of the present invention includes multiple levels of processing units, a first position coding layer, a first multi-head attention layer, a second multi-head attention layer, a first normalization and addition layer, a feedforward neural network layer, and a second normalization and addition layer, etc. The second position coding layer includes a second position coding layer, and two groups of multi-head attention layers are added to respectively obtain different aspects of user interest in positive and negative feedback.

[0119] In an embodiment of the present invention, the recommendation network includes a self-attention layer, a linear layer and a loss function layer, wherein the self-attention layer fuses the first to fourth embedding vectors to obtain a fused vector, and the linear layer predicts the recommended content of the user's items of interest based on the fused vector.

[0120] It can be understood that the recommendation network of the embodiment of the present invention includes a self-attention layer, a linear layer and a loss function layer. The self-attention layer is used to fuse the first to fourth embedding vectors to obtain a fusion vector, and the linear layer predicts the recommended content of the user's items of interest based on the fusion vector.

[0121] Specifically, the implementation process of the content recommendation model includes:

[0122] 1. Perform the first embedding processing and position encoding on the refined positive and negative feedback respectively.

[0123] 2. Output the positive and negative feedback to a set of multi-head attention models for processing.

[0124] 3. Perform normalization and addition operations to maintain the stability of the gradient.

[0125] 4. Input into a fully connected feedforward neural network, which usually consists of two linear transformations and a nonlinear activation function (such as ReLU). It receives the output from the multi-head attention and further transforms and abstracts it.

[0126] 5. Then perform normalization and addition operations.

[0127] 6. The input of the self-attention unit is the embedding vector of the user features, the embedding vector of the item features, and the embedding vector of the user's positive and negative feedback sequences.

[0128] 7. Input into the linear layer and softmax function for prediction.

[0129] There are four groups of features input into the content recommendation model: user features, project features, user positive feedback sequence, and user negative feedback sequence. Among them, user features include some basic attributes of users, such as user ID, age, and occupational characteristics, denoted as e user ; The characteristics of a project include some basic attributes of the project, including but not limited to project ID, project category, project price, etc., denoted as e item ; The user's positive and negative feedback sequences are the user's historical interaction records over a period of time. The user's positive feedback sequence is the sequence of items that the user has clicked, purchased, or browsed over a period of time; the user's negative feedback sequence is the sequence of items that the user has exposed to but not clicked, purchased, or browsed during the same period of time. The user's positive and negative feedback sequences contain multiple items, so the user's positive feedback sequence is mapped to The user's negative feedback sequence is mapped to Where n is the number of interactions (clicks, no clicks, etc.) between the user and the item in the positive and negative feedback sequences, and d s is the embedding size of user and item interactions.

[0130] In an embodiment of the present invention, the attention mechanism of the self-attention layer includes: obtaining target weights of the first embedding vector and the second embedding vector respectively; and fusing the first to fourth embedding vectors according to the target weights.

[0131] It can be understood that the embodiment of the present invention obtains the target weights of the first embedding vector and the second embedding vector, and fuses the first to fourth embedding vectors according to the target weights to obtain a fused vector, specifically:

[0132] C=[e item ||e user ||w pr R pos ||w nr R neg ||];

[0133] Among them, C is the fused vector, w pr 、w nr is a dynamic weight, which can adjust the importance of different interest types of users according to their different interest types. pos is the embedding vector of the positive feedback sequence after removing noise interference, R neg is the embedding vector of the negative feedback sequence after removing noise interference, e item is the embedding vector of the item feature, e user is the embedding vector of user features.

[0134] In addition, it should be noted that simply concatenating the embeddings of positive and negative feedback and inputting them into the model for processing will reduce the performance of the model because the model cannot distinguish the difference between positive and negative feedback. The corresponding representation is as follows:

[0135] E neg =FFN(multihead);

[0136] The method of obtaining the refined representation of the negative feedback sequence is similar to that of the positive feedback. The obtained positive feedback is represented by R pos .

[0137] In an embodiment of the present invention, obtaining target weights of the first embedding vector and the second embedding vector includes: identifying different interest types of users; and determining target weights of the first embedding vector and the second embedding vector according to the different interest types of users.

[0138] It can be understood that the embodiment of the present invention can determine the target weights of the first embedding vector and the second embedding vector according to different interest types of the user. The specific weight calculation method is as follows:

[0139] w pr =

[0140] exp(ReLU(W pr *f*R pos )+t) / (exp(ReLU(W pr *f*R pos )+t)+exp(ReLU(W nr *f*

[0141] R neg )+t));

[0142] W nr =

[0143] exp(ReLU(W nr *f*R neg )+t) / (exp(ReLU(W pr *f*R pos )+t)+exp(ReLU(W nr *f*

[0144] R neg )+t));

[0145] Among them, W is a matrix, f is a vector, and t is a scalar. The reason for adding t is to model the intrinsic importance of a specific type of user interest, regardless of its actual value. Using the exp function when calculating the weight can make the weight value greater than 1, thereby compensating for the dimensional difference between interests at different levels.

[0146] The following describes the training method of the content recommendation model of the present invention through a specific embodiment. The architecture is as follows: Figure 3 As shown in the figure, it includes feedback module, embedding module and prediction module. The purpose of embedding module and feedback module is to obtain better user features and user feedback representation, because good representation helps to improve the performance of downstream tasks. The role of prediction module is to match the item to be predicted with the user interest representation to obtain the prediction score. A special loss function is introduced in the training stage of the framework to solve the problem of the influence of pseudo negative feedback on the use of negative feedback.

[0147] 1. Feedback Module

[0148] Compared with models such as recurrent neural network (RNN) and long short-term memory (LSTM), LLM can more effectively capture the relationship between each item in the sequence and maintain the context order, and it has been proven to have good performance in various sequence tasks. The present invention uses LLM to process the sequence to obtain a better sequence representation.

[0149] There is the following assumption: the user's original positive feedback sequence and negative feedback sequence are S pos , S neg .

[0150] z(Hidden Prior Belief): This is a theoretical construct used to represent potential prior knowledge that is beneficial to the recommendation system. It helps the model identify which user-item interactions are true positive samples.

[0151] e (CF-Side Rational Representation): This is the representation learned by the recommendation system through user-item interaction data. It reflects the characteristics of users and items, but may contain noise. This article refers to S pos , S neg .

[0152] s(LLMs-Enhanced Semantic Representation): This is the semantic representation of users and items extracted from text information through large language models. It captures the semantic aspects of user preferences and behaviors.

[0153] Both e and s contain shared information related to user-item interactions, which indicates that they contain aspects that are beneficial for recommendation, consistent with the prior belief z. The goal of this paper is to find the optimal value of e * , is to accurately classify S pos , S neg , which is achieved by maximizing the conditional probability p(z, s|e). This is done to ensure that the representation e obtains purer information from the prior belief z and shares more information with the text representation s. Through a series of derivations, it is proved that maximizing p(z, s|e) is equivalent to maximizing the mutual information I(e, s) between e and s. This is because the probability p(s) of the text information s is fixed during the learning process. By optimizing the mutual information I(e, s), we are actually trying to maximize the correlation between e and s. This helps to mitigate the impact of noise and ensure that the signal captured by the representation e is relevant to the recommendation.

[0154] In order to learn the optimal value e representing e * , the formula for maximizing conditional probability and its derivation are as follows:

[0155]

[0156] I(e, s) is defined as the degree of dependence between e and s, so we can get:

[0157] I(e i ,s i )=I(s i , e i );

[0158] From I(s i ,e i ) for derivation.

[0159] First, using I(s i ,e i )=I(s i ,e i )-log(N), where N is the number of samples, we get:

[0160]

[0161] Then, we can further deduce that:

[0162]

[0163] Further deduction, introducing the negative sample set S neg (i.e. except for S pos All samples except ), we get:

[0164]

[0165] Since f(s i ,e i )∝p(s i ∣e i ) / p(s i ), we obtain a lower bound of the following form:

[0166]

[0167] From the above formula, we can see that the density ratio f(s i ,e i ) is used to measure user i’s attitude towards item e i Preferences i With all its other possible preferences j function of the difference between . This ratio expresses the user i's preference for item e. j The relative strength of a person's preference relative to all possible preferences.

[0168] To summarize, MAX(I(e,s)) is the conditional probability indicator used in this paper to eliminate the noise interference in positive and negative feedback and distinguish between positive and negative feedback.

[0169] 2. Embedded Module

[0170] In order to obtain user and item descriptions that accurately capture user interaction preferences, a profiling paradigm enabled by a large language model is also designed in the framework. Considering that datasets usually contain more text descriptions about item attributes, the framework adopts an item-to-user generation paradigm. For the generation of item descriptions, prompt templates are manually designed to guide the large language model to summarize the item features that attract users. Specifically, a set of features of a user or item is mapped to an embedding matrix where N is the number of features in a set of features and d represents the size of the embedding.

[0171] Precondition: The feedback module further refines the low-dimensional dense vectors of the user's positive and negative feedback sequences to obtain a more accurate representation of the positive and negative feedback sequences.

[0172] 1. Perform the first embedding processing and position encoding on the refined positive and negative feedbacks respectively (first position encoding branch).

[0173] 2. The positive and negative feedback are output to a set of multi-head attention (first multi-head attention layer and second multi-head attention layer) models for processing.

[0174] 3. Perform normalization and addition operations (the first normalization and addition layer) to maintain the stability of the gradient.

[0175] 4. Input into a fully connected feedforward neural network, which usually consists of two linear transformations and a nonlinear activation function (such as ReLU). It receives the output from the multi-head attention and further transforms and abstracts it.

[0176] 5. Perform normalization and addition operations again (second normalization and addition layer).

[0177] 6. The input of the self-attention unit (self-attention layer) is the embedding vector of the user feature (obtained based on the second position encoding branch), the embedding vector of the item feature (obtained based on the second position encoding branch), and the embedding vector of the user's positive and negative feedback sequences.

[0178] 7. Input into the linear layer and softmax function (loss function layer) for prediction.

[0179] There are four groups of features input into the model: user features, project features, user positive feedback sequence, and user negative feedback sequence. Among them, user features include some basic attributes of users, such as user ID, age, and occupational characteristics, denoted as e user; The characteristics of a project include some basic attributes of the project, including but not limited to project ID, project category, project price, etc., denoted as e item ; The user's positive and negative feedback sequences are the user's historical interaction records over a period of time. The user's positive feedback sequence is the sequence of items that the user has clicked, purchased, or browsed over a period of time; the user's negative feedback sequence is the sequence of items that the user has exposed to but not clicked, purchased, or browsed during the same period of time. The user's positive and negative feedback sequences contain multiple items, so the user's positive feedback sequence is mapped to The user's negative feedback sequence is mapped to Where n is the number of interactions (clicks, no clicks, etc.) between the user and the item in the positive and negative feedback sequences, and d s is the embedding size of user and item interactions.

[0180] 3. Prediction Module

[0181] The function of the prediction module is to fuse the refined representation Rpos, Rneg of the positive feedback sequence, and other feature vectors eitem and euser, and then input them into the attention unit to predict the probability of the user clicking on the candidate item.

[0182] The most common fusion strategy is to simply connect all different user interests directly. However, direct connection cannot find the user interests that are most relevant to the information of the item to be predicted. For example, when predicting a product that a user does not like, the user interest represented by the user's negative feedback sequence should be more related to the product than the user interest represented by the positive feedback sequence. Inspired by some work in cross-domain recommendation, a cross-interest attention mechanism is proposed:

[0183] C=[e item ||e user ||w pr R pos ||w nr R neg ||];

[0184] Where C is the fused vector, w pr R pos ||、w nr It is a dynamic weight that can adjust the importance of different interest types of users according to their different interest types. Specifically, the method of calculating these weights is as follows:

[0185] w pr =

[0186] exp(ReLU(W pr *f*R pos )+t) / (exp(ReLU(W pr *f*R pos)+t)+exp(ReLU(W nr *f*

[0187] R neg )+t));

[0188] W nr =

[0189] exp(ReLU(W nr *f*R neg )+t) / (exp(ReLU(W pr *f*R pos )+t)+exp(ReLU(W nr *f*

[0190] R neg )+t));

[0191] Where W is a matrix, f is a vector, and t is a scalar. The reason for adding t is to model the intrinsic importance of a specific type of user interest, regardless of its actual value. Using the exp function when calculating the weight can make the weight value greater than 1, thereby compensating for the dimensional differences between interests at different levels.

[0192] It should be noted that simply concatenating the positive and negative feedback embeddings and inputting them into the model for processing will reduce the performance of the model because the model cannot distinguish between positive and negative feedback. The corresponding representation is as follows:

[0193] R neg =FFN(multihead);

[0194] The method of obtaining the refined representation of the negative feedback sequence is similar to that of the positive feedback. The obtained positive feedback is represented by R pos .

[0195] 4. Loss Function

[0196] The loss value of noisy feedback during training will be higher than that of real feedback. In order to reduce the impact of noisy feedback on modeling user interests, the present invention uses reweighted cross entropy loss (R-CE) in the prediction module, which is defined as:

[0197] L R-CE (u, i) = ω(u, i)L CE (u, i);

[0198] Where L is the second-order cross entropy loss commonly used in click-through rate prediction tasks, and ω is a weight function that can dynamically adjust the weight of noise interaction during training. The function is defined as:

[0199]

[0200] Where y is the predicted probability of the output, and β is a hyperparameter used to control the weight range. When y is close to 1 (i.e., the prediction is correct), the weight ω is small, which means that a small weight is given to the correct positive sample; and when y is close to 0 (i.e., the prediction is wrong), the weight ω is large, which means that a larger weight is given to the wrong negative sample. In this way, the model will pay more attention to those samples that are predicted incorrectly during the training process, thereby improving the robustness of the model. f(s i , e i ) is the density ratio of positive feedback samples. The larger the density ratio of positive feedback samples, the smaller the weight is given, so that the model pays more attention to negative feedback samples.

[0201] In general, the present invention uses two sets of multi-head attention to obtain different aspects of user interests in positive and negative feedback. Then, an attention unit is used to adaptively match the user interests most relevant to the item to be predicted. In addition, in order to eliminate the interference caused by pseudo-negative feedback, a loss function that can adaptively slow down the interaction of pseudo-negative sample data is designed.

[0202] According to the training method of the content recommendation model proposed in the embodiment of the present invention, the original positive feedback sequence and the original negative feedback sequence in the user's interaction data for the project can be input into a large language model, and through the deep semantic understanding ability of the large language model, high-quality positive feedback semantic representation, negative feedback semantic representation, and user characteristics and project characteristics are generated, and positive feedback and negative feedback are comprehensively taken into consideration. By eliminating noise interference, it is ensured that the generated data set is more accurate and representative, which helps the model to learn the characteristics of users and projects more accurately, improve the accuracy and diversity of recommendations, enhance generalization ability and robustness, and thereby improve the diversity of content recommended by subsequent models.

[0203] The above embodiments focus on the description from the perspective of training the content recommendation model. The following embodiments will specifically describe the content recommendation method based on the content recommendation model from the perspective of application. The incomplete parts between the embodiments can be referenced to each other.

[0204] Figure 4 The present invention provides a flowchart of a content recommendation method according to an embodiment of the present invention.

[0205] like Figure 4 As shown, the content recommendation method includes the following steps:

[0206] In step S201, original positive feedback sequences and original negative feedback sequences in the user's interaction data with respect to the project are identified.

[0207] The original positive feedback sequence and the original negative feedback sequence have been described in the above embodiments and will not be described again here.

[0208] In step S202, the original positive feedback sequence and the original negative feedback sequence are input into a large language model, and the large language model outputs positive feedback semantic representation, negative feedback semantic representation, user features, and item features.

[0209] It is understandable that the embodiment of the present invention can input the original positive feedback sequence and the original negative feedback sequence into LLM (Large Language Model), use LLM to perform in-depth analysis on the user's behavior, and output the positive feedback semantic representation s i , negative feedback semantic representation s j 、User characteristics user and project features item .

[0210] In step S203, noise interference of the original positive feedback sequence and the original negative feedback sequence is removed according to the positive feedback semantic representation and the negative feedback semantic representation.

[0211] It can be understood that the embodiments of the present invention can remove the noise of the original positive feedback sequence and the original negative feedback sequence according to the positive feedback semantic representation and the negative feedback semantic representation, and generate a data set according to the positive feedback sequence and the negative feedback sequence after the noise interference is removed, as well as the user characteristics and the project characteristics, so as to improve the data quality of the data set so that it can be used for subsequent training of the content recommendation model. The specific method for removing noise interference has been explained in the above embodiment and will not be repeated here.

[0212] In step S204, the positive feedback sequence and the negative feedback sequence after noise interference is eliminated, as well as the user features and the project features are input into the content recommendation model, and the content recommendation model outputs the recommended content of the project that the user is interested in, wherein the content recommendation model is trained by the training method of the content recommendation model of the above embodiment.

[0213] It can be understood that the embodiments of the present invention can input the positive feedback sequence and negative feedback sequence after eliminating noise interference, as well as user characteristics and project characteristics into the content recommendation model, and the content recommendation model outputs the project recommendation content that the user is interested in, so as to obtain different aspects of user interests from the user's positive and negative feedback, avoid recommending a large amount of homogeneous content to users, and improve the low diversity of recommendations.

[0214] According to the content recommendation method proposed in an embodiment of the present invention, the original positive feedback sequence and the original negative feedback sequence in the user's interaction data for the project can be input into a large language model, and through the deep semantic understanding ability of the large language model, high-quality positive feedback semantic representation, negative feedback semantic representation, user features and project features are generated, and the positive feedback semantic representation, negative feedback semantic representation, user features and project features after noise interference are eliminated are input into the content recommendation model to recommend diversified content of interest to the user through the content recommendation model.

[0215] Next, the content recommendation model training device and the content recommendation device of the present invention will be described with reference to the accompanying drawings.

[0216] Figure 5 A schematic diagram of a training device for a content recommendation model provided according to an embodiment of the present invention.

[0217] like Figure 5 As shown, the training device 10 of the content recommendation model includes: a first recognition module 101, a first input module 102, a generation module 103 and a training module 104.

[0218] Among them, the first recognition module 101 is used to identify the original positive feedback sequence and the original negative feedback sequence in the user's interaction data for the project; the first input module 102 is used to input the original positive feedback sequence and the original negative feedback sequence into a large language model, and the large language model outputs positive feedback semantic representation, negative feedback semantic representation, user characteristics and project characteristics; the generation module 103 is used to eliminate the noise interference of the original positive feedback sequence and the original negative feedback sequence according to the positive feedback semantic representation and the negative feedback semantic representation, and generate a data set according to the positive feedback sequence and the negative feedback sequence after eliminating the noise interference, as well as the user characteristics and the project characteristics; the training module 104 is used to train the content recommendation model using the data set.

[0219] In an embodiment of the present invention, the generation module 103 is further used to: calculate multiple conditional probability indicators of positive and negative feedback according to the positive feedback semantic representation and the negative feedback semantic representation, and identify the target conditional probability indicator among the multiple conditional probability indicators of positive and negative feedback; and determine the positive feedback sequence and the negative feedback sequence after removing noise interference from the original positive feedback sequence and the original negative feedback sequence based on the target conditional probability indicator.

[0220] In the embodiment of the present invention, the calculation formula of the target conditional probability index is:

[0221]

[0222] in, s′ is the negative feedback semantic representation of the item, s is the positive feedback semantic representation of the item, f(s′,e) is the correlation between the user's negative feedback semantic representation s′ and the original feedback sequence e, f(s,e) is the correlation between the user's positive feedback semantic representation s and the original feedback sequence e, I(s,e) is used to measure the degree of dependence between the positive feedback semantic representation s and the original feedback sequence e, is the relative size of the correlation between the negative feedback semantic representation s′ and the positive feedback semantic representation s in the user feedback sequence e, and E is the expected value.

[0223] In the embodiment of the present invention, the device 10 of the embodiment of the present invention further includes: an updating module.

[0224] Among them, the update module is used to calculate the training loss value using the reweighted cross entropy loss function in the process of training the content recommendation model using the data set; and update the model parameters of the content recommendation model according to the training loss value.

[0225] In an embodiment of the present invention, the reweighted cross entropy loss function is:

[0226] L R-CE (u,i)=ω(u,i)L CE (u,i)

[0227] Among them, L R-CE is the reweighted cross entropy loss, ω is the weight function, u is each user, i is the item, L CE is the second-order cross entropy loss.

[0228] In an embodiment of the present invention, a content recommendation model includes: an embedding network and a recommendation network, wherein a data set is input into the embedding network, and the embedding network outputs first to fourth embedding vectors, wherein the first to fourth embedding vectors are respectively positive feedback sequences and negative feedback sequences after noise interference is eliminated, and embedding vectors corresponding to user features and project features respectively; the first to fourth embedding vectors are input into the recommendation network, and the recommendation network outputs recommended content of projects of interest to the user.

[0229] In an embodiment of the present invention, the embedding network includes a first position coding branch and a second position coding branch, wherein the first position coding branch is used to encode the positive feedback sequence and the negative feedback sequence after removing noise interference into a first embedding vector and a second embedding vector, and the second position coding branch is used to encode the user features and the project features into a third embedding vector and a fourth embedding vector.

[0230] In an embodiment of the present invention, the first position encoding branch includes a first position encoding layer, a first multi-head attention layer, a second multi-head attention layer, a first normalization and addition layer, a feedforward neural network layer and a second normalization and addition layer, and the second position encoding branch includes a second position encoding layer.

[0231] In an embodiment of the present invention, the recommendation network includes a self-attention layer, a linear layer and a loss function layer, wherein the self-attention layer fuses the first to fourth embedding vectors to obtain a fused vector, and the linear layer predicts the recommended content of the user's items of interest based on the fused vector.

[0232] In an embodiment of the present invention, the attention mechanism of the self-attention layer includes: obtaining target weights of the first embedding vector and the second embedding vector respectively; and fusing the first to fourth embedding vectors according to the target weights.

[0233] In an embodiment of the present invention, obtaining target weights of the first embedding vector and the second embedding vector includes: identifying different interest types of users; and determining target weights of the first embedding vector and the second embedding vector according to the different interest types of users.

[0234] According to the training device of the content recommendation model proposed in the embodiment of the present invention, the original positive feedback sequence and the original negative feedback sequence in the user's interaction data for the project can be input into the large language model, and through the deep semantic understanding ability of the large language model, high-quality positive feedback semantic representation, negative feedback semantic representation, and user characteristics and project characteristics are generated, and positive feedback and negative feedback are comprehensively taken into consideration. By eliminating noise interference, it is ensured that the generated data set is more accurate and representative, which helps the model to learn the characteristics of users and projects more accurately, improve the accuracy and diversity of recommendations, enhance generalization ability and robustness, and thus improve the diversity of content recommended by subsequent models.

[0235] Figure 6 It is a schematic diagram of a content recommendation device provided according to an embodiment of the present invention.

[0236] like Figure 6 As shown, the content recommendation device 20 includes: a second identification module 201 , a second input module 202 , a proposal module 203 and a third input module 204 .

[0237] Among them, the second identification module 201 is used to identify the original positive feedback sequence and the original negative feedback sequence in the user's interaction data for the project; the second input module 202 is used to input the original positive feedback sequence and the original negative feedback sequence into a large language model, and the large language model outputs positive feedback semantic representation, negative feedback semantic representation, user characteristics and project characteristics; the elimination module 203 is used to eliminate noise interference of the original positive feedback sequence and the original negative feedback sequence according to the positive feedback semantic representation and the negative feedback semantic representation; the third input module 204 is used to input the positive feedback sequence and the negative feedback sequence after the noise interference is eliminated, as well as the user characteristics and the project characteristics into a content recommendation model, and the content recommendation model outputs the project recommendation content that the user is interested in, wherein the content recommendation model is trained by the training device of the content recommendation model of the above-mentioned embodiment.

[0238] According to the content recommendation device proposed in the embodiment of the present invention, the original positive feedback sequence and the original negative feedback sequence in the user's interaction data for the project can be input into a large language model, and through the deep semantic understanding ability of the large language model, high-quality positive feedback semantic representation, negative feedback semantic representation, user characteristics and project characteristics are generated, and the positive feedback semantic representation, negative feedback semantic representation, user characteristics and project characteristics after noise interference are eliminated are input into the content recommendation model to recommend diversified content of interest to the user through the content recommendation model.

[0239] Figure 7 A schematic diagram of the structure of a vehicle provided by an embodiment of the present invention. The vehicle may include:

[0240] A memory 701 , a processor 702 , and a computer program stored in the memory 701 and executable on the processor 702 .

[0241] When the processor 702 executes the program, the content recommendation model training method or the content recommendation method provided in the above embodiments is implemented.

[0242] Furthermore, the vehicle also includes:

[0243] The communication interface 703 is used for communication between the memory 701 and the processor 702 .

[0244] The memory 701 is used to store computer programs that can be executed on the processor 702 .

[0245] The memory 701 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0246] If the memory 701, the processor 702 and the communication interface 703 are implemented independently, the communication interface 703, the memory 701 and the processor 702 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0247] Optionally, in a specific implementation, if the memory 701, the processor 702 and the communication interface 703 are integrated on a chip, the memory 701, the processor 702 and the communication interface 703 can communicate with each other through an internal interface.

[0248] The processor 702 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.

[0249] An embodiment of the present invention further provides a computer-readable storage medium having a computer program or instruction stored thereon. When the computer program or instruction is executed by a processor, the training method of the content recommendation model or the content recommendation method as described above is implemented.

[0250] An embodiment of the present invention further provides a computer program product, including a computer program or instructions, which, when executed, implements the above-mentioned content recommendation model training method or content recommendation method.

[0251] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0252] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0253] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0254] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one or a combination of multiple of the following technologies known in the art: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array, a field programmable gate array, etc.

[0255] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

Claims

1. A method for training a content recommendation model, characterized in that: The following steps are involved: Identify the original positive feedback sequence and the original negative feedback sequence in the user's interaction data for the project; Inputting the original positive feedback sequence and the original negative feedback sequence into a large language model, wherein the large language model outputs positive feedback semantic representation, negative feedback semantic representation, user features, and item features; Eliminating noise interference of the original positive feedback sequence and the original negative feedback sequence according to the positive feedback semantic representation and the negative feedback semantic representation, and generating a data set according to the positive feedback sequence and the negative feedback sequence after the noise interference is eliminated, as well as the user features and the project features; The content recommendation model is trained using the data set.

2. The method for training a content recommendation model according to claim 1, characterized in that: The removing noise interference of the original positive feedback sequence and the original negative feedback sequence according to the positive feedback semantic representation and the negative feedback semantic representation includes: Calculating a plurality of conditional probability indicators of positive and negative feedback according to the positive feedback semantic representation and the negative feedback semantic representation, and identifying a target conditional probability indicator among the plurality of conditional probability indicators of positive and negative feedback; Based on the target conditional probability index, a positive feedback sequence and a negative feedback sequence after noise interference is eliminated are determined from the original positive feedback sequence and the original negative feedback sequence.

3. The method for training a content recommendation model according to claim 2, characterized in that: The calculation formula of the target conditional probability index is: in, s ′ is the negative feedback semantic representation of the item, s is the positive feedback semantic representation of the item, f(s ′ ,e) is the semantic representation of the user's negative feedback on the item s ′ f(s,e) is the correlation between the user's positive feedback semantic representation s and the original feedback sequence e, and I(s,e) is used to measure the degree of dependence between the positive feedback semantic representation s and the original feedback sequence e. is the negative feedback semantic representation s ′ The relative size of the correlation with the positive feedback semantic representation s in the user feedback sequence e, and E is the expected value.

4. The method for training a content recommendation model according to claim 1, characterized in that: In the process of training the content recommendation model using the data set, the following step is also included: The training loss value is calculated using the reweighted cross entropy loss function; The model parameters of the content recommendation model are updated according to the training loss value.

5. The method for training a content recommendation model according to claim 4, characterized in that: The reweighted cross entropy loss function is: L R-CE (u,i)=ω(u,i)L CE (u,i); Among them, L r-CE is the reweighted cross entropy loss, ω is the weight function, u is each user, i is the item, L CE is the second-order cross entropy loss.

6. The content recommendation model training method according to claim 1, characterized in that: The content recommendation model includes: an embedding network and a recommendation network, wherein: The data set is input into the embedding network, and the embedding network outputs first to fourth embedding vectors, wherein the first to fourth embedding vectors are respectively the positive feedback sequence and the negative feedback sequence after removing noise interference, and the embedding vectors corresponding to the user feature and the project feature; The first to fourth embedding vectors are input into the recommendation network, and the recommendation network outputs recommended content of items that the user is interested in.

7. The content recommendation model training method according to claim 6, characterized in that: The embedding network includes a first position encoding branch and a second position encoding branch, wherein the first position encoding branch is used to encode the positive feedback sequence and the negative feedback sequence after removing noise interference into a first embedding vector and a second embedding vector, and the second position encoding branch is used to encode the user features and the project features into a third embedding vector and a fourth embedding vector.

8. The method for training a content recommendation model according to claim 7, characterized in that: The first position encoding branch includes a first position encoding layer, a first multi-head attention layer, a second multi-head attention layer, a first normalization and addition layer, a feedforward neural network layer and a second normalization and addition layer, and the second position encoding branch includes a second position encoding layer.

9. The method for training a content recommendation model according to claim 6, characterized in that: The recommendation network includes a self-attention layer, a linear layer and a loss function layer, wherein the self-attention layer fuses the first to fourth embedding vectors to obtain a fused vector, and the linear layer predicts the recommended content of the user's items of interest based on the fused vector.

10. The content recommendation model training method according to claim 9, characterized in that: The attention mechanism of the self-attention layer includes: Obtain target weights for the first embedding vector and the second embedding vector; The first to fourth embedding vectors are fused according to the target weight.

11. The method for training a content recommendation model according to claim 10, characterized in that: The obtaining of the target weights of the first embedding vector and the second embedding vector respectively includes: Identify different interest types of users; Determine target weights of the first embedding vector and the second embedding vector according to different interest types of the user.

12. A content recommendation method, characterized in that: The following steps are involved: Identify the original positive feedback sequence and the original negative feedback sequence in the user's interaction data for the project; Inputting the original positive feedback sequence and the original negative feedback sequence into a large language model, wherein the large language model outputs positive feedback semantic representation, negative feedback semantic representation, user features, and item features; Eliminate noise interference of the original positive feedback sequence and the original negative feedback sequence according to the positive feedback semantic representation and the negative feedback semantic representation; The positive feedback sequence and the negative feedback sequence after noise interference is eliminated, as well as the user characteristics and the project characteristics are input into a content recommendation model, and the content recommendation model outputs the recommended content of the project that the user is interested in, wherein the content recommendation model is trained by the training method of the content recommendation model described in any one of claims 1-11.

13. A training device for a content recommendation model, characterized in that: include: The first recognition module is used to recognize the original positive feedback sequence and the original negative feedback sequence in the user's interaction data with the project; A first input module, used for inputting the original positive feedback sequence and the original negative feedback sequence into a large language model, wherein the large language model outputs positive feedback semantic representation, negative feedback semantic representation, user features and project features; A generating module, configured to remove noise interference of the original positive feedback sequence and the original negative feedback sequence according to the positive feedback semantic representation and the negative feedback semantic representation, and generate a data set according to the positive feedback sequence and the negative feedback sequence after the noise interference is removed, as well as the user features and the project features; A training module is used to train the content recommendation model using the data set.

14. A content recommendation device, characterized in that: include: The second recognition module is used to recognize the original positive feedback sequence and the original negative feedback sequence in the user's interaction data with the project; A second input module, used for inputting the original positive feedback sequence and the original negative feedback sequence into a large language model, wherein the large language model outputs positive feedback semantic representation, negative feedback semantic representation, user features and project features; A removal module, used to remove noise interference of the original positive feedback sequence and the original negative feedback sequence according to the positive feedback semantic representation and the negative feedback semantic representation; The third input module is used to input the positive feedback sequence and the negative feedback sequence after noise interference is eliminated, as well as the user characteristics and the project characteristics into a content recommendation model, and the content recommendation model outputs the recommended content of the project that the user is interested in, wherein the content recommendation model is trained by the training device of the content recommendation model according to claim 13.

15. A vehicle, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the content recommendation model training method as described in any one of claims 1 to 11, or the content recommendation method as described in claim 12.

16. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: The computer program or instruction is executed by a processor to implement the content recommendation model training method as described in any one of claims 1 to 11, or the content recommendation method as described in claim 12.

17. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed, it implements the content recommendation model training method as described in any one of claims 1 to 11, or the content recommendation method as described in claim 12.

Citation Information

Patent Citations

  • Comparative learning recommendation method and device based on large model semantics and storage medium

    CN117932149A

Cited By

  • Recommendation system-oriented spatio-temporal data enhancement method

    CN120179926A