A knowledge-enhanced multi-task recommendation method under hyperbolic space
By mapping entities in hyperbolic space and combining them with graph attention networks, this method addresses the problem of unexplored higher-order interactions between users and items in existing recommendation methods, achieving more efficient recommendation results and alleviating data sparsity and long-tail problems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2026-03-24
AI Technical Summary
Existing knowledge graph-based recommendation methods fail to fully explore the higher-order interactions between users and items, and their models are complex and time-consuming, making them unable to effectively solve the long-tail problem and the cold start problem.
Entities are mapped to hyperbolic space, and complex relationships are captured using the non-Euclidean features of hyperbolic space. Knowledge enhancement is performed by combining graph attention networks, and recommendation and graph link prediction are optimized through multi-task learning. TransH and perceptual graph attention networks are used for feature information classification and sharing.
It improves the accuracy and efficiency of the recommendation system, better captures user preferences, alleviates the data sparsity problem, and enhances the model's recommendation performance.
Smart Images

Figure CN116204719B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of item recommendation, and in particular to a knowledge-enhanced multi-task recommendation method in hyperbolic space. Background Technology
[0002] The primary goal of recommender systems is to provide users with better recommendations. Collaborative filtering is undoubtedly the most widely used method in the field. It mines users' interests and preferences based on their historical behavior information, and then recommends items that match their characteristics. However, collaborative filtering-based recommendation algorithms often suffer from long-tail problems and cold-start problems. For example, when a user uses the recommendation system for the first time, the lack of historical interaction information makes it impossible to provide recommendations that match the user's characteristics. Recommendation methods based on knowledge graphs (KGs) can effectively address the limitations of collaborative filtering. Researchers have found that using knowledge graphs as auxiliary information in recommendation methods can effectively alleviate these problems. Therefore, this has sparked a surge of research interest.
[0003] While methods using knowledge graphs (KGs) as auxiliary information for recommendations have been widely applied and researched, most KG-based recommendation methods simply encode auxiliary information, lacking higher-order interactions between entities and failing to uncover potential connections between users and items. Multi-task learning is a commonly used approach, emphasizing knowledge graph modeling to assist recommendations. Simultaneously, the recommendation system trains user and item features and combines these feature-bearing items with the knowledge graph for training, thus obtaining embedded entities with shared features. Among various multi-task learning-based recommendation algorithms, the MKR model addresses the data sparsity problem by designing a deep, end-to-end framework to enhance the learning of higher-order interactions between items and entities. However, it only emphasizes the optimization effect of multi-task learning on auxiliary tasks; without improvements to coordinated optimization and graph neural network modeling, the algorithm's complexity reaches an exponential level, and its optimization performance needs further improvement.
[0004] As technology advances, recommendation algorithms based on multi-task learning require improvement. On one hand, while Euclidean space provides a visually friendly model for observation, many complex data types often exceed the geometric representation of Euclidean space. For example, the CFKG model constructs a user-item knowledge graph (KG) for recommendations based on user historical behavior information. However, it largely treats the knowledge graph as a series of complete information chains, or simply embeds raw data into the KG. Data in non-Euclidean space cannot be fully utilized, thus failing to capture the higher-order relationships typically present in the recommendation domain. On the other hand, algorithms based on Graph Attention Networks (GAT) focus on displaying the interaction relationships between users and items, but pre-training entity embedding methods are very time-consuming. Therefore, we believe that since the embedded space lacks the ability to observe data in non-Euclidean space, attributing unobserved data to noise will cause distortion. Equally important is that time cost and practicality must be considered during model training. Summary of the Invention
[0005] This invention aims to at least solve the technical problems existing in the prior art, and in particular, it innovatively proposes a knowledge-enhanced multi-task recommendation method in hyperbolic space.
[0006] To achieve the above-mentioned objectives of this invention, this invention provides a knowledge-enhanced multi-task recommendation method in hyperbolic space, comprising the following steps:
[0007] S1 maps entities to hyperbolic space, fully capturing the non-Euclidean features of entities to obtain user embeddings and item embeddings;
[0008] S2, train the triple information in the knowledge graph to obtain a knowledge perception representation based on object entities;
[0009] S3, the entity vectors of the item embedding and knowledge-enhanced training are jointly and alternately trained. The entity vectors of the knowledge-enhanced training include multiple knowledge-aware representations, so that entities can share feature information. The training continues according to the user information obtained for the user's specific preferences, so as to obtain item entities that satisfy the user's preferences (item entities are the set of all tail entities of triples), thereby enabling the recommendation system to capture the user's most realistic preferences for items.
[0010] Furthermore, S1 includes the following steps:
[0011] S1-1, obtaining the most primitive representation of users and items in Euclidean space;
[0012] S1-2, using Lorentz notation to represent the embeddings of users and items:
[0013] First, we fix the origin o, which is any point in hyperbolic space; we take the origin o as the reference point, and define the tangent space τ at the origin o. o H d Gaussian distribution sampling was performed to obtain the initial embeddings of users and items in the tangent space:
[0014] θ′ u ,θ′ i ~N(0,σI) d×d (1)
[0015] Where θ′ u This represents the user's initial embedding in the tangent space;
[0016] θ′ i This indicates the initial embedding of the item in tangent space;
[0017] θ′ u ,θ′ i ~N(0,σI) d×d ) represents θ′ u ,θ′ i It follows a normal distribution with an expected value of 0 and a variance of σI. d×d ;
[0018] σ represents the standard deviation;
[0019] I d×d Represents a collection of items;
[0020] Then, the obtained initial feature matrix (initial embedding) is subjected to adaptive cross-array: θ″ u =[0; θ′ u ];θ″ i =[0; θ′ i ], thus obtaining the embedding matrix θ″ u ,θ″ i ∈τ o H d , [;] indicates a join operation;
[0021] Then embedding matrix θ″ u ,θ″ i The hyperbolic space is mapped using an exponential mapping operation, as follows:
[0022]
[0023] Where k is a hyperparameter, k = -1 / c, and c represents curvature;
[0024] Thus, the user and items in hyperbolic space H were obtained. d High-order feature embedding in:
[0025] θu =exp o (θ″ u );θ i =exp o (θ″ i (3)
[0026] Where θ u This indicates that the user is in hyperbolic space H d High-order feature embedding in;
[0027] θ i Indicates the object in hyperbolic space H d High-order feature embedding in;
[0028] θ″ u The embedding matrix represents the user's embedding matrix;
[0029] θ″ u An embedding matrix representing the items;
[0030] Finally, a logarithmic mapping is performed on the feature items corresponding to all users in the hyperbolic space to obtain the user-item feature embedding:
[0031]
[0032] e u =log o (θ u )
[0033] e i =log o (θ i (5)
[0034] Here, arcosh() represents the inverse hyperbolic function;
[0035] <·,·> represent the inner product;
[0036] <·,·> L Represents the Lorentz inner product;
[0037] x is any point in the tangent space;
[0038] k represents the negative curvature constant;
[0039] |||| L Represents the L-norm;
[0040] e u Indicates user feature embedding;
[0041] e i Indicates the embedding of item features;
[0042] log o() indicates performing a logarithmic operation with respect to point o, mapping the embedding in hyperbolic space to Euclidean space;
[0043] O is the point in hyperbolic space corresponding to the exponential mapping through which the tangent space passes; that is, the origin after the mapping.
[0044] Furthermore, it also includes: the hyperbolic loss function can be defined as:
[0045] L H =max(d H (θ u ,θ i )-d H (θ u ,θ j (6) + m, 0)
[0046] Where d H (·,·) indicates the degree of relevance between the user and the item;
[0047] θ u This indicates that the user is in hyperbolic space H d High-order feature embedding in;
[0048] θ i This represents the item (positive sample) i corresponding to the user in the hyperbolic space H. d High-order feature embedding in;
[0049] θ j This represents an item (negative sample) j that does not correspond to the user in hyperbolic space H. d High-order feature embedding in.
[0050] Furthermore, S2 includes the following steps:
[0051] S2-1, KGE is used to train the knowledge graph, and entity embeddings are obtained after training; the knowledge graph is composed of several triplet information.
[0052] S2-2, using the method of embedding a perceptual graph attention network to generate tail entities with different weights, thereby representing the implicit meaning of the tail entities and obtaining the different meanings of different head entities and relational entities; the attention network has a four-layer neural network structure, with the first three layers being ReLU functions.
[0053] Our aim is to use KGE pre-trained knowledge graphs to classify the feature information of items, and use a designed attention network to perceive items (triple entities) with different features to obtain the most suitable feature information for the items, thereby achieving the effect of knowledge enhancement.
[0054] Further, if the KGE is TransH, then S2-1 includes the following steps:
[0055] S2-1-1, for each triple, project the embeddings of the head entity and the tail entity onto the hyperparameter plane, with the projections set to h⊥ and t⊥:
[0056]
[0057]
[0058] Where h⊥ represents the embedding projection of the head entity;
[0059] h represents the initial header entity;
[0060] This represents the projection of w onto the hyperparameter plane;
[0061] w r Represents the hyperparameter plane normal vector;
[0062] t⊥ represents the embedding projection of the tail entity;
[0063] t represents the original tail entity;
[0064] S2-1-2, if it is an incomplete triplet, then complete it using the complete triplet with the same projection;
[0065] S2-1-3, after training, the entity embedding is obtained, and preprocessing is completed.
[0066] Furthermore, it also includes: evaluating the reasonableness of the completed triples using a scoring function, wherein the scoring function is:
[0067]
[0068] Where d r Represents a relation vector;
[0069] This represents the square of the L2 norm.
[0070] Furthermore, it also includes the loss function:
[0071]
[0072] Where Max represents the maximum value;
[0073] d r Represents a relation vector;
[0074] This represents the square of the L2 norm.
[0075] Furthermore, S2-2 includes the following steps:
[0076] First, construct the attention a for the tail entities in the knowledge graph triple (h,r,t). i , represented as:
[0077]
[0078] Where ∏(·) represents a perceptual attention potential attribute weight for head entities and relations;
[0079]
[0080] Then, scaling is performed: the entity embedding trained by KGE is passed through three layers of ReLU activation functions, and the result is then subjected to Sigmoid.
[0081]
[0082] A perceptual attentional latent attribute weight representing head entities and relationships;
[0083] Then, a joint weighted operation is performed on the obtained relational entities and head entities to extract the perceptual feature terms, resulting in the tail entity:
[0084]
[0085] Indicates the embedding of the tail entity;
[0086] r i Represents a relational entity;
[0087] Indicates the embedding of the head entity;
[0088] After perceptual attention embedding, the tail entity of weighted attention is represented as an object entity. And it adopts l knowledge-aware representation sets based on object entities, using e l express:
[0089]
[0090] in This represents the l-th knowledge-aware representation based on object entities.
[0091] Furthermore, S3 includes the following steps:
[0092] The entity vector e l and item embedding v lThe feature matrix obtained by merging features through the concat operation ensures that both items and associated entities share the features of both. The resulting feature matrix is then mapped into the latent vector space, and the next layer's feature matrix is output.
[0093] First, construct a training weight w l ∈R d and fitted vector μ l ∈R d The training weights w l The purpose of this is to compress the dimension of the feature matrix, thereby obtaining the item embeddings and entity vectors (entity embeddings) trained at l+1 times:
[0094]
[0095]
[0096] Where v l+1 This indicates that the (l+1)th item is embedded;
[0097] · T Represents the transpose of a matrix;
[0098] w l VV This represents the weights of the two item entities during the l-th training iteration;
[0099] w l VE This represents the weights corresponding to the item entity and the user entity during the l-th training iteration;
[0100] Indicates deviation;
[0101] w l EE This represents the weights corresponding to the two user entities during the l-th training iteration;
[0102] Finally, the v obtained from the last training iteration l+1 The output [v] represents the items that should be recommended to the user;
[0103] The latent feature matrix C l Build it in the following way:
[0104]
[0105] C l Let C represent the joint feature matrix of layer l. l ∈R d*d ;
[0106] v l Indicates the embedding of the l-th item, vl ∈R d ;
[0107] . T Represents the transpose of a matrix;
[0108] e l e represents the entity vector trained with knowledge reinforcement. l ∈R d ;
[0109] d is the dimension.
[0110] Furthermore, it also includes the loss function:
[0111]
[0112] L H This represents the loss function of the recommendation module;
[0113] L KGE This represents the loss in the KGE module;
[0114] Where λ1 and λ2 are balancing parameters used to adjust the range of each loss function;
[0115] u and v represent the user set and the project set, respectively;
[0116] The σ(·) function represents the nonlinear activation function Sigmoid;
[0117] (h,r,t) represents the initial triplet;
[0118] (h′,r′,t′) represents the triplet after training;
[0119] G represents a knowledge graph;
[0120] ε is the regularization term.
[0121] In summary, by employing the aforementioned technical solutions, this invention treats user and item modeling and knowledge graph modeling as two independent but related tasks. On one hand, it leverages the extensibility and strong adaptability of hyperbolic space to capture complex non-Euclidean relationships between entities, realizing high-order interaction relationships between users and items. On the other hand, it models the rich interactions between all available information entities in the recommendation scenario as a heterogeneous graph, using a graph attention network to aggregate heterogeneous information, distinguish auxiliary information from different knowledge neighborhoods, and embed it into the node representation vectors of users and items. This alleviates the problem of sparse user-item interaction information and can uncover the latent semantic relationships between users and items in the vector space. Furthermore, a multi-task learning method is used to jointly optimize graph link prediction and recommendation tasks, enabling the model to simultaneously capture explicit and implicit features, thereby improving the model's recommendation performance.
[0122] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0123] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0124] Figure 1 This is a schematic diagram of the overall architecture of the HKMR model of this invention.
[0125] Figure 2 This is a diagram showing the operation of the hyperbolic mapping module of the present invention. Detailed Implementation
[0126] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0127] The method of this invention starts from a multi-tasking approach, setting the user as U = {u1,...u}. m}, the items are set as I = {i1, ... i} n If the user and the item have interactive attributes, then use R. u,i express;
[0128] The triplet is (h) m ,r m ,t m ) represent the same group, h m Represents the head entity of the m-th triple, r m Let t represent the relation entity of the m-th triple. m Let m be the tail entity of the m-th triple; the final results are obtained through multi-task learning. The main objective is to predict the user's final rating for unknown items.
[0129] The method of this invention is based on the HKMR model, and the overall architecture of the HKMR model is as follows: Figure 1 As shown, it includes:
[0130] (1) Hyperbolic mapping module: maps entities to hyperbolic space. The input of the hyperbolic mapping module is the original embedding of u and i, and the output is the embedding of u and i with non-Euclidean structure features.
[0131] The hyperbolic mapping module comprises two spatial mapping layers. The first layer is a hyperbolic mapping layer (logarithmic mapping), which aims to map data in Euclidean space to hyperbolic space. This allows non-Euclidean data, which cannot be observed in Euclidean space, to be represented in hyperbolic space, thereby increasing the quantity of feature data. The second layer is an exponential projection layer, which aims to project the enhanced data back into Euclidean space, facilitating subsequent feature calculations.
[0132] The innovations of the hyperbolic mapping module are as follows: Traditional recommendation algorithms in Euclidean space ignore non-Euclidean structure data that exists but cannot be observed in Euclidean space. This can lead to incorrect evaluation of users' true preferences in real-world scenarios. The method of this invention aims to overcome this limitation by making full use of the extensibility of hyperbolic space to capture data with complex structures. In real-world recommendation scenarios, it maximizes the collection of user-item feature information, thereby making reasonable recommendations to users.
[0133] (2) Knowledge enhancement module: Enhance the feature information of graph nodes in hyperbolic space.
[0134] (1) First step KGE training: Input is (h, r, t), output is (h, r, t) after training; the purpose is to make the information of the triple more complete as the training continues. (2) Second step tail entity attention training: Input is (h, r, t) after KGE training, output is (h, r, t) with rich features, the third part mainly uses t tail entities.
[0135] The innovations of the knowledge enhancement module are as follows: For recommendation systems, the problem to be solved is to recommend items reasonably. Users cannot simply want any item to be recommended; the feature information of the items is crucial for the recommendation system to decide whether to recommend an item to the user. Knowledge graphs serve as auxiliary information for recommendations, but most knowledge graphs are incomplete, or lack complete feature information. This invention aims to overcome this limitation by using a TransH pre-trained knowledge graph to classify the obtained feature information about items. Our designed attention network then perceives items (triple entities) with different features, obtaining the most suitable feature information for each item, thus achieving the effect of knowledge enhancement.
[0136] (3) Feature Joint Module: The embeddings with item features obtained from the first two modules are trained alternately and jointly, enabling entities to share feature information, thus allowing the recommendation system to capture the user's most authentic preferences for items. The input to the feature joint module is the item-embedding obtained from the hyperbolic mapping module and the tail-embedding obtained from the knowledge enhancement module. The output is the item entity embedding with all features.
[0137] The innovation of the feature concatenation module is as follows: Traditional multi-task learning methods perform Cartesian product operations on features. This operation has two drawbacks: First, the algorithm has high time complexity. In recommendation algorithms, not only the accuracy of recommendations but also time cost must be considered. Second, the feature attributes generated by alternating training are not strong enough. If the hyperbolic mapping module obtains information that the user's rating of an item is close to 0, it means that this part will have very few features. However, if the knowledge enhancement part obtains positive attributes of the item, and Cartesian product is used, the final score will be very low (close to 0), resulting in very few feature attributes. (The rating can be approximated as a feature attribute, which is a certain feature attribute of the item). Therefore, traditional recommendation methods are obviously ineffective. We concatenate the two, sharing the feature attributes obtained from both, thus expanding the feature attributes of the item and enabling better recommendations.
[0138] 1. Hyperbolic Mapping Module:
[0139] The hyperbolic mapping module works as follows Figure 2 As shown, Figure 2 The graph can intuitively reflect the change in distance between positive and negative samples after hyperbolic mapping. This represents the positive sample in tangent space. This represents the negative sample in tangent space. d H Let represent the distances in tangent space and hyperbolic space, respectively. o represents the initial origin, O represents the origin formed by the interaction between samples after hyperbolic mapping, and o′ represents the origin representation after hyperbolic transformation.
[0140] We obtain the most primitive user and item representations in Euclidean space and use Lorentz notation to represent the embeddings of users and items. First, we fix the origin o, which is any point in hyperbolic space. The origin o is represented as: H d Represent hyperbolic space; take the origin as our reference point, and set the curvature c as a hyperparameter k = -1 / c; we have the tangent space τ at the origin o. o H d Gaussian distribution sampling was performed to obtain the initial embeddings of users and items in the tangent space:
[0141] θ′ u ,θ′ i ~N(0,σI) d×d (1)
[0142] Where θ′ u This represents the user's initial embedding in the tangent space;
[0143] θ′ i This indicates the initial embedding of the item in tangent space;
[0144] θ′ u ,θ′ i ~N(0,σI) d×d ) represents θ′ u ,θ′ i It follows a normal distribution with an expected value of 0 and a variance of σI. d×d ;
[0145] σ represents the standard deviation;
[0146] I d×d Represents a collection of items;
[0147] Then, perform adaptive cross-column analysis on the obtained initial feature matrix: θ″ u =[0; θ′ u ];θ″ i =[0; θ′ i ], thus obtaining the embedding matrix θ″ u ,θ″ i ∈τ o H d , [;] denotes a join operation. To obtain the embeddings of users and items in hyperbolic space, we map them to τ in hyperbolic space. o H d →H d , → is the mapping symbol:
[0148]
[0149] exp o (x) represents the logarithmic operation;
[0150] cosh() represents the hyperbolic cosine function;
[0151] || || L Represents the L-norm;
[0152] k represents the negative curvature constant;
[0153] sinh() represents the hyperbolic sine function;
[0154] x∈τ o H d Let be any point in the tangent space and satisfy
[0155] Through the exponential mapping operation we set up, we can obtain the user and item positions in hyperbolic space H. d High-order feature embedding in:
[0156]
[0157] Where θ u This indicates that the user is in hyperbolic space H d High-order feature embedding in;
[0158] θ i Indicates the object in hyperbolic space H d High-order feature embedding in;
[0159] θ″ u The embedding matrix represents the user's embedding matrix;
[0160] θ″ u An embedding matrix representing the items;
[0161] The hyperbolic space embeddings of the users and items we obtained are applicable to all users {θ}. u} u∈U and items {θ i} i∈I Finally, we perform a logarithmic mapping on the feature items corresponding to all users in hyperbolic space to obtain the user-item feature embeddings we need:
[0162]
[0163] e u =log o (θ u )
[0164] e i =log o (θ i (5)
[0165] Here, arcosh() represents the inverse hyperbolic function;
[0166] <·,·> represent the inner product;
[0167] <·,·> L Represents the Lorentz inner product;
[0168] x is any point in the tangent space;
[0169] k represents the negative curvature constant;
[0170] |||| L Represents the L-norm;
[0171] e u Indicates user feature embedding;
[0172] e i Indicates the embedding of item features;
[0173] log o() indicates that a logarithmic operation is performed with respect to point o, mapping the embedding in hyperbolic space to Euclidean space.
[0174] O is the point in hyperbolic space corresponding to the exponential mapping through which the tangent space passes; that is, the origin after the mapping.
[0175] We set a distance constant m. The distance-based recommendation model requires sampling. For each user u, we formally set the positive samples as R. u,i =1, negative samples are set to R u,j =0; therefore, the hyperbolic loss function can be defined as:
[0176] L H =max(d H (θ u ,θ i )-d H (θ u ,θ j (6) + m, 0)
[0177] Where d H (·,·) indicates the degree of relevance between the user and the item;
[0178] θ u This indicates that the user is in hyperbolic space H d High-order feature embedding in;
[0179] θ i This represents the item (positive sample) i corresponding to the user in the hyperbolic space H. d Higher-order feature embeddings in; positive samples
[0180] θ j This represents an item (negative sample) j that does not correspond to the user in hyperbolic space H. d High-order feature embedding in.
[0181] The relevance between users and items is represented by the Lorentz distance formula:
[0182]
[0183] d H (x,y) represents the degree of correlation between x and y;
[0184] c represents curvature;
[0185] cosh -1 This indicates the calculation of inverse trigonometric functions;
[0186] <·,·> L Represents the Lorentz inner product;
[0187] 2. Knowledge Enhancement Module:
[0188] Knowledge graph embedding models (KGE) play a pre-training role in knowledge graph-based recommendation systems. TransE is a processing method of KGE, and although it has been widely used, its basic idea satisfies e h +r≈e t This could potentially lead to a single relationship corresponding to multiple head or tail entities, resulting in one-to-many, many-to-one, and many-to-many problems. Where e... h The header entity's embedding is represented by r, which represents the relation entity, and e is represented by e. t This represents the embedding of the tail entity. Therefore, to address these issues, we use the TransH method to train the knowledge graph in knowledge graph modeling. The knowledge graph, or knowledge graph, is represented by multiple triples. The core idea is to set a hyperparameter plane for the relations in each triple. For a triple (h, r, t), the embeddings of the head and tail entities are projected onto the hyperparameter plane, with the projections set to h⊥ and t⊥. If the original triple (h, r, t) is incomplete, we can train complete triples with the same projection, thus completing the knowledge graph. Furthermore, we set a scoring function. To evaluate the rationality of the completed triplet.
[0189]
[0190]
[0191] Where h⊥ represents the embedding projection of the head entity;
[0192] h represents the initial header entity;
[0193] This represents the projection of w onto the hyperparameter plane;
[0194] w r Represents the hyperparameter plane normal vector;
[0195] t⊥ represents the embedding projection of the tail entity;
[0196] t represents the original tail entity.
[0197] We substitute formulas (9) and (9) into the scoring function. The scoring function for KGE is obtained as follows:
[0198]
[0199] Where d r Represents a relation vector;
[0200] Represents the square of the L2 norm;
[0201] Therefore, to distinguish between correct and incomplete triplets, we used a margin-based ranking for loss evaluation. To differentiate hyperbolic margin values, we used n to represent the Euclidean margin value:
[0202]
[0203] We believe that entities trained using KGE still lack distinctiveness. Building upon the idea of capturing user interests and preferences through the features of tripled entities, we further refine this approach by targeting the latent meaning of each tail entity to find suitable items. In knowledge graphs, the latent meaning of a tail entity becomes highly meaningful when it has different relational and head entities. For example, the films *Dying to Survive* and *Lost in Thailand* share high similarities in their protagonists and directors, but become dissimilar when categorized by emotion or genre. To address this, we propose using a perceptual graph attention network embedding method to generate tail entities with different weights. This represents the implicit meaning of tail entities as much as possible, capturing the different meanings of different head and relational entities, thereby improving the accuracy of user recommendations. Our tail entity attention network is designed to be more targeted during model training, aggregating entity information to enhance the features of tail entities. Each entity has a weight, which is randomly generated. The tail entities obtained through training also have weights, which are further randomly generated based on the obtained entities, in the same way as the weights generated for the original entities.
[0204] First, we process the completed knowledge graph triple (h, r, t). We first construct an attention a for the tail entity. i It is represented as:
[0205]
[0206] in, This represents the embedding of the i-th head entity;
[0207] r i Represents the embedding of relations;
[0208] Indicates the embedding of the tail entity;
[0209] ∏(·) represents a perceptual attention latent attribute weight for the head entity and relation. We use the ReLU and Sigmoid functions here. Our attention network has a four-layer neural network structure, with the first three layers using ReLU functions.
[0210]
[0211] Where σ represents the Sigmoid function;
[0212] W1 is set as the weight matrix through the attention network;
[0213] W0() represents a trainable attention weight matrix;
[0214] Represents head entity With relation entity r i Chain operations between them;
[0215] || represents a series operation; δ is a reasonably existing deviation constant, which is represented by a constant for different number of layers depending on the subscript.
[0216] Then, a scaling operation is performed. The entity embedding trained by KGE is passed through three layers of ReLU activation functions, and the result is then subjected to Sigmoid.
[0217]
[0218] A perceptual attentional latent attribute weight representing head entities and relationships;
[0219] To better achieve knowledge association and acquisition, and to address the question of which adjacent tail entity to focus on, we set up a focus function A. l , satisfying (h′,r′,t′)∈A l , l represents the triplet data of which level.
[0220] Since the entity representations in the initial entity set are similar to feature terms, users and items should have a strong connection. We perform a joint weighting operation on the obtained relation entities and head entities to extract the perceived feature terms, thus obtaining the tail entities:
[0221]
[0222] Indicates the embedding of the tail entity;
[0223] r i Represents a relational entity;
[0224] Indicates the embedding of the head entity;
[0225] After perceptual attention embedding, we represent the tail entity of weighted attention as an object entity. We designed l sets of knowledge-aware representations based on object entities, using el express:
[0226]
[0227] in This represents the l-th knowledge-aware representation based on object entities.
[0228] 3 Feature Union Module:
[0229] Our algorithm treats recommendation systems and knowledge graph modeling as two independent but related tasks. To improve the high-order interaction between them, we set up a feature joint module. The trained features are relatively well-developed, but the entity vector e... l and item vector v l These are two different interpretations of the same category of objects, so joint data sharing between them allows each to obtain additional feature data from the other, thus compensating for their own data sparsity. First, let's consider the entity vector e... l and item vector v l Construct their latent feature matrix C l :
[0230]
[0231] C l Let C represent the joint feature matrix of layer l. l ∈R d*d ;
[0232] v l Let v represent the embedding (item vector) of the l-th item. l ∈R d ;
[0233] · T Represents the transpose of a matrix;
[0234] e l e represents the entity vector trained with knowledge reinforcement. l ∈R d ;
[0235] d is the dimension.
[0236] We will use entity vector e l and item vector v l The `concat` operation is used to merge the features of both the item and the associated entity, ensuring they share the characteristics of both. The resulting feature matrix is then mapped into the latent vector space, and the next layer's feature matrix is output. First, a training weight `w` is constructed. l ∈R d and fitted vector μ l ∈Rd Training weights w l The purpose is to compress the dimension of the feature matrix to facilitate the next step:
[0237]
[0238]
[0239] Where v l+1 This indicates that the (l+1)th item is embedded;
[0240] · T Represents the transpose of a matrix;
[0241] w l VV This represents the weights of the two item entities during the l-th training iteration;
[0242] w l VE This represents the weights corresponding to the item entity and the user entity during the l-th training iteration;
[0243] Indicates deviation;
[0244] w l EE This represents the weights corresponding to the two user entities during the l-th training iteration;
[0245] Finally, the v obtained from the last training iteration l+1 The output [v] represents the item that should be recommended to the user. It's worth noting that the feature union module aims to interactively learn the features of the item and its associated entity as much as possible.
[0246] 4. Loss Function Settings
[0247] We will construct loss functions for the recommendation module and the knowledge graph modeling module respectively. The loss function for the recommendation module will be set using the hyperbolic loss function L. H The loss function setting for the knowledge graph modeling module is based on the loss of KGE, which we use as the loss of KG.
[0248] The loss function formula mentioned in this article is shown below:
[0249]
[0250] The first item L H This represents the loss function of the recommendation module; the second term L KGE This represents the loss in the KGE module.
[0251] Where λ1 and λ2 are balancing parameters used to adjust the range of each loss function;
[0252] u and v represent the user set and the project set, respectively;
[0253] The σ(·) function represents the nonlinear activation function Sigmoid;
[0254] (h,r,t) represents the initial triplet;
[0255] (h′,r′,t′) represents the triplet after training;
[0256] G represents a knowledge graph;
[0257] ε is the regularization term.
[0258] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims
1. A knowledge-enhanced multi-task recommendation method in hyperbolic space, characterized in that, Includes the following steps: S1, mapping entities to hyperbolic space to fully capture their non-Euclidean features, yielding user embeddings and item embeddings; step S1 includes the following steps: S1-1, obtaining the most primitive representation of users and items in Euclidean space; S1-2, using Lorentz notation to represent the embeddings of users and items: First, we fix the origin. , Let the origin be any point in hyperbolic space; As a reference point, at the origin tangent space Gaussian distribution sampling was performed to obtain the initial embeddings of users and items in the tangent space: , in This represents the user's initial embedding in the tangent space; This indicates the initial embedding of the item in tangent space; express It follows a normal distribution with an expected value of 0 and a variance of . ; Indicates standard deviation; Represents a collection of items; Then, the obtained initial feature matrix is subjected to adaptive cross-multiplication: ; The embedding matrix is obtained. , Indicates a connection operation; Then embedding matrix The hyperbolic space is mapped using an exponential mapping operation, as follows: , in Hyperparameters are hyperparameters. , Indicates curvature; Thus, the user and items in hyperbolic space were obtained. High-order feature embedding in: , , in Indicates the user is in hyperbolic space High-order feature embedding in; Indicates the object in hyperbolic space High-order feature embedding in; The embedding matrix represents the user's embedding matrix; An embedding matrix representing the items; Finally, a logarithmic mapping is performed on the feature items corresponding to all users in the hyperbolic space to obtain the user-item feature embedding: , , , in, Represents the inverse hyperbolic function; Indicates the inner product; Represents the Lorentz inner product; Let be any point in the tangent space; Represents the negative curvature constant; express Norm; Indicates user feature embedding; Indicates the embedding of item features; Indicated by point Perform logarithmic operations to map the embedding in hyperbolic space to Euclidean space; S2, train the triple information in the knowledge graph to obtain a knowledge perception representation based on object entities; S3, the entity vectors of the embedded items and the knowledge-enhanced training are jointly and alternately trained. The entity vectors of the knowledge-enhanced training include multiple knowledge-aware representations, so that entities can share feature information. The training continues according to the user information obtained for the user's specific preferences, so as to obtain item entities that meet the user's preferences.
2. The multi-task recommendation method with knowledge enhancement in hyperbolic space according to claim 1, characterized in that, Also includes: The hyperbolic loss function is defined as: , in Indicates the degree of relevance between the user and the item; Indicates the user is in hyperbolic space High-order feature embedding in; Represents the items corresponding to the user In hyperbolic space High-order feature embedding in; Indicates items that do not correspond to the user. In hyperbolic space High-order feature embedding in.
3. The multi-task recommendation method with knowledge enhancement in hyperbolic space according to claim 1, characterized in that, S2 includes the following steps: S2-1, KGE is used to train the knowledge graph, and entity embeddings are obtained after training; the knowledge graph is composed of several triplet information. S2-2, using the method of embedding a perceptual graph attention network to generate tail entities with different weights, thereby representing the implicit meaning of the tail entities and obtaining the different meanings of different head entities and relational entities; the attention network has a four-layer neural network structure, with the first three layers being ReLU functions.
4. The multi-task recommendation method with knowledge enhancement in hyperbolic space according to claim 3, characterized in that, If the KGE is TransH, then S2-1 includes the following steps: S2-1-1, for each triple, project the embeddings of the head entity and the tail entity onto the hyperparameter plane, and set the projection to... and : , , in Represents the embedded projection of the head entity; Indicates the initial header entity; express Projection onto the hyperparameter plane; Represents the hyperparameter plane normal vector; Represents the embedded projection of the tail entity; Represents the original tail entity; S2-1-2, if it is an incomplete triplet, then complete it using the complete triplet with the same projection; S2-1-3, after training, the entity embedding is obtained, and preprocessing is completed.
5. The multi-task recommendation method with knowledge enhancement in hyperbolic space according to claim 4, characterized in that, It also includes: evaluating the reasonableness of the completed triples using a scoring function, wherein the scoring function is: , in Represents a relation vector; This represents the square of the L2 norm.
6. The multi-task recommendation method with knowledge enhancement in hyperbolic space according to claim 4, characterized in that, It also includes the loss function: , in This indicates taking the maximum value; Represents a relation vector; This represents the square of the L2 norm.
7. A multi-task recommendation method with knowledge enhancement in hyperbolic space according to claim 3, characterized in that, S2-2 includes the following steps: First, construct knowledge graph triples. Attention of the mid-tail entity , represented as: , in A perceptual attentional latent attribute weight representing head entities and relationships; , Then, scaling is performed: the entity embedding trained by KGE is passed through three layers of ReLU activation functions, and the result is then subjected to Sigmoid. , A perceptual attentional latent attribute weight representing head entities and relationships; Then, a joint weighted operation is performed on the obtained relational entities and head entities to extract the perceptual feature terms, resulting in the tail entity: , Indicates the embedding of the tail entity; Represents a relational entity; Indicates the embedding of the head entity; After perceptual attention embedding, the tail entity of weighted attention is represented as an object entity. and adopt A set of knowledge-aware representations based on object entities, using express: , in Indicates the first A knowledge-aware representation based on object entities.
8. The multi-task recommendation method with knowledge enhancement in hyperbolic space according to claim 1, characterized in that, S3 includes the following steps: Entity vectors trained with knowledge enhancement and item embedding The feature matrix is obtained by merging through the concat operation, then the obtained feature matrix is mapped to the latent vector space, and the feature matrix of the next layer is output. First, construct a training weight. and fitted vector Among them, training weights To compress the dimension of the feature matrix, thereby obtaining Item embeddings and entity vectors from the second training iteration: , , in Indicates the first An item is embedded; Represents the transpose of a matrix; Indicates the first The weights corresponding to the two item entities during the training cycle; Indicates the first The weights corresponding to the item entity and the user entity during the second training session; Indicates deviation; Indicates the first The weights corresponding to the two user entities during the training cycle; Finally, the result of the last training iteration As output , This indicates the items that should be recommended to the user; Latent feature matrix Build it in the following way: , express Layer feature joint matrix, ; Indicates the first An item is embedded. ; Represents the transpose of a matrix; It is a dimension.
9. A multi-task recommendation method with knowledge enhancement in hyperbolic space according to claim 1, characterized in that, It also includes the loss function: , , This represents the loss function of the recommendation module; This represents the loss in the KGE module; in , These are balancing parameters used to adjust the range of each loss function; Represents the initial triplet; This indicates the triplet after training; Representing a knowledge graph; It is a regularization term.
Citation Information
Patent Citations
Personalized recommendation method based on collaborative knowledge graph
CN112149004A
User recommendation method based on end-to-end hyperbolic space
CN115186197A