Image enhancement method based on LLM low-cost interaction

By screening items and users in the recommendation system and establishing new prediction connections using LLM, the problems of high interaction cost and poor scalability in the prior art are solved, and efficient graph enhancement and recommendation accuracy are achieved.

CN120067437AActive Publication Date: 2025-05-30CCCC FHDI ENG
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510001682.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-05-30
Estimated Expiration
2045-01-02

AI Technical Summary

Technical Problem

When using LLM to enhance user item interaction diagrams of recommendation systems, the prior art has high computational interaction cost, poor scalability and high noise in introducing the system, making it difficult to efficiently apply in large-scale systems.

Method used

By filtering items and users, selecting representative items and users with little interaction data, using LLM to analyze these filtered items and users to establish new predictive connections, reducing calculation costs and improving the integrity and richness of the graph.

Benefits of technology

It effectively reduces the computing cost of LLM interaction, improves the scalability and real-timeness of the system, and improves the accuracy of understanding and recommendations of users' preferences, avoiding the introduction of low-quality system noise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067437A_ABST
    Figure CN120067437A_ABST
Patent Text Reader

Abstract

The invention discloses a graph enhancement method based on LLM low-cost interaction, and belongs to the technical field of recommendation systems and deep learning, and the method comprises the following steps: S1, obtaining basic data of users and articles, and constructing a user-article interaction matrix, a user-article scoring matrix and a multi-label article type matrix; s2, calculating a type preference vector of the user; s3, calculating a cosine similarity and a comprehensive score of the article; s4, constructing a directed weighted hypergraph, calculating importance scores of nodes, and generating prediction connection by using an LLM model; and S5-S6, calculating the original loss and the new loss of the recommendation system, and updating the user-article bipartite graph. According to the method, the problems of high calculation interaction cost, poor expansibility, large introduced system noise and the like when the LLM is used for enhancing the user article interaction graph of the recommendation system in the prior art are solved, the integrity and richness of the user article interaction bipartite graph are effectively improved through low-cost LLM interaction, the expandability and the real-time performance of the system are ensured, and the user article interaction method is suitable for being popularized and applied. And meanwhile, the recommendation accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of deep learning, and particularly to a graph enhancement method based on low-cost interaction of LLM. Background Art

[0002] With the rapid development of e-commerce, streaming services, and social media platforms, recommendation systems have become a key component for providing personalized content and enhancing the user experience. Traditional recommendation algorithms are mainly based on collaborative filtering, content filtering, or a combination of both. However, these methods have limitations in dealing with complex user-item interaction relationships and capturing high-order connection patterns.

[0003] Graph convolutional neural network, as a deep learning model capable of processing graph-structured data, has been widely applied in recommendation systems in recent years. By modeling the user-item interaction graph, the graph convolutional neural network can capture high-order associations and latent features between nodes, thereby improving the accuracy of recommendations. Chinese Patent Publication No. CN113961820A, with a publication date of January 21, 2022, titled "A Social Recommendation System Based on Lightweight Graph Convolutional Network" discloses a recommendation system, including an information acquisition module, an information propagation module, and an information recommendation module; this patent uses a graph convolutional network to propagate the representation of users on two graphs respectively, and the representation of items on the user-item interaction graph, and utilizes user social data to enhance the representation of users and items. The fusion model ensures that the two representations of users can be fully utilized, ensuring that the information learned by users in the two graphs will not lead to a decline in the representation effect of users and items due to conflicts. However, the performance of the graph convolutional neural network highly depends on the integrity and richness of the graph structure. For users with sparse interaction data, its recommendation effect may be limited. And large language models have powerful natural language understanding and generation capabilities, and can learn complex semantic relationships from a large amount of text data. Therefore, introducing LLM into the recommendation system can utilize its in-depth understanding of user preferences and item features to complement the deficiencies of traditional models. However, the direct interaction between traditional methods and LLM often performs calculations for each user and item to ensure accuracy, requiring processing of a large amount of text data, resulting in high computational costs and being difficult to be efficiently applied in large-scale systems. In the prior art, there is a lack of an effective method to enhance the integrity and richness of the graph structure by using LLM to ensure high performance of the graph convolutional neural network, while controlling the cost of interacting with LLM to ensure the scalability and real-time performance of the system, and at the same time improving the understanding of user preferences and the accuracy of recommendations. Summary of the Invention

[0004] The present invention overcomes the problems of high computational interaction cost, poor scalability, and large system noise introduction in the prior art when using an LLM to enhance the user-item interaction graph, and provides a graph enhancement method based on low-cost interaction of the LLM. Before using the LLM to interact with user-item data, items and users are screened. Representative items and users with less interaction data are selected, and the LLM is used to analyze these selected items and users to establish new prediction connections, effectively improving the integrity and richness of the user-item interaction graph at a computational cost far lower than the conventional usage of the LLM. Furthermore, high-quality prediction connections are further screened to reduce the introduced system noise, ensuring the scalability and real-time performance of the system in a low-cost LLM interaction manner, while enhancing the system's understanding of user preferences and the accuracy of recommendations.

[0005] To achieve the above object, the present invention adopts the following scheme: A graph enhancement method based on low-cost interaction of the LLM, comprising the following steps: S1: Obtain the basic data of users and items in the target database, and construct a user-item interaction matrix, a user-item rating matrix, and a multi-label item type matrix according to the basic data; S2: Calculate the type preference vector of the user for the item according to the user-item rating matrix and the multi-label item type matrix; S3: Calculate the cosine similarity between the type vector of the items evaluated by the user and the type preference vector of the user. Use the number of rating times of each item in the database as the degree of understanding of the LLM model for it. Calculate the comprehensive score of the item according to the cosine similarity and the degree of understanding, and select several items from high to low according to the comprehensive score to form an evaluation history set; S4: Construct a directed weighted hypergraph with users as nodes and items as hyperedges. Use the PageRank algorithm to calculate the importance score of each node. Select several nodes in ascending order of importance score, and use the LLM model to screen out the items that the user may like or dislike from the item candidate set according to the descriptive prompts of the node user. Construct new prediction connections between the nodes and the screened items. The descriptive prompts include task instructions, user attributes, evaluation history set, and item candidate set; S5: Construct a user-item bipartite graph according to the user-item interaction matrix, and construct a graph neural network model according to the user-item bipartite graph to calculate the original loss of the recommendation system; S6: Add each new prediction connection to the user-item bipartite graph respectively and calculate the new loss of the recommendation system respectively. If the new loss after adding a new prediction connection is less than the original loss, retain this prediction connection, otherwise delete it.

[0006] Preferably, the basic data includes user basic information, item basic information, and user rating data for items. The user basic information includes the user's age, gender, occupation, and place of origin. The item basic information includes the item's ID, type, name, and release time.

[0007] Preferably, the elements in the user-item interaction matrix indicate whether a user has interacted with an item. If a user has interacted with an item, the corresponding element value is 1; otherwise, the corresponding element value is 0. The elements in the user-item rating matrix are the rating values given by the user for each item, and if there is no rating, it is 0. The elements in the multi-label item type matrix indicate the type labels to which an item belongs. If an item belongs to a type label, the corresponding element value is 1; otherwise, the corresponding element value is 0.

[0008] Preferably, the method of calculating the type preference vector uses the rating deviation method, including the following steps: Calculate the user rating using the following formula: Where, is the average rating of user , is the number of items evaluated by user , is the rating given by user for item . Calculate the rating deviation of the user for each item using the following formula: Where, is the rating deviation of user for item . Use the rating deviation to weight the type vector of each item that the user has interacted with using the following formula: Where, where is the type preference vector of user , is the type vector corresponding to item in the multi-label item type matrix; Normalize the type preference vector: Where, is the type preference vector after normalization.

[0009] Preferably, the weighted hypergraph constructed in step S4 , where the node set , is the user set, and the hyperedge set , is the item set, represents the directed weight from node to hyperedge , represents a directed weight from hyperedge to node , and the weight value is equal to the score given by the user represented by node to the item represented by hyperedge . The hyperedge connects all users who have scored the item represented by this hyperedge.

[0010] Preferably, the cosine similarity is calculated using the following formula: where is the absolute value of the cosine similarity between the type preference vector of user and the type vector of item , is the type preference vector after normalization, is the type vector after normalization.

[0011] Preferably, calculating the comprehensive score of an item includes the following steps: Normalize the cosine similarity: where is the normalized cosine similarity, and are the upper and lower limit values of the absolute value of the cosine similarity respectively; Normalize the degree of understanding of the item by the LLM model: where is the degree of understanding of item by the LLM model, is the degree of understanding after normalization, and are the maximum and minimum values of the degree of understanding of each item by the LLM model respectively; Calculate the comprehensive score: where is the item obtained by user The comprehensive score, with the weight coefficient ranges from 0 to 1.

[0012] Preferably, calculating the importance score includes the following steps: Calculate the transition probability between nodes in the directed weighted hypergraph: where is the transition probability from node through hyperedge to node , is the set of neighbor hyperedges of node , is the set of neighbor nodes of hyperedge , is the directed weight from node to its neighbor hyperedge , is the directed weight from hyperedge to its neighbor node , is the sum of the directed weights from node to all its neighbor hyperedges, is the sum of the directed weights from hyperedge to all its neighbor nodes, is the transition probability from node through all the hyperedge sets and connecting nodes to node ; Obtain the transition matrix by calculating the transition probabilities between all nodes. The element in the transition matrix represents the transition probability from node to node , is the number of nodes; Use the PageRank algorithm to iteratively calculate the importance score: where is the damping factor, and the initial importance score of the node . Iterate until , is the convergence threshold.

[0013] Preferably, construct the user-item bipartite graph , where the node set , is the set of user nodes, is the set of item nodes, and the edge set where , , is the user-item interaction matrix; The constructed graph neural network model adopts the following propagation rule formula: where is the activation function, and respectively represent the normalized adjacency matrices from users to items and from items to users, is the node representation matrix of the (k - 1)-th layer, represents the learnable weight matrix of the k-th layer; The feature representations of users and items output by the graph neural network model are: where is the feature representation of the user, is the feature representation of the item, is the number of propagation layers, is the importance parameter of the graph convolution operation in the -th layer.

[0014] Preferably, the original loss and the new loss are calculated as follows: For the original bipartite graph without new predicted connections , calculate the original loss : where is the predicted output of the original model, is the true label, is the BPR loss function; For the new bipartite graph with new predicted connections , calculate the new loss : where is the predicted output of the new model.

[0015] The present invention has at least the following beneficial effects: (1) By introducing LLM into the recommendation system, its deep understanding of user preferences and item features can be utilized to supplement the deficiency of traditional recommendation models in not fully recognizing user preferences, thereby improving the accuracy of recommendations; (2) By selecting representative items to form an evaluation history set and an item candidate set, and combining necessary information such as user attributes into descriptive prompts, the number of Tokens for interacting with LLM is reduced. At the same time, it is ensured that LLM can fully understand user preferences. Only users with less connected interaction data are selected to interact with LLM, reducing the number of interactions with LLM, lowering the cost requirements of computational overhead, and improving the scalability of the system; (3) By verifying the loss rate of newly connected connections, only connections with positive benefits to the performance of the recommendation system are retained to ensure the stability of system performance and avoid introducing low-quality system noise. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 FIG. is a schematic diagram of a graph enhancement method based on low-cost interaction of LLM provided by the present invention; Figure 2 FIG. is a flowchart of steps of a graph enhancement method based on low-cost interaction of LLM provided by the present invention; Figure 3 FIG. is an example of a user-item bipartite graph of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0017] The following further detailed description of the present invention is provided in conjunction with the accompanying drawings, so that those skilled in the art can implement it with reference to the text of the specification.

[0018] As Figures 1 - 3 shown, the graph enhancement method based on low-cost interaction of LLM provided by the present invention includes the following steps: S1: Obtain the basic data of users and items in the target database, and construct a user-item interaction matrix, a user-item rating matrix, and a multi-label item type matrix based on the basic data; the target database is the data source and service foundation of the recommendation system, which contains all data of users and items. The item content can include various types of items in various fields such as movies, music, novels, short videos, goods, etc. As an example, the target database is a movie database, which is a structured relational database, and the items in it are movies; the element content of the user-item interaction matrix is whether there is an interaction relationship between each user and each movie. The interaction relationship can optionally include: various movie-related interaction behaviors such as the user searching for or opening and browsing this movie, the duration of the user watching this movie, whether the user evaluates the movie or communicates with other users about this movie, etc.; the user-item rating matrix records the positive reviews, negative reviews, and specific evaluation scores of users for all movies; the database classifies and stores movies according to the tags of the movies, such as genre type, release time, region, style, etc., and at this time, the type vector formed by each row or column in the multi-label item type matrix records the tag types to which the corresponding movie belongs.

[0019] S2: Calculate the type preference vector of users for items according to the user-item rating matrix and the multi-label item type matrix; the rating situation of users for items can directly reflect whether users are interested in the items. By using the rating deviation to weighted accumulate the tag types of the items evaluated by users, we can accurately know the degree of preference of users for items of each tag type, so as to obtain the type preference vector of users for items. Taking movies as an example of items, if a user rates a certain movie, the rating value is weighted to the type vector to which the movie belongs, and the accumulated sum of all weighted type vectors can represent the degree of preference of the user for movies of all types, that is, the type preference vector of the user for movies.

[0020] S3: Calculate the cosine similarity between the type vectors of the items rated by the user and the user's type preference vector. Use the number of rating times of each item in the database as the degree of understanding of the item by the LLM model. Calculate the comprehensive score of the item based on the cosine similarity and the degree of understanding, and select several items from high to low according to the comprehensive score to form an evaluation history set. Cosine similarity is a commonly used indicator to reflect the similarity between two vectors. In the calculation process, the two vectors can be normalized for convenient calculation and comparison. The higher the cosine similarity, the closer the directions of the two non-empty vectors. If the cosine similarity between the type vector of the item and the user's type preference vector is positive, the larger the absolute value of the cosine similarity, the more this item is liked by this user. Conversely, if the cosine similarity is negative, the larger the absolute value of the cosine similarity, the more this item is disliked by this user. In the recommendation system, items that users particularly like or dislike have strong guidance for the accuracy of recommendations. Since the spread and user attention of different items are different, their rating information will also have different abilities to reflect customer preferences. This is manifested in the analysis process of the LLM model as the degree of understanding of different items by the model. The higher the degree of understanding, the higher the reference value of the analysis result of the LLM model. The comprehensive score obtained by setting weight coefficients according to importance to balance the influence of cosine similarity and the degree of understanding can more accurately represent the reference value of this item for user preference analysis. Taking movie items as an example, sort the movies rated by the user from high to low according to the comprehensive score, and select the top k movies to form a refined evaluation history set , for constructing the user 's descriptive prompt , in order to reduce the number of tokens, a smaller value can be taken, such as taking 4 means selecting the top 4 movies with the highest comprehensive scores as representative members of the evaluation history set.

[0021] S4: Construct a directed weighted hypergraph with users as nodes and items as hyperedges. Use the PageRank algorithm to calculate the importance score of each node. Select several nodes in ascending order of importance scores, and use the LLM model to screen out the items that the user may like or dislike from the item candidate set according to the descriptive prompt of the node user, and build a new prediction connection between the node and the screened items. The descriptive prompt includes task instructions, user attributes, evaluation history set, and item candidate set.

[0022] Taking movie items as an example, in the descriptive prompt: Task Instruction: You are a movie recommendation system and are required to recommend movies to users based on user profiles and their rating history. Consider movie titles, years, ratings, and genres, alongside user attributes such as age, gender, occupation, and nationality for personalized suggestions. The content of the above task instruction is a simple example in the movie item scenario. In actual use, depending on the item type, data source, etc. of the recommendation system, there will be different task instruction contents and organizational methods.

[0023] User attributes are composed of the obtained user information and generate a textual description of the user profile based on the preprocessed basic user information.

[0024] Evaluation history set: The refined evaluation history set selected in step S3 。

[0025] Movie candidate set: Movie candidate set Generated by the LightGCN recommendation model without graph augmentation. Here, it is introduced because the LLM cannot rank all a large number of items. These candidate samples are samples with high prediction scores, which may be either valuable positive samples or negative samples that are difficult to distinguish. By screening and differentiating potential and valuable positive and negative samples, the graph neural network can learn higher-quality interaction information after graph augmentation.

[0026] A hypergraph is an extension of a traditional graph, consisting of nodes and hyperedges. Different from an ordinary graph, a hyperedge in a hypergraph can connect any number of nodes. A directed weighted hypergraph has different weights on the connection paths of different nodes. Construct a directed weighted hypergraph , where the node set , the hyperedge set , represents a directed weight from node to hyperedge ; represents a directed weight from hyperedge to node , and the weight value is equal to node The ratings of the items represented by the user for the hyperedge There are multiple directed weights on a hyperedge, and the hyperedge connects all users who have rated the item represented by this hyperedge.

[0027] Because the directed weighting mechanism is used, the weights are different when propagating in the forward and reverse directions between two nodes. The magnitude of the directed weight represents the probability of transfer from one node to another along this hyperedge. As an example, for the hypergraph structure constructed above, during the random walk process of the PageRank algorithm, the walk path can reflect the preferences of users for the items they interact with. Specifically, there is an item and two users , user rates the item as 1 point, and user rates the item as 5 points. Then in the graph structure, the random walker goes from user through the item to user , and the process of going from user through the item to user has different walk effects.

[0028] The easier a node is to be connected to by other nodes, the more important and central this node is in the hypergraph. The PageRank algorithm uses the connection structure between nodes and hyperedges in the hypergraph to score the nodes. Each connection can be regarded as a score for the target node. At each node position, the PageRank algorithm calculates the probability of transfer from this node to another node, and a damping factor can be set so that there is a small probability of not transferring along the connection but randomly transferring to any node. The PageRank algorithm assigns an initial score to all nodes, and then continuously iterates and calculates to update the score of each node until the score stabilizes to reach an equilibrium state, and then the importance scores of each node in the hypergraph can be obtained. The selected nodes with the lowest importance scores correspond to users who are relatively isolated from other users. Therefore, it is necessary to use the LLM model to screen out the items that these users may like or dislike from the candidate items and supplement and establish new connection relationships for these users. As an example, the descriptive prompts of k users are uploaded to the large language model LLM using the API of OpenAI, and the descriptive prompts It contains information such as the user's user attributes, evaluation history set, and item candidate set. The item candidate set is a representative set of items selected from the database, which can ensure that the LLM can fully understand the user's preferences. The representative items and necessary user information are constructed into a concise descriptive prompt, which can reduce the number of tokens transmitted to the LLM model and reduce the interaction cost with the LLM. In a practical operation example, the constructed descriptive prompt Prompt is sent to the large language model LLM using the OpenAI API; by polling, the response message of the large language model LLM is checked; the script traverses the response message of the model, extracts the predicted connection data generated by the LLM and saves it locally; during the request process, if an HTTP error, response parsing error, or other abnormal situation occurs, the error information is captured and printed, and appropriate processing is performed at the same time, such as re-requesting or waiting for a period of time before re-requesting; the predicted connection data generated by the LLM is the ID of the item selected by the LLM from the item candidate set. This process is equivalent to enriching the user's historical interaction records using the LLM. A new predicted connection is constructed between the node and the selected item. This predicted connection is not added to the hyperedge connection relationship in the hypergraph, but a predictive interaction relationship is established between the user and the corresponding item, as is the Figure 3 connection relationship in the user-item bipartite graph shown. The predicted connections generated by the LLM form a connection set , which represents all the predicted connections generated by processing the descriptive prompts of the users in the low-importance user set using the LLM model.

[0029] S5: Construct a user-item bipartite graph based on the user-item interaction matrix, and construct a graph neural network model based on the user-item bipartite graph to calculate the original loss of the recommendation system; A bipartite graph is a special type of graph whose vertices can be divided into two disjoint sets, namely the user node set and the item node set. Each edge in the bipartite graph is used to connect the vertices in these two sets, and there are no edges between the vertices in the same set, that is, the connection relationship only exists between users and items, and there is no connection relationship between users and between items. As Figure 3 ​Shown is an example of a user-item bipartite graph, showing a part of the actual bipartite graph, where the blank nodes represent users, the shaded nodes represent items, the solid lines connecting the nodes are the original connections, and the dashed lines are the new predicted connections generated by the LLM. The new predicted connections fabricate new interaction relationships for users with relatively few original interactions. As an example, the graph neural network uses a lightweight graph convolutional neural network (LightGCN) model. For the user-item bipartite graph constructed from the user-item interaction matrix, LightGCN is used for forward propagation to obtain the predicted output of the original graph. A loss function suitable for the recommendation system, such as the Bayesian personalized ranking loss function, is used to calculate the original loss between the predicted output result of the LightGCN model and the true labels.

[0030] S6: Add each new predicted connection to the user-item bipartite graph and calculate the new loss of the recommendation system respectively. If the new loss after adding a new predicted connection is less than the original loss, then retain this predicted connection; otherwise, delete it. After verifying by adding all the predicted connections to the user-item bipartite graph, the low-quality connections are removed, and a new predicted user-item bipartite graph with richer interaction relationships is obtained. This is used as the model parameter of the graph neural network of the recommendation system, and the user-item interaction matrix is updated according to the user-item bipartite graph as the recommendation parameter. Compared with the original user-item bipartite graph that has not been processed by the method provided in this application, using the new user-item bipartite graph as the input of the graph neural convolutional network enables the recommendation system to recommend items that are more likely to match the user's preferences to the user. This improvement in recommendation performance is particularly obvious for users with fewer original interaction relationships. The quality of the new predicted connection is evaluated by calculating the loss difference before and after adding the new predicted connection. If the new loss is and the original loss is , then the loss difference : If , it means that the new predicted connection reduces the model loss and is considered a high-quality connection, so it is retained; if , it means that the new predicted connection cannot reduce the model loss and is considered a low-quality connection, so it is removed to avoid introducing new system noise. The recommendation system corrects the item recommendation information for the user according to the updated user-item interaction matrix.

[0031] According to, such as Figure 1Based on the method principle shown above, a specific implementation process example of a method is provided: First, preprocess the data in the database. The preprocessing includes preliminary data processing processes such as data integration classification and screening. Then, on the one hand, select representative items to reduce the number of tokens passed to the LLM model; on the other hand, select users with poor interactivity, that is, users with low importance scores, to reduce the user data that needs to interact with the LLM. Through these two aspects of processing, the user-item interaction graph can be enhanced while greatly reducing the interaction cost with the LLM. When selecting representative items, on the one hand, calculate the similarity score between the item and the user type preference, and on the other hand, calculate the understanding degree score of the LLM for the item. Based on the similarity score and the understanding degree score, comprehensively select the most representative item queue. When selecting users with poor interactivity, construct a directed weighted hypergraph from the user perspective, and use the PageRank algorithm to calculate the importance scores of each user node in the directed weighted hypergraph. Then select the user nodes with low importance scores, that is, users with poor interactivity. Before interacting with the LLM, construct a descriptive prompt for the user to simplify the interaction process and reduce the amount of interaction data. Based on the powerful understanding and analysis ability of the LLM, after the LLM generates a predictive interaction connection between the interacting users and items, add the interaction connection to the user-item bipartite graph and process and delete the low-quality connections according to the change of the front and back losses of the graph neural network to obtain a new user-item bipartite graph for the graph neural network model of the recommendation system to improve the recommendation accuracy of the recommendation system.

[0032] Introducing the LLM into the recommendation system can utilize its in-depth understanding of user preferences and item characteristics, complementing the deficiency of traditional recommendation models in not being able to fully recognize user preferences and improving the accuracy of recommendations; by selecting representative items to form an evaluation history set and an item candidate set, and combining necessary information such as user attributes to form a descriptive prompt, the number of Tokens interacting with the LLM is reduced, while ensuring that the LLM can fully understand user preferences. Only select users with less interaction data to interact with the LLM, reducing the number of interactions with the LLM. Since it is charged according to the amount of interaction when communicating with high-performance large language models such as ChatGPT, the method provided in this application to reduce the interaction with the LLM model can undoubtedly directly reduce the overall cost requirement of the computing overhead. And because only a part of users and items are selected, even for a recommendation system with a large-scale user and item set, it is not necessary to increase a lot of LLM interaction costs to improve the integrity and richness of the user-item bipartite graph connection relationship, improving the scalability of the system so that it can be applied to recommendation systems of various types and data scales; by verifying the loss rate of the new connection, only retain the connections that have a positive benefit to the performance of the recommendation system to ensure the stability of the system performance and avoid introducing low-quality system noise.

[0033] In another technical solution, the basic data includes user basic information, item basic information, and user rating data for items. The user basic information includes the user's age, gender, occupation, and place of origin. The item basic information includes the item's ID, type, name, and release time. Taking movie items as an example, the target movie database is the Movielens movie database. The basic movie information includes the unique identifier of the movie in the target movie database, the movie title, the movie release date, and the movie type. The movie type tags include: Unknown, Action, Adventure, Animation, Children's, Comedy, Crime, Documentary, Drama, Fantasy, Film-Noir, Horror, Musical, Mystery, Romance, Sci-Fi, Thriller, War, and Western.

[0034] The elements in the user-item interaction matrix indicate whether a user has interacted with an item. If a user has interacted with an item, the corresponding element value is 1; otherwise, the corresponding element value is 0. The elements in the user-item rating matrix are the rating values given by the user to each item, and if there is no rating, it is 0. The elements in the multi-label item type matrix indicate the type tags to which the item belongs. If an item belongs to a type tag, the corresponding element value is 1; otherwise, the corresponding element value is 0.

[0035] In another technical solution, the method of using rating deviation is adopted to calculate the type preference vector, including the following steps: Calculate the user rating using the following formula: where is the average rating of user , is the number of items rated by user , is the rating given by user to item . Calculate the rating deviation of the user for each item using the following formula: where is the rating deviation of user for item ; the rating deviation can reflect the actual preference degree of the user for the item. By considering positive and negative deviations, both the types that the user likes and the types that they don't like are captured. Positive deviation ( ): indicates that the user likes this item more than the average level; negative deviation ( ): indicates that the user likes this item less than the average level.

[0036] Use the rating deviation to weight the type vector of each item that the user has interacted with, using the following formula: where, is the type preference vector of user , is the type vector corresponding to item in the multi-label item type matrix. The type vector is derived from the multi-label item type matrix, , the set of item types . If p = 19 among them, then the number of all possible item types is 19. The multi-label item type matrix , in the multi-label item type matrix , the element indicates whether item belongs to type , that is: . Use the rating deviation to weight the type vector of each item browsed by the user. The types liked by the user will get positive weights, while the types disliked by the user will get negative weights.

[0037] Normalize the type preference vector: where, is the type preference vector after normalization. Different users may have different rating habits. For example, some users generally give higher or lower ratings. Normalization can reduce the impact brought by this difference in rating scales. The length of the normalized vector is 1, eliminating the influence of the number of ratings and the magnitude of the rating values, making the similarity calculation only based on directional similarity, which is fast and easy to compare.

[0038] In another technical solution, calculate the cosine similarity using the following formula: where, is the absolute value of the cosine similarity between the type preference vector of user and the type vector of item , is the type preference vector after normalization, is the type vector after normalization, that is: An item may have multiple types. Normalization can make the lengths of the type vectors consistent, facilitating comparison. The similarity without taking the absolute value can be positive or negative. A positive value indicates that the type of the item matches the type liked by the user, while a negative value indicates a match with the type disliked by the user. The larger the absolute value of either, the more it represents the user's preference. Therefore, the cosine similarity is used after adding the absolute value.

[0039] Calculating the comprehensive score of an item includes the following steps: Normalize the cosine similarity: where is the normalized cosine similarity, and are the upper and lower limit values of the absolute value of the cosine similarity respectively; Normalize the degree of understanding of the item by the LLM model: where is the degree of understanding of the item by the LLM model, is the normalized degree of understanding, and are the maximum and minimum values of the degree of understanding of each item by the LLM model respectively; Calculate the comprehensive score: where is the comprehensive score of the item obtained for the user . The weight coefficient ranges from 0 to 1. The weight coefficient is adjusted according to the actual situation to balance the importance of the cosine similarity of the user's type preference vector and the degree of understanding of the LLM. Constructing the comprehensive score ensures that an item can be selected that both represents the user's preference and is familiar to the LLM.

[0040] In another technical solution, calculating the importance score includes the following steps: Calculate the transition probability between nodes in the directed weighted hypergraph: where is the transition probability from node through the hyperedge to node , is the set of neighbor hyperedges of node , is the hyperedge The set of neighbor nodes of is the slave node pointing to its neighbor hyperedges is the directed weight, is from the hyperedge pointing to its neighbor nodes is the directed weight, is the slave node is the sum of the directed weights from the node is from the hyperedge pointing to all its neighbor nodes is the sum of the directed weights, is the slave node through all the connected nodes and is the hyperedge set reaching the node is the transition probability; and are both used to normalize the transition probability. Among any two nodes there exists a hyperedge subset containing all the hyperedges connecting the nodes and the node . , the condition means that the hyperedge connects the nodes and the node simultaneously.

[0041] The transition matrix is obtained by calculating the transition probabilities between all nodes. The element in the transition matrix represents the transition probability from the node to the node , is the number of nodes; The importance scores are iteratively calculated using the PageRank algorithm: where is the damping factor, and the initial importance score of the node , iterating until , is the convergence threshold. The value of

[0042] In another technical solution, the constructed user-item bipartite graph where the node set , is the user node set, is the set of item nodes and the edge set , where , , is the user-item interaction matrix; The constructed graph neural network model adopts the following propagation rule formula: where is the activation function, and respectively represent the normalized adjacency matrices from user to item and from item to user, is the node representation matrix of the (k - 1)-th layer, represents the learnable weight matrix of the k-th layer; As an example, the constructed LightGCN model adopts the following propagation rule formula: where represents the set of item nodes that have interacted with user , represents the set of user nodes that have interacted with item ; is the symmetric normalization term, which can prevent the graph convolution operation from increasing the scale of the embedding.

[0043] The feature representations of users and items output by the LightGCN model are: where is the feature representation of the user, is the feature representation of the item, is the number of layers of the graph convolution operation, is for the layer of the graph convolution operation as the importance parameter. , which can be used as a hyperparameter that needs to be manually adjusted or automatically optimized as a model parameter (e.g., the output of the attention network). As an example, can be uniformly set to .

[0044] The calculation methods of the original loss and the new loss are as follows: For the original bipartite graph without adding new prediction connections, calculate the original loss Among them, is the predicted output of the original model, is the true label, is the BPR loss function; the model prediction is defined as the inner product of the final representations of the user and the item: Adopt the Bayesian Personalized Ranking (BPR) loss as the model loss function: σ(·) is the Sigmoid function, 𝜆 is the regularization coefficient, and Θ is the set of model parameters.

[0045] For the new bipartite graph with the newly added predicted connection , calculate the new loss : Among them, is the predicted output of the new model.

[0046] As an example, construct the original user-item bipartite graph structure , among which, the node set ; the edge set: , where , , is the user-item interaction matrix.

[0047] On the original graph , use the LightGCN model for forward propagation to obtain the predicted output: Among them, is the randomly initialized node feature matrix.

[0048] Calculate the original loss .

[0049] Secondly, for each new predicted connection , construct a new edge set , construct a new graph . On the new graph , use LightGCN for forward propagation to obtain the new predicted output: Calculate the new loss .

[0050] Finally, calculate the loss difference and evaluate the quality of the predicted connection for selection.

[0051] It should be noted that although the above steps are described in a specific order, it does not mean that the steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently or even in a different order, as long as the required functions can be achieved. The number of devices and the processing scale described here are used to simplify the description of the present invention, and the application, modification, and variation of the present invention are obvious to those skilled in the art.

[0052] Although the embodiments of the present invention have been disclosed as above, it is not limited to the applications listed in the specification and embodiments. It can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily made. Therefore, without departing from the general concept defined by the claims and their equivalents, the present invention is not limited to the specific details and the illustrated examples herein.

Claims

1. A graph enhancement method based on LLM low-cost interaction, characterized in that: The following steps are involved: S1: Obtain basic data of users and items in the target database, and construct a user-item interaction matrix, a user-item rating matrix, and a multi-label item type matrix based on the basic data; S2: Calculate the user's item type preference vector based on the user-item rating matrix and the multi-label item type matrix; S3: Calculate the cosine similarity between the type vector of the items evaluated by the user and the type preference vector of the user, take the number of ratings of each item in the database as the degree of understanding of the LLM model, calculate the comprehensive score of the item based on the cosine similarity and the degree of understanding, and select several items from high to low according to the comprehensive score to form a review history set; S4: Construct a directed weighted hypergraph with users as nodes and items as hyperedges, use the PageRank algorithm to calculate the importance score of each node, select several nodes in order from low to high importance scores, and use the LLM model to filter out items that users may like or dislike from the item candidate set based on the descriptive prompts of the node users, and build new prediction connections between the nodes and the filtered items. The descriptive prompts include task instructions, user attributes, evaluation history sets, and item candidate sets. S5: constructing a user-item bipartite graph according to the user-item interaction matrix, and constructing a graph neural network model according to the user-item bipartite graph to calculate the original loss of the recommendation system; S6: Add each new prediction connection to the user-item bipartite graph and calculate the new loss of the recommendation system. If the new loss after adding a new prediction connection is less than the original loss, then keep this prediction connection, otherwise delete it.

2. The LLM low-cost interactive graph enhancement method according to claim 1 is characterized in that: The basic data includes user basic information, item basic information and user rating data for items. The user basic information includes the user's age, gender, occupation and place of origin. The item basic information includes the item's ID, type, name and release time.

3. The LLM low-cost interactive graph enhancement method according to claim 1 is characterized in that: The elements in the user-item interaction matrix indicate whether a user has interacted with an item. If a user has interacted with an item, the corresponding element value is 1, otherwise the corresponding element value is 0; The elements in the user-item rating matrix are the ratings given by the user to each item, and if there is no rating, the value is 0; The elements in the multi-label item type matrix represent the type labels to which the items belong. If an item belongs to a type label, the corresponding element value is 1, otherwise the corresponding element value is 0.

4. The LLM low-cost interactive graph enhancement method according to claim 1, characterized in that: The type preference vector is calculated using a scoring bias method, comprising the following steps: To calculate the user rating, use the following formula: Among them, For users The average rating of For users The number of items reviewed, Is a user For items Ratings; Calculate the user's rating deviation for each item using the following formula: in, For users For items Rating bias; The rating bias is used to weight the type vector of each item that the user has interacted with, using the following formula: in, For users The type preference vector of For items in the multi-label item type matrix The corresponding type vector; The type preference vector is normalized: in, is the normalized type preference vector.

5. The LLM low-cost interactive graph enhancement method according to claim 4 is characterized in that: The directed weighted hypergraph constructed in step S4 , where the node set , is the user set, the hyperedge set , For item sets, Represents a slave node Pointing to the hyperedge The directed weights on From the hyperedge Point to Node A directed weight, the weight value is equal to the node The user represented by the hyperedge The rating of the item represented by Connects all users who have rated the item represented by this hyperedge.

6. The LLM low-cost interactive graph enhancement method according to claim 1, characterized in that: The cosine similarity is calculated using the following formula: in, For users The type preference vector and items The absolute value of the cosine similarity of the type vector, is the normalized type preference vector, is the normalized type vector.

7. The LLM low-cost interactive graph enhancement method according to claim 6 is characterized in that: Calculating an item's overall score involves the following steps: Normalize the cosine similarity: in, is the normalized cosine similarity, and They are the upper and lower limits of the absolute value of cosine similarity respectively; Normalize the LLM model's understanding of the item: in, For LLM model items degree of understanding, is the normalized understanding level, and are the maximum and minimum values ​​of the LLM model’s understanding of each item; Calculate the overall score: in, For users Items obtained The comprehensive score, weight coefficient The value range is 0 to 1.

8. The LLM low-cost interactive graph enhancement method according to claim 1, characterized in that: Calculating the importance score involves the following steps: Compute transition probabilities between nodes in a directed weighted hypergraph: in For slave nodes Through the super edge Arrival Node The transition probability, For Node The neighbor hyperedge set of For super edge The set of neighbor nodes of For slave nodes Hyperedge pointing to its neighbor The directed weight of From the super edge Point to its neighbor node The directed weight of It is a slave node The sum of the directed weights of all hyperedges pointing to its neighbors, From the super edge The sum of the directed weights pointing to all its neighbor nodes is the slave node Passing through all connected nodes and The hyperedge set Arrival Node The transition probability of The transfer matrix is ​​obtained by calculating the transfer probability between all nodes. , the elements in the transfer matrix Represents a slave node To Node The transition probability, is the number of nodes; The importance score is calculated iteratively using the PageRank algorithm: in, is the damping coefficient, the initial importance score of the node , iterate until , is the convergence threshold.

9. The LLM low-cost interactive graph enhancement method according to claim 1, characterized in that: The constructed user-item bipartite graph , where the node set , is the user node set, is the set of item nodes and the set of edges ,in , , is the user-item interaction matrix; The constructed graph neural network model adopts the following propagation rule formula: in, is the activation function, and Represent the normalized adjacency matrices from user to item and from item to user, respectively. The nodes in the k-1th layer represent matrices, represents the learnable weight matrix of the kth layer; The features of users and items output by the graph neural network model are represented as follows: in, is the user's feature representation, is the characteristic representation of the item, is the number of propagation layers, For the Importance parameter for layer graph convolution operations.

10. The LLM low-cost interactive graph enhancement method according to claim 9, characterized in that: The original loss and the new loss are calculated as follows: For the original bipartite graph without adding new prediction connections , calculate the original loss : in, is the prediction output of the original model, is the true label, is the BPR loss function; For the new bipartite graph with the new prediction connection , calculate the new loss : in, is the prediction output of the new model.

Citation Information

Patent Citations

  • Social recommendation system based on lightweight graph convolutional network

    CN113961820A

  • Document-level event causal relationship identification method based on graph reinforcement learning

    CN118627617A

  • Intelligent equipment fault question-answering method and system based on knowledge graph enhancement

    CN119226481A

  • Article aspect-level preference decoupling recommendation method based on big language model enhancement

    CN119226625A

  • Persona and application matching using large language models

    US20240184983A1