Logic center graph reasoning recommendation method based on large language model induced semantic rules
By generating rule sets offline using a frozen large language model and combining intersection and union operators for logical reasoning, this approach solves the problems of high rule planning costs and insufficient semantic grounding capabilities in existing recommendation systems, achieving efficient personalized recommendations and long-tail user preference capture.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SUZHOU UNIV
- Filing Date
- 2026-02-09
- Publication Date
- 2026-06-19
AI Technical Summary
In existing recommendation systems, the logic-centered approach relies on predefined rules, which has high planning costs and limited coverage, and lacks semantic grounding capabilities. Directly incorporating large language models into the training process is also costly and difficult to effectively guide recommendation decisions.
By using a frozen large language model, a rule set is generated offline from text metadata, a heterogeneous recommendation graph is constructed and logical reasoning is performed, node representations are updated by combining intersection and union operators, the final user representation is generated, and personalized recommendations are generated based on matching scores.
It reduces the cost of rule planning, expands the semantic coverage, can capture the preferences of long-tail users, and improves the accuracy and interpretability of recommendations.
Smart Images

Figure CN122242719A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, specifically to a logical central graph reasoning and recommendation method based on semantic rules induced by a large language model. Background Technology
[0002] Recommender systems are a fundamental technology for personalized information retrieval on large-scale online platforms. By ranking and filtering items, they provide users with tailored choices, thus alleviating information overload. Traditional collaborative filtering methods learn from historical interactions, with matrix factorization becoming the dominant paradigm due to its efficiency and scalability. Building on this, deep learning further advances recommender systems by learning representations from heterogeneous signals through neural networks. Among them, graph neural network recommenders model the relationship structure between users and items, constructing graph structures using additional entities such as attributes and tags. This supports multi-hop dependency modeling and alleviates data sparsity through high-order path propagation. Although graph neural network recommenders have demonstrated excellent empirical performance, their preference modeling essentially simplifies the results of message passing to implicit vector matching. The generated similarity scores mask the underlying reasoning, making the decision-making process difficult to interpret. To reduce opacity, logic-based recommender systems introduce explicit combinatorial operators for symbolic relation learning and utilize structured representations such as box embeddings to achieve set-based operations that are naturally aligned with symbolic logic.
[0003] However, existing logic-centric recommendation methods have the following shortcomings: First, they rely on predefined rules or manually designed logic templates, resulting in high rule planning costs and limited coverage. The reasoning basis appears rigid and fails to reflect the long-tail semantics in user behavior. Second, they lack semantic grounding. Although text metadata is rich, it is rarely formalized into explicit rules that directly participate in reasoning. Existing methods usually compress text into static embeddings, failing to fully utilize its structuring potential. Furthermore, while large language models excel at semantic extraction, directly incorporating them into end-to-end recommendation training is extremely costly. Existing methods treat their output as frozen priors, but the extracted semantics are rarely combined with implicit feedback-supervised reasoning mechanisms, making it difficult to effectively guide recommendation decisions. Summary of the Invention
[0004] In view of the above-mentioned problems, the present invention is proposed.
[0005] To address the aforementioned technical problems, this invention provides the following technical solution: a logical center graph reasoning recommendation method based on semantic rules induced by a large language model, comprising:
[0006] Acquire user interaction data, text metadata, and tag vocabulary, and offline induce the generation of rule sets from the text metadata using a frozen large language model;
[0007] A heterogeneous recommendation graph is constructed based on the tag vocabulary, the interaction data, and the rule set; the heterogeneous recommendation graph includes user nodes, item nodes, tag nodes, and rule tag nodes;
[0008] The text embeddings of each node are obtained by freezing the large language model and fused with the type-gated embeddings of trainable identifiers to generate initial node representations. At the same time, rule-derived user representations are generated by aggregating the rule set.
[0009] Logical reasoning is performed on the heterogeneous recommendation graph based on box embedding representation. In each layer of reasoning, the box embeddings of the node neighborhood are aggregated by intersection and union operators to update the node representation. After the reasoning is completed, the graph reasoning representation of the user node is fused with the rule-derived user representation to generate the final user representation.
[0010] A matching score is calculated based on the intersection volume between the end-user representation and the candidate item representation, and a personalized recommendation result is generated based on the matching score.
[0011] As a preferred embodiment of the logical center graph reasoning recommendation method based on large language model-induced semantic rules described in this invention, the method of generating a rule set offline from the text metadata through a frozen large language model includes constructing structured prompt words, wherein the structured prompt words include user metadata, a tag vocabulary, rule quantity constraints, tag cardinality constraints, and output format requirements.
[0012] The structured prompts are input into the frozen large language model to obtain a structured output containing multiple candidate rules. Each candidate rule includes a natural language description of the preference pattern, a rule label, a rule type, and a confidence score. The structured output is then post-processed to generate a rule set.
[0013] The rule set is quality-verified based on the interaction data, and the empirical support and hit indicator for each rule are calculated.
[0014] As a preferred embodiment of the logical center graph reasoning recommendation method based on large language model-induced semantic rules described in this invention, the construction of a heterogeneous recommendation graph based on the tag vocabulary, the interaction data, and the rule set includes constructing user nodes, item nodes, tag nodes, and rule tag nodes based on the tag vocabulary, the interaction data, and the rule set.
[0015] Based on the interaction data, a user-project interaction edge is established between the user node and the project node;
[0016] Establish project-tag edges between project nodes and tag nodes based on the project's tag information;
[0017] Based on the rule label of each rule in the rule set, user-rule label edges are established between user nodes and corresponding rule label nodes, forming a heterogeneous recommendation graph containing different types of nodes and different types of edges.
[0018] As a preferred embodiment of the logical center graph reasoning recommendation method based on semantic rules induced by a large language model according to the present invention, the generation of initial node representation includes obtaining text embeddings of each node in the heterogeneous recommendation graph through the encoder of the frozen large language model; wherein, item nodes and tag nodes use names and metadata as input text, and user nodes use concatenated induced rule texts as input text;
[0019] Type-specific linear projection is used to map the text embeddings of nodes of different types to a unified dimension;
[0020] Initialize a trainable identifier embedding for each node, and generate center parameters and offset parameters for box embeddings based on the trainable identifier embeddings; the offset parameters are ensured to be non-negative by modifying the linear unit function;
[0021] For each node, the mapped text embedding and the central parameter are weighted and fused using type-specific scalar gating parameters to generate an initial node representation.
[0022] As a preferred embodiment of the logical center graph reasoning and recommendation method based on large language model-induced semantic rules described in this invention, wherein: generating rule-derived user representations based on the rule set aggregation includes, for each user node, obtaining a set of rule tag nodes associated through the user-rule tag edge;
[0023] The box embedding center parameters of each rule tag node in the rule tag node set are aggregated to generate a central representation of the rule-derived user representation;
[0024] The offset parameters of the box embedding of each rule tag node in the rule tag node set are aggregated and processed by the modified linear unit function to generate the rule offset representation of the rule-derived user representation; the center representation and the rule offset representation of the rule-derived user representation together constitute the rule-derived user representation.
[0025] As a preferred embodiment of the logical center graph reasoning recommendation method based on large language model-induced semantic rules described in this invention, the following is included: logical reasoning of the heterogeneous recommendation graph based on box embedding representation includes, for the box embeddings to be aggregated, when calculating the intersection box embedding, calculating the attention weight of the center of each box embedding through a multilayer perceptron, using the attention weight to perform a weighted summation of the centers of each box embedding to obtain the center of the intersection box embedding, and simultaneously taking the minimum value of the offset of each box embedding element to obtain the offset of the intersection box embedding;
[0026] For the box embeddings to be aggregated, when calculating the union box embedding, attention weights are calculated for the center of each box embedding through a multilayer perceptron. The attention weights are then used to perform a weighted summation of the centers of each box embedding to obtain the center of the union box embedding. At the same time, the offset of each box embedding is obtained by taking the maximum value of each element.
[0027] For users, the user nodes are first aggregated using the intersection operator based on the box embedding of the project nodes associated with the user-project interaction edge. Then, the user nodes are aggregated using the union operator based on the box embedding of the tag nodes associated with the user nodes. Finally, the aggregation results of the intersection operator and the aggregation results of the union operator are fused using the intersection operator to obtain the user node representation based on graph reasoning.
[0028] After reasoning, the user node representation based on graph reasoning and the rule-derived user representation are weighted and fused by linear interpolation to obtain the final user representation.
[0029] As a preferred embodiment of the logical center graph reasoning recommendation method based on semantic rules induced by a large language model according to the present invention, the method for generating personalized recommendation results based on the matching score includes: sorting candidate items according to the matching score to generate a recommendation list; for target items recommended to the target user in the recommendation list, retrieving the rule with the maximum overlap with the tag set of the target item from the rule set of the target user; when multiple rules have the same overlap, selecting one based on a calibration confidence score; the calibration confidence score is based on the confidence score estimated by the frozen large language model and calibrated using the empirical support and the hit indicator.
[0030] The rule text retrieved according to the selected rule, the calibration confidence score, and the tags matching the target item are used as the rule-based interpretation; at the same time, the matching score between each tag node in the heterogeneous recommendation graph and the target user and the target item are calculated, and the tag node with the highest score is selected as the tag evidence interpretation; the rule-based interpretation and the tag evidence interpretation are presented together with the recommendation list.
[0031] A logical center graph reasoning recommendation system based on semantic rules induced by a large language model, wherein:
[0032] The rule-inducing module acquires user interaction data, text metadata, and tag vocabulary, and offline induces the generation of rule sets from the text metadata using a frozen large language model;
[0033] The heterogeneous recommendation module constructs a heterogeneous recommendation graph based on the tag vocabulary, the interaction data, and the rule set; the heterogeneous recommendation graph includes user nodes, item nodes, tag nodes, and rule tag nodes;
[0034] The embedding initialization and fusion module obtains the text embeddings of each node through the frozen large language model, and performs type-gated fusion with the trainable identifier embeddings to generate the initial node representation. At the same time, it aggregates and generates rule-derived user representations based on the rule set.
[0035] The graph reasoning module performs logical reasoning on the heterogeneous recommendation graph based on box embedding representation. In each layer of reasoning, the box embeddings of the node neighborhood are aggregated through intersection and union operators to update the node representation. After the reasoning is completed, the graph reasoning representation of the user node is fused with the rule-derived user representation to generate the final user representation.
[0036] The recommendation result generation module calculates a matching score based on the intersection volume between the end user representation and the candidate item representation, and generates personalized recommendation results based on the matching score.
[0037] A computer device includes: a memory and a processor; the memory stores a computer program, wherein: when the processor executes the computer program, it implements the steps of the method described in any one of the present invention.
[0038] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of the present invention.
[0039] The beneficial effects of this invention are as follows: This invention automatically induces semantic preference rules from text metadata through a frozen large language model, and combines this with interaction data for quality verification and confidence calibration, realizing a shift from relying on manual rule templates to automated rule generation, effectively reducing rule planning costs, expanding semantic coverage, and capturing long-tail user preference patterns. In the node representation learning stage, type gating combines frozen text embeddings with trainable label embeddings, preserving the rich semantic priors contained in the large language model while ensuring the model's adaptability in sparse interaction scenarios, achieving effective complementarity between semantic and structural information. A logical central graph reasoning network with rule injection is constructed. Intersection and union operators are used to perform combined reasoning on user, item, tag, and rule tag nodes in the heterogeneous recommendation graph, generating rule- and tag-based explanations. This accurately models the logical combination characteristics of user preferences, improving recommendation accuracy. Attached Figure Description
[0040] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is an overall flowchart of the logical center graph reasoning and recommendation method based on semantic rules induced by a large language model, provided in an embodiment of the present invention.
[0042] Figure 2 This is an overall architecture diagram of the logical center graph reasoning and recommendation method based on semantic rules induced by a large language model, provided in an embodiment of the present invention.
[0043] Figure 3 A computer device diagram illustrating the logical center graph reasoning and recommendation method based on semantic rules induced by a large language model, as provided in an embodiment of the present invention. Detailed Implementation
[0044] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0045] Example 1, referring to Figures 1-3 As an embodiment of the present invention, a logical center graph reasoning recommendation method based on semantic rules induced by a large language model is provided, comprising:
[0046] In this embodiment, as Figure 2 The diagram illustrates the overall architecture of the framework proposed in this invention, which mainly includes offline rule induction from text metadata and logic-centered graph reasoning for recommendation. First, a frozen large language model is used as an offline generator to induce user-level semantic rules with confidence levels from text metadata, and these rules are fused with identification information to initialize node representations. Then, a heterogeneous recommendation graph containing user, item, tag, and rule nodes is constructed, and logic-centered graph reasoning is performed on the graph using intersection and union operators based on box embedding. Finally, a recommendation list and interpretable output based on rules and tags are generated based on the reasoning results, thereby achieving a deep integration of generative semantic understanding and symbolic logic reasoning.
[0047] S1: Obtain user interaction data, text metadata, and tag vocabulary, and generate a rule set offline from the text metadata using a frozen large language model.
[0048] In this embodiment, the implementation of the logic-centric graph reasoning recommendation method relies on the accurate acquisition and effective representation of symbolic rules. By extracting semantic information from text metadata and formalizing it into structured rules, interpretable semantic constraints are provided for the subsequent graph reasoning network. The acquired rules not only need to accurately reflect the user's preference patterns, but also need to be consistent with the user's actual interaction behavior. These rules together constitute the basic input for logical reasoning. In the recommendation system, text metadata contains rich semantic clues about user preferences and item features, which can reveal the deep reasons for user preferences and detailed descriptions of item features. However, text metadata usually exists in free-format text. Directly injecting free-format text into graph learning usually produces implicit and difficult-to-interpret signals. Therefore, this embodiment converts text metadata into a set of compact symbolic rules, which not only reveals interpretable semantic evidence, but can also be directly used by a lightweight reasoning network without training or fine-tuning a large language model (LLM). In addition, it solves a key limitation of previous logic-based recommendation systems: that is, the reasoning module usually relies on manually specified rule forms or predefined reasoning templates, which not only limits flexibility, but also makes it difficult to incorporate constantly evolving semantic concepts and long-tail labels.
[0049] To transform text metadata into actionable symbolic rules, a model with strong semantic understanding capabilities is needed to analyze and refine the text. This embodiment uses a frozen large language model as an offline generator. The frozen large language model means that the model parameters remain unchanged during the rule induction process without fine-tuning or training. It fully utilizes the general semantic understanding capabilities obtained by the large language model in the pre-training stage, and can summarize structured symbolic rules from unstructured text. At the same time, the large language model can generate rule labels that meet the constraints based on a given tag vocabulary, ensuring that the symbolic rules are consistent with the recommendation system. In addition, since frequent calls to the large language model during online inference will bring huge computational overhead and response latency, using an offline method for rule induction can decouple the rule generation process from the recommendation inference process. Rules only need to be regenerated when the data is updated, and the stored rule set can be used directly in the inference stage, thereby ensuring the real-time performance and scalability of the system.
[0050] Specifically, obtaining user interaction data, text metadata, and tag vocabulary includes the following steps:
[0051] First, acquire user interaction data, i.e., observed implicit feedback interactions. (or equivalently represented as a binary interaction matrix) ),in Represents a set of users. Represents a collection of items. Indicates user Already with the project Interaction occurs; simultaneously, text metadata associated with each user and project is retrieved, denoted as... and For example, profile information, titles, descriptions, and comments; further, obtain a tag thesaurus or attribute thesaurus, where tags It can be linked to users or projects as additional side information. This is a list of tag terms.
[0052] In this embodiment, the large language model is used offline to induce symbol rules from text metadata, and the generated rule labels constitute a set. And each user A subset (or multiple sets) of rule labels. Related, therefore given the observed interactions With available side information (text metadata and rule labels), the goal of this embodiment is to learn a scoring function. This is used to estimate user preferences and generate personalized rankings of candidate items for each user.
[0053] Furthermore, before inducing rule-based behavior, the representation of the rules is defined, where for each user... The rule generator outputs a set of rules. Each of the rules Represented as a quadruple, the specific formula is as follows:
[0054]
[0055] in, A natural language description of the inferred preference pattern; For the associated tag set (used as rule tags); Does the corresponding rule express a strong preference or a trial-and-error preference? This represents the confidence level estimated by the large language model.
[0056] Furthermore, the offline generation of a rule set from the text metadata via a frozen large language model includes the following steps: given user metadata and tag word list The system prompts a freeze instruction to follow the large language model to generate a small number of candidate rules in a structured pattern. In this embodiment, the large language model acts as an offline generator, extracting all rules of each dataset only once and storing them locally. When the underlying data or label vocabulary is updated, the pipeline can be rerun to refresh the rule labels without modifying the inference network.
[0057] Specifically, firstly, a structured prompt word is constructed, which includes user metadata, a tag word list, rule quantity constraints, tag cardinality constraints, and output format requirements; the structured prompt word is required to output in JSON format, and the core instructions include: (1) inferring preference rules; (2) providing a tag word list. and user metadata (3) Number of constraint rules and cardinality of tags; (4) Format requirements: return quadruples .
[0058] For example, structured prompts are as follows: Instruction: Infer the most... Preference rules. Context: User metadata and tag word list Constraints: Each rule contains 1 to 100 rules. One from the tag word list The tags are defined and include confidence levels. Output: A JSON list containing the fields text, tags, type, and confidence.
[0059] It should be noted that the large language model is guided to generate rules that meet specific format and quality requirements through explicit instructions and constraints. The provision of a tag vocabulary as a constraint ensures that the generated rule tags come from a predefined vocabulary, which facilitates subsequent normalization processing. The mandatory JSON output format simplifies the subsequent parsing and processing flow.
[0060] Furthermore, the structured prompts are input into the frozen large language model to obtain a structured output containing multiple candidate rules. Each candidate rule includes a natural language description of the preference pattern, a rule label, a rule type, and a confidence score. Specifically, due to the use of JSON format constraints, the output returned by the large language model is a list of rules, with each rule containing a four-tuple. .
[0061] It should be noted that freezing the parameters means that the parameters of the large language model are not used in training, but only as an offline inference tool. Freezing the model parameters avoids the computational overhead required for fine-tuning the large language model in recommendation tasks, while maintaining the quality of rule generation. The semantic understanding capability of the large language model is used to automatically extract structured rules from unstructured text without the need for careful planning by human experts. The generated rules cover rich semantic concepts and long-tail labels, overcoming the limitation of the limited coverage of predefined rules. Executing the rule generation offline decouples it from the online recommendation process, ensuring the response efficiency of the recommendation system.
[0062] Furthermore, to reduce noise, this embodiment performs lightweight post-processing on the structured output to generate a rule set, specifically including the following steps: First, the rule labels are normalized to the corresponding label IDs to ensure that the rule labels have a consistent representation with the label nodes used in subsequent graph reasoning; second, invalid labels are discarded to ensure that the generated rules only use predefined labels and avoid introducing noisy labels; finally, duplicate rules mapped to the same label set are deduplicated to reduce redundancy and make the rule set more compact.
[0063] Furthermore, to ensure that the induced rules reflect the user's true preferences, the rule set is quality-verified based on the interaction data, and the empirical support and hit indicator for each rule are calculated; specifically, let For users The collection of projects that have been interacted with For the project Tag set, rules Compared to users The experience support score is defined as follows:
[0064]
[0065] in, For rules Compared to users Experience support score; For users The collection of projects that have been interacted with; For the project The set of tags; For the associated tag set (used as rule tags).
[0066] The binary hit indicator is defined as:
[0067]
[0068] in, For rules Compared to users The binary hit indicator; For users The collection of projects that have been interacted with; For the project The set of tags; For the associated tag set (used as rule tags).
[0069] Rule quality is validated based on empirical support scores or hit indicators. Lower or hit indicator Rules that are deemed unreliable are weighted less reliably when selecting and presenting rule-based interpretations, using empirical support scores and hit indicators, for example, for hit indicators. The rules, while retained, will be subject to a lower bound during the subsequent interpretation and generation phases. Discounted.
[0070] It should be noted that, compared with traditional predefined rule methods, this approach automatically induces rules through a large language model, eliminating the need for meticulous rule planning by human experts. It can automatically extract semantic rules from text metadata, making it suitable for large-scale recommendation systems. The generated rules cover rich semantic concepts and long-tail tags, reflecting real-world user behavior preference patterns and overcoming the limited coverage of predefined rules. Offline rule induction decouples rule generation from the online recommendation process, maintaining the modularity and computational efficiency of the recommendation system. When data is updated, only the rule induction pipeline needs to be rerun, without modifying the inference network. Post-processing and quality verification mechanisms ensure that the generated rule set is both semantically rich and supported by interactive evidence, balancing rule coverage and reliability. Transforming free-format text metadata into a compact set of symbolic rules reveals interpretable semantic evidence and can be directly used by a lightweight inference network without training or fine-tuning the large language model, laying the foundation for subsequent heterogeneous graph construction, logical reasoning, and interpretation generation.
[0071] S2: Construct a heterogeneous recommendation graph based on the tag vocabulary, the interaction data, and the rule set; the heterogeneous recommendation graph includes user nodes, item nodes, tag nodes, and rule tag nodes.
[0072] In this embodiment, in order to fully utilize the rule set induced in step S1 and to integrate user interaction data, item tag information, and semantic rules into a computable graph structure, a heterogeneous recommendation graph needs to be constructed to unify interaction signals, side information links, and induced rule tags, thereby enabling graph-based reasoning. This graph includes not only user nodes and item nodes in the recommendation system but also tag nodes and rule tag nodes, thus embedding explicit semantic information and symbolic rules into the graph structure. This provides a structured graph representation for subsequent logical reasoning, enabling the recommendation system to perform interpretable reasoning on the graph structure while preserving semantic evidence of user preferences.
[0073] Specifically, constructing a heterogeneous recommendation graph based on the tag vocabulary, the interaction data, and the rule set includes the following steps: constructing a heterogeneous recommendation graph based on the tag vocabulary, the interaction data, and the rule set. User nodes, project nodes, tag nodes, and rule tag nodes; where a node set is defined as... , For edge set, user set Corresponding to user nodes; project collections Corresponding to project nodes; tag list Corresponding to tag nodes or attribute nodes; rule tag collection This corresponds to the rule tag node.
[0074] Furthermore, edge set Specifically, this includes: establishing a user-project interaction edge between user nodes and project nodes based on the interaction data. .
[0075] Based on the project's tag information, establish a project-tag edge between project nodes and tag nodes.
[0076] Based on the rule label of each rule in the rule set, user-rule label edges are established between user nodes and corresponding rule label nodes, forming a heterogeneous recommendation graph containing different types of nodes and different types of edges.
[0077] For nodes The neighborhood is denoted as Its degree is recorded as In this embodiment, the following is used: Representing heterogeneous recommendation graphs The (block) adjacency matrix, This represents the angle matrix, which enables the inference network to pass through heterogeneous recommendation graphs. Messages are passed on to each other, and the interaction signals are integrated with the rule labels induced by the large language model.
[0078] It should be noted that, addressing the problem that traditional recommendation graphs only contain user nodes and item nodes, lacking explicit modeling of item attribute features and user preference rules, leading to difficult-to-interpret recommendation results and ineffective utilization of semantic information, a heterogeneous recommendation graph is constructed. This organically integrates interaction data, tag information, and semantic rules into a unified graph structure. Firstly, by introducing tag nodes and item-tag edges, the content features of items are explicitly encoded into the graph structure, enabling the graph reasoning network to perform matching and reasoning based on semantic information, thus enhancing recommendation accuracy. Secondly, by introducing rule tag nodes and user-rule tag edges, the rule tags induced in step S1 are embedded into the graph structure, allowing user preference patterns to play a guiding role in the graph reasoning process, achieving rule-based logical reasoning. Thirdly, the heterogeneous graph structure retains semantic evidence of user preferences, laying the foundation for generating interpretable recommendation results. Finally, the various types of nodes and edges enable the graph reasoning network to perform multi-hop, multi-path logical reasoning, fully exploring the relationships between users, items, tags, and rules, and improving the expressive and reasoning capabilities of the recommendation system.
[0079] S3: Obtain the text embeddings of each node through the frozen large language model, and perform type gating fusion with the trainable identifier embeddings to generate the initial node representation. At the same time, generate the rule-derived user representation based on the rule set.
[0080] In this embodiment, in order to support subsequent logic-centered graph reasoning, it is necessary to generate initial representations for each node in the heterogeneous recommendation graph constructed in step S2. Logic-centered reasoning requires node embeddings to have both semantic meaning and task adaptability. The generated node representations must contain rich semantic information and be able to adapt to the specific goals of the recommendation task. At the same time, in order to explicitly inject the induction rules in step S1 into the user representation, it is also necessary to generate rule-derived user representations based on rule set aggregation, thereby providing an input basis for subsequent logical reasoning.
[0081] In recommender systems, purely ID-based embeddings perform poorly under sparse interactions, especially for long-tail users and cold-start projects, where insufficient interaction data makes it difficult to train ID embeddings adequately. While pure text embeddings can provide rich semantic information, they may not be consistent with the recommendation goals and cannot directly optimize recommendation performance. Therefore, this embodiment uses a text embedding initialization representation derived from a frozen large language model and uses lightweight type gating to fuse the derived text embedding initialization representation with trainable ID embeddings. This preserves the semantic prior of the text and can adapt to the recommendation task through trainable parameters.
[0082] Specifically, the process of obtaining the text embeddings of each node through a frozen large language model and performing type-gated fusion with the trainable identifier embeddings to generate the initial node representation includes the following steps:
[0083] First, for each node in the heterogeneous recommendation graph Text embeddings are obtained through the encoder of a frozen large language model. ; where project nodes and tag nodes use their names and metadata as input text; for user nodes, the input text is the concatenated rule text induced for the user in step S1.
[0084] Due to the frozen text embeddings output by the large language model The dimension may not match the embedding dimension required by the subsequent inference network. In this embodiment, type-specific linear projection is used to map the text embeddings of different types of nodes to a unified dimension. The specific formula is as follows:
[0085]
[0086] in, This is the mapped text embedding vector; This is the transformation matrix for different nodes; Embedded text.
[0087] Further, a trainable identifier embedding is initialized for each node, and the center parameters and offset parameters of the box embedding are generated based on the trainable identifier embedding; the offset parameters are ensured to be non-negative by modifying the linear unit function; specifically, each node... It also has a trainable identifier embedding. Since subsequent logical reasoning is based on box embedding representation, each node needs to be represented by a hyperrectangular box. The hyperrectangular box is defined by a center parameter and an offset parameter. Therefore, this embodiment uses the center parameter... and offset parameters The two parameters form a box space to represent each node, where the offset parameter... By correcting the linear unit function Ensure that the value is non-negative.
[0088] It should be noted that box embedding defines a hyperrectangular region using a center parameter and an offset parameter. The center parameter represents the position of the box, and the offset parameter represents the size or uncertainty of the box. Ensuring that the offset parameter is non-negative by modifying the linear unit function is a necessary constraint for box embedding representation, because negative offsets are geometrically meaningless and would lead to an invalid box definition. The offset parameter is generated from the label embedding through a trainable transformation, rather than being directly initialized, so that the offset can be adjusted according to task requirements to reflect the uncertainty or diversity of nodes.
[0089] Furthermore, for each node, the mapped text embedding and the center parameter are weighted and fused using type-specific scalar gating parameters to generate an initial node representation, i.e., the text center and the identifier center are fused using scalar gating, as shown in the following formula:
[0090]
[0091] in, This is the initial node representation; For the Sigmoid function; To enable the model to adaptively rely on semantic or ID information in order to learn for different node types; For trainable identifier embeddings.
[0092] It should be noted that using type-specific gating parameters allows different types of nodes to select different fusion strategies based on their characteristics. For example, for project nodes with rich text information, the model may learn higher text weights, while for user nodes with sufficient interaction data, the model may learn higher label weights. The node representation retains the semantic priors from the large language model and can adapt to the supervision signals of the recommendation task through trainable label embeddings. In sparse interaction scenarios, text embeddings provide effective semantic supplementation, alleviate the problem of insufficient training of label embeddings, and improve the robustness and generalization ability of the model.
[0093] Furthermore, in order to inject the induced rules from step S1 as semantic constraints into the user representation, and to generate rule-derived user representations based on the rule set, the following steps are specifically included: obtaining the set of rule label nodes associated through the user-rule label edge. The box embedding center parameters of each rule tag node in the rule tag node set are aggregated to generate the central representation of the rule-derived user representation. The specific formula is as follows:
[0094]
[0095] in, The central representation for user representation derived from rules; A collection of rule tag nodes; For rule label nodes; For the first The central parameter of each rule label node.
[0096] The offset parameters of the box embedding of each rule tag node in the rule tag node set are aggregated and processed by a modified linear unit function to generate the rule offset representation of the rule-derived user representation. The specific formula is as follows:
[0097]
[0098] in, The rule offset representation for deriving user representations from rules; A collection of rule tag nodes; For rule label nodes; For the first The offset parameter of each rule label node.
[0099] Finally, the central representation and the rule offset representation of the user representation derived from the rules together constitute the rule-derived user representation.
[0100] It should be noted that, addressing the issues in traditional recommendation methods where node representation either relies on sparse interactions leading to cold start problems or uses general text embeddings resulting in task incompatibility, this paper combines the semantic priors of frozen large language models with trainable label embeddings through type gating. This achieves task-adaptive optimization while preserving rich semantic information. Especially in sparse interaction scenarios, text embeddings provide effective semantic supplementation for long-tail nodes, improving the robustness of the model. Secondly, by employing box embedding representation, nodes are represented as hyperrectangular regions with centers and offsets, providing natural support for subsequent logical reasoning operations. This enables the recommendation system to perform symbolic combinatorial reasoning through geometric intersection and union operations, achieving a paradigm shift from implicit vector matching to explicit logical reasoning. Thirdly, by aggregating rule-labeled nodes to generate rule-derived user representations, the guiding rules from step S1 are explicitly injected into the user representations. This allows user preference patterns to play a guiding role in graph reasoning, achieving rule-based logical reasoning and enhancing the interpretability of recommendations.
[0101] S4: Logical reasoning is performed on the heterogeneous recommendation graph based on box embedding representation. In each layer of reasoning, the box embeddings of the node neighborhood are aggregated by the intersection operator and the union operator to update the node representation. After the reasoning is completed, the graph reasoning representation of the user node is fused with the rule-derived user representation to generate the final user representation.
[0102] In this embodiment, to fully utilize the heterogeneous recommendation graph structure constructed in step S2 and the initial node representation and rule-derived user representation generated in step S3, logical reasoning needs to be performed on the graph structure to update the node representation. However, although graph convolution can capture high-order collaborative filtering patterns, the standard message passing mechanism lacks explicit operators to model combinatorial relation constraints. Therefore, this embodiment adopts a box-embedding-based logical reasoning method. By using the reasoning network to represent each node as a hyperrectangle (Box), and using logical operations simulating set intersection and union operations to update the hyperrectangle, the recommendation system can perform explicit logical combinatorial reasoning, shifting from implicit vector matching to explicit logical reasoning, thereby realizing the application of logical reasoning on the heterogeneous recommendation graph. Semantic and rule-aware propagation is carried out on the upper level.
[0103] Specifically, performing logical reasoning on the heterogeneous recommendation graph based on box embedding representation includes the following steps:
[0104] First, for the box embedding constructed in step S3, in the... In the layer, each node Associate a box with an embedded Box ,in As the center vector, This is the offset vector (representing the size or uncertainty of the hyperrectangle).
[0105] Furthermore, referring to hyperrectangle-based inference operators, this embodiment defines intersection and union operations on a set of hyperrectangles. Specifically, for the box embeddings to be aggregated, when calculating the intersection box embedding, attention weights are calculated for the centers of each box embedding using a multilayer perceptron. The centers of each box embedding are then weighted and summed using these attention weights to obtain the center of the intersection box embedding. Simultaneously, the minimum value of the offsets of each box embedding is taken as the element-wise offset to obtain the offset of the intersection box embedding. Specifically, given a set of boxes... Intersection Box The calculation formula is:
[0106]
[0107] in, This refers to the box embedding obtained from the intersection operation, i.e., the intersection box embedding. The center node of the intersection box; For the set of boxes, the first Weights of each box embedding; For the set of boxes, the first Individual box embedding; For the set of boxes, the first The central node is embedded in the box; This represents the number of boxes embedded in the box set. It is an element-wise product; It is a multilayer perceptron; The offset for embedding the intersection box; Execute on an element-by-element basis; For the set of boxes, the first The offset of each box embedding.
[0108] It should be noted that the intersection operator corresponds to the logical conjunction operation, which means that multiple conditions are satisfied at the same time. By taking the minimum value of the offset, the size of the intersection box is constrained to the strictest boundary among all participating boxes, which conforms to the semantics of logical intersection, that is, the intersection region cannot exceed the range of any participating box. Furthermore, by calculating the weighted sum of the centers through the attention mechanism, the model can adjust the aggregation weights according to the importance of different box embeddings, thereby improving the flexibility and accuracy of inference.
[0109] Furthermore, for the box embeddings to be aggregated, when calculating the union box embedding, attention weights are calculated for the centers of each box embedding using a multilayer perceptron. These attention weights are then used to perform a weighted summation of the centers of each box embedding to obtain the center of the union box embedding. Simultaneously, the offset of each box embedding is obtained by taking the maximum value element-wise. Specifically, for the box set... , and set box Similarly, the calculation is performed using the attention mechanism, and the formula is as follows:
[0110]
[0111] in, This refers to the box embedding obtained from the union operation, i.e., the union box embedding. The central node of the union box embedding; For the set of boxes, the first Weights of each box embedding; For the set of boxes, the first Individual box embedding; For the set of boxes, the first The central node is embedded in the box; This represents the number of boxes embedded in the box set. It is an element-wise product; It is a multilayer perceptron; The offset for the union box embedding; Execute on an element-by-element basis; For the set of boxes, the first The offset of each box embedding.
[0112] It should be noted that the union operator corresponds to the logical disjunction operation, which means that at least one of multiple conditions is satisfied. By taking the maximum value of the offset, the size of the union box is expanded to cover the boundaries of all participating boxes, which conforms to the semantics of logical union, that is, the union region needs to contain the range of all participating boxes. Furthermore, by calculating the weighted sum of the centers through the attention mechanism, the model can consider the relative importance of different box embeddings during the aggregation process, thereby enhancing the expressive power of reasoning.
[0113] Furthermore, utilizing the intersection and union operators defined above, this embodiment employs type-aware neighborhood updates in heterogeneous recommendation graphs. Multi-hop inference is performed to fully utilize the semantic information in the heterogeneous graph structure; among which, for users The reasoning process is achieved by finding the intersection of evidence derived from interactions and evidence derived from tags. Specifically, first, the user node is embedded into boxes of the project nodes associated with the user-item interaction edge, and then aggregated using the intersection operator. Next, the user node's associated tag nodes are embedded into boxes, and then aggregated using the union operator. Finally, the results of the intersection and union operators are fused using the intersection operator to obtain the user node representation based on graph reasoning. The specific formula is as follows:
[0114]
[0115] in, For users In the Layered box embedding; For intersection operators; For the project In the Layered box embedding; For users Project neighborhoods are linked through interactive edges; For union operators; For tags In the Layered box embedding; For users Associated label neighborhood.
[0116] Specifically, for users, the intersection of item neighborhoods captures common preference signals supported by historical behavior; while the union of label neighborhoods (including inducing rule labels) preserves a broader semantic prior. The final intersection of the two allows user representations to be both behaviorally based and semantically expressive; for items... Evidence is aggregated by finding the union of its neighborhood; for labels Then, more stringent constraints are imposed through the intersection; after each layer, a modified linear unit function is applied. Ensure the offset is non-negative.
[0117] Furthermore, after After layered inference, the user node representation Box based on graph inference is transformed using linear interpolation. The user representation derived from the aforementioned rules is weighted and fused to obtain the final user representation, which guides the final inference. The specific formula is as follows:
[0118]
[0119] in, This represents the final user center after integration. To adjust the contribution weights between graph structure information and induced rule information; For users go through The central representation after layer diagram reasoning; The central representation for user representation derived from rules; This represents the final user offset after merging. For users go through Offset representation after layer diagram inference; The rule offset representation is derived from the user representation of the rule.
[0120] It should be noted that, addressing the shortcomings of traditional recommendation methods that rely solely on implicit vector matching based on interaction data and lack logical reasoning ability and interpretability, this paper proposes a box-embedding-based logical reasoning method. This method utilizes intersection and union operators to simulate conjunction and disjunction operations in symbolic logic, enabling the recommendation system to perform explicit logical combination reasoning. This represents a paradigm shift from implicit vector matching to explicit logical reasoning. Secondly, through a hierarchical logical combination reasoning approach, the intersection operator is first used to aggregate item nodes, then the union operator is used to aggregate tag nodes, and finally the two are merged. This allows the model to capture user behavior from multiple dimensions. The model captures user preference patterns, reflecting both common characteristics of interactive behaviors and the diversity of semantic interests, thus improving recommendation accuracy. Through multi-layered logical reasoning and multi-hop path reasoning, it fully explores high-order relationships between users, items, tags, and rule tags, enhancing the model's ability to capture actual preference patterns. By fusing graph reasoning representations with rule-derived user representations, it organically combines interactive reasoning based on heterogeneous graph structures with semantic constraints induced by large language models, ensuring both recommendation accuracy and interpretability, and providing a foundation for subsequent matching score calculation and recommendation result generation.
[0121] S5: Calculate the matching score based on the intersection volume between the end user representation and the candidate item representation, and generate personalized recommendation results based on the matching score.
[0122] Furthermore, in order to make personalized recommendations based on the final user representation generated in step S4, a matching mechanism needs to be designed to measure the relevance between users and candidate items. Since users and items have been represented as box embeddings in step S4, this embodiment can naturally use the intersection volume based on box embeddings as the matching score. By utilizing the geometric properties of box embeddings, the degree of matching is measured by calculating the intersection volume of the user box and the item box. The larger the intersection volume, the higher the overlap between user preferences and item features, and the better the matching degree. This not only has intuitive logical semantics, but also provides natural support for generating interpretable recommendation results in the future.
[0123] Specifically, calculating the matching score based on the intersection volume between the end-user representation and the candidate item representation includes the following steps:
[0124] For users and projects By acquiring users Box embedding represents Box and projects Box embedding represents Box The hyperrectangular regions of the user preference space and the item feature space are defined respectively; the matching score between the user and the item is calculated based on the intersection volume of these two box embedding representations, as shown in the following formula:
[0125]
[0126] in, For users With the project The matching score; For users The final box embedding representation; For the project Box embedding representation; This is the function for calculating the volume of a hyperrectangle; For intersection; It is a logarithmic function.
[0127] To train the model to learn accurate user and item representations, the loss function of Bayesian Personalized Ranking (BPR) is optimized, where for each observed interaction... Randomly sample a negative sample The following loss function was calculated:
[0128]
[0129] in, The loss function for Bayesian personalized ranking; For users Already with the project Interaction occurs; For the Sigmoid function; For users With the project The matching score; For randomly sampled negative samples, For users A collection of projects that have been interacted with.
[0130] Secondly, the Adam optimizer is used to minimize the loss function. Once the loss function converges, the optimized model parameters are obtained.
[0131] Furthermore, to prevent overfitting, this embodiment applies to all trainable parameters. Regularization, the specific formula is as follows:
[0132]
[0133] in, This is the loss function after regularization; This is the regularization coefficient, used to control the strength of regularization; Embed a matrix to identify all nodes; This is the offset parameter matrix for all nodes; This is the weight matrix of the multilayer perceptron; It is the square of the L2 norm.
[0134] In this embodiment, the final overall objective function is:
[0135]
[0136] in, This is the final total loss function; The loss function for Bayesian personalized ranking; This is the loss function after regularization.
[0137] It should be noted that, Regularization prevents overfitting of the model on training data by penalizing excessively large parameter values, thereby improving the model's generalization ability on test data and ensuring that all parameters remain within a reasonable range; regularization coefficient The strength of regularization needs to be adjusted according to the specific task and dataset. Too much regularization may lead to underfitting, while too little may not effectively prevent overfitting. By combining the Bayesian personalized ranking loss with the regularization loss, the model maintains a reasonable range of parameters while optimizing ranking performance, thus achieving a balance between performance and generalization ability.
[0138] Furthermore, after the above model training is completed, personalized recommendation results are generated using the optimized model parameters, and interpretable explanations are provided for the recommendation results, specifically including rule-based explanations and label evidence explanations.
[0139] Specifically, generating personalized recommendation results based on the matching score includes the following steps:
[0140] Candidate items are sorted according to the matching scores to generate a recommendation list; items recommended to users are then... Project Based on the rule set derived from the retrieval And select the most relevant rules by maximizing the overlap between rule labels and the project:
[0141]
[0142] in, The most relevant rule to select; To retrieve the rule set that has been summarized; For the associated tag set (used as rule tags); For the project A collection of tags; For rules The calibration confidence level.
[0143] During this process, if cases with the same degree of overlap (breakties) occur, the determination is made using the rule reliability score (the higher the better). The rule reliability score is the confidence level estimated by the large language model using interaction evidence. The calibration process yields the following formula:
[0144]
[0145] in, For rules Calibration confidence level; Confidence level estimated for large language models; For rules Compared to users The binary hit indicator; For rules Compared to users Experience support score; To control the extent of discounting rules with low support; This is a small lower bound value, designed to prevent rule scores without supporting evidence from collapsing to zero; in this embodiment, it is set to... and ; Rule text Its calibrated confidence level Together with the matching tags, they provide a concise and readable explanation.
[0146] Furthermore, the rule text retrieved according to the selected rule, the calibration confidence score, and the label matching the target item are used as the rule-based interpretation; specifically, for the most relevant selected rule... Extract the corresponding rule text Calibration confidence In addition to providing tags that match the target item and offering a concise and readable explanation, this multi-layered explanatory information not only enhances users' trust in the recommendation results but also helps them better understand the logic of the recommendation system.
[0147] Simultaneously, the matching scores of each tag node in the heterogeneous recommendation graph with the target user and the target item are calculated, and the tag node with the highest score is selected as the tag evidence explanation. That is, explanatory tags are identified by measuring the alignment between the tag box and the user box or item box, and the tag with the highest score is selected as the explanatory evidence. The specific formula is as follows:
[0148]
[0149] in, For tags With users and projects Alignment score; For users With tags The matching score; For tags With the project The matching score.
[0150] Finally, the rule-based explanation and the tag evidence explanation are presented together with the recommendation list. That is, when showing the recommendation list to the user, for each recommended item, both the rule-based explanation and the tag evidence explanation are presented simultaneously.
[0151] It should be noted that, addressing the lack of interpretability in traditional recommendation systems and the difficulty for users to understand the recommendation criteria, a matching mechanism based on the intersection volume of box embeddings not only provides intuitive geometric semantics but also lays the foundation for generating multi-dimensional explanations. By calculating the intersection volume of user boxes and item boxes as the matching score, the geometric characteristics of box embeddings are used to naturally characterize the overlap between user preferences and item features. The intersection volume has stronger logical semantics and interpretability, while logarithmic transformation improves numerical stability. By calibrating the confidence level and comprehensively considering the confidence level estimated by the large language model, empirical support, and hit indicators, the generated explanations are ensured to be both semantically reasonable and supported by interactive evidence, avoiding the use of unreliable rules for explanation and improving the quality of explanations and user trust. Furthermore, by optimizing the Bayesian personalized ranking loss function and combining it with... Regularization allows the model to maintain good generalization ability while learning the ranking relationship of user preferences, avoiding overfitting and thus achieving a balance between accuracy and interpretability, providing users with a transparent and trustworthy personalized recommendation experience.
[0152] On the other hand, this embodiment also provides a logical center graph reasoning recommendation system based on semantic rules induced by a large language model, which includes:
[0153] The inducement rule module acquires user interaction data, text metadata, and tag vocabulary, and offline induces the generation of rule sets from the text metadata using a frozen large language model.
[0154] The heterogeneous recommendation module constructs a heterogeneous recommendation graph based on the tag vocabulary, the interaction data, and the rule set; the heterogeneous recommendation graph includes user nodes, item nodes, tag nodes, and rule tag nodes.
[0155] The embedding initialization and fusion module obtains the text embeddings of each node through the frozen large language model, and performs type-gated fusion with the trainable identifier embeddings to generate the initial node representation. At the same time, it aggregates and generates rule-derived user representations based on the rule set.
[0156] The graph reasoning module performs logical reasoning on the heterogeneous recommendation graph based on box embedding representation. In each layer of reasoning, the box embeddings of the node's neighborhood are aggregated using intersection and union operators to update the node representation. After the reasoning is completed, the graph reasoning representation of the user node is fused with the rule-derived user representation to generate the final user representation.
[0157] The recommendation result generation module calculates a matching score based on the intersection volume between the end user representation and the candidate item representation, and generates personalized recommendation results based on the matching score.
[0158] like Figure 3 As shown, if the above functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0159] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0160] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0161] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0162] Example 2, referring to Tables 1 and 2, is an embodiment of the present invention, providing a logical center graph reasoning recommendation method based on semantic rules induced by a large language model. To verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculations and simulation experiments.
[0163] This embodiment conducts extensive experiments on three standard recommendation benchmark datasets: MovieLens, LastFM, and Yelp. Detailed data for these datasets is shown in Table 1 below. MovieLens contains 1651 users and 5381 items; LastFM contains 1808 users and 12212 items; and Yelp is the largest dataset, containing 12471 users and 10363 items. As can be seen from Table 1, the three datasets each have their own characteristics in terms of size and sparsity, comprehensively verifying the performance of this invention in different scenarios.
[0164] Table 1. Detailed Data Table of the Dataset
[0165] Dataset Number of users (#Users) Number of items (#Items) Number of tags (#Tags) Training set (#Train) Validation set (#Val) Test suite (#Test) MovieLens 1651 5381 1586 29466 2302 2303 LastFM 1808 12212 2305 140151 6827 6827 Yelp 12471 10363 1550 429822 49393 64272
[0166] To verify the recommendation performance of the LogGRec framework proposed in this invention, it was compared with several mainstream baseline models, including traditional collaborative filtering methods (BPR, NFM, IFM), graph neural network methods (LightGCN, NGCF), knowledge-aware methods (KGIN, KGRec), and label-aware methods (DSPR, TGCN, LFGCF, BoxGNN). The experiment used hit-oriented (Recall@K) and ranking-sensitive (NDCG@K) as evaluation metrics, where K was set to 10 and 20, respectively. The experimental results are shown in Table 2.
[0167] Table 2 Recommended Performance Comparison Table
[0168] Model MovieLens (R@10) MovieLens(R@20) MovieLens(N@10) MovieLens(N@20) LastFM (R@10) LastFM (R@20) LastFM (N@10) LastFM (N@20) BPR 0.0453 0.0661 0.0320 0.0381 0.0673 0.0978 0.0563 0.0643 NFM 0.0351 0.0608 0.0225 0.0306 0.0762 0.1173 0.0656 0.0768 IFM 0.0338 0.0474 0.0191 0.0232 0.0562 0.0898 0.0412 0.0507 LightGCN 0.0446 0.0724 0.0313 0.0393 0.1020 0.1555 0.0875 0.1002 NGCF 0.0352 0.0592 0.0273 0.0331 0.1149 0.1580 0.0943 0.1041 KGIN 0.0633 0.0978 0.0516 0.0607 0.1113 0.1662 0.0924 0.1068 KGRec 0.0468 0.0819 0.0380 0.0476 0.1166 0.1665 0.0996 0.1116 DSPR 0.0661 0.0929 0.0476 0.0549 0.0505 0.0885 0.0438 0.0541 TGCN 0.0527 0.0838 0.0427 0.0510 0.0917 0.1398 0.0747 0.0876 LFGCF 0.0812 0.1167 0.0601 0.0705 0.1241 0.1848 0.1058 0.1198 BoxGNN 0.0866 0.1226 0.0704 0.0812 0.1350 0.1934 0.1124 0.1264 AlphaRec 0.0498 0.0728 0.0279 0.0355 0.0845 0.1358 0.0691 0.0832 LLMEmb 0.0495 0.0817 0.0319 0.0409 0.0906 0.1387 0.0771 0.0887 LogGRec 0.0935 0.1357 0.0797 0.0918 0.1394 0.1955 0.1129 0.1271
[0169] Continued from Table 2: Recommended Performance Comparison Table
[0170] Model Yelp (R@10) Yelp (R@20) Yelp(N@10) Yelp(N@20) BPR 0.0692 0.1161 0.0571 0.0753 NFM 0.0682 0.1091 0.0542 0.0701 IFM 0.0521 0.0962 0.0481 0.0622 LightGCN 0.0790 0.1302 0.0657 0.0855 NGCF 0.0690 0.1155 0.0571 0.0752 KGIN 0.0602 0.1043 0.0502 0.0661 KGRec 0.0812 0.1308 0.0670 0.0892 DSPR 0.0532 0.0971 0.0492 0.0631 TGCN 0.0722 0.1172 0.0621 0.0783 LFGCF 0.0835 0.1371 0.0702 0.0913 BoxGNN 0.0831 0.1359 0.0699 0.0903 AlphaRec 0.0664 0.0995 0.0502 0.0593 LLMEmb 0.0642 0.0974 0.0491 0.0584 LogGRec 0.0849 0.1403 0.0716 0.0930
[0171] As shown in Table 2, overall, this invention achieved the best results on all datasets and evaluation metrics, indicating that injecting semantic rules induced by large language models into logic-centric graph reasoning networks can achieve robust improvements in both recall-oriented (Recall@K) and ranking-sensitive (NDCG@K) evaluations. Specifically, compared with the strongest benchmark models on each dataset (BoxGNN on MovieLens and LastFM, and LFGCF on Yelp), this invention improved the NDCG@20 metric by 13.1%, 0.6%, and 1.9%, respectively, and the Recall@20 metric by 10.7%, 1.1%, and 2.3%, respectively. Compared with traditional collaborative filtering benchmarks (such as BPR, NFM, and IFM), there are effective improvements, highlighting the necessity of capturing higher-order relational signals and semantic information in addition to modeling bidirectional interactions.
[0172] Secondly, compared to graph-based recommendation models (such as NGCF and LightGCN) and knowledge-aware methods (such as KGIN and KGRec), this invention further benefits from explicit reasoning on tag semantics through intersection and union operators, rather than relying solely on message passing mechanisms. Notably, this invention consistently outperforms tag-aware benchmark models (such as DSPR, TGCN, LFGCF, and BoxGNN), demonstrating the advantages of combining tag semantics with logic-centric reasoning. In contrast, this invention leverages large language models to induce personalized and verifiable semantic rules and combines them with logic-centric reasoning, thereby achieving co-alignment of user intent, tag semantics, and item evidence within a unified reasoning framework.
[0173] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A logical center graph reasoning and recommendation method based on semantic rules induced by a large language model, characterized in that, include: Acquire user interaction data, text metadata, and tag vocabulary, and offline induce the generation of rule sets from the text metadata using a frozen large language model; A heterogeneous recommendation graph is constructed based on the tag vocabulary, the interaction data, and the rule set; the heterogeneous recommendation graph includes user nodes, item nodes, tag nodes, and rule tag nodes; The text embeddings of each node are obtained by freezing the large language model and fused with the type-gated embeddings of trainable identifiers to generate initial node representations. At the same time, rule-derived user representations are generated by aggregating the rule set. Logical reasoning is performed on the heterogeneous recommendation graph based on box embedding representation. In each layer of reasoning, the box embeddings of the node neighborhood are aggregated by intersection and union operators to update the node representation. After the reasoning is completed, the graph reasoning representation of the user node is fused with the rule-derived user representation to generate the final user representation. A matching score is calculated based on the intersection volume between the end-user representation and the candidate item representation, and a personalized recommendation result is generated based on the matching score.
2. The logical center graph reasoning and recommendation method based on semantic rules induced by a large language model as described in claim 1, characterized in that: Offline generation of rule sets from the text metadata through a frozen large language model includes constructing structured prompt words, which contain user metadata, a tag vocabulary, rule quantity constraints, tag cardinality constraints, and output format requirements. The structured prompts are input into the frozen large language model to obtain a structured output containing multiple candidate rules. Each candidate rule includes a natural language description of the preference pattern, a rule label, a rule type, and a confidence score. The structured output is then post-processed to generate a rule set. The rule set is quality-verified based on the interaction data, and the empirical support and hit indicator for each rule are calculated.
3. The logical center graph reasoning and recommendation method based on semantic rules induced by a large language model as described in claim 2, characterized in that: Constructing a heterogeneous recommendation graph based on the tag vocabulary, the interaction data, and the rule set includes constructing user nodes, item nodes, tag nodes, and rule tag nodes based on the tag vocabulary, the interaction data, and the rule set. Based on the interaction data, a user-project interaction edge is established between the user node and the project node; Establish project-tag edges between project nodes and tag nodes based on the project's tag information; Based on the rule label of each rule in the rule set, user-rule label edges are established between user nodes and corresponding rule label nodes, forming a heterogeneous recommendation graph containing different types of nodes and different types of edges.
4. The logical center graph reasoning and recommendation method based on semantic rules induced by a large language model as described in claim 3, characterized in that: The generation of initial node representations includes obtaining text embeddings for each node in the heterogeneous recommendation graph through the encoder of the frozen large language model; wherein, item nodes and tag nodes use names and metadata as input text, and user nodes use concatenated induced rule texts as input text; Type-specific linear projection is used to map the text embeddings of nodes of different types to a unified dimension; Initialize a trainable identifier embedding for each node, and generate center parameters and offset parameters for box embeddings based on the trainable identifier embeddings; the offset parameters are ensured to be non-negative by modifying the linear unit function; For each node, the mapped text embedding and the central parameter are weighted and fused using type-specific scalar gating parameters to generate an initial node representation.
5. The logical center graph reasoning and recommendation method based on semantic rules induced by a large language model as described in claim 4, characterized in that: The generation of rule-derived user representations based on the rule set includes, for each user node, obtaining a set of rule tag nodes associated through the user-rule tag edge; The box embedding center parameters of each rule tag node in the rule tag node set are aggregated to generate a central representation of the rule-derived user representation; The offset parameters of the box embedding of each rule tag node in the rule tag node set are aggregated and processed by the modified linear unit function to generate the rule offset representation of the rule-derived user representation; the center representation and the rule offset representation of the rule-derived user representation together constitute the rule-derived user representation.
6. The logical center graph reasoning and recommendation method based on semantic rules induced by a large language model as described in claim 5, characterized in that: Logical reasoning based on box embedding representation of the heterogeneous recommendation graph includes, for the box embeddings to be aggregated, when calculating the intersection box embedding, calculating the attention weight of the center of each box embedding through a multilayer perceptron, using the attention weight to perform a weighted sum of the centers of each box embedding to obtain the center of the intersection box embedding, and taking the minimum value of the offset of each box embedding element by element to obtain the offset of the intersection box embedding. For the box embeddings to be aggregated, when calculating the union box embedding, attention weights are calculated for the center of each box embedding through a multilayer perceptron. The attention weights are then used to perform a weighted summation of the centers of each box embedding to obtain the center of the union box embedding. At the same time, the offset of each box embedding is obtained by taking the maximum value of each element. For users, the user nodes are first aggregated using the intersection operator based on the box embedding of the project nodes associated with the user-project interaction edge. Then, the user nodes are aggregated using the union operator based on the box embedding of the tag nodes associated with the user nodes. Finally, the aggregation results of the intersection operator and the aggregation results of the union operator are fused using the intersection operator to obtain the user node representation based on graph reasoning. After reasoning, the user node representation based on graph reasoning and the rule-derived user representation are weighted and fused by linear interpolation to obtain the final user representation.
7. The logical center graph reasoning and recommendation method based on semantic rules induced by a large language model as described in claim 6, characterized in that: Generating personalized recommendation results based on the matching score includes: sorting candidate items according to the matching score to generate a recommendation list; for target items recommended to the target user in the recommendation list, retrieving the rule with the maximum overlap with the tag set of the target item from the target user's rule set; when multiple rules have the same overlap, selecting one based on a calibrated confidence score; the calibrated confidence score is based on the confidence score estimated by the frozen large language model and calibrated using the empirical support and the hit indicator. The rule text retrieved according to the selected rule, the calibration confidence score, and the tags matching the target item are used as the rule-based interpretation; at the same time, the matching score between each tag node in the heterogeneous recommendation graph and the target user and the target item are calculated, and the tag node with the highest score is selected as the tag evidence interpretation; the rule-based interpretation and the tag evidence interpretation are presented together with the recommendation list.
8. A logical center graph reasoning recommendation system based on semantic rules induced by a large language model, employing the method described in any one of claims 1-7, characterized in that: The rule-inducing module acquires user interaction data, text metadata, and tag vocabulary, and offline induces the generation of rule sets from the text metadata using a frozen large language model; The heterogeneous recommendation module constructs a heterogeneous recommendation graph based on the tag vocabulary, the interaction data, and the rule set; the heterogeneous recommendation graph includes user nodes, item nodes, tag nodes, and rule tag nodes; The embedding initialization and fusion module obtains the text embeddings of each node through the frozen large language model, and performs type-gated fusion with the trainable identifier embeddings to generate the initial node representation. At the same time, it aggregates and generates rule-derived user representations based on the rule set. The graph reasoning module performs logical reasoning on the heterogeneous recommendation graph based on box embedding representation. In each layer of reasoning, the box embeddings of the node neighborhood are aggregated through intersection and union operators to update the node representation. After the reasoning is completed, the graph reasoning representation of the user node is fused with the rule-derived user representation to generate the final user representation. The recommendation result generation module calculates a matching score based on the intersection volume between the end user representation and the candidate item representation, and generates personalized recommendation results based on the matching score.
9. A computer device, comprising: A memory and a processor; the memory stores a computer program, characterized in that: when the processor executes the computer program, it implements the steps of the method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-7.