Graph neural network-based full-scene adaptive intelligent recommendation method and system
Patent Information
- Application Number
- CN202511654723.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2045-11-12
AI Technical Summary
[0004]本发明实施例的目的在于提供基于图神经网络的全场景自适应智能推荐方法及系统,以至少解决现有智能推荐方法难以灵活应对用户在不同场景下的动态需求、信息融合不足以及可解释性缺失的技术问题
Smart Images

Figure CN121479067B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence technology, and particularly relates to the field of machine learning and data mining technology, specifically a full-scene adaptive intelligent recommendation method and system based on graph neural networks. Background Technology
[0002] Currently, intelligent recommendation technology has evolved from a functional component of internet platforms into a decision-making system that drives multi-industry ecosystems, achieving deep penetration in fields such as e-commerce, social networks, video entertainment, and local life services.
[0003] In related technologies, traditional recommender systems typically employ a single, fixed model, resulting in poor scenario adaptability and difficulty in flexibly responding to users' dynamic needs in different scenarios, such as user cold start, interest exploration, in-depth mining of historical preferences, or specific intent queries. In addition, existing collaborative filtering, sequence recommendation, and other methods each focus on different information sources, lacking a unified framework to dynamically integrate these heterogeneous information, leading to insufficient information fusion. Furthermore, most recommender systems lack interpretability, failing to provide users with clear and convincing reasons for recommendations, which reduces user trust and acceptance. Summary of the Invention
[0004] The purpose of this invention is to provide a full-scene adaptive intelligent recommendation method and system based on graph neural networks, so as to at least solve the technical problems of existing intelligent recommendation methods that are difficult to flexibly respond to the dynamic needs of users in different scenarios, lack information fusion, and lack of interpretability.
[0005] To achieve the above objectives, the embodiments of this application provide the following technical solutions.
[0006] According to one embodiment of this application, a full-scene adaptive intelligent recommendation method based on graph neural networks is provided, comprising the following steps:
[0007] Heterogeneous graphs are constructed based on the collected heterogeneous data. Graph neural networks are used to perform multi-layer information propagation and aggregation on the heterogeneous graphs to obtain user embeddings and item embeddings that integrate node content features and high-order collaborative information of graph structure.
[0008] A parallel candidate recommendation model is constructed to generate a diverse candidate pool. In the GNN collaborative filtering module, preference scores are calculated based on user embedding and item embedding. In the sequence recommendation module, the Transformer model with a location feedforward network is used to calculate the probability of the user's next interaction with all items. The RAG module driven by the large language model retrieves external knowledge to generate highly novel candidates, thus obtaining a diverse candidate pool.
[0009] Receive all context information of the current user's recommendation request, determine the user's scene tag through CoT inference rules, and use the scene tag as the query to retrieve the most matching strategy document from the strategy knowledge base using the RAG module, and formulate the dynamic execution strategy for the current recommendation.
[0010] The original scores of the parallel candidate recommendation model are normalized based on the dynamic execution strategy, and a preliminary fusion score is calculated based on the dynamic weights retrieved from the strategy knowledge base to generate a preliminary ranking list.
[0011] The initial sorted list is reordered based on large language model reasoning, taking into account the scenario and strategy guidance. Evidence retrieved from the fact knowledge base based on the RAG module is introduced into the reordering result to obtain a final recommended list with linguistic explanations.
[0012] Furthermore, the steps for multi-layer information propagation and aggregation on heterogeneous graphs using graph neural networks include:
[0013] The original features of the heterogeneous data are encoded to obtain the initial embedding vectors of the nodes propagating in the GNN. ;
[0014] In multi-layer information propagation, a graph neural network (GNN) is used to assign different weights to neighboring nodes using a self-attention mechanism. The attention weights for node i to aggregate information from its neighbor node j are as follows: It is expressed as follows:
[0015]
[0016] in, Indicates the first Attention weights of layers It is a node In the The feature vector of the layer, It is the first The linear transformation matrix shared by the layers. yes The weight vector of the layer attention mechanism, Indicates a splicing operation; Let j represent the set of neighboring nodes. ;k represents the node index;
[0017] Through multi-layer propagation of the GNN, the (l+1)th layer embedding of node i is obtained. , is represented as:
[0018]
[0019] in, and They are the first The weights and transformation matrix of each attention head, where K represents the number of attention heads. For neighboring nodes In the In the layer, ReLU is the activation function;
[0020] go through After layer propagation, user embeddings and item embeddings are obtained by fusing node content features and high-order collaborative information of the graph structure. The final user embedding is represented as: The final item embedding representation is as follows: .
[0021] Furthermore, the steps in the GNN collaborative filtering module that calculate preference scores based on user embeddings and item embeddings include:
[0022] Based on user embedding and item embedding ; Calculate user u's preference score for item i using inner product or multilayer perceptron (MLP). ,in:
[0023] Calculate using inner product Represented as: ;
[0024] Calculation via Multilayer Perceptron (MLP) Represented as: ;
[0025] Training is performed using the Bayesian Personalized Ranking (BPR) loss function, which characterizes the score difference between the observed positive samples and the unobserved negative samples. Positive samples are those interacted with by the user, and negative samples are those obtained through sampling. The BPR loss function is expressed as:
[0026]
[0027] in, It is the training sample set. It is the Sigmoid function. It is the regularization coefficient. These are all the learnable parameters of the model;
[0028] The candidate item list is output based on the trained GNN collaborative filtering module. .
[0029] Furthermore, the step in the sequence recommendation module that uses a Transformer model with an introduced location feedforward network to calculate the probability of the user's next interaction with all items includes:
[0030] A sequence recommendation module is constructed based on the Transformer self-attention model, and the historical behavior sequence of user u is used. As input to the sequence recommendation module;
[0031] Following the self-attention mechanism based on Transformer, a position feedforward network is introduced, represented as:
[0032]
[0033] Sequence representations are learned by stacking multiple layers of sequence recommendation modules, and based on the last time step. Output Calculate the probability of the user's next interaction with all items, expressed as:
[0034]
[0035] in, It is an item embedding matrix;
[0036] The sequence recommendation module is used to output a candidate list based on interaction probability ranking. .
[0037] Furthermore, the steps of using a large language model to drive the RAG module to retrieve external knowledge and generate highly novel candidates to obtain a diverse candidate pool include:
[0038] Construct a fact knowledge base to store unstructured external knowledge, use an encoder to vectorize the documents in the fact knowledge base, and establish a fact vector index;
[0039] When candidates need to be generated, the RAG module is based on the user query. Encode the data and retrieve the Top-N relevant documents from the fact vector index by calculating similarity. Next, the user information, user query, and retrieved knowledge are combined into a context-rich prompt. ;
[0040] The prompt As input to a large language model, a diverse candidate list is obtained. , is represented as:
[0041]
[0042] In the formula, Representing a large language model, This indicates a prompt. This indicates a user query. Represents user information, Identify the retrieved knowledge.
[0043] Furthermore, using scenario tags as queries, the RAG module retrieves the most matching policy document from the policy knowledge base and formulates the steps for the currently recommended dynamic execution policy, including:
[0044] Construct a policy knowledge base that stores predefined recommendation meta-policies, and use an encoder to vectorize the documents in the policy knowledge base to create a policy vector index;
[0045] Use scene tags As a query, the code is ;
[0046] By maximizing similarity From the policy vector index Search for the most matching strategy document ;
[0047] Receive retrieved policy documents The strategy document contains recommended fusion weight vectors. and guidelines ;
[0048] The retrieved strategies will be used as system instructions for the next action, and the recommended dynamic execution strategy will be formulated. , represented as .
[0049] Furthermore, the step of generating the preliminary sorted list includes,
[0050] Summarize the candidate set and the original score set, wherein the candidate set includes a list of candidate items. Candidate List and a diverse list of candidates The original rating set includes a list User ratings of items List User ratings of items and list User ratings of items ;
[0051] Based on dynamic execution strategy Normalize each score;
[0052] According to strategy Weights in Calculate the preliminary fusion score And generate a preliminary sorted list. .
[0053] Furthermore, the step of performing a reordering based on large language model reasoning on the preliminary sorted list in conjunction with scenario and strategy guidance, and incorporating evidence retrieved from the fact knowledge base based on the RAG module into the reordering result to obtain a final recommendation list with linguistic explanations, includes:
[0054] right Performing rearrangement based on large language model reasoning is represented as:
[0055]
[0056] In the formula, This represents the agent used for rearrangement, which examines the internal Prompt. and in combination with the scenario and strategy guidance Perform reasoning, and based on the reasoning results, rank the preliminary list. Rearrange the items to obtain the final Top-K list. ;
[0057] For each recommendation Generate natural language interpretation Among them, RAG is activated, targeting the fact knowledge base, for items Search for relevant evidence ;
[0058] Rearrange the list With the generation of each item Combined together, this yields a final recommendation list with language explanations; among which, Evidence retrieved by RAG Supported natural language interpretation, The generation process is represented as follows:
[0059]
[0060] In the formula, Indicates the search for evidence. Indicates scene tags, This represents user information, and 'i' represents the item index. This refers to the intelligent agent used to generate the explanation.
[0061] Furthermore, it also includes the following steps:
[0062] When outputting the final recommended list with language explanations, user feedback on the items is collected. and feedback on the explanation Among them, feedback and feedback Knowledge base for evaluating and adjusting strategies Strategies; Feedback Used to update GNN collaborative filtering module parameters .
[0063] According to another embodiment of this application, a full-scene adaptive intelligent recommendation system based on graph neural networks is provided, including the following modules:
[0064] The heterogeneous data processing module is used to construct a heterogeneous graph based on the collected heterogeneous data, and to use a graph neural network to perform multi-layer information propagation and aggregation on the heterogeneous graph to obtain user embeddings and item embeddings that integrate node content features and high-order collaborative information of graph structure.
[0065] The candidate pool generation module is used to build a parallel candidate recommendation model for generating a diverse candidate pool. In the GNN collaborative filtering module, preference scores are calculated based on user embedding and item embedding. In the sequence recommendation module, the Transformer model with a location feedforward network is used to calculate the probability of the user's next interaction with all items. The RAG module driven by the large language model retrieves external knowledge to generate highly novel candidates, thus obtaining a diverse candidate pool.
[0066] The strategy formulation module receives all context information of the current user's recommendation request, determines the user's scenario tags through CoT inference rules, and uses the scenario tags as the query to retrieve the most matching strategy document from the strategy knowledge base using the RAG module to formulate the dynamic execution strategy for the current recommendation.
[0067] The preliminary list generation module is used to normalize the original scores of the parallel candidate recommendation model based on the dynamic execution strategy, and calculate the preliminary fusion score based on the dynamic weights retrieved from the strategy knowledge base to generate a preliminary ranking list.
[0068] The final list generation module is used to perform a reordering based on large language model reasoning on the preliminary sorted list in combination with scenario and strategy guidance, and to introduce evidence retrieved from the fact knowledge base based on the RAG module into the reordering result to obtain a final recommendation list with language explanation.
[0069] Compared with existing technologies, the beneficial effects of the full-scene adaptive intelligent recommendation method and system based on graph neural networks in this application are as follows: First, the present invention generates a diverse candidate set in parallel using graph neural networks and sequence models; then, based on the perceived scene, it retrieves the best fusion strategy from the policy knowledge base using retrieval enhancement generation technology; finally, all candidate results are reviewed and rearranged, and combined with RAG evidence retrieved from the fact knowledge base, thereby obtaining a highly personalized, scene-adaptive final recommendation list with clear natural language interpretation. Attached Figure Description
[0070] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0071] In the attached diagram:
[0072] Figure 1 This is a flowchart illustrating the implementation of the full-scene adaptive intelligent recommendation method based on graph neural networks in an embodiment of the present invention.
[0073] Figure 2 This is a structural block diagram of the full-scene adaptive intelligent recommendation system based on graph neural networks according to an embodiment of the present invention;
[0074] Figure 3 This is a structural block diagram of a terminal device provided in an embodiment of the present invention. Detailed Implementation
[0075] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0076] According to the embodiments of this application, a method embodiment of a full-scene adaptive intelligent recommendation method based on graph neural networks is provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0077] Figure 1 This is a flowchart illustrating the implementation of the full-scene adaptive intelligent recommendation method based on graph neural networks in an embodiment of this application.
[0078] Please refer to Figure 1 The embodiments of this application provide a full-scene adaptive intelligent recommendation method based on graph neural networks;
[0079] Includes the following steps:
[0080] Step S101: Construct a heterogeneous graph based on the collected heterogeneous data, and use a graph neural network to perform multi-layer information propagation and aggregation on the heterogeneous graph to obtain user embeddings and item embeddings that integrate node content features and high-order collaborative information of graph structure.
[0081] In this embodiment, heterogeneous data is collected from multiple sources, including: static user profile data (such as age, gender, and registration information); dynamic user behavior sequences (such as clicks, browsing, purchases, ratings, and their corresponding timestamps); multimodal attribute information of items (such as text descriptions, specifications, category tags, and cover images); and social relationship data between users. This data is then cleaned, deduplicated, and standardized.
[0082] It should be noted that in this embodiment, the user's static profile data and the user's dynamic behavior sequence are collected with the user's permission.
[0083] In this embodiment, all data comes from an e-commerce platform, as detailed below:
[0084] User static profile data: This can be obtained from user registration information on an e-commerce platform, with the user's permission, such as the user's city (if provided) and user level (e.g., Prime member).
[0085] User dynamic behavior sequence: With the user's permission, collect the user's clicks, browsing, purchase records, ratings (1-5 stars) and timestamps of these events in categories such as "Apparel" or "Electronics".
[0086] Multimodal attribute information of items: This data is collected from product pages, such as product description (textual features), SKU specifications (parameters), category (e.g., "Men's Shirts" - "Casual"), and main product image (cover image). Social relationship data between users: Social relationships can be approximated using community interaction data such as "mutual following of commenters" or "question and answer" interactions.
[0087] In this embodiment, the heterogeneity diagram is represented as follows: , where the set of nodes It must contain at least user nodes, item nodes, and attribute nodes (such as category and brand); edge set Includes multiple predefined meta-relations Examples include "user-item" interaction (Interact), "item-attribute" attribution (Belongs_to), and (if available) "user-user" social interaction (Social); preprocessed data is instantiated into a heterogeneous graph, and graph neural networks are used to perform multi-layer information propagation and aggregation on the heterogeneous graph.
[0088] In the data preparation phase, this embodiment constructs a "fact knowledge base" to store unstructured external knowledge. And a "policy knowledge base" that stores predefined recommendation meta-policies. and using an encoder The documents in the knowledge base are vector-encoded to create a vector index. and Specifically, in this embodiment, two independent RAG knowledge bases are constructed. One is the Factual Knowledge Base (FactualKB), which contains unstructured knowledge of the external world. The other is the Policy Knowledge Base (PolicyKB), which stores a large number of predefined recommendation meta-policies in structured or semi-structured form. This application embodiment uses an encoder. These documents from the knowledge base Encode as a vector And based on these vectors, construct an efficient vector index. and (e.g., FAISS); the subsequent retrieval process will calculate the query vector. This is accomplished using the cosine similarity with the knowledge base vectors. The cosine similarity is expressed as:
[0089]
[0090] In the formula, q represents the knowledge base vector, and q represents the query vector;
[0091] In this embodiment, the fact knowledge base Storing external knowledge about products, such as fashion trend analysis articles for new clothing products, industry review reports for electronic products, and unstructured user evaluations of a brand; while the strategy knowledge base... Used to store predefined meta-strategies in recommendation services, such as the strategy for the scenario "Cold_Start": weight Guidelines "Prioritize recommending highly rated novel products"; the strategy for the "Deep_Preference" scenario: "weighting" Guidelines "Focusing on categories that frequently appear in historical purchase records"; in the encoder In this process, text embedding models such as MiniLM or BGE are selected to encode knowledge documents into vectors.
[0092] Furthermore, in step S101, the graph neural network (GNN) of this embodiment preferably adopts a heterogeneous graph attention network (HAN) or a graph attention network (GAT), and updates the embedding vector of node i through a multi-head attention mechanism (K heads). ;
[0093] Specifically, this embodiment utilizes graph neural networks to perform multi-layer information propagation and aggregation on heterogeneous graphs, including the following steps:
[0094] The original features of the heterogeneous data are encoded to obtain the initial embedding vectors of the nodes propagating in the GNN. ;
[0095] In multi-layer information propagation, a graph neural network (GNN) is used to assign different weights to neighboring nodes using a self-attention mechanism. The attention weights for node i to aggregate information from its neighbor node j are as follows: It is expressed as follows:
[0096]
[0097] in, This represents the attention weights of the l-th layer. It is a node In the The feature vector of the layer, It is the linear transformation matrix shared by the l-th layer. It is the weight vector of the l-layer attention mechanism. Indicates a splicing operation; Let j represent the set of neighboring nodes. ;k represents the node index;
[0098] Through multi-layer propagation of the GNN, the (l+1)th layer embedding of node i is obtained. Embedding obtained using multi-head attention Represented as:
[0099]
[0100] in, and They are the first The weights and transformation matrix of each attention head, where K represents the number of attention heads. For neighboring nodes In the In the layer, ReLU is the activation function;
[0101] go through After layer propagation, user embeddings and item embeddings are obtained by fusing node content features and high-order collaborative information of the graph structure. The final user embedding is represented as: The final item embedding representation is as follows: .
[0102] Please continue to refer to Figure 1 The full-scene adaptive intelligent recommendation method based on graph neural networks in this embodiment also includes the following steps:
[0103] Step S102: Construct a parallel candidate recommendation model for generating a diverse candidate pool. In the GNN collaborative filtering module, preference scores are calculated based on user embeddings and item embeddings. In the sequence recommendation module, the Transformer model with a location feedforward network is used to calculate the probability of the user's next interaction with all items. The RAG module driven by the large language model retrieves external knowledge to generate highly novel candidates, thus obtaining a diverse candidate pool.
[0104] In step S102 of this embodiment,
[0105] The steps in the GNN collaborative filtering module that calculate preference scores based on user embeddings and item embeddings include:
[0106] Based on user embedding and item embedding ; Calculate user u's preference score for item i using inner product or multilayer perceptron (MLP). ,in:
[0107] Calculate using inner product Represented as: ;
[0108] Calculation via Multilayer Perceptron (MLP) Represented as: ;
[0109] Training is performed using the Bayesian Personalized Ranking (BPR) loss function, which characterizes the score difference between the observed positive samples and the unobserved negative samples. Positive samples are those interacted with by the user, and negative samples are those obtained through sampling. The BPR loss function is expressed as:
[0110]
[0111] in, It is the training sample set. It is the Sigmoid function. It is the regularization coefficient. These are all the learnable parameters of the model;
[0112] The candidate item list is output based on the trained GNN collaborative filtering module. .
[0113] Furthermore, the sequence recommendation module in this embodiment is used to capture the dynamic evolution of user interests, and finally outputs a candidate list ranked based on this probability. ;
[0114] Specifically, the step in the sequence recommendation module that uses a Transformer model with an introduced location feedforward network to calculate the probability of a user's next interaction with all items includes:
[0115] A sequence recommendation module is constructed based on the Transformer self-attention model, and the historical behavior sequence of user u is used. As input to the sequence recommendation module;
[0116] Following the self-attention mechanism based on Transformer, a position feedforward network is introduced, represented as:
[0117]
[0118] Sequence representations are learned by stacking multiple layers of sequence recommendation modules, and based on the last time step. Output Calculate the probability of the user's next interaction with all items, expressed as:
[0119]
[0120] in, It is an item embedding matrix;
[0121] The sequence recommendation module is used to output a candidate list based on interaction probability ranking. .
[0122] Furthermore, the RAG module in this embodiment is designed to address exploratory needs and cold start problems, generating candidates with high novelty and diversity. The RAG module is driven by a large language model.
[0123] Specifically, the step of using a large language model to drive the RAG module to retrieve external knowledge and generate highly novel candidates to obtain a diverse candidate pool includes:
[0124] Construct a fact knowledge base to store unstructured external knowledge, use an encoder to vectorize the documents in the fact knowledge base, and establish a fact vector index;
[0125] When candidates need to be generated, the RAG module is based on the user query. Encode the data and retrieve the Top-N relevant documents from the fact vector index by calculating similarity. Next, the user information, user query, and retrieved knowledge are combined into a context-rich prompt. ;
[0126] The prompt As input to a large language model, a diverse candidate list is obtained. , is represented as:
[0127]
[0128] In the formula, Representing a large language model, This indicates a prompt. This indicates a user query. Represents user information, Identify the retrieved knowledge.
[0129] Please continue to refer to Figure 1 The full-scene adaptive intelligent recommendation method based on graph neural networks in this embodiment also includes the following steps:
[0130] Step S103: Receive all context information of the current user's recommendation request, determine the user's scene tag through CoT inference rules, and use the scene tag as the query to retrieve the most matching strategy document from the strategy knowledge base using the RAG module, and formulate the dynamic execution strategy for the current recommendation.
[0131] The context information Including user profiles Historical sequence Current query Through internal chain-of-thought (CoT) reasoning, the current scene is classified, that is... ;
[0132] For example, internal reasoning might be: "IF length( )<5 THEN =[Cold_Start]”;
[0133] The final output is the current scene label. ;
[0134] For example, for users Its context information for ( (Member, often shops around 10 PM) (No interaction in the last 7 days) (Empty); then CoT inference: "The user is a member but has had no recent interaction ( (Empty), but the total historical sequence is long. This is not a cold start, but a 'low-activity' scenario; the scenario label at this time... for or .
[0135] Furthermore, in step S103 of this embodiment, based on the perceived scene, the optimal fusion strategy is retrieved from the strategy knowledge base using retrieval enhancement generation technology.
[0136] In this embodiment, the steps of using scene tags as queries, retrieving the most matching policy document from the policy knowledge base using the RAG module, and formulating the currently recommended dynamic execution policy include:
[0137] Construct a policy knowledge base that stores predefined recommendation meta-policies, and use an encoder to vectorize the documents in the policy knowledge base to create a policy vector index;
[0138] Use scene tags As a query, the code is ;
[0139] By maximizing similarity From the policy vector index Search for the most matching strategy document ;
[0140] Receive retrieved policy documents The strategy document contains recommended fusion weight vectors. and guidelines Guidelines For example, diversity should be ensured to avoid excessive resemblance to history;
[0141] The retrieved strategies will be used as system instructions for the next action, and the recommended dynamic execution strategy will be formulated. , represented as .
[0142] Please continue to refer to Figure 1 The full-scene adaptive intelligent recommendation method based on graph neural networks in this embodiment also includes the following steps:
[0143] Step S104: Normalize the original scores of the parallel candidate recommendation model based on the dynamic execution strategy, and calculate the preliminary fusion score based on the dynamic weights retrieved from the strategy knowledge base to generate a preliminary ranking list;
[0144] Specifically, the step of generating the preliminary sorted list includes:
[0145] Summarize the candidate set and the original score set, wherein the candidate set includes a list of candidate items. Candidate List and a diverse list of candidates The original rating set includes a list User ratings of items List User ratings of items and list User ratings of items ;
[0146] Based on dynamic execution strategy Normalize each score;
[0147] According to strategy Weights in Calculate the preliminary fusion score And generate a preliminary sorted list. .
[0148] Furthermore, the step of performing a reordering based on large language model reasoning on the preliminary sorted list in conjunction with scenario and strategy guidance, and incorporating evidence retrieved from the fact knowledge base based on the RAG module into the reordering result to obtain a final recommendation list with linguistic explanations, includes:
[0149] right Performing rearrangement based on large language model reasoning is represented as:
[0150]
[0151] In the formula, This represents the agent used for rearrangement, which examines the internal Prompt. and in combination with the scenario and strategy guidance Perform reasoning, and based on the reasoning results, rank the preliminary list. Rearrange the items to obtain the final Top-K list. ;
[0152] In this embodiment, for In the process of performing a rearrangement based on large language model reasoning, an example is: the intelligent experience (in the internal Prompt) examines... and in combination with the scenario and strategy guidance To reason; for example, if The requirement is to "enhance diversity." The AI will proactively examine the category concentration of the Top-K items and improve the diversity derived from them. The ranking of novel items; additionally, in this embodiment, 0.3}, after the agent performs the rearrangement, a list of candidate items... The "highly relevant" phone case (score 0.83) ranked first, while a more diverse list of candidates also came in. The "novel" smart desk lamp ranked fifth; the smart agent is based on Infer that there is only one in the current Top-5. The products were then ranked so that the agents were ranked in the Top 3 to meet the diversity requirements, and a final list was generated. .
[0153] Please continue to refer to Figure 1 The full-scene adaptive intelligent recommendation method based on graph neural networks in this embodiment also includes:
[0154] Step S105: Combine scenario and strategy guidance to perform a reordering based on large language model reasoning on the preliminary sorted list, and introduce evidence retrieved from the fact knowledge base based on the RAG module into the reordering result to obtain a final recommendation list with language explanation;
[0155] Specifically, this embodiment determines the Top-K item list. Then, the agent makes each recommendation Generate natural language interpretation Among these, RAG is restarted, targeting the fact knowledge base, for items. Search for relevant evidence ;
[0156] Finally, rearrange the list. With the generation of each item Combined together, this yields a final recommendation list with language explanations; among which, Evidence retrieved by RAG Supported natural language interpretation, The generation process is represented as follows:
[0157]
[0158] In the formula, Indicates the search for evidence. Indicates scene tags, This represents user information, and 'i' represents the item index. This represents the agent used to generate the explanation. For example, as in this instance, the agent outputs the explanation. "Recommend [XX Smart Desk Lamp]; Reason: Considering the user's recent low activity level ( This helps users discover highly innovative products. The knowledge base displays... This product has won the latest design award and uses OLED eye-care technology, making it perfect for you to enjoy at 10 pm. Use it while reading.
[0159] In one implementation of this application, the full-scene adaptive intelligent recommendation method based on graph neural networks further includes the following steps:
[0160] When outputting the final recommended list with language explanations, user feedback on the items is collected. and feedback on the explanation Among them, feedback and feedback Knowledge base for evaluating and adjusting strategies Strategies; Feedback Used to update parameters of the GNN collaborative filtering module ;
[0161] For example, by minimizing the new loss function Incremental training is performed on specific user actions such as adding items to the shopping cart; among which, and Used to evaluate strategies in the strategy knowledge base The effectiveness; if a certain scenario is found The following strategy This results in lower utility and will be adjusted automatically or semi-automatically. This strategy is to ensure future... In such scenarios, this strategy can be prioritized and used to enable the agent's decision-making capabilities to evolve on their own.
[0162] Furthermore, this embodiment also calls external search engines or multimodal data sources to ensure that when finally presenting recommendation results to users, it can also return multimodal information such as high-quality images, video links, or the latest real-time prices of items, so as to enrich the user experience.
[0163] Please refer to Figure 2 In another embodiment of this application, a full-scene adaptive intelligent recommendation system based on graph neural networks is also provided, which includes the following modules:
[0164] The heterogeneous data processing module 201 is used to construct a heterogeneous graph based on the collected heterogeneous data, and to use a graph neural network to perform multi-layer information propagation and aggregation on the heterogeneous graph to obtain user embeddings and item embeddings that integrate node content features and high-order collaborative information of graph structure.
[0165] The candidate pool generation module 202 is used to construct a parallel candidate recommendation model for generating a diverse candidate pool. In the GNN collaborative filtering module, preference scores are calculated based on user embedding and item embedding. In the sequence recommendation module, the Transformer model with a location feedforward network is used to calculate the probability of the user's next interaction with all items. The RAG module driven by the large language model retrieves external knowledge to generate highly novel candidates, thus obtaining a diverse candidate pool.
[0166] The strategy formulation module 203 is used to receive all context information of the current user's recommendation request, determine the user's scene tag through the CoT inference rules, and use the scene tag as the query to retrieve the most matching strategy document from the strategy knowledge base using the RAG module to formulate the dynamic execution strategy for the current recommendation.
[0167] The preliminary list generation module 204 is used to normalize the original scores of the parallel candidate recommendation model based on the dynamic execution strategy, and calculate the preliminary fusion score according to the dynamic weights retrieved from the strategy knowledge base to generate a preliminary ranking list.
[0168] The final list generation module 205 is used to perform a rearrangement based on large language model reasoning on the preliminary sorted list in combination with scenario and strategy guidance, and to introduce evidence retrieved from the fact knowledge base based on the RAG module into the rearrangement result to obtain a final recommendation list with language explanation.
[0169] like Figure 3 As shown, in this embodiment of the invention, a terminal device is provided. At the hardware level, the terminal includes a processor and optionally also includes an internal bus, a network interface, and a memory.
[0170] The memory may include main memory, such as high-speed random access memory, or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for its operations.
[0171] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA bus, PCI bus, or EISA bus, etc.
[0172] The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0173] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0174] The processor reads the corresponding computer program from non-volatile memory into memory and then runs it, forming a full-scene adaptive intelligent recommendation system based on graph neural networks at the logical level.
[0175] The processor executes the program stored in the memory, and specifically executes the full-scene adaptive intelligent recommendation method based on graph neural networks provided in the above embodiments.
[0176] The above is as stated in this application. Figure 1 The full-scene adaptive intelligent recommendation method based on graph neural networks disclosed in the illustrated embodiments can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed through integrated logic circuits in the processor's hardware or through software instructions. The processor can be a general-purpose processor, including a central processing unit (CPU), network processor, etc.; it can also be a digital signal processor, application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor.
[0177] The steps of the method disclosed in the embodiments of this application can be directly reflected as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor.
[0178] The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0179] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform... Figure 1 The embodiment shown is a full-scene adaptive intelligent recommendation method based on graph neural networks.
[0180] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0181] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A full-scene adaptive intelligent recommendation method based on a graph neural network, characterized in that, Includes the following steps: Heterogeneous graphs are constructed based on the collected heterogeneous data. Graph neural networks are used to perform multi-layer information propagation and aggregation on the heterogeneous graphs to obtain user embeddings and item embeddings that integrate node content features and high-order collaborative information of graph structure. A parallel candidate recommendation model is constructed to generate a diverse candidate pool. In the GNN collaborative filtering module, preference scores are calculated based on user embedding and item embedding. In the sequence recommendation module, the Transformer model with a location feedforward network is used to calculate the probability of the user's next interaction with all items. The RAG module driven by the large language model retrieves external knowledge to generate highly novel candidates, thus obtaining a diverse candidate pool. It receives all context information of the current user's recommendation request, determines the user's scene tags through CoT inference rules, and uses the scene tags as the query. It then uses the RAG module to retrieve the most matching policy document from the policy knowledge base, formulating a dynamic execution strategy for the current recommendation. This includes: constructing a policy knowledge base storing predefined recommendation meta-policies, using an encoder to vectorize the documents in the policy knowledge base, and establishing a policy vector index; using scene tags... As a query, the code is By maximizing similarity From the policy vector index Search for the most matching strategy document ; Receive the retrieved policy documents The strategy document contains recommended fusion weight vectors. and guidelines The retrieved strategies will be used as system instructions for the next action, and the recommended dynamic execution strategy will be formulated accordingly. , represented as ; The original scores of the parallel candidate recommendation model are normalized based on a dynamic execution strategy, and a preliminary fusion score is calculated based on the dynamic weights retrieved from the strategy knowledge base to generate a preliminary ranking list, including: a summary candidate set and an original score set, based on the dynamic execution strategy. The scores in the original score set are normalized according to a strategy. Weights in Calculate the preliminary fusion score and generate a preliminary ranking list. ; The initial ranked list is reordered based on large language model reasoning, taking into account scenario and strategy guidance. Evidence retrieved from a fact knowledge base using the RAG module is incorporated into the reordering result to obtain a final recommended list with linguistic explanations. Performing rearrangement based on large language model reasoning is represented as: In the formula, This represents the agent used for rearrangement, which examines the internal Prompt. and in combination with the scenario and strategy guidance Perform reasoning, and based on the reasoning results, rank the preliminary list. Rearrange the items to obtain the final Top-K list. ; For each recommendation Generate natural language interpretation Among them, RAG is activated, targeting the fact knowledge base, for items Search for relevant evidence ; Rearrange the list With the generation of each item Combined, this yields a final recommendation list with language explanations; among which, Evidence retrieved by RAG Supported natural language interpretation, The generation process is represented as follows: In the formula, Indicates the search for evidence. Indicates scene tags, This represents user information, and 'i' represents the item index. This refers to the intelligent agent used to generate the explanation.
2. The full-scene adaptive intelligent recommendation method based on graph neural networks according to claim 1, characterized in that, The steps for multi-layer information propagation and aggregation on heterogeneous graphs using graph neural networks include: The original features of the heterogeneous data are encoded to obtain the initial embedding vectors of the nodes propagating in the GNN. ; In multi-layer information propagation, a graph neural network (GNN) is used to assign different weights to neighboring nodes using a self-attention mechanism. The attention weights for node i to aggregate information from its neighbor node j are as follows: It is expressed as follows: in, Indicates the first Attention weights of layers It is a node In the The feature vector of the layer, It is the first The linear transformation matrix shared by the layers. yes The weight vector of the layer attention mechanism, Indicates a splicing operation; Let j represent the set of neighboring nodes. ;k represents the node index; Through multi-layer propagation of the GNN, the (l+1)th layer embedding of node i is obtained. , represented as: in, and They are the first The weights and transformation matrix of each attention head, where K represents the number of attention heads. Neighboring nodes In the The embedding of the layer, where ReLU is the activation function; go through After layer propagation, user embeddings and item embeddings are obtained by fusing node content features and high-order collaborative information of the graph structure. The final user embedding is represented as: The final item embedding representation is as follows: .
3. The full-scene adaptive intelligent recommendation method based on graph neural networks according to claim 2, characterized in that, The steps in the GNN collaborative filtering module that calculate preference scores based on user embeddings and item embeddings include: Based on user embedding and item embedding ; Calculate user u's preference score for item i using inner product or multilayer perceptron (MLP). ,in: Calculate using inner product Represented as: Calculation via Multilayer Perceptron (MLP) Represented as: Training is performed using the Bayesian Personalized Ranking (BPR) loss function, which characterizes the score difference between maximizing observed positive samples and unobserved negative samples; where positive samples are those interacted with by the user, and negative samples are those obtained through sampling; the BPR loss function is expressed as: in, It is the training sample set. It is the Sigmoid function. It is the regularization coefficient. For all learnable parameters of the model; The candidate item list is output based on the trained GNN collaborative filtering module. .
4. The full-scene adaptive intelligent recommendation method based on graph neural networks according to claim 3, characterized in that, The step in the sequence recommendation module that uses a Transformer model with a location-feedforward network to calculate the probability of a user's next interaction with all items includes: A sequence recommendation module is constructed based on the Transformer self-attention model, and the historical behavior sequence of user u is used. As input to the sequence recommendation module; Following the self-attention mechanism based on Transformer, a position feedforward network is introduced, represented as: Sequence representations are learned by stacking multiple layers of sequence recommendation modules, and based on the last time step. Output Calculate the probability of the user's next interaction with all items, expressed as: in, It is an item embedding matrix; The sequence recommendation module is used to output a candidate list sorted by interaction probability. .
5. The full-scene adaptive intelligent recommendation method based on graph neural networks according to claim 4, characterized in that, The steps for using a large language model to drive the RAG module to retrieve external knowledge and generate highly novel candidates, resulting in a diverse candidate pool, include: Construct a fact knowledge base to store unstructured external knowledge, use an encoder to vectorize the documents in the fact knowledge base, and establish a fact vector index; When candidates need to be generated, the RAG module is based on the user query. Encode the data and retrieve the Top-N relevant documents from the fact vector index by calculating similarity. Next, the user information, user query, and retrieved knowledge are combined into a context-rich prompt. ; The prompt As input to a large language model, a diverse candidate list is obtained. , represented as: In the formula, Representing a large language model, This indicates a prompt. This indicates a user query. Represents user information, Identify the retrieved knowledge.
6. The full-scene adaptive intelligent recommendation method based on graph neural networks according to claim 5, characterized in that, The candidate set includes a list of candidate items. Candidate List and a diverse list of candidates The original rating set includes a list User ratings of items List User ratings of items and list User ratings of items ; The preliminary fusion score is expressed as: 。 7. The full-scene adaptive intelligent recommendation method based on graph neural networks according to any one of claims 2 to 6, characterized in that, It also includes the following steps: When outputting the final recommended list with language explanations, user feedback on the items is collected. and feedback on the explanation Among them, feedback and feedback Knowledge base for evaluating and adjusting strategies Strategies; Feedback Used to update parameters of the GNN collaborative filtering module .
8. A recommendation system for implementing the full-scene adaptive intelligent recommendation method based on graph neural networks as described in any one of claims 1 to 7, characterized in that, Includes the following modules: The heterogeneous data processing module is used to construct a heterogeneous graph based on the collected heterogeneous data, and to use a graph neural network to perform multi-layer information propagation and aggregation on the heterogeneous graph to obtain user embeddings and item embeddings that integrate node content features and high-order collaborative information of graph structure. The candidate pool generation module is used to build a parallel candidate recommendation model for generating a diverse candidate pool. In the GNN collaborative filtering module, preference scores are calculated based on user embedding and item embedding. In the sequence recommendation module, the Transformer model with a location feedforward network is used to calculate the probability of the user's next interaction with all items. The RAG module driven by the large language model retrieves external knowledge to generate highly novel candidates, thus obtaining a diverse candidate pool. The strategy formulation module receives all context information of the current user's recommendation request, determines the user's scenario tags through CoT inference rules, and uses the scenario tags as the query to retrieve the most matching strategy document from the strategy knowledge base using the RAG module to formulate the dynamic execution strategy for the current recommendation. The preliminary list generation module is used to normalize the original scores of the parallel candidate recommendation model based on the dynamic execution strategy, and calculate the preliminary fusion score based on the dynamic weights retrieved from the strategy knowledge base to generate a preliminary ranking list. The final list generation module is used to perform a reordering based on large language model reasoning on the preliminary sorted list in combination with scenario and strategy guidance, and to introduce evidence retrieved from the fact knowledge base based on the RAG module into the reordering result to obtain a final recommendation list with language explanation.
Citation Information
Patent Citations
Multi-agent-based content recommendation method and device, equipment, medium and product
CN119202373A