Long sequence recommendation method based on de-noising multi-interest logical reasoning
By introducing a method based on denoising multi-interest logic inference in the recommendation system, the problem of multiple interests of noisy items and users in long interactive sequences is solved, and higher recommendation accuracy and diversity are achieved.
Patent Information
- Application Number
- CN202510685298.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-05-27
AI Technical Summary
Existing recommendation methods based on logical reasoning have not yet effectively solved the negative impact of noisy items on recommendation accuracy in long interactive sequences, nor have they fully considered the multiple interest preferences of users in long sequences.
A long-sequence recommendation method based on denoising multi-interest logic inference is proposed. By constructing an interest extractor based on logic rules and an item recommendation model based on multi-interest logic inference, the model is trained using multi-interest learning strategy to reduce interference from noise terms and capture the user's multi-faceted interests.
It effectively alleviates the interference of noisy items in long sequences on logical reasoning, overcomes the limitations of the single main interest-dominated user, and improves the accuracy and diversity of recommendations.
Smart Images

Figure CN120216775A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data mining, and particularly relates to a long-sequence recommendation method based on denoising multi-interest logical reasoning. Background Art
[0002] Recommendation systems need to possess matching capabilities and cognitive reasoning capabilities because users' future behaviors depend not only on the similarity matching with historical interactions but also on their cognitive reasoning process from historical interactions to future behaviors. Recommendation methods based on logical reasoning use logical operators (including intersection, union, negation, and implication) for interactive items and introduce logical rules into model learning to improve the accuracy of recommendations.
[0003] Existing recommendation methods based on logical reasoning can be roughly divided into two categories: methods for learning embedding representations based on logical rules and methods for converting the recommendation problem into a logical reasoning problem. The first category of methods uses first-order logical rules to accurately learn the embedding representations of users and items. For example, Spillo et al. proposed a knowledge-aware recommendation method based on neural-symbolic graph embedding and first-order logical rules. This method first extracts first-order logical rules from the knowledge graph and then learns the embedding representations of users and items based on the triples in the knowledge graph and the extracted logical rules. In addition, Yuan et al. proposed a sequential recommendation method with probabilistic logical reasoning (SR-PLR), which introduced probabilistic embeddings based on first-order logical rules into the sequential recommendation model, thus improving the recommendation accuracy. The second category of methods directly uses logical reasoning to solve the recommendation problem. For example, Shi et al. proposed a neural logic reasoning method (NLR), which converts the recommendation problem into a propositional logic problem and performs logical reasoning on the items in the interactive sequence through logical operations and rules to predict the next item that the user may be interested in. In contrast, Chen et al. proposed a neural collaborative reasoning method (NCR), which first models the relationship between the user and the items in the interactive sequence (such as purchase behavior) and then explicitly introduces the user's sentiment tendency (such as like or dislike) for logical reasoning to achieve personalized recommendation. This method effectively enhances the recommendation system's ability to understand user preferences and further improves the recommendation effect. However, these methods have not explored the negative impact of noisy items in long interactive sequences on the recommendation accuracy, nor have they considered the multiple interest preferences of users in long sequences.
[0004] Some studies have adopted heuristic methods, unsupervised learning, and community mining to capture multiple interests from users' interaction sequences. Sabour et al. proposed the Multi-Interest Network with Dynamic Routing (MIND) algorithm, which designed a multi-interest extractor based on a dynamic routing mechanism for modeling and extracting multiple interests in interaction sequences. Cen et al. proposed the Controllable Multi-interest Framework for Sequential Recommendation (ComiRec), which uses a self-attention method to capture users' multiple interests from interaction sequences and introduces a controllable factor to balance the accuracy and diversity of recommendations. However, these methods cannot address the negative impact of noise on recommendation accuracy and lack cognitive reasoning ability. Summary of the Invention
[0005] Aiming at the deficiencies of the prior art, the present invention provides a long-sequence recommendation method based on denoising multi-interest logical reasoning, aiming to effectively alleviate the interference of noisy items in the long sequence on logical reasoning, and at the same time overcome the limitation that existing methods are usually dominated by users' single main interest, thereby improving the accuracy of recommendations.
[0006] The technical solution of the present invention is as follows:
[0007] A long-sequence recommendation method based on denoising multi-interest logical reasoning, comprising the following steps:
[0008] Construct an interest extractor based on logical rules; the interest extractor based on logical rules is used to deduce the embedded representation of the user's interest through the input interaction sequence, and then obtain the multi-faceted interest embedding matrix of the user; the interaction sequence is a sequence used to represent the user's historical interaction items, which includes interaction items at different times, and each interaction item is the embedded representation of the item interacting with the user.
[0009] Construct an item recommendation model based on multi-interest logical reasoning; the item recommendation model based on multi-interest logical reasoning is used to recommend items for the user according to the multi-faceted interest embedding matrix of the user.
[0010] Use a multi-interest learning strategy to train the interest extractor based on logical rules and the item recommendation model based on multi-interest logical reasoning to obtain a trained interest extractor based on logical rules and an item recommendation model based on multi-interest logical reasoning.
[0011] Use the trained interest extractor based on logical rules and the item recommendation model based on multi-interest logical reasoning to perform item recommendation to obtain an item recommendation result.
[0012] Furthermore, the process of deriving the embedded representation of the user's interest from the input interaction sequence is as follows:
[0013] First, determine whether the user likes an item based on the user's rating of the item. That is, if the rating of the item is greater than the set threshold, it means the user likes the item; otherwise, the user does not like the item. Convert the user's rating into a binary label to represent the two emotions of the user towards the item: like or dislike. If the user rates the item higher than the set threshold, then the item has a binary label , otherwise, the item has a binary label . Based on the value of the binary label , define two preference operators: and . When , use the preference operator to increase the importance of the item in constructing the embedded representation of the user's interest; when , use the preference operator to reduce the importance of the item in constructing the embedded representation of the user's interest. Specifically, by defining logic rule-based mapping functions and for the preference operators and respectively, and using the logic rule-based mapping functions and to obtain the preference probability embedding implementation of the item, where represents the embedded representation of an item, represents the dimension of the embedded representation of the item. Then use the self-attention method to extract the embedded representation of the user's interest from the preference probability embedding of the item.
[0014] Furthermore, the method for constructing the preference probability embedding of the item is as follows:
[0015] When the user likes the item , use the logic rule-based mapping function to obtain the preference probability embedding of the item : (4);
[0016] Among them, represents the embedded representation of the item , represents the preference probability embedding of the item when the user likes the item , denotes a multi-layer perceptron, denotes the number of the Beta distribution and , and is the shape parameter of the -th Beta distribution.
[0017] When the user does not like item , a mapping function based on logical rules is used to obtain the preference probability embedding of item : (5);
[0018] where denotes the preference probability embedding of item when the user does not like item , is the probability negation operator corresponding to the non-logical operator .
[0019] Furthermore, the method for extracting the embedding representation of the user's interest from the preference probability embedding of items by using the self-attention method is specifically as follows:
[0020] For the interaction sequence , where denotes the -th user, denotes the user number, denotes the embedding representation of the -th item , denotes the item number, denotes the interaction sequence ; the preference probability embeddings of all items in the interaction sequence are obtained as , where denotes the mapping function based on logical rules or , and a set of attention weight vectors for calculating the preference probability embeddings of all items are obtained: (6); (7);
[0021] where and respectively denote the matrix of the part and the matrix of the part in the preference probability embeddings of all items, are respectively of part and part, and is the shape parameter of the $k$-th Beta distribution; denotes the attention weight vector of denotes the attention weight vector of denotes the softmax function, , and are trainable parameters, denotes the dimension of the attention weight vector, denotes the matrix transpose symbol.
[0022] Then, calculate the preference fusion embedding of each item:
[0023] When the user likes item , its preference fusion embedding is: (8);
[0024] When the user dislikes item , its preference fusion embedding is: (9);
[0025] where denotes the preference fusion embedding of item
[0026] According to the preference fusion embedding of each item, further obtain the user's preference fusion embedding matrix: , denotes the user's
[0027] Based on the obtained set of attention weight vectors and weighted sum the user's preference fusion embedding matrix to obtain the embedding representation of the user's one interest , specifically as follows: (10); (11); (12);
[0028] where and are the embedded representations of interests respectively in the embedded vectors of part and the embedded vectors of part,
[0029] Further, the method for obtaining the multi-faceted interest embedding matrix of the user is as follows:
[0030] Expand the attention weight vectors and from dimensions to dimensions of the attention weight matrix and , where and are trainable parameter matrices. At the same time, repeat the calculations of equations (10), (11) and (12) to obtain the multi-faceted interest embedding matrix , represents the embedded representation of the th interest of the user, is the number of the user's interests, is the quantity of the user's interests.
[0031] Further, the process of the item recommendation model based on multi-interest logical reasoning is specifically as follows:
[0032] First, construct the embedded representation of the logical expression according to the multi-faceted interest embedding matrix of the user obtained from the interest extractor based on logical rules: (13);
[0033] Among them, is the embedded representation of the logical expression; represents the candidate item, is the embedded representation of the candidate item, represents implication.
[0034] Then, the embedded representation of the logical expression is equivalent to: (14);
[0035] Among them, represents the non-logical operator, represents the AND logical operator, represents the OR logical operator; then, the logical operators , and They are regarded as a multi-layer perceptron respectively, which are: and ; The input vector of is ; and both accept two input vectors and and respectively obtain the output vectors and the output vector .
[0036] Finally, by evaluating the similarity between the embedded representation of the logical expression and the embedded representation of the true value , it is decided whether to recommend the target item , specifically as follows: (15);
[0037] Among them, represents the recommended target item, represents the set of candidate items, and the similarity metric function is used to calculate the similarity between the embedded representation of the logical expression and the embedded representation of the true value , is the true value, is the embedded representation of the true value .
[0038] Furthermore, in the multi-interest learning strategy, the trained loss function is used to train the interest extractor based on logical rules and the item recommendation model based on multi-interest logical reasoning. The construction process of the trained loss function is as follows:
[0039] The probability density function of the embedded representation of each interest is defined as: (16);
[0040] Among them, is the probability density function of the embedded representation of the interest, represents the input value of the probability density function, is function, and represent the th shape parameters of the Beta distribution corresponding to the interest.
[0041] The probability density function is defined as: (17);
[0042] Wherein, is the probability density function of , , and are the shape parameters of the th Beta distribution corresponding to the interest; represents the weight of the embedded representation of the interest, and , is a multi-level perception, and respectively represent the embedded vectors of the part in the embedded representation of the interest and the embedded vector of the part, is the number of the user's interest.
[0043] Define the KL divergence distance between the embedded representation of the target item and the embedded representation of the user's interest: (18);
[0044] Wherein, represents the KL divergence distance between the embedded representation of the target item and the embedded representation of the user's interest, represents the KL divergence distance function, , and are the shape parameters of the th Beta distribution corresponding to the target item, .
[0045] Calculate the KL divergence distance between the embedded representation of the target item and the multi-faceted interest embedded matrix of the user: (19);
[0046] Wherein, represents the Embedding representation With the multi-faceted interest embedding matrix of the user The KL divergence distance between them .
[0047] Construct the interest probability distribution contrast loss as: (20);
[0048] Wherein Is the interest probability distribution contrast loss , And Is the KL divergence distance vector Is a preset interval hyperparameter Is the embedding representation of a negative sample Represents the KL divergence distance between the embedding representation of the negative sample and the multi-faceted interest embedding matrix of the user Between them
[0049] Construct the interest logical reasoning contrast loss as: (21);
[0050] Wherein Represents the interest logical reasoning contrast loss , The embedding representation of the logical expression , Represents the embedding representation of the logical expression And the embedding representation of the true value The similarity between them Represents the embedding representation of the logical expression And the embedding representation of the true value The similarity between them, the embedding representation of the logical expression Is defined as , Represents the embedding representation of the logical expression And the embedding representation of the true value The similarity between them; Is a preset hyperparameter
[0051] Construct the logical regularization loss as: (22);
[0052] Wherein Is the logical regularization loss Is the logical regularization term Is the number of the logical regularization term
[0053] The loss function for training Defined as: (23);
[0054] Wherein, is the loss function trained in the multi - interest learning strategy, , , and are preset parameters, is the parameter of the interest extractor based on logical rules and the item recommendation model based on multi - interest logical reasoning, is the second norm.
[0055] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0056] The logical neural network structure provides two significant advantages: modularity and logical regularization. Modularity refers to the dynamic assembly of the neural network architecture based on logical expressions, where each logical operation corresponds to a lightweight neural network module. These network modules adjust their structures according to the user's interactions and preferences (such as likes and dislikes), thereby accurately learning the latent embedding of the user's interests. In addition, logical regularization further improves the accuracy of learning interest embeddings by imposing constraints on the neural network using the prior knowledge of logical rules.
[0057] Two preference operators are introduced to enhance the influence of preference items on the interest representation and effectively suppress the interference of disliked items, which helps to reduce the negative impact of noise items on the user interest learning. During the process of learning interest embeddings, the introduction of IPD and ILR contrast losses avoids the limitation of the model learning only a single interest embedding, promotes the learning of multiple user interests, and improves the quality of multi - interest embedding learning. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 is the framework diagram of the long - sequence recommendation method based on denoising multi - interest logical reasoning in the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0059] The present invention will be described in detail below with reference to the drawings and embodiments.
[0060] The present invention first designs an interest extractor based on logical rules to enhance the importance of user - preferred items when constructing user interests, while reducing the negative impact of items disliked by the user. Two preference operators are defined: is mainly used to enhance the influence of user - preferred items when constructing user interests; It is used to reduce the impact of items that users dislike. This design effectively alleviates the interference of noisy items on user interest modeling. Next, mapping functions based on logical rules are defined for these two preference operators to obtain the preference probability embeddings of corresponding items. In the preference probability distribution space of items, the self-attention mechanism is used to extract user interest embeddings. Finally, logical reasoning is performed based on the obtained user interest embeddings to recommend the next item, thereby avoiding the negative impact of noisy items on logical reasoning and improving the accuracy of recommendations. In addition, in order to fully consider the multiple interests of users during the logical reasoning process, a multi-interest learning strategy is designed, which includes an Interest Probability Distribution (IPD) contrast loss and an Interest Logical Reasoning (ILR) contrast loss. The function of the IPD contrast loss is to require items to be as close as possible to the multi-interest probability distribution space, rather than just the probability distribution of a single interest. The function of the ILR contrast loss is to ensure that multiple interests of users can be considered during logical reasoning, rather than only focusing on their main interests. The invention performs more stably and accurately in long-sequence recommendation tasks.
[0061] A long-sequence recommendation method based on denoising multi-interest logical reasoning, as Figure 1 shown, includes the following steps:
[0062] Step 1: Construct an interest extractor based on logical rules.
[0063] Noisy items in the interaction sequence will have an adverse impact on the logical reasoning of the recommendation method. By inferring user interests from interaction items, the negative impact of noisy items can be effectively reduced. Therefore, an interest extractor based on logical rules is proposed to derive the embedded representation of user interests through the input interaction sequence, and then obtain the multi-faceted interest embedding matrix of the user; the interaction sequence is a sequence used to represent the historical interaction items of the user, which includes interaction items at different times, and each interaction item is the embedded representation of the item that interacts with the user.
[0064] Specifically, the process of deriving the embedded representation of user interests through the input interaction sequence is as follows:
[0065] First, determine whether the user likes the item according to the user's rating of the item, that is, if the rating of the item is greater than 3, it means the user likes the item; otherwise, the user does not like the item; convert the user's rating into a binary label to represent the two emotions of the user towards the item: like or dislike. If the user rates the item higher than 3, then the binary label of the item is , otherwise, the binary label of the item is ; based on the value of the binary label , define two preference operators: and When it is the case, the importance of the item in the embedded representation for constructing the user interest is increased by using the preference operator ; when it is the case, the importance of the item in the embedded representation for constructing the user interest is decreased by using the preference operator , specifically, by defining the logic rule-based mapping functions and respectively for and , and obtaining the preference probability embedding implementation of the item by using the logic rule-based mapping functions and , where represents the embedded representation of an item represents the dimension of the embedded representation of the item; then the embedded representation of the user interest is extracted from the preference probability embedding of the item by using the self-attention method.
[0066] The logic rule-based mapping functions and satisfy the double negation and idempotency in the logic rules, which can be expressed in mathematical language as: (1); (2); (3);
[0067] where represents the NOT logical operator represents the AND logical operator represents the OR logical operator; the above equations ensure that the logic rule-based mapping functions and follow the double negation and idempotency in the logic rules in logical reasoning.
[0068] The logic rule-based mapping functions and obtain the preference probability embedding following multiple independent Beta distributions from the embedded representation of the item, where the Beta distribution has two shape parameters , and the multiple independent Beta distributions can capture the multi-faceted interests of the user in the item. For the item , the construction method of its preference probability embedding is:
[0069] When the user likes the item , the logic rule-based mapping function is used to obtain the preference probability embedding of the item : (4);
[0070] Wherein, represents the embedded representation of an item ; represents the preference probability embedding of the item when the user likes the item ; represents a multi-layer perceptron represents the number of the Beta distribution and , and are the shape parameters of the -th Beta distribution, and the setting of follows the range specified in the BetaE model proposed by Ren et al.
[0071] When the user does not like the item , a mapping function based on logical rules is used to obtain the preference probability embedding of the item : (5);
[0072] Wherein, represents the preference probability embedding of the item when the user does not like the item ; is the probability negation operator corresponding to the non-logical operator .
[0073] The method for extracting the embedded representation of the user's interest from the preference probability embedding of the item by using the self-attention method is specifically as follows:
[0074] For the interaction sequence , wherein, represents the -th user, represents the number of the user, represents the -th item 's embedded representation, represents the number of the item, represents the interaction sequence ; the preference probability embeddings of all items in the interaction sequence are obtained according to formulas (4) and (5) as , wherein, without loss of generality, represents the mapping function based on logical rules or , and the preference probability embeddings of all items are calculated as follows A set of attention weight vectors: (6); (7);
[0075] Wherein, and respectively represent the matrix of the part and the matrix of the part in the preference probability embedding of all items, part and the are respectively the part and the part of , and are the shape parameters of the th Beta distribution; represents the attention weight vector of , represents the attention weight vector of , represents the softmax function, , and are trainable parameters, represents the dimension of the attention weight vector, represents the matrix transpose symbol.
[0076] Then calculate the preference fusion embedding of each item:
[0077] When the user likes item , its preference fusion embedding is: (8);
[0078] When the user doesn't like item , its preference fusion embedding is: (9);
[0079] Wherein, represents the preference fusion embedding of item .
[0080] According to the preference fusion embedding of each item, further obtain the user's preference fusion embedding matrix: , represents the user's preference fusion embedding matrix.
[0081] Based on the obtained set of attention weight vectors and for the user Perform a weighted sum on the preference fusion embedding matrix to obtain the user An embedding representation of an interest , specifically as follows: (10); (11); (12);
[0082] Among them, and are respectively the embedding vectors of the part and the part in the embedding representation of the interest, and is the activation function.
[0083] In order to capture the multi-faceted interests of users, the present invention extends the attention weight vectors and in equations (6) and (7) from dimensions to an attention weight matrix of dimensions and , where and are trainable parameter matrices. At the same time, by repeating the calculations of equations (10), (11), and (12), a multi-faceted interest embedding matrix of the user is obtained, represents the embedding representation of the user's th interest, is the number of the user's interest, is the number of the user's interests.
[0084] Step 2: Construct an item recommendation model based on multi-interest logical reasoning.
[0085] The item recommendation model based on multi-interest logical reasoning is used to recommend items for users according to the multi-faceted interest embedding matrix of the users.
[0086] For the interaction sequence , the present invention uses Horn clauses to transform the recommendation problem: into a logical reasoning problem, where represents the target item to be recommended, represents the candidate item, represents the set of candidate items, Represents a recommendation decision function based on user interaction sequences; different from NCR, NCR directly constructs Horn clauses based on interaction sequences, while the present invention uses interest embeddings extracted from interaction sequences to construct Horn clauses, thus effectively reducing the negative impact of noise terms in interaction sequences on logical reasoning.
[0087] Specifically, first, according to the multi-faceted interest embedding matrix of the user obtained from the interest extractor based on logical rules Construct an embedding representation of the logical expression , as follows: (13);
[0088] Wherein, Is the embedding representation of the logical expression; Represents a candidate item, Is the embedding representation of the candidate item, Represents implication, and formula (13) represents the embedding representation of the logical expression obtained by performing logical reasoning on the multi-faceted interest embedding of the user and the candidate item embedding.
[0089] Then, the embedding representation of the logical expression Is equivalent to: (14);
[0090] Wherein, Represents the not logical operator, Represents the and logical operator, Represents the or logical operator; then, the logical operators , And Are respectively regarded as a multi-layer perceptron, which are respectively: And ; The input vector of is , and the output vector is ; And Both accept two input vectors And , and respectively obtain the output vector And the output vector . Similar to NLR and NCR, constraints are imposed on these multi-layer perceptrons through a logical regularizer to ensure that they conform to the basic logical rules of logical operators.
[0091] Finally, by evaluating the similarity between the embedding representation of the logical expression And the embedding representation of the truth value , decide whether to recommend the target item , specifically as follows: (15);
[0092] Among them, the similarity metric function is used to calculate the embedding representation of the logical expression and the true value of the embedding representation between the similarities, is the true value, is the true value of the embedding representation, the true value of the embedding representation is randomly initialized and not updated during the model learning process.
[0093] Step 3: Use the multi-interest learning strategy to train the logical rule-based interest extractor and the item recommendation model based on multi-interest logical reasoning to ensure that during the logical reasoning process, not only the single interest of the user is concerned, but also multiple interests of the user are considered simultaneously, and the trained logical rule-based interest extractor and the item recommendation model based on multi-interest logical reasoning are obtained.
[0094] Specifically, the probability density function of the embedding representation of each interest is defined as: (16);
[0095] Among them, is the probability density function of the embedding representation of the interest, represents the input value of the probability density function, is function, and represent the corresponding to the interest the
[0096] The logical rule-based interest extractor in the present invention uses the self-attention method to learn the importance of each interest in the multi-faceted interest embedding matrix , represents the weight of the embedding representation of the interest, and , is a multi-level perception, and respectively represent the embedding vectors of the part and the part in the embedding representation of the interest, is the number of the user interest.
[0097] The probability density function is defined as: (17);
[0098] where is the probability density function, , , and are the th shape parameters of the Beta distribution corresponding to the interest.
[0099] Define the KL divergence distance between the embedding representation of the target item and the embedding representation of the user interest, so that the target item is as close as possible to the user interest : (18);
[0100] where represents the KL divergence distance between the embedding representation of the target item and the embedding representation of the user interest, represents the KL divergence distance function, , and are the th shape parameters of the Beta distribution corresponding to the target item .
[0101] At the same time, in order to make the target item as close as possible to the multi-faceted interests, calculate the KL divergence distance between the embedding representation of the target item and the user's multi-faceted interest embedding matrix : (19);
[0102] where represents the KL divergence distance between the embedding representation of the target item and the user's multi-faceted interest embedding matrix , .
[0103] The present invention designs an interest contrast loss to ensure that multiple user interests are considered simultaneously during the logical reasoning process. The interest contrast loss includes an Interest Probability Distribution (IPD) contrast loss and an Interest Logical Reasoning (ILR) contrast loss. The Interest Probability Distribution (IPD) contrast loss requires that in the interest probability distribution space, greater than , and greater than , where is the embedded representation of a negative sample, represents the KL divergence distance between the embedded representation of the negative sample and the multi-faceted interest embedding matrix of the user.
[0104] The Interest Probability Distribution (IPD) contrast loss is constructed as: (20);
[0105] where is the interest probability distribution contrast loss, , and are the KL divergence distance vectors, is a preset interval hyperparameter. Here, the formula is used to replace the sum mean of the formula , reducing the computational complexity while ensuring .
[0106] The Interest Logical Reasoning (ILR) contrast loss requires that the logical reasoning result based on multiple interests is closer to the true value than the result based on a single interest, and the logical reasoning result based on multiple interests is closer to the true value than the logical reasoning result of the negative sample. The mathematical expression of the Interest Logical Reasoning (ILR) contrast loss is: (21);
[0107] where represents the interest logical reasoning contrast loss, , the embedded representation of the logical expression , represents the similarity between the embedded representation of the logical expression and the embedded representation of the true value , represents the similarity between the embedded representation of the logical expression and the embedded representation of the true value , the embedded representation of the logical expression is defined as , The embedded representation of the logical expression and the embedded representation of the true value The similarity between; Is a preset hyperparameter, here, use To reduce the computational complexity while ensuring .
[0108] During the training process, use the logical regularization term To ensure And Follow the logical rules, the logical regularization loss is as follows: (22);
[0109] Among them, Is the logical regularization loss, Is the logical regularization term, the specific description is shown in Table 1, Is the number of the logical regularization term.
[0110] Table 1 Description of the logical regularization term;
[0111] In Table 1, Is the logical expression, and , Is the logical expression The logical variable in, for example Or Etc., Represents the embedded representation of the logical variable, F Is the false value, the false value F The embedded representation of is the vector .
[0112] The logical regularization loss , the IPD comparison loss And the ILR comparison loss are combined for training, and a norm is introduced to constrain the size of the parameters to prevent the model from overfitting. The loss function for training is defined as: (23);
[0113] Among them, Is the loss function for training in the multi-interest learning strategy, , , And Are preset parameters, Is the parameter of the interest extractor based on logical rules and the item recommendation model based on multi-interest logical reasoning, is the second norm, which is used to constrain the parameters of the interest extractor based on logical rules and the item recommendation model based on multi-interest logical reasoning.
[0114] Step 4: Use the trained interest extractor based on logical rules and the item recommendation model based on multi-interest logical reasoning to perform item recommendation and obtain the item recommendation result.
[0115] In this embodiment, extensive experiments are carried out on two public datasets, MovieLens 1M (ML-1M) and Movies and TV (MoTV), to compare the recommendation accuracies of six methods. These two datasets contain user ID, item ID, and rating information. The sequence lengths of the ML-1M and MoTV datasets include 10, 50, and 100. The sequence length of the dataset represents the number of items that the user interacts with in a recent period of time. The evaluation metrics NDCG@5, NDCG@10, HR@5, and HR@10 are used to evaluate the recommendation performance of these methods. In Tables 2 - 5, the best results are shown in bold, and the strongest baseline results are underlined.
[0116] Table 2 Results of the NDCG@5 and HR@5 metrics of the method proposed in the present invention and five baseline methods on the ML-1M dataset;
[0117] Table 3 Results of the NDCG@10 and HR@10 metrics of the method proposed in the present invention and five baseline methods on the ML-1M dataset;
[0118] Table 4 Results of the NDCG@5 and HR@5 metrics of the method proposed in the present invention and five baseline methods on the MoTV dataset;
[0119] Table 5 Results of the NDCG@10 and HR@10 metrics of the method proposed in the present invention and five baseline methods on the MoTV dataset;
[0120] The results in Tables 2 to 5 show that the proposed method outperforms the five baseline methods in terms of NDCG@5 and NDCG@10 on all datasets. On the ML-1M dataset with a sequence length of 100, the HR@5 and HR@10 of the proposed method are slightly lower than those of GRU4Rec and NARM, possibly because excessive noisy items interfere with the extraction of interest embeddings. Traditional sequential recommendation methods such as STAMP, GRU4Rec, and NARM are less affected by changes in sequence length, but their overall recommendation performance on the two datasets is lower than that of the proposed method and NCR. For the ML-1M and MoTV datasets, as the sequence length increases from 10 to 100, the recommendation performance of NLR and NCR significantly decreases. Compared with NLR and NCR, the proposed method can effectively overcome the adverse effects of noisy items in long sequences on interest modeling. Therefore, the proposed method exhibits better recommendation performance and robustness.
Claims
1. A long-sequence recommendation method based on denoising multi-interest logical reasoning, characterized in that Including the following steps: Construct an interest extractor based on logical rules; the interest extractor based on logical rules is used to deduce the embedded representation of the user's interest through the input interaction sequence, and then obtain the user's multi-faceted interest embedding matrix; the interaction sequence is a sequence used to represent the user's historical interaction items, including interaction items at different times, and each interaction item is the embedded representation of the item that interacts with the user; Construct an item recommendation model based on multi-interest logical reasoning; the item recommendation model based on multi-interest logical reasoning is used to recommend items for the user according to the user's multi-faceted interest embedding matrix; Use a multi-interest learning strategy to train the interest extractor based on logical rules and the item recommendation model based on multi-interest logical reasoning to obtain the trained interest extractor based on logical rules and the item recommendation model based on multi-interest logical reasoning; Use the trained interest extractor based on logical rules and the item recommendation model based on multi-interest logical reasoning to perform item recommendation to obtain the item recommendation result.
2. The long-sequence recommendation method based on denoising multi-interest logical reasoning according to claim 1, wherein The process of deducing the embedded representation of the user's interest through the input interaction sequence is as follows: First, determine whether the user likes the item according to the user's rating of the item. That is, if the rating of the item is greater than the set threshold, it means the user likes the item; otherwise, the user does not like the item. Convert the user's rating into a binary label to represent the two emotions of the user towards the item: like or dislike. If the user rates the item higher than the set threshold, then the binary label of the item is , otherwise, the binary label of the item is ; Based on the value of the binary label , define two preference operators: and . When , use the preference operator to increase the importance of the item in the embedded representation for constructing the user's interest. When , use the preference operator to reduce the importance of the item in the embedded representation for constructing the user's interest. Specifically, by defining logic rule-based mapping functions and for the preference operators and respectively, and using the logic rule-based mapping functions and to obtain the preference probability embedding implementation of the item, where represents the embedded representation of an item, represents the dimension of the embedded representation of the item; then use the self-attention method to extract the embedded representation of the user's interest from the preference probability embedding of the item.
3. The long sequence recommendation method based on denoising multi-interest logical reasoning according to claim 2, wherein The construction method of the preference probability embedding of the item is as follows: When the user likes an item a logic rule-based mapping function is used to obtain the item 's preference probability embedding: (4); Among them, represents the embedded representation of an item ; represents the preference probability embedding of the item when the user likes the item ; represents a multi-layer perceptron represents the number of the Beta distribution and , and are the shape parameters of the th Beta distribution; When the user does not like an item a logic rule-based mapping function is used to obtain the preference probability embedding of the item: (5); Among them, indicates that the user does not like the item When the preference probability embedding of the item is a non-logical operator corresponding probability negation operator.
4. The long-sequence recommendation method based on denoising multi-interest logical reasoning according to claim 3, wherein The method of using the self-attention method to extract the embedded representation of the user's interest from the preference probability embedding of the item is specifically as follows: For the interaction sequence , where represents the th user denotes the user ID represents the th item 's embedding representation denotes the item ID represents the interaction sequence in the number of interaction terms; obtain the preference probability embeddings of all items in the interaction sequence as , where represents the mapping function based on logical rules or , calculate a set of attention weight vectors for the preference probability embeddings of all items: (6); (7); Among them, and respectively represent the matrix sum of the in part and the matrix sum of the part, are respectively of part and part, and are the shape parameters of the th Beta distribution; represents attention weight vector of, represents attention weight vector of, represents the softmax function, , and are trainable parameters, represents the dimension of the attention weight vector, represents the matrix transpose symbol; Then calculate the preference fusion embedding of each item: When the user likes an item its preference fusion embedding is as follows: (8); When the user does not like the item its preference fusion embedding is as follows: (9); Among them, represents the preference fusion embedding of the item ; Fuse the embeddings according to the preferences of each item, and then obtain the user's preference-fused embedding matrix: , denote the preference-fused embedding matrix of user ; Based on the obtained set of attention weight vectors and weighted sum is performed on the preference fusion embedding matrix of the user to obtain an embedded representation of the user's one interest, specifically as follows: (10); (11); (12); Among them, and are the embedded representations of interests in the embedded vectors of part and the embedded vectors of part, is the activation function.
5. The long-sequence recommendation method based on denoising multi-interest logical reasoning according to claim 4, wherein The method for obtaining the user's multi-faceted interest embedding matrix is as follows: The attention weight vectors in equations (6) and (7) and are extended from dimensions to dimensional attention weight matrices and , where and are trainable parameter matrices. At the same time, equations (10), (11) and (12) are repeated for calculation to obtain the multi-faceted interest embedding matrix , represents the embedding representation of the user's th interest, is the number of the user's interests, is the number of the user's interests.
6. The long-sequence recommendation method based on denoising multi-interest logical reasoning according to claim 5, wherein The process of the item recommendation model based on multi-interest logical reasoning is specifically as follows: First, according to the multi-faceted interest embedding matrix of the user obtained from the logic rule-based interest extractor construct the embedding representation of the logical expression : (13); Among them, is the embedded representation of the logical expression; represents a candidate item, is the embedded representation of the candidate item, represents implication; Then, the embedded representation of the logical expression is equivalent to: (14); Among them, represents a non-logical operator, represents an AND logical operator, represents an OR logical operator; then, the logical operators , and are respectively regarded as a multi-layer perceptron, which are: and ; The input vector of is ; and both accept two input vectors and , and respectively obtain an output vector and an output vector ; Finally, by evaluating the embedded representation of the logical expression and the true value of the embedded representation to determine whether to recommend the target item , as follows: (15); Among them, represents the recommended target item, represents the set of candidate items, and the similarity metric function is used to calculate the embedding representation of the logical expression and the embedding representation of the truth value between them, is the truth value, is the truth value embedding representation.
7. The long sequence recommendation method based on denoising multi-interest logical reasoning according to claim 6, characterized in that, The loss function used in the multi-interest learning strategy is used to train the logic rule-based interest extractor and the item recommendation model based on multi-interest logical reasoning. The construction process of the loss function is as follows: Embedding representation of each interest The probability density function of which is defined as: (16); Among them, is the embedded representation of interest of the probability density function, represents the input value of the probability density function, is a function, and represents the corresponding shape parameter of the $k$-th Beta distribution; The probability density function is defined as: (17); Among them, is the probability density function, , , and are the corresponding th shape parameters of the Beta distribution; represents the weight of the embedded representation of the interest, and , is a multi-level perception, and respectively represent the embedded vectors of the portion in the embedded representation of the interest and is the number of the user interest; Define the target item Embedding representation And the embedding representation of the user interest The KL divergence distance between them: (18); Among them, represents the embedded representation of the target item and the embedded representation of the user interest The KL divergence distance between them , represents the KL divergence distance function , and are the shape parameters of the th Beta distribution corresponding to the target item ; Calculate the embedding representation of the target item and the KL divergence distance between it and the multi-faceted interest embedding matrix of the user : (19); Among them, represents the embedded representation of the target item and the multi-faceted interest embedding matrix of the user, ; Construct an interest probability distribution contrast loss as: (20); Among them, is the interest probability distribution contrast loss, , and is the KL divergence distance vector, is a preset interval hyperparameter, is the embedding representation of a negative sample, represents the KL divergence distance between the embedding representation of the negative sample and the multi-faceted interest embedding matrix of the user; Construct an interest logical reasoning contrast loss as: (21); Among them, represents the interest logic inference contrast loss, , the embedded representation of the logical expression , represents the embedded representation of the logical expression and the embedded representation of the true value the similarity between them, represents the embedded representation of the logical expression and the embedded representation of the true value the similarity between them, the embedded representation of the logical expression is defined as , represents the embedded representation of the logical expression and the embedded representation of the true value the similarity between them; is a preset hyperparameter; Construct a logical regularization loss as: (22); Among them, is the logical regularization loss, is the logical regularization term, is the number of the logical regularization term; Loss function of training is defined as: (23); Among them, is the loss function trained in the multi-interest learning strategy, , , and are preset parameters, are the parameters of the interest extractor based on logical rules and the item recommendation model based on multi-interest logical reasoning, is the second norm.
Citation Information
Patent Citations
Deep click-through rate estimation method supporting extraction of multiple fine-grained interests
CN115309981A
Multi-interest recommendation method and device
CN116521973A
Probability logic reasoning-based article sequence recommendation method
CN116523608A
Cross-domain recommendation method based on source domain data enhancement and multi-interest refinement migration
CN117611273A
User interested content recommendation method and device and storage medium
CN117951380A
Cited By
Time perception sequence recommendation method based on multi-kernel convolution and Mama architecture
CN122332660A