Personalized recommendation method and device based on large language model and logical relationship mining

By building a binary graph of user-item interaction and a large language model, high-order logical relationships are extracted, and rules are generated and filtered, and user and item embedding are optimized. The problems of incomplete logical relationships and insufficient semantic understanding in the personalized recommendation system are solved, and higher recommendation accuracy and credibility are achieved.

CN120336386APending Publication Date: 2025-07-18ZHEJIANG GONGSHANG UNIVERSITY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510415476.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

In the existing personalized recommendation system, incomplete logical relationships and insufficient semantic understanding lead to low recommendation accuracy and credibility.

Method used

By constructing a binary graph of user-item interaction, using closed loop detection to extract higher-order relationships, combining large language model generation and screening rules, we build enhanced heterogeneous graphs, optimize user and item embedding, and optimize model parameters using binary cross entropy loss to perform personalized recommendations.

Benefits of technology

It improves the accuracy and credibility of the recommendation system, can better capture user needs and generate high-quality recommendation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336386A_ABST
    Figure CN120336386A_ABST
Patent Text Reader

Abstract

The invention discloses a personalized recommendation method and device based on a large language model and logical relationship mining. According to the method, user-driven logic relation extraction is constructed, the semantic reasoning ability and graph structure analysis of the large language model are fused, the high-order logic relation in the heterogeneous graph is mined, and the problems that an existing method is incomplete in logic relation and insufficient in semantic understanding are solved. The method comprises the following steps: analyzing user-article interaction data through a user-driven logic relationship extraction module, and identifying implicit association; performing rule expansion by utilizing a large language model, and generating a high-order logic rule in combination with semantic and structural information; screening high-quality rules through confidence score to construct an enhanced heterogeneous graph; and finally, demand perception recommendation is realized in combination with user preference embedding and logic relation characteristics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of recommendation systems, and particularly to a personalized recommendation method and device based on large language models and logical relationship mining. Background Art

[0002] With the development of big data technology and artificial intelligence, personalized recommendation systems have been widely applied in fields such as e-commerce and social platforms. The personalized recommendation system aims to provide relevant recommended content according to the interests and needs of users. In many application scenarios, the preferences of users may involve multiple complex logical requirements, such as the hope that the recommended content meets multiple specific attribute requirements. Such requirements can be represented by structured queries on heterogeneous graphs, which contain different types of entities such as users, items, and external knowledge and their association relationships.

[0003] Heterogeneous graphs provide rich user interaction information and semantic relationships, providing a good reasoning basis for recommendation systems. However, the existing recommendation systems based on logical relationships face the following two problems: First, the logical relationships are incomplete. In real recommendation data, the interaction data between users and items is often incomplete, resulting in difficulty for the recommendation system to obtain complete logical relationships. This incomplete logical relationship will reduce the accuracy and credibility of recommendations. Second, the relationship semantics are missing. Existing methods often ignore the semantic information in logical relationships and only perform reasoning based on structural information, unable to effectively capture high-order logical relationships, resulting in the lack of deep semantic understanding ability of recommendation results. Summary of the Invention

[0004] The purpose of the present invention is to address the problems of incomplete logical relationships and insufficient relationship semantics in current recommendation systems, and propose a personalized recommendation method based on large language models and logical relationship mining. By combining user-driven logical relationship extraction and the semantic understanding ability of large language models, high-order logical relationships in the heterogeneous graph of the recommendation system are mined to improve the accuracy and credibility of the recommendation system.

[0005] The purpose of the present invention is achieved through the following technical solutions: A personalized recommendation method based on large language models and logical relationship mining, the method comprising the following steps:

[0006] S1. Extract relationship pairs of the user-item interaction bipartite graph through closed-loop detection, and construct a logical relationship set;

[0007] S2. Generate an initial rule set according to the closed-loop paths in the user-item interaction bipartite graph, construct a natural language description according to the logical relationships and output it to the large language model to generate a rule set and merge it with the initial rule set to obtain an extended rule set;

[0008] S3. Use confidence to filter the rules in the extended rule set to generate an enhanced rule set;

[0009] S4. Construct a recommendation model with demand awareness. The implementation process of the model includes: fusing the enhanced rule set and the user-item interaction bipartite graph to obtain a complete enhanced graph, and learning the embeddings of users and items based on the enhanced graph; using the embeddings of users and items as historical interaction preferences to calculate the similarity of the fusion logical relationship between users and items.

[0010] S5. Optimize the model parameters according to the binary cross-entropy loss, and perform recommendations using the user-item similarity ranking obtained by the optimized model.

[0011] Further, the relationship pairs extracted by the closed-loop detection from the user-item interaction bipartite graph specifically include: constructing a user-item interaction bipartite graph; \(u\in U\) is the set of user nodes, \(i\in I\) is the set of item nodes, and \(E\) is the set of interaction edges; extracting high-order relationship pairs \((i1, i2)\) through closed-loop detection.

[0012] The calculation formula for extracting high-order relationship pairs by closed-loop detection is:

[0013]

[0014] That is, when two items are often co-purchased by the same group of users, there is an implicit "co-purchase" logical relationship between these two items, which reflects the shared interaction between users \(u1\) and \(u2\), indicating the existence of a meaningful co-purchase association.

[0015] Further, the construction of the logical relationship set includes:

[0016] Count the co-occurrence frequencies of high-order relationship pairs, retain the top \(K\) relationships, and combine them with the existing relationship set of the heterogeneous graph to obtain the final user-driven logical relationship set \(R\).

[0017] Further, the generation of the initial rule set according to the closed-loop path in the user-item interaction bipartite graph includes: using the breadth-first search technique to identify the closed-loop path \(p\) in the graph, where the path is defined as a sequence of relationships \(\{p: r1, r2,..., r\}\) that form a high-order connection, emphasizing how different relationships are logically related, where the relationship \(r\in R\); that is, a path can be \(\{p1: series(r1), genre(r2)\to genre(r2)\}\), where \(r2\) represents the target rule to be inferred, and \(r1\) and \(r2\) represent the supporting relationships. The target rules inferred from all closed-loop paths \(p\) form the initial rule set \(S\). n →r}, which forms a high-order connection, emphasizing how different relationships are logically related, where the relationship \(r\in R\); that is, a path can be \(\{p1: series(r1), genre(r2)\to genre(r2)\}\), where \(r2\) represents the target rule to be inferred, and \(r1\) and \(r2\) represent the supporting relationships. The target rules inferred from all closed-loop paths \(p\) form the initial rule set \(S\).

[0018] Further, the specific operation of constructing a natural language description according to the logical relationship, outputting it to the large language model to generate a rule set, and merging it with the initial rule set is as follows:

[0019] Convert the relationships in each rule in the initial rule set into human-readable natural language sentences, and then put the expressed rules, along with the user-driven logical relationships, into the designed prompt template and input them into the large language model to generate an additional extended rule set, which is combined with the initial rule set to obtain the extended rule set.

[0020] Furthermore, the rule screening of the extended rule set using confidence is specifically as follows: Calculate the confidence score of the rule to evaluate the quality of each rule r; for rule screening, retain the rules with a confidence score exceeding 0.9 to form the final enhanced rule set S*, and the calculation of the confidence score includes:

[0021]

[0022] where r(x,y) means that entity x is connected to entity y through rule r; the numerator of the calculation formula represents the number of relationships that are simultaneously satisfied with r(x,y) in the extended rule set, and the denominator of the calculation formula represents all possible instances that satisfy r1, r2,..., r n The number of relationships that are simultaneously satisfied with r(x,y) in the extended rule set, and the denominator of the calculation formula represents all possible instances that satisfy r1, r2,..., r n of all possible instances.

[0023] Furthermore, the calculation of the similarity of the fusion logical relationship between the user and the item includes:

[0024]

[0025] where measures the direct similarity between the user and item embeddings, f(F u,v ; S * ) incorporates the logical relationships derived from the optimized rule set S*; f is a single-layer feedforward network with a softmax activation function; σ(·) represents the sigmoid function, ensuring that the output is a probability score.

[0026] Furthermore, the optimization of the model parameters according to the binary cross-entropy loss is specifically as follows: Minimize the binary cross-entropy loss of positive and negative user-item pairs, and the calculation formula of the binary cross-entropy loss is as follows:

[0027]

[0028] where y uv ∈{0, 1} indicates whether user u has an interaction with item v, represents the set of all training pairs, and sim uv represents the similarity.

[0029] On the other hand, a personalized recommendation device based on large language models and logical relationship mining is also provided, including a memory and one or more processors. Executable code is stored in the memory. When the processor executes the executable code, the described personalized recommendation method based on large language models and logical relationship mining is implemented.

[0030] On the other hand, a computer-readable storage medium is also provided, on which a program is stored. When the program is executed by a processor, the described personalized recommendation method based on large language models and logical relationship mining is implemented.

[0031] Advantages of the present invention:

[0032] 1. By using user-driven logical relationship extraction technology, through analyzing the interaction data between users and items, user-driven logical relationships are extracted, implicit associations between users and items are identified, and the problem of incomplete logical relationships in existing methods is solved.

[0033] 2. By using the semantic reasoning and graph structure analysis capabilities of large language models, new logical rules are generated, and combined with semantic and structural information, high-order logical relationships in the heterogeneous graph of the recommendation system are mined, solving the problem of insufficient semantic understanding of logical relationships in existing methods.

[0034] 3. A logical relationship mining model in personalized recommendation based on large language models is constructed, prior knowledge and external knowledge are fully utilized, and high-quality rules are screened through confidence scoring to construct an enhanced heterogeneous graph, improving the accuracy and credibility of the recommendation system. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a case diagram for implementing personalized recommendation based on large language models and logical relationship mining provided by an embodiment of the present invention;

[0036] Figure 2 It is a flowchart of a method for mining logical relationships in personalized recommendation based on large language models provided by an embodiment of the present invention;

[0037] Figure 3 It is an example block diagram of basic logical requirements and zero-shot logical requirements provided by an embodiment of the present invention;

[0038] Figure 4 It is a schematic diagram of a personalized recommendation device based on large language models and logical relationship mining provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0039] The following further describes the specific embodiments of the present invention in detail with reference to the accompanying drawings.

[0040] As Figure 1As shown, in the present invention, the user-item interaction bipartite graph refers to a graph structure composed of two types of nodes (users and items), where the interaction relationship (such as purchase, browsing, rating, etc.) between users and items is represented by edges. This bipartite graph can effectively represent the relationship between users and items and provide a basic data structure for the recommendation algorithm. By analyzing the interaction data between users and items, the bipartite graph can reveal the preference patterns of users, thereby supporting the generation of personalized recommendations.

[0042] Logical relationship refers to the structural association between users and items, items and items, and users and users. For example, in Figure 1 , the interaction (purchase) between user 1 and the item "Mockingjay" indicates that user 1 has a certain preference for the item "Mockingjay". Similarly, there is a series relationship between the item "Mockingjay" and the item "The Spark That Ignited the Prairie". In personalized recommendation, mining and utilizing these logical relationships can help better meet the preference needs of users.

[0043] Heterogeneous graph refers to a graph structure that contains different types of nodes and edges. In the present invention, the heterogeneous graph contains multiple entities such as users, items, and external knowledge, as well as the complex multiple relationships between them, as Figure 1 shown. Different from the traditional single-type node graph, the heterogeneous graph can more comprehensively represent the rich associations between users, items, and external knowledge. The diversity and complexity of the heterogeneous graph enable it to better capture the potential logical relationships between users and items, thereby supporting more accurate recommendations.

[0044] Higher-order logical relationship refers to the complex relationship that goes beyond the basic user-item interaction. These relationships are usually captured through multi-dimensional analysis of user behavior. For example, if two items are often co-purchased by the same user, it can be considered that there is a certain logical relationship (co-purchase relationship) between them. The mining of higher-order logical relationships helps the system more accurately understand user needs and improve the accuracy of recommendations.

[0045] Large language model (LLM) refers to a natural language processing model based on deep learning that can understand and generate natural language text. In the present invention, the LLM is used to mine the higher-order logical relationships in the heterogeneous graph and generate recommendation rules related to user needs. The large language model can not only understand semantic information but also generate novel rules through reasoning, thereby enhancing the reasoning ability of the recommendation system.

[0046] The logical relationship mining method based on the large language model refers to mining the higher-order logical relationships of the nodes and edges in the heterogeneous graph by using the large language model, thereby optimizing the accuracy and reasoning ability of personalized recommendations. This method can effectively capture and complement the complex logical relationships that cannot be processed by traditional recommendation systems and improve the accuracy of recommendations. Such asFigure 1 As shown, the logical relationship mining based on the large language model analyzes the associations in the isomer structure and related item texts according to the existing complex logical relationships between "Sparkling Fire" and "Mockingjay", and generates new logical rules {"Sparkling Fire" type "dystopia"}.

[0047] Personalized recommendation refers to: recommending products or services that meet the user's preferences based on the user's historical behavior, interest preferences, and logical needs. Specifically, personalized recommendation relies on the interaction information between the user and the product or service, and combines the user's semantic needs with structured graph data to generate a recommendation list. The recommendation system provides relevant content for the user through deep learning or traditional algorithms.

[0048] As Figure 2 shown, a method for mining logical relationships in personalized recommendation based on a large language model provided in this embodiment is as follows:

[0049] S1. User-driven logical relationship extraction, extracting high-order logical relationships by analyzing shared user interactions in the user-item interaction bipartite graph, mainly including three sub-steps:

[0050] S1.1. Construct a user-item interaction bipartite graph;

[0051] S1.2. Extract high-order relationship pairs (i1, i2) through closed-loop detection;

[0052] S1.3. Statistically count the co-occurrence frequencies of high-order relationship pairs, retain the top K relationships, and combine them with the existing relationship set of the heterogeneous graph to obtain the final user-driven logical relationship set R.

[0053] The specific implementation details are as follows:

[0054] (a) Model the user-item interaction as a bipartite graph, where u ∈ U is the set of user nodes, i ∈ I is the set of item nodes, and E is the set of interaction edges;

[0055] (b) Extract high-order relationship pairs (i1, i2) through closed-loop detection, and the calculation formula is:

[0056]

[0057] For example, if two items are often co-purchased by the same group of users, there is an implicit "co-purchase" logical relationship between these two items, reflecting the shared interaction between users u1 and u2, indicating the existence of a meaningful co-purchase association;

[0058] S2. Based on the semantic reasoning ability and graph structure analysis ability of the large language model, expand the initial rule set to generate a new extended rule set S′, mainly including four sub-steps:

[0059] S2.1. Read the user-driven logic relationship set R finally obtained in Step 1;

[0060] S2.2. Use the breadth-first search technique to identify the closed-loop path p in the graph and generate the initial rule set S;

[0061] S2.3. Given the initial rule set S and the user-driven logic relationship set R, design a prompt template to convert the relationships into natural language descriptions, and input them into the large language model to generate the rule set G;

[0062] S2.4. Merge the initial rule set S and the rule set G generated by the large language model to obtain the extended rule set S′ = S ∪ G.

[0063] The specific implementation details are as follows:

[0064] (a) Use the breadth-first search technique to identify the closed-loop path p in the graph, where the path is defined as a sequence of relationships {p: r1, r2,..., r n →r}, which forms a higher-order connection, emphasizing how different relationships are logically related, where the relationship r ∈ R. For example, a path can be {p1: series(r1), genre(r2) → genre(r2)}, where r2 represents the target rule to be inferred, r1 and r2 represent the supporting relationships, and the target rules inferred from all closed-loop paths p form the initial rule set S;

[0065] (b) Given the initial rule set S and the user-driven logic relationship set R, design a prompt template to convert the relationships into natural language descriptions, and input them into the large language model to generate the rule set G. Specifically, first, convert the relationships in each rule in the rule set S into human-readable natural language sentences. For example, a relationship like "inv_bought" is expressed as "the reverse relationship of bought"; then, put these expressed rules, together with the user-driven logic relationship R, into the designed prompt template and input them into the large language model to generate an additional extended rule set G. The simplified prompt template is as follows:

[0066]

[0067] S3. Confidence-driven rule screening, mainly including two sub-steps:

[0068] S3.1. Calculate the confidence score of the rule to evaluate the quality of each rule r;

[0069] S3.2. Rule screening, retain the rules with a confidence score exceeding 0.9 to form the final enhanced rule set S*;

[0070] The specific implementation details are as follows:

[0071] (a) Calculate the confidence score of the calculation rules to evaluate the quality of each rule r. The specific calculation formula is as follows:

[0072]

[0073] where r(x, y) indicates that entity x is connected to entity y through rule r; the numerator of the calculation formula represents the number of relationships that are satisfied simultaneously with r(x, y) in the extended rule set, and the denominator of the calculation formula represents all possible instances that satisfy r1, r2,..., r n The number of relationships that are satisfied simultaneously with r(x, y), and the denominator of the calculation formula represents all possible instances that satisfy r1, r2,..., r n of all possible instances.

[0074] S4. Construct a recommendation model that perceives requirements, which mainly includes five sub-steps:

[0075] S4.1. Integrate the enhanced rule set S* with the initial user-item interaction information to obtain a complete enhanced graph that combines the user-item interaction bipartite graph and high-order logical relationships;

[0076] S4.2. Based on the complete enhanced graph, learn the user embedding Zu and the item embedding Zv;

[0077] S4.3. Design a similarity function that fuses logical relationships to calculate the similarity between user u and item v;

[0078] The specific implementation details are as follows:

[0079] (a) The user embedding Zu and the item embedding Zv are respectively initialized as vectors using the random initialization method to provide a starting point, and then are continuously updated and adjusted through the binary cross-entropy loss function during the training process.

[0080] (b) Design a similarity function that fuses logical relationships to calculate the similarity between user u and item v. The specific calculation formula is as follows:

[0081]

[0082] where measures the direct inner product similarity between the user and item embeddings to capture the direct preferences in the user's historical interactions; f(F u,v ; S * ) incorporates the logical relationships derived from the optimized rule set S* to learn supplementary information from the logical relationship features F u,v to enhance the modeling of user requirements; f is a single-layer feedforward network with a softmax activation function; σ(·) represents the sigmoid function to ensure that the output is a probability score.

[0083] S5. Optimize the model parameters according to the binary cross - entropy loss to minimize the binary cross - entropy loss of positive and negative user - item pairs; perform recommendations using the user - item similarity ranking obtained from the optimized model.

[0084] The specific implementation details are as follows:

[0085] Update and optimize the model parameters through the binary cross - entropy loss function to minimize the binary cross - entropy loss of positive and negative user - item pairs. The calculation formula is as follows:

[0086]

[0087] where y uv ∈ {0, 1} indicates whether user u has an interaction with item v, represents the set of all training pairs. In this training process, the updated parameters mainly include:

[0088] User embedding parameter (Zu): used to capture the historical behavior and needs of users.

[0089] Item embedding parameter (Zv): used to capture item features.

[0090] Parameters of the feed - forward network f: This includes the weight matrix and bias terms in the network, which are used to convert the logical relationship features extracted from S* into supplementary similarity components.

[0091] Furthermore, in order to comprehensively evaluate the performance of the method described in the present invention in recommendation systems in different fields, this application verifies the performance effect on three representative real - world recommendation system datasets, namely Amazon Books and Last - FM MIND. These datasets have been widely used in previous research, and due to their characteristics in different fields, different scales, and different data densities, they can fully verify the wide applicability and superiority of the present invention. The statistical data of the experimental datasets are as follows:

[0092] Amazon Books Last-FM MIND Number of users 70679 23566 100000 Number of items 24915 45123 30577 Number of interactions 847733 3034796 2975319 Number of entities 88572 58266 24733 Number of relationships 39 9 512 Number of triples 2557746 464567 148568

[0093] The present invention uses two key metrics to evaluate the recommendation performance: H@k (hit rate at k) and N@k (normalized discounted cumulative gain at k). At the same time, the present invention compares the following representative state - of - the - art baselines (comparative algorithms), which mainly include the following two types: First, knowledge - graph - based methods that enrich the representations of users and items by integrating background knowledge from knowledge graphs, including RippleNet, CFKG, KGCN, and MKR; second, logic query expansion - based methods that focus on processing logical queries, including GQE, Q2B, BetaE, FuzzQE, and LogicRec.

[0094] The experimental results are summarized in Table 1. The present invention consistently outperforms the state-of-the-art baseline methods in all datasets and evaluation metrics, demonstrating its superiority in handling personalized recommendation tasks. Specifically, the present invention models the user's needs by integrating logical queries, thus surpassing the knowledge graph-based baselines (such as CFKG), and achieving more accurate intent modeling. In addition, the present invention uses the LLM to mine the logical relationships in the heterogeneous graph, solving the scalability and semantic limitations, and thus outperforming the logical query expansion methods (such as LogicRec). In addition, the performance improvement of the present invention ranges from substantial (32.99% on the Amazon-Book dataset) to moderate (1.33% on the Last-FM dataset). This variability highlights two key factors. First, in highly sparse datasets, the present invention effectively overcomes the challenges brought by the incompleteness of the knowledge graph. Second, in datasets with simpler relational structures, the limited number of logical rules generated by the LLM may limit the potential of the model. Despite this limitation, the performance of the present invention is always better than that of the sub-optimal models, demonstrating its robustness in datasets with different characteristics.

[0095] Table 2: Recommendation performance on three datasets (the best performance is in bold, and the second-best performance is underlined).

[0096]

[0097] In addition, to demonstrate the effectiveness of the present invention for complex logical requirements, we evaluated the performance of the present invention at different levels of logical complexity. As Figure 3 shown, four key logical requirements simulate different user preferences and scenarios in the recommendation task, where the symbols i, u, and p represent intersection (∧), union (∨), and projection respectively. The experimental results shown in Table 2 indicate that the present invention always outperforms the sub-optimal baseline on Amazon-Book, with improvement gains ranging from 15.38% to 73.91%. This highlights the ability of the present invention to effectively meet the complex and zero-shot recommendation logical requirements.

[0098] Table 2: Experimental results table for basic logical requirements and zero-shot logical requirements (using H@20 as the evaluation metric)

[0099]

[0100]

[0101] The present invention constructs user-driven logical relationship extraction, integrates the semantic reasoning ability of the large language model with graph structure analysis, mines the high-order logical relationships in the heterogeneous graph, and solves the problems of incomplete logical relationships and insufficient semantic understanding of existing methods.

[0102] Corresponding to the embodiment of the foregoing personalized recommendation method based on large language models and logical relationship mining, the present invention also provides an embodiment of a personalized recommendation device based on large language models and logical relationship mining.

[0103] Refer to Figure 4 , an embodiment of a personalized recommendation device based on large language models and logical relationship mining provided by the embodiments of the present invention includes a memory and one or more processors. Executable code is stored in the memory. When the processor executes the executable code, it is used to implement the personalized recommendation method based on large language models and logical relationship mining in the foregoing embodiment.

[0104] The embodiment of the personalized recommendation device based on large language models and logical relationship mining provided by the present invention can be applied to any device with data processing capabilities. The any device with data processing capabilities can be a device or apparatus such as a computer. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a logically meaningful device, it is formed by the processor of any device with data processing capabilities where it is located reading the corresponding computer program instructions in the non-volatile memory into the memory for operation. From the hardware level, as Figure 4 shown, it is a hardware structure diagram of any device with data processing capabilities where the personalized recommendation device based on large language models and logical relationship mining provided by the present invention is located. In addition to Figure 4 the processor, memory, network interface, and non-volatile memory shown, any device with data processing capabilities where the device in the embodiment is located usually also includes other hardware according to the actual functions of the any device with data processing capabilities, which will not be elaborated here.

[0105] The specific implementation processes of the functions and roles of each unit in the above device are specifically described in the implementation processes of the corresponding steps in the above method, which will not be elaborated here.

[0106] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiments described above are only illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the present invention. Those of ordinary skill in the art can understand and implement it without creative work.

[0107] An embodiment of the present invention also provides a computer-readable storage medium, on which a program is stored. When the program is executed by a processor, a personalized recommendation method based on large language models and logical relationship mining in the above embodiment is implemented.

[0108] The computer-readable storage medium may be an internal storage unit of any device with data processing capabilities described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium may also be an external storage device of any device with data processing capabilities, such as a plug-in hard disk, a Smart Media Card (SMC), an SD card, a Flash Card, etc. equipped on the device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of any device with data processing capabilities. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and may also be used to temporarily store data that has been output or will be output.

[0109] The present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, the personalized recommendation method based on large language models and logical relationship mining is implemented.

[0110] After considering the specification and practicing the content disclosed herein, those skilled in the art will readily think of other implementation manners of the present application. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include common general knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present application are pointed out by the claims.

[0111] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. The present application is not limited to the precise structure already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.

Claims

1. A personalized recommendation method based on large language models and logical relationship mining, characterized in that, The method includes the following steps: S1. Extract relationship pairs of the user-item interaction bipartite graph through closed-loop detection, and construct a logical relationship set; S2. Generate an initial rule set according to the closed-loop paths in the user-item interaction bipartite graph, construct a natural language description based on the logical relationships, output it to a large language model to generate a rule set and merge it with the initial rule set to obtain an extended rule set; S3. Use confidence to filter the rules in the extended rule set to generate an enhanced rule set; S4. Construct a demand-aware recommendation model. The implementation process of the model includes: fusing the enhanced rule set and the user-item interaction bipartite graph to obtain a complete enhanced graph, and learning the embeddings of users and items based on the enhanced graph; using the embeddings of users and items as historical interaction preferences to calculate the similarity of the fused logical relationships between users and items; S5. Optimize the model parameters according to the binary cross-entropy loss, and perform recommendations using the user-item similarity ranking obtained by the optimized model.

2. The personalized recommendation method based on large language model and logical relationship mining according to claim 1, characterized in that The closed-loop detection for extracting relationship pairs of the user-item interaction bipartite graph specifically includes: constructing a user-item interaction bipartite graph; U is the set of user nodes, i ∈ I is the set of item nodes, and E is the set of interaction edges; extracting high-order relationship pairs (i1, i2) through closed-loop detection The calculation formula for the closed-loop detection to extract high-order relationship pairs is: That is, when two items are often co-purchased by the same group of users, there is an implicit "co-purchase" logical relationship between these two items, which reflects the shared interaction between users u1 and u2, indicating the existence of a meaningful co-purchase association.

3. The personalized recommendation method based on large language models and logical relationship mining according to claim 1, characterized in that, The construction of the logical relationship set includes: Count the co-occurrence frequencies of the high-order relationship pairs, retain the top K relationships, and combine them with the existing relationship set of the heterogeneous graph to obtain the final user-driven logical relationship set R.

4. The personalized recommendation method based on large language models and logical relationship mining according to claim 1, wherein The generation of the initial rule set according to the closed-loop paths in the user-item interaction bipartite graph includes: using the breadth-first search technique to identify the closed-loop path p in the graph, where the path is defined as a sequence of relationships {p: r1, r2,..., r n →r}, which forms a higher-order connection, emphasizing how different relationships are logically related, where the relationship r ∈ R; that is, a path {p1: series(r1), genre(r2) → genre(r2)}, where r2 represents the target rule to be inferred, r1 and r2 represent the supporting relationships, and the target rules inferred from all the closed-loop paths p form the initial rule set S.

5. The personalized recommendation method based on large language model and logical relationship mining according to claim 1, wherein The construction of a natural language description based on the logical relationships, output to a large language model to generate a rule set and merge it with the initial rule set is specifically: Convert the relationships in each rule in the initial rule set into human-readable natural language sentences, then put the expressed rules, together with the user-driven logical relationships, into a designed prompt template, and input them into the large language model to generate an additional extended rule set, and merge it with the initial rule set to obtain an extended rule set.

6. The personalized recommendation method based on large language models and logical relationship mining according to claim 1, wherein, The rule screening of the extended rule set using confidence is specifically as follows: calculate the confidence score of the rule to evaluate the quality of each rule r; For rule screening, retain the rules with a confidence score exceeding 0.9 to form the final enhanced rule set S*, and the calculation of the confidence score includes: where r(x, y) indicates that entity x is connected to entity y through rule r; the numerator of the calculation formula represents the number of relationships that are satisfied simultaneously with r(x, y) in the extended rule set, and the denominator of the calculation formula represents all possible instances that satisfy r1, r2,..., r n The number of relationships that are satisfied simultaneously with r(x, y), and the denominator of the calculation formula represents all possible instances that satisfy r1, r2,..., r n All possible instances.

7. An individualized recommendation method based on large language models and logical relationship mining according to claim 1, characterized in that The calculation of the similarity of the fused logical relationships between users and items includes: Among them To measure the direct similarity between user and item embeddings, f(F u,v ; S * ) incorporates the logical relationship derived from the optimized rule set S*; f is a single-layer feedforward network with a softmax activation function; σ(·) represents the sigmoid function, ensuring that the output is a probability score.

8. The personalized recommendation method based on large language model and logical relationship mining according to claim 1, characterized in that The optimization of the model parameters according to the binary cross-entropy loss is specifically: minimizing the binary cross-entropy loss of positive and negative user-item pairs, and the calculation formula of the binary cross-entropy loss is as follows: where y uv ∈ {0, 1} indicates whether user u has an interaction with item v, represents the set of all training pairs, and sim uv represents the similarity.

9. A personalized recommendation device based on large language models and logical relationship mining, including a memory and one or more processors, wherein executable code is stored in the memory, characterized in that, When the processor executes the executable code, it implements a personalized recommendation method according to any one of claims 1-8, which is based on a large language model and logical relationship mining.

10. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements a personalized recommendation method according to any one of claims 1-8, which is based on a large language model and logical relationship mining.

Citation Information

Cited By

  • Personalized recommendation method and system based on large model

    CN120804432A

  • Personalized intelligent recommendation method and system based on large language model

    CN120873294A