Knowledge enhancement recommendation method based on large language model and multi-view comparative learning
By constructing a user-item bipartite graph and combining it with a large language model to generate semantic embeddings, and constructing multiple views for comparative learning, this approach addresses the shortcomings of existing recommendation methods in scenarios with sparse data and long-tail items, achieving more efficient recommendation results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-05-19
AI Technical Summary
Existing recommendation methods struggle to fully uncover users' potential interests when faced with data sparsity, cold start, and long-tail items, and lack the utilization of unstructured semantic information, resulting in poor recommendation performance, especially in long-tail item recommendations and cold start scenarios.
By constructing a user-item bipartite graph, generating semantic embeddings using a large language model, constructing multiple views and performing comparative learning, introducing hard negative sample mining and adaptive temperature adjustment, optimizing the alignment and uniformity of the embedding space, and employing a dynamic weighting strategy to optimize the loss function, recommendation performance is improved.
It significantly enhances the representation capabilities of recommendation systems in scenarios with sparse data and long-tail items, improving the accuracy and stability of recommendations. In particular, it can effectively mine complex semantic information in scenarios with long-tail items and cold start, thereby improving the robustness and discriminativeness of recommendation systems.
Smart Images

Figure CN122066482A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to data mining and graph topology analysis techniques, and more particularly to a knowledge-enhanced recommendation method based on large language models and multi-view comparative learning. Background Technology
[0002] Currently, traditional recommendation methods mainly include collaborative filtering based on user or item similarity and latent factor models based on matrix factorization. These methods construct preference representations through historical interactions between users and items, alleviating the information overload problem to some extent. However, these methods heavily rely on the density of the interaction matrix, and their recommendation performance significantly declines when facing data sparsity, cold start, and long-tail item problems, making it difficult to fully explore users' potential interests, especially for new users or new items, where traditional methods struggle to provide accurate recommendations. With the development of deep learning, many recommendation models based on nonlinear networks have enhanced feature interaction modeling capabilities. Graph Neural Networks (GNNs) have been introduced into the recommendation field, further modeling user-item interactions as bipartite graphs, capturing high-order collaborative relationships through multi-layer neighbor node aggregation. These methods outperform traditional recommendation algorithms, but still mainly rely on structured interaction information and underutilize unstructured semantic information such as long text reviews and product descriptions, resulting in the recommendation system's inability to fully understand the complex semantic relationships between users and items. During multi-layer propagation, graph neural networks are also prone to over-smoothing problems, causing node representations to lose discriminativeness and making them sensitive to noise, affecting the system's stability and robustness. To mitigate data sparsity and noise interference, multi-view contrastive learning methods have been introduced into recommender systems. By constructing graph views from different perspectives (e.g., structurally enhanced views generated through data perturbation) and imposing contrastive constraints between these views, the aim is to enhance the consistency and robustness of representations. However, most existing multi-view methods remain limited to structural enhancement based on the interaction graph itself, failing to effectively combine multi-source information from textual semantics and graph structure. They lack collaborative modeling and explicit alignment between different views, thus failing to fully leverage the complementary advantages of both. Meanwhile, although Large Language Models (LLMs) have been applied in recommender systems in recent years, some studies have attempted to package user behavior sequences and item texts into prompts for input into LLMs to obtain semantic representations, or to use them as text encoders to enhance item representations. While these methods improve semantic modeling capabilities to some extent, they typically treat LLMs as independent "semantic feature extractors" rather than deeply integrating them with graph neural networks and contrastive learning frameworks. More importantly, existing methods generally lack systematic multi-view alignment and constraint mechanisms, and in contrastive learning, they lack designs such as hard negative sample mining, adaptive temperature adjustment, and embedding space alignment-uniformity control. This results in insufficient discriminative representation of the model, and the embedding space is prone to collapse, making it difficult to achieve ideal recommendation results in the combined scenarios of "extremely sparse interactions + long-tail distribution + complex text semantics". Especially in the long-tail item recommendation and cold start problems, existing technologies have failed to fully explore the complex semantic information and the potential associations between long-tail items, thus affecting the actual performance of recommendation systems in these scenarios. Summary of the Invention
[0003] The purpose of this invention is to provide a knowledge-enhanced recommendation method based on large language models and multi-view comparative learning, so as to solve the problems existing in the prior art.
[0004] The knowledge-enhanced recommendation method based on large language model and multi-view comparative learning described in this invention constructs a user-item bipartite graph and semantic embedding based on large language model after preprocessing data, constructs multi-view after learning graph neural network collaborative representation, compares and learns multi-view and optimizes the model, calculates the overall loss and generates and outputs recommendations.
[0005] The knowledge enhancement recommendation method based on large language models and multi-view comparative learning described in this invention has the following advantages: (1) Knowledge-enhanced User-Item Representation Construction Method Based on LLM: This invention constructs prompts for both the user and item sides using a Large Language Model (LLM). User historical interaction sequences and text such as item titles, descriptions, tags, and comments are input into the LLM to generate semantic embeddings. These embeddings are fused with collaborative filtering-based embedding vectors in a unified vector space, thereby constructing a user-item representation that simultaneously contains interaction structure information and external semantic knowledge. This method significantly enhances the representation capabilities of recommendation systems in scenarios with sparse data, long-tail items, and cold starts, enabling them to more effectively handle situations with incomplete information or limited user behavior.
[0006] (2) Recommendation representation optimization mechanism for multi-view collaborative contrastive learning: The original collaborative view, cross-layer view, and masked perturbation view are constructed around the user-item bipartite graph. The representations of nodes propagated at different levels and the perturbed representations are incorporated into the multi-view contrastive learning framework. Loss functions such as InfoNCE are used to explicitly constrain the consistency of the same node in different views, while maintaining the necessary differences between views, thus alleviating the problems of excessive smoothing and sensitivity to noise during graph convolution.
[0007] (3) Combining hard negative sample mining with adaptive temperature contrastive learning enhancement mechanism: In the multi-view contrastive learning framework, this invention introduces hard negative sample mining and adaptive temperature adjustment mechanisms. Hard negative sample mining dynamically selects nodes that are semantically similar to the target node but have not interacted with it as negative samples by calculating the similarity between nodes in the current embedding space, thereby enhancing the discriminative signal in contrastive learning. Adaptive temperature adjustment adaptively adjusts the temperature parameter using the following formula.
[0008] (4) Embedding Space Alignment and Uniformity Joint Regularization Constraint Method: In order to optimize the geometric structure of the embedding space, this invention introduces alignment regularization and uniformity regularization into the loss function. Alignment regularization is used to constrain the distance between the embedding representations of the same node in different views, ensuring the semantic consistency of multi-view representations; uniformity regularization, on the other hand, controls the distance distribution between embedding vectors to prevent the embedding vectors from being overly concentrated in the space, thereby maintaining good inter-class separability.
[0009] (5) Dynamic weighted joint optimization strategy for recommendation ranking loss and multi-view contrast loss: Under a unified training framework, this invention jointly models the BPR recommendation ranking loss, multi-view contrast loss, and alignment / uniformity regularization loss. The system adopts a dynamic weighting strategy, automatically adjusting the weights of each loss term at different training stages. In the early stage of training, the system increases the weights of the contrast loss and regularization term to stabilize and shape the structure of the embedding space; in the later stage of training, the weights of the BPR loss are gradually increased to focus on optimizing recommendation ranking performance. Attached Figure Description
[0010] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0011] like Figure 1 As shown, the knowledge-enhanced recommendation method based on large language model and multi-view comparative learning described in this invention constructs a user-item bipartite graph and semantic embedding based on large language model after preprocessing data, constructs multi-view after learning graph neural network collaborative representation, compares and learns multi-view and optimizes the model, calculates the overall loss and generates and outputs recommendations.
[0012] (1) Preprocessing data and constructing a bipartite graph: [S1] Collection and preprocessing of user-item interaction data and text information The system collects user-item interaction data from business databases (such as servers of e-commerce platforms and content distribution platforms). This interaction data includes, but is not limited to, clicks, browsing, favorites, and purchases. Simultaneously, it collects text information about items from an item information database, including the item's title, description, attribute tags, and user reviews. The collected raw data is then cleaned and filtered. Specifically, records lacking key fields are deleted; for rating data, interactions with ratings greater than or equal to a preset threshold (e.g., 4 points) are considered positive samples; and a k-core filtering algorithm (e.g., k=5) is used to remove users and items with too few interactions to control data sparsity.
[0013] [S2] Construct a user-item bipartite graph Based on the interaction data of the training set, a user-item bipartite graph is constructed. The node set of the user-item bipartite graph consists of the user set. and item collection The structure involves establishing an undirected edge between user u and item i when they interact. An adjacency matrix is generated based on all interactions within the user-item bipartite graph. The normalized adjacency matrix is then obtained for graph neural network computation. Simultaneously, a d-dimensional randomly initialized embedding vector is assigned to each user and item. and .
[0014] (2) Constructing semantic embeddings based on large language models [S1] Constructing user semantic embeddings: for a set of users Every user in The system extracts the user's historical interaction item sequence and collects the titles, descriptions, and representative comments of these items. Based on a pre-defined user-side prompt template, this text information is combined into a structured prompt (e.g., "The user has recently interacted with the following items: [item list]. Please analyze the user's interests and preferences based on this and output a vector representation"). This prompt is then input into a pre-trained large language model to obtain the output semantic vector. This vector is then passed through a fully connected layer for dimensionality reduction and L2 normalization to finally obtain the user's semantic embedding. .
[0015] [S2] Constructing item semantic embeddings: For a set of items Each item in The system collects the item's title, description, category tags, and user reviews. Based on a pre-defined item-side prompt template, it constructs input prompts (e.g., "Item title: [title], description: [description], user review summary: [reviews]. Please summarize the core features of this item and output a vector representation"). Similarly, this prompt is input into a large language model, and the output vector is reduced in dimensionality and normalized to obtain the item's semantic embedding. .
[0016] (3) Learning graph neural network collaborative representation and constructing multiple views [S1] Learning collaborative representations in graph neural networks Based on the constructed user-item bipartite graph and normalized adjacency matrix Using graph neural networks Information propagation at each layer. The propagation rule for each layer is: update the current representation of the target node by aggregating the representations of its neighboring nodes from the previous layer. Users and items... Layer embedding via formula The calculation yielded, where Represents a node The neighborhood group, Representing neighboring nodes The set of its own neighbors is used to weight and fuse the embeddings obtained from each layer through the graph neural network to obtain the final cooperative embedding. ,in These are learnable or preset weight coefficients. and Represented as user and items In the graph convolutional network The embedded representation obtained from the layer, =0 corresponds to the initial embedding layer.
[0017] [S2] Constructing multiple views By constructing at least two views—a cross-layer view and a perturbation view—for subsequent comparative learning, the construction of the cross-layer view specifically involves: initial embedding of nodes... and the final layer of embedding As two different views of this node; constructing the perturbation view specifically involves: the collaborative embedding of the node. Apply a random mask or add Gaussian noise to generate a perturbed embedding. As a new view.
[0018] (4) Comparative learning of multi-view and optimization model [S1] Cross-layer contrast loss and perturbation contrast loss The contrastive learning multi-view and optimization model includes calculating cross-layer contrastive loss and perturbation contrastive loss, and an optimization mechanism, which includes adaptively adjusting temperature parameters, calculating embedding space regularization loss and uniformity regularization loss.
[0019] Calculate cross-layer contrast loss Specifically, it involves the initial embedding of nodes. and the final layer of embedding As positive sample pairs, the embeddings of this node with any other node are used as negative sample pairs. The InfoNCE loss function, calculated based on cosine similarity, is used to bring positive sample pairs closer together and push negative sample pairs further apart. ; in, The initial embedding vector for this node. For this node Layer embedding vectors, The cosine similarity function is used. The similarity score is given to positive sample pairs (initial embeddings and deep embeddings of the same node). For negative sample pairs (the initial embedding of the current node and other nodes) The similarity score of the deep embedding. This refers to the temperature parameter in the InfoNCE loss function.
[0020] Calculate the disturbance contrast loss Specifically, it involves the original collaborative embedding of nodes. and its perturbation and embedding As positive sample pairs, the perturbed embeddings of this node and any other node are used as negative sample pairs, and the InfoNCE loss function is also used for calculation. ; in, This is the collaborative embedding vector for that node. The embedding vector generated by the node itself after data perturbation, and the denominator contains... Indicates a negative sample node. That is, negative sample nodes The perturbation embedding vector.
[0021] [S2] Optimization Mechanism When calculating cross-layer contrastive loss and perturbation contrastive loss, instead of randomly selecting negative samples, the node with the highest semantic similarity to the target node but which has not interacted with the target node is selected from the candidate nodes as the negative sample to enhance the learning difficulty and the model's discriminative power.
[0022] The adaptive adjustment of the temperature parameter specifically refers to the temperature parameter in the InfoNCE loss function. The values are dynamically adjusted during training. Larger values are used in the early stages to smooth the probability distribution, and smaller values are used in the later stages to sharpen the decision boundary. Calculate the embedding space regularization loss Specifically, this involves calculating the semantic embedding of the same node. With collaborative embedding The mean square error between them is used to constrain their alignment in the vector space. ; in, This is the semantic embedding vector of the node. This is the collaborative embedding vector for this node.
[0023] Calculate the uniformity regularization loss Specifically, this involves calculating the log-expected similarity between all pairwise embeddings of all nodes, encouraging a uniform distribution of embedding vectors in the overall vector space, and avoiding collapse. ; in, and For the set of nodes The embedding vectors of any two different nodes obtained by independent and identically distributed sampling. This represents the expectation of the calculated value for all such nodes.
[0024] (5) Calculate the overall loss and generate recommendations and output them. [S1] Total Loss Design Calculating the total loss includes calculating the BPR loss and the total loss; The recommendation part uses a ranking-based BPR loss, which is defined as: ; in, Indicates user u Positive sample items With negative sample items j The triplet formed, and These are the predicted preference scores, This is the Sigmoid function.
[0025] The overall loss function is defined as: ; in This is the sum of the multi-view contrast losses. and It varies with time (number of training cycles) t The dynamically changing weight coefficients are used to adjust the balance between the main recommendation task and the auxiliary regularization task at different stages of training. and To balance the preset hyperparameters for different contrastive learning objectives, a higher setting is used in the early stages of training. and Prioritize optimizing the representation space structure; gradually reduce the size during later training stages. and The weight, while increasing The relative importance; Simultaneously, the gradient descent algorithm is used to minimize the total loss. Update all parameters in the model.
[0026] [S2] Generate recommendations and output them. Generating and outputting recommendations specifically involves: after the model training is complete, for users who need recommendations... and candidate items Each of these methods yields its final representation, which is formed by concatenating collaborative embedding and semantic embedding. ; in, and For users respectively and items The collaborative embedding vector.
[0027] Then calculate the user With items The matching score between them is calculated using cosine similarity: For target users Calculate its matching score with all candidate items, sort them from highest to lowest score, and output the results.
[0028] This invention addresses the key problems exposed by existing recommendation methods in scenarios characterized by "extremely sparse interactions, long-tail distribution, and complex text semantics," proposing the following core technological innovations. First, in scenarios with sparse data and long-tail items, traditional methods struggle to construct high-quality user and item representations relying solely on limited interaction data. This invention's knowledge-enhanced recommendation method introduces a large language model to mine rich unstructured textual information, such as product descriptions and user reviews, thereby enhancing representational capabilities. This is particularly effective in long-tail items and cold-start scenarios, compensating for insufficient interaction data. Second, existing multi-view or multimodal methods lack consistency modeling between different views. This invention's knowledge-enhanced recommendation method establishes a unified multi-view contrastive learning framework, explicitly aligning the representations of the same entity across different views while maintaining discriminativeness, avoiding information conflicts, and improving information fusion effectiveness. Third, traditional contrastive learning often employs random negative samples and fixed temperature parameters, leading to insufficient learning of decision boundaries. This invention's knowledge-enhanced recommendation method enhances contrast signals through a difficult negative sample mining mechanism and adaptive temperature adjustment, improving the discriminativeness and robustness of the embedding, especially in long-tail items and cold-start user scenarios. Fourth, existing methods lack effective constraints on the geometric structure of the embedding space, which can easily lead to representation collapse or inseparable clusters. The knowledge-enhanced recommendation method of this invention introduces a joint regularization mechanism of alignment and uniformity to ensure that the embedding space after multi-view fusion is both aligned with each other and uniformly distributed in the overall space, avoiding the problem of representation imbalance. Finally, existing training objective optimization mechanisms lack a balancing mechanism. The knowledge-enhanced recommendation method of this invention uses a dynamic weighting strategy to reasonably adjust the weights of recommendation ranking loss, multi-view contrast loss, and regularization loss at different training stages, ensuring that recommendation performance is maximized while stabilizing the embedding space structure, thereby systematically overcoming many limitations of existing technologies.
[0029] The knowledge-enhanced recommendation method of this invention combines the strong semantic modeling capability of large language models for unstructured text with the high-order collaborative relationship modeling capability of graph neural networks, and introduces multi-view contrastive learning and hard negative sample mining mechanisms to simultaneously improve recommendation performance and representation quality within a unified framework. The specific innovations are as follows: 1. A Knowledge-Enhanced User-Item Representation Construction Method Based on LLM: This invention constructs user-side and item-side prompts using a Large Language Model (LLM). User historical interaction sequences and text such as item titles, descriptions, tags, and reviews are input into the LLM to generate semantic embeddings. These embeddings are fused with collaborative filtering-based embedding vectors in a unified vector space, thereby constructing a user-item representation that simultaneously incorporates interaction structure information and external semantic knowledge. This method significantly enhances the representation capabilities of recommendation systems in scenarios with sparse data, long-tail items, and cold start, enabling them to more effectively handle situations with incomplete information or limited user behavior.
[0030] 2. Recommendation Representation Optimization Mechanism for Multi-View Collaborative Comparative Learning: Based on the user-item bipartite graph, original collaborative views, cross-layer views, and masked perturbation views are constructed. The representations of nodes propagated at different levels and their perturbed representations are incorporated into the multi-view comparative learning framework. Loss functions such as InfoNCE are used to explicitly constrain the consistency of the same node across different views, while maintaining necessary differences between views, thus mitigating the problems of excessive smoothing and sensitivity to noise during graph convolution.
[0031] 3. A contrastive learning enhancement mechanism combining hard negative sample mining and adaptive temperature: Within the multi-view contrastive learning framework, this invention introduces hard negative sample mining and adaptive temperature adjustment mechanisms. Hard negative sample mining dynamically selects nodes semantically similar to the target node but without interaction as negative samples by calculating the similarity between nodes in the current embedding space, thereby enhancing the discriminative signal in contrastive learning. Adaptive temperature adjustment adaptively adjusts the temperature parameter using the following formula.
[0032] 4. Embedding Space Alignment and Uniformity Joint Regularization Constraint Method: To optimize the geometric structure of the embedding space, this invention introduces alignment regularization and uniformity regularization into the loss function. Alignment regularization is used to constrain the distance between the embedded representations of the same node in different views, ensuring semantic consistency of multi-view representations; uniformity regularization, by controlling the distance distribution between embedding vectors, prevents embedding vectors from being overly concentrated in the space, thereby maintaining good inter-class separability.
[0033] 5. Dynamic Weighted Joint Optimization Strategy for Recommendation Ranking Loss and Multi-View Contrast Loss: Under a unified training framework, this invention jointly models the BPR recommendation ranking loss, multi-view contrast loss, and alignment / uniformity regularization loss. The system employs a dynamic weighting strategy, automatically adjusting the weights of each loss term at different training stages. In the early stages of training, the system increases the weights of the contrast loss and regularization term to stabilize and shape the structure of the embedding space; in the later stages of training, the weight of the BPR loss is gradually increased to focus on optimizing recommendation ranking performance.
[0034] For those skilled in the art, various corresponding changes and modifications can be made based on the technical solutions and concepts described above, and all such changes and modifications should fall within the protection scope of the claims of this invention.
Claims
1. A knowledge-enhanced recommendation method based on large language models and multi-view comparative learning, characterized in that, After preprocessing the data, a user-item bipartite graph and semantic embedding based on a large language model are constructed. After learning the collaborative representation of the graph neural network, a multi-view is constructed. The multi-view is compared and the model is optimized. After calculating the overall loss, a recommendation is generated and output.
2. The knowledge enhancement recommendation method based on large language model and multi-view comparative learning according to claim 1, characterized in that, The preprocessed data consists of user-item interaction data collected from the business database, text information of items collected from the item information database, and the collected raw data cleaned and filtered. The user-item interaction data includes, but is not limited to, clicks, browsing, favorites, and purchases. The text information of the item includes the item's title, description, attribute tags, and user reviews.
3. The knowledge enhancement recommendation method based on large language model and multi-view comparative learning according to claim 2, characterized in that, The cleaning and filtering of the collected raw data specifically involves deleting records with missing key fields. For rating data, interactions with rating values greater than or equal to a preset threshold are considered positive samples. The k-core filtering algorithm is used to remove users and items with too few interactions.
4. The knowledge enhancement recommendation method based on large language model and multi-view comparative learning according to claim 1, characterized in that, The node set of the user-item bipartite graph consists of the user set. and item collection The adjacency matrix is generated based on all interaction relationships in the user-item bipartite graph. The normalized adjacency matrix is then obtained for graph neural network computation. At the same time, a d-dimensional randomly initialized embedding vector is assigned to each user and item. and .
5. The knowledge enhancement recommendation method based on large language model and multi-view comparative learning according to claim 1, characterized in that, Constructing the semantic embedding based on the large language model includes constructing user semantic embeddings and constructing item semantic embeddings. Specifically, constructing user semantic embeddings involves: for a set of users... Every user in The system extracts the historical interaction item sequence and collects the titles, descriptions, and representative comments of these items. Based on a pre-set user-side prompt word template, the above text information is combined into structured prompt words. These prompt words are then input into a pre-trained large language model to obtain the output semantic vector. This vector is then passed through a fully connected layer for dimensionality reduction and L2 normalization to finally obtain the user's semantic embedding. ; Constructing semantic embeddings for items specifically involves: for a set of items Each item in The system collects the title, description, category tags, and user reviews of the item. Based on a pre-defined item-side prompt template, it constructs input prompts, inputs these prompts into a large language model, obtains the output semantic vector, and then performs dimensionality reduction and normalization on the output vector to obtain the semantic embedding of the item. .
6. The knowledge enhancement recommendation method based on large language model and multi-view comparative learning according to claim 5, characterized in that, The learning graph neural network collaborative representation specifically refers to: based on the constructed user-item bipartite graph and the normalized adjacency matrix. Using graph neural networks Information propagation occurs at each layer, with the following propagation rule: the current representation of the target node is updated by aggregating the representations of its neighboring nodes from the previous layer. This applies to users and items at each layer. Layer embedding via formula The calculation yielded, where Represents a node The neighborhood group, Representing neighboring nodes The set of its own neighbors is used to weight and fuse the embeddings obtained from each layer through the graph neural network to obtain the final cooperative embedding. ,in These are learnable or preset weight coefficients. and Represented as user and items In the graph convolutional network The embedded representation obtained from the layer, =0 corresponds to the initial embedding layer.
7. The knowledge enhancement recommendation method based on large language model and multi-view comparative learning according to claim 6, characterized in that, Constructing the aforementioned multi-view specifically involves: constructing at least two views—a cross-layer view and a perturbation view—for subsequent comparative learning. Constructing the cross-layer view specifically involves: initial embedding of nodes... and the final layer of embedding As two different views of this node; constructing the perturbation view specifically involves: the collaborative embedding of the node. Apply a random mask or add Gaussian noise to generate a perturbed embedding. As a new view.
8. The knowledge enhancement recommendation method based on large language model and multi-view comparative learning according to claim 7, characterized in that, The contrastive learning multi-view and model optimization includes calculating cross-layer contrastive loss and perturbation contrastive loss, and optimization mechanisms, including adaptive adjustment of temperature parameters, calculation of embedding space regularization loss and uniformity regularization loss; Calculate cross-layer contrast loss Specifically, it involves the initial embedding of nodes. and the final layer of embedding As positive sample pairs, the embeddings of this node with any other node are used as negative sample pairs. The InfoNCE loss function, calculated based on cosine similarity, is used to bring positive sample pairs closer together and push negative sample pairs further apart. ; in, The initial embedding vector for this node. For this node Layer embedding vectors, The cosine similarity function is used. The similarity score is given to positive sample pairs (initial embeddings and deep embeddings of the same node). For negative sample pairs (the initial embedding of the current node and other nodes) The similarity score of the deep embedding. The temperature parameter in the InfoNCE loss function; Calculate the disturbance contrast loss Specifically, it involves the original collaborative embedding of nodes. and its perturbation and embedding As positive sample pairs, the perturbed embeddings of this node and any other node are used as negative sample pairs, and the InfoNCE loss function is also used for calculation. ; in, This is the collaborative embedding vector for that node. The embedding vector generated by the node itself after data perturbation, and the denominator contains... Indicates a negative sample node. That is, negative sample nodes The perturbation embedding vector; When calculating cross-layer contrastive loss and perturbation contrastive loss, the node with the highest semantic similarity to the target node but which has not interacted with the candidate node is selected as the negative sample. The adaptive adjustment of the temperature parameter specifically refers to the temperature parameter in the InfoNCE loss function. The values are dynamically adjusted during training. Larger values are used in the early stages to smooth the probability distribution, and smaller values are used in the later stages to sharpen the decision boundary. Calculate the embedding space regularization loss Specifically, this involves calculating the semantic embedding of the same node. With collaborative embedding The mean square error between them is used to constrain their alignment in the vector space. ; in, This is the semantic embedding vector of the node. This is the collaborative embedding vector for this node; Calculate the uniformity regularization loss Specifically, this involves calculating the log-expected similarity between all pairwise embeddings of all nodes, encouraging a uniform distribution of embedding vectors in the overall vector space, and avoiding collapse. ; in, and For the set of nodes The embedding vectors of any two different nodes obtained by independent and identically distributed sampling. This represents the expectation of the calculated value for all such nodes.
9. The knowledge enhancement recommendation method based on large language model and multi-view comparative learning according to claim 8, characterized in that, Calculating the total loss includes calculating the BPR loss and the total loss; The recommendation part uses a ranking-based BPR loss, which is defined as: ; in, Indicates user u Positive sample items With negative sample items j The triplet formed, and These are the predicted preference scores, For the Sigmoid function; The overall loss function is defined as: ; in This is the sum of the multi-view contrast losses. and It varies with time (number of training cycles) t The dynamically changing weight coefficients are used to adjust the balance between the main recommendation task and the auxiliary regularization task at different stages of training. and To balance the preset hyperparameters for different contrastive learning objectives, a higher setting is used in the early stages of training. and Prioritize optimizing the representation space structure; gradually reduce the size during later training stages. and The weight, while increasing The relative importance; Simultaneously, the gradient descent algorithm is used to minimize the total loss. Update all parameters in the model.
10. The knowledge enhancement recommendation method based on large language model and multi-view comparative learning according to claim 9, characterized in that, Generating and outputting recommendations specifically involves: after the model training is complete, for users who need recommendations... and candidate items Each of these methods yields its final representation, which is formed by concatenating collaborative embedding and semantic embedding. ; in, and For users respectively and items ; Then calculate the user With items The matching score between them is calculated using cosine similarity: For target users Calculate its matching score with all candidate items, sort them from highest to lowest score, and output the results.