Heterogeneous graph structure discovery method and system based on large language model

Through a heterogeneous graph element structure discovery method based on a large language model, using genetic algorithms and semantic similarity optimization, combined with natural language coding, the problem of difficult interpretation and scale of element structure design in the existing technology has been solved, and prediction performance has been achieved. Meta-structure discovery and interpretability improve the generality and interpretability of the model.

CN118673103BActive Publication Date: 2024-10-29TSINGHUA UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411164473.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-10-29
Estimated Expiration
2044-08-23

AI Technical Summary

Technical Problem

It is difficult to design heterogeneous primitive structures that take into account both predictive performance and interpretability with existing technology, and manual design relies on expert knowledge and is difficult to scale. Methods based on reinforcement learning or machine learning often search for highly complex metastructures, which are difficult to interpret and interpret. understand.

Method used

Using a method based on large language models, through meta-structure selection and differential interpretation modules, genetic algorithms are used to optimize meta-structures, and combined with semantic similarity and natural language coding, automatically discover meta-structures that take into account both predictive performance and interpretability.

Benefits of technology

It realizes the automatic discovery of meta-structures that take into account both prediction performance and interpretability in different complex networks and various downstream tasks, improves the versatility and interpretability of the model, and reduces labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118673103B_ABST
    Figure CN118673103B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence technology, and provides a method and system for discovering heterogeneous graph metastructures based on a large language model, the method comprising: determining candidate metastructures of a heterogeneous graph; inputting the candidate metastructures of the heterogeneous graph into a large language model for metastructure selection, and obtaining a selected metastructure output by the large language model for metastructure selection; optimizing the selected metastructure based on a genetic algorithm, and repeatedly iterating the steps of determining the candidate metastructures of the heterogeneous graph and inputting the large language model for metastructure selection until a preset number of iterations are completed to obtain a discovered metastructure; inputting the discovered metastructure into a large language model for differential interpretation, and obtaining a semantic interpretation output by the large language model for differential interpretation. The present invention utilizes the reasoning ability of a large language model, and is guided by downstream task requirements, and can achieve metastructure discovery that takes into account both predictive performance and interpretability, and has strong versatility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method and system for discovering heterogeneous graph primitive structures based on a large language model. Background Art

[0002] Heterogeneous graph data mining refers to the process of revealing meaningful patterns, associations, and knowledge hidden in data by analyzing and mining the complex relationships between nodes and edges in heterogeneous graphs. Heterogeneous graphs are graph structures composed of multiple types of nodes or edges, which are widely used in various practical application scenarios, such as social networks, bioinformatics, financial transactions, recommendation systems, etc. By applying heterogeneous graph mining technology, we can discover information such as similarity, group structure, key paths, recommendation relationships, etc. between nodes, thereby supporting applications in fields such as data analysis, knowledge discovery, recommendation systems, and intelligent decision-making. Due to the complex relationships between nodes and edges, an important solution for heterogeneous graph data mining is to discover meta-paths or meta-structures. Meta-paths are a concept used to describe specific relationship patterns between nodes in heterogeneous graphs. They can be represented by defining a sequence of node types and edge types, while meta-structures are generalized meta-paths, extending them from linear structures to graph structures. By discovering and analyzing different types of meta-paths or meta-structures, we can reveal complex associations and patterns between nodes, thereby gaining a deep understanding of the graph structure.

[0003] Existing methods for manually designing meta-structures are highly dependent on expert domain knowledge, which is labor-intensive, difficult to scale, and cannot effectively guarantee model performance. Meta-structure search based on reinforcement learning or machine learning methods only optimizes the prediction performance of downstream tasks, so highly complex meta-structures are often searched, which are difficult to explain and understand.

[0004] Therefore, how to design an algorithm that can automatically discover meta-structures that balance predictive performance and interpretability from heterogeneous graph data and can be efficiently applied to different complex networks and multiple downstream tasks is an urgent problem to be solved. Summary of the invention

[0005] The present invention provides a method and system for discovering heterogeneous graph metastructures based on a large language model, which is used to solve the defect of the prior art that it is difficult to explain highly complex metastructures. The present invention utilizes the reasoning ability of the large language model and is guided by the requirements of downstream tasks. It can achieve metastructure discovery that takes into account both predictive performance and explainability, and has strong versatility.

[0006] The present invention provides a method for discovering meta-structures of heterogeneous graphs based on a large language model, comprising: determining candidate meta-structures of a heterogeneous graph; the candidate meta-structures of the heterogeneous graph contain semantic information; inputting the candidate meta-structures of the heterogeneous graph into a large language model for meta-structure selection to obtain a selected meta-structure output by the large language model for meta-structure selection; the large language model for meta-structure selection is used to evaluate and select the candidate meta-structures of the heterogeneous graph based on semantic similarity; optimizing the selected meta-structure based on a genetic algorithm, repeatedly iterating the steps of determining the candidate meta-structures of the heterogeneous graph and inputting the large language model for meta-structure selection until a preset number of iterations are completed to obtain a discovered meta-structure; inputting the discovered meta-structure into a large language model for differential interpretation to obtain a semantic interpretation output by the large language model for differential interpretation; the large language model for differential interpretation is used to explain the relationship between the structural attributes of the discovered meta-structure and the performance in downstream tasks.

[0007] According to a method for discovering meta-structures of heterogeneous graphs based on a large language model provided by the present invention, the method of determining candidate meta-structures of the heterogeneous graph includes: determining an initial meta-structure; modifying the meta-structure based on the initial meta-structure to obtain a modified meta-structure; the meta-structure modification method includes an insertion operation, a grafting operation, and a deletion operation; and performing natural language encoding on the modified meta-structure based on the semantic information to obtain a candidate meta-structure of the heterogeneous graph.

[0008] According to a heterogeneous graph meta-structure discovery method based on a large language model provided by the present invention, the large language model for meta-structure selection includes a small sample predictor and a semantic similarity-oriented meta-structure selector; the step of inputting the candidate meta-structure of the heterogeneous graph into the large language model for meta-structure selection to obtain the selected meta-structure output by the large language model for meta-structure selection includes: inputting the candidate meta-structure of the heterogeneous graph and preset prompt words into the small sample predictor and the semantic similarity-oriented meta-structure selector respectively; the preset prompt words include performance prediction prompt words and selection prompt words; the performance prediction prompt words include meta-structure evaluation records sampled from a preset memory pool , the selection prompt word includes a meta-structure selection record sampled from the preset memory pool; according to the performance prediction prompt word, a performance prediction pair of each candidate meta-structure of the heterogeneous graph is determined by the small sample predictor; the performance prediction pair is a data pair that associates the performance prediction result of the candidate meta-structure of the heterogeneous graph and the confidence of the performance prediction result; the confidence is used to characterize the semantic similarity between the candidate meta-structure of the heterogeneous graph and the meta-structure sampled from the preset memory pool; according to the selection prompt word and the performance prediction pair, the selected meta-structure is determined from the candidate meta-structures of the heterogeneous graph by the semantic similarity-guided meta-structure selector.

[0009] According to a heterogeneous graph meta-structure discovery method based on a large language model provided by the present invention, the optimization of the selected meta-structure based on a genetic algorithm includes: performing a performance evaluation on each of the selected meta-structures to obtain an evaluation result; the performance evaluation is performed by training the graph neural network in the downstream task through the selected meta-structure; the downstream tasks include node classification, link prediction, graph classification and recommendation system; eliminating poor meta-structures from the selected meta-structures; the poor meta-structures are meta-structures whose evaluation results do not meet preset evaluation conditions in the selected meta-structures; breeding the surviving meta-structures to obtain candidate meta-structures of the optimized heterogeneous graph; the surviving meta-structures are meta-structures whose evaluation results meet preset evaluation conditions in the selected meta-structures.

[0010] According to a heterogeneous graph meta-structure discovery method based on a large language model provided by the present invention, the preset memory pool is used to store historically selected meta-structures to train the performance of the graph neural network of the downstream task.

[0011] According to a heterogeneous graph meta-structure discovery method based on a large language model provided by the present invention, the method of inputting the discovered meta-structure into a differentially interpreted large language model to obtain a semantic interpretation of the output of the differentially interpreted large language model includes: determining a neighbor meta-structure according to the discovered meta-structure; the neighbor meta-structure is a meta-structure obtained after meta-structure modification and natural language encoding of the discovered meta-structure; the meta-structure modification method includes insertion operation, grafting operation and deletion operation; using the differentially interpreted large language model to perform structural attribute decomposition on the discovered meta-structure and the neighbor meta-structure respectively to obtain a discovered sub-structure and a neighbor sub-structure; the discovered sub-structure corresponds to the discovered meta-structure, and the neighbor sub-structure corresponds to the neighbor meta-structure; the graph neural network in the downstream task is trained by the discovered sub-structure and the neighbor sub-structure respectively to obtain a performance result; the performance result is used to characterize the performance of the discovered sub-structure and the neighbor sub-structure in the downstream task; based on the performance result, a semantic interpretation is performed by the differentially interpreted large language model; the semantic interpretation includes a structure in the discovered sub-structure that is beneficial to the performance improvement of the downstream task and a structure that is not beneficial to the performance improvement of the downstream task.

[0012] The present invention also provides a heterogeneous graph meta-structure discovery system based on a large language model, comprising: a determination module, used to determine candidate meta-structures of a heterogeneous graph; the candidate meta-structures of the heterogeneous graph contain semantic information; a selection module, used to input the candidate meta-structures of the heterogeneous graph into a large language model for meta-structure selection, and obtain a selected meta-structure output by the large language model for meta-structure selection; the large language model for meta-structure selection is used to evaluate and select the candidate meta-structures of the heterogeneous graph based on semantic similarity; an optimization module, used to optimize the selected meta-structure based on a genetic algorithm, repeatedly and iteratively execute the steps of determining the candidate meta-structures of the heterogeneous graph and inputting the large language model for meta-structure selection until a preset number of iterations are completed to obtain a discovered meta-structure; an explanation module, used to input the discovered meta-structure into a large language model for differential interpretation, and obtain a semantic explanation output by the large language model for differential interpretation; the large language model for differential interpretation is used to explain the relationship between the structural attributes of the discovered meta-structure and the performance in downstream tasks.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for discovering heterogeneous graph structures based on a large language model as described above is implemented.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described methods for discovering heterogeneous graph primitive structures based on a large language model.

[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for discovering heterogeneous graph primitive structures based on a large language model as described above is implemented.

[0016] The present invention provides a method and system for discovering metastructures of heterogeneous graphs based on a large language model, the method comprising: determining candidate metastructures of heterogeneous graphs; inputting the candidate metastructures of the heterogeneous graphs into a large language model for metastructure selection, and obtaining a selected metastructure output by the large language model for metastructure selection; optimizing the selected metastructure based on a genetic algorithm, and repeatedly iterating the steps of determining the candidate metastructures of the heterogeneous graphs and inputting the large language model for metastructure selection until a preset number of iterations are completed to obtain a discovered metastructure; inputting the discovered metastructure into a large language model for differential interpretation, and obtaining a semantic interpretation output by the large language model for differential interpretation. The present invention utilizes the reasoning ability of the large language model, is guided by downstream task requirements, and can achieve metastructure discovery that takes into account both predictive performance and interpretability, and has strong versatility. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 It is a flow chart of a heterogeneous graph primitive structure discovery method based on a large language model provided by the present invention.

[0019] Figure 2 It is a schematic diagram of the principle of a heterogeneous graph primitive structure discovery method based on a large language model provided by the present invention.

[0020] Figure 3 It is a schematic diagram of the principle of the method of modifying the metastructure provided by the present invention.

[0021] Figure 4 It is a schematic diagram of the principle of the meta-structure natural language encoding provided by the present invention.

[0022] Figure 5a Schematic diagram of preset prompt words provided by the present invention (in English).

[0023] Figure 5b Schematic diagram of the preset prompt words provided by the present invention (in Chinese).

[0024] Figure 6a It is a schematic diagram (in English) of the discovered meta-structure and corresponding semantic interpretation provided by the present invention.

[0025] Figure 6b is a schematic diagram (in Chinese) of the discovered meta-structure and corresponding semantic interpretation provided by the present invention.

[0026] Figure 7 It is a structural schematic diagram of a heterogeneous graph primitive structure discovery system based on a large language model provided by the present invention.

[0027] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0029] Please refer to Figure 1 , Figure 1 A schematic flow chart of a method for discovering heterogeneous graph primitive structures based on a large language model provided by the present invention.

[0030] Please refer to Figure 2 , Figure 2 A schematic diagram of the principle of a heterogeneous graph primitive structure discovery method based on a large language model provided by the present invention.

[0031] The present invention provides a method for discovering heterogeneous graph primitive structures based on a large language model, comprising:

[0032] 101: Determine a candidate meta-structure of a heterogeneous graph; the candidate meta-structure of the heterogeneous graph contains semantic information;

[0033] 102: Inputting the candidate meta-structures of the heterogeneous graph into the large language model for meta-structure selection to obtain the selected meta-structure output by the large language model for meta-structure selection; the large language model for meta-structure selection is used to evaluate and select the candidate meta-structures of the heterogeneous graph based on semantic similarity;

[0034] 103: Optimizing the selected meta-structure based on a genetic algorithm, repeatedly iteratively executing the step of determining the candidate meta-structure of the heterogeneous graph and the step of inputting the large language model for meta-structure selection, until a preset number of iterations is completed, and obtaining the discovered meta-structure;

[0035] 104: Input the discovered meta-structure into a differentially interpreted large language model to obtain a semantic interpretation output by the differentially interpreted large language model; the differentially interpreted large language model is used to explain the connection between the structural properties of the discovered meta-structure and the performance on downstream tasks.

[0036] Technological breakthroughs in Large Language Models (LLMs) provide a unique opportunity to address the challenges of meta-structure discovery. As they scale, LLMs emerge with new capabilities for complex tasks beyond autoregression. Heuristic chains of thought can effectively stimulate LLMs' reasoning capabilities for common sense, mathematical, and logical problems. This general reasoning ability has great potential to understand the rich semantic information in heterogeneous graphs, and has groundbreaking significance for current performance-oriented meta-structure search algorithms. In other words, the reasoning ability of LLMs can promote the joint optimization of semantic interpretability, rather than just searching for the best performing meta-structure.

[0037] The goal of the present invention is to achieve meta-structure discovery that takes into account both predictive performance and interpretability based on the type information of the input heterogeneous graph nodes and edges and guided by the downstream task requirements. Downstream tasks refer to specific tasks based on graph data, such as node classification, link prediction, graph classification, recommendation systems, etc.

[0038] The present invention can be applied to a variety of scenarios based on heterogeneous information networks, such as recommendation systems, social network analysis, bioinformatics, etc. Taking the recommendation system as an example, its core goal is to recommend the most likely products to users in the future based on their historical behaviors (such as user purchases of products, interactions between users, etc.). According to the method provided by the present invention, it is possible to adaptively mine the high-order structure between users and products on real data, while improving the performance of downstream recommendation tasks and ensuring interpretability, thereby helping business personnel to optimize the recommendation system in a targeted manner.

[0039] Specifically, on a heterogeneous graph constructed by data such as social networks, the type information of nodes and edges of the heterogeneous graph is first used as input, and the semantics (semantic information) of each node and edge is explicitly described in natural language. After the semantic annotation of the heterogeneous graph is completed, the candidate meta-structure is generated and natural language encoded. Then, the candidate meta-structure of the heterogeneous graph is pre-evaluated and selected based on semantic similarity through the large language model for meta-structure selection to obtain the selected meta-structure. After that, according to the selected meta-structure, the selected meta-structure is eliminated and propagated to make its overall performance stable and evolve, and the steps of determining the candidate meta-structure of the heterogeneous graph and inputting the large language model for meta-structure selection are iteratively executed until the preset number of iterations is completed, and the discovered meta-structure (with the best performance) is obtained. Finally, the discovered meta-structure is input into the large language model of differential interpretation to explain the relationship between the structural attributes of the discovered meta-structure and the performance in the downstream tasks, and a text explanation that can be understood by the user is automatically generated to reveal the reasons for the excellent performance. The meta-structure discovered by the present invention can be put online for specific applications of relevant downstream tasks. The present invention has the characteristics of good prediction performance, strong interpretability, strong versatility, etc., and can effectively solve the shortcomings of existing solutions.

[0040] As a preferred embodiment, determining a candidate metastructure of a heterogeneous graph includes: determining an initial metastructure; modifying the metastructure based on the initial metastructure to obtain a modified metastructure; the metastructure modification method includes insertion operation, grafting operation and deletion operation; and encoding the modified metastructure in natural language based on semantic information to obtain a candidate metastructure of the heterogeneous graph.

[0041] Please refer to Figure 3 , Figure 3 A schematic diagram of the principles of the method for modifying the metastructure provided by the present invention.

[0042] In this embodiment, the candidate meta-structure generator defines the following three basic operations for modifying the initial meta-structure in order to generate effective and diverse candidate meta-structures:

[0043] Insertion operation: This operation inserts an edge in the initial metastructure Replace with a component , the result is equivalent to adding a node to the initial meta-structure. Assume that the node set contained in the initial meta-structure is , the new meta structure contains the node set , then its mathematical expression is: .

[0044] Grafting operation: This operation accepts a component , and find two nodes in the initial metastructure that are of the same type as the first and last nodes of the selected component , and merge them separately. The result is equivalent to adding a bypass between two points of the initial meta-structure. Therefore, this is the only basic operation that can generate a meta-structure from a meta-path. Its mathematical expression is: .

[0045] DELETION operation: This operation deletes a certain number of nodes from the initial meta structure. , and try to reconnect all neighboring nodes. Its mathematical expression is: .

[0046] At the same time, in order to limit the number of candidate metastructures in each iteration, the present invention designs a set of components for performing these operations: all metapaths containing at most 2 nodes are used as components for the insertion operation, and all metapaths containing at most 3 nodes are used as components for the grafting operation. The deletion operation does not require components as input because it regards all existing nodes on the initial metastructure as operation candidates.

[0047] Please refer to Figure 4 , Figure 4 A schematic diagram of the principle of the metastructure natural language encoding provided by the present invention.

[0048] To assist the understanding of LLM, the present invention designs a natural language encoder, which explicitly describes the semantics (semantic information) of each node and edge in natural language, and encodes each metastructure into a natural language sentence. For any metastructure, first traverse the structure to find all possible simple paths from the source node to the target node; each simple path obtained is equivalent to a metapath connecting the source node and the target node decomposed from the initial metastructure. For each simple path, a nested clause represented by THAT is used to encode it into a natural language sentence, thereby obtaining a set of sub-logics. After obtaining the natural language encoding (i.e., sub-logics) of the decomposed metapath, they are further combined using the conjunction AND to represent the logical summation effect, thereby obtaining the natural language encoding of the entire metastructure, providing a semantically clear and easy-to-understand expression form for LLM.

[0049] As a preferred embodiment, the large language model for meta-structure selection includes a small sample predictor and a semantic similarity-oriented meta-structure selector; the candidate meta-structure of the heterogeneous graph is input into the large language model for meta-structure selection to obtain the selected meta-structure output by the large language model for meta-structure selection, including: inputting the candidate meta-structure of the heterogeneous graph and preset prompt words into the small sample predictor and the semantic similarity-oriented meta-structure selector respectively; the preset prompt words include performance prediction prompt words and selection prompt words; the performance prediction prompt words include meta-structure evaluation records sampled from a preset memory pool, and the selection prompt words include meta-structure selection records sampled from the preset memory pool; according to the performance prediction prompt words, the performance prediction pair of each candidate meta-structure of the heterogeneous graph is determined by the small sample predictor; the performance prediction pair is a data pair of the performance prediction result and the confidence of the performance prediction result of the candidate meta-structure of the associated heterogeneous graph; the confidence is used to characterize the semantic similarity between the candidate meta-structure of the heterogeneous graph and the meta-structure sampled in the preset memory pool; according to the selection prompt words and the performance prediction pair, the selected meta-structure is determined from the candidate meta-structures of the heterogeneous graph by the semantic similarity-oriented meta-structure selector.

[0050] As a preferred embodiment, a preset memory pool is used to store historically selected meta-structures to train the performance of graph neural networks for downstream tasks.

[0051] In this embodiment, in order to standardize the interpretability of the discovered meta-structure, the large language model for meta-structure selection designs two LLM-driven modules (small sample predictor and semantic similarity-oriented meta-structure selector) to evaluate and select candidate meta-structures based on semantic similarity. Taking a set of candidate meta-structures as input, the large language model for meta-structure selection outputs the optimal selected meta-structure, achieving single-step optimization of meta-structure performance.

[0052] Please refer to Figure 5a , Figure 5a A schematic diagram of the preset prompt words provided by the present invention (in English).

[0053] Please refer to Figure 5b , Figure 5b A schematic diagram of the preset prompt words provided by the present invention (in Chinese).

[0054] Specifically, a group of meta-structures with similar structures are used as candidate meta-structures of the heterogeneous graph, including both meta-structures encountered and evaluated in earlier generation and completely new meta-structures. In order to utilize the insights gained from previous evaluations in the decision-making process, the present invention maintains a preset memory pool to store all evaluated meta-structures. When predicting the performance of the candidate structures, the prompt word generator samples a certain number of meta-structure evaluation records from the preset memory pool and inputs them into the small sample predictor as part of the performance prediction prompt words. The small sample predictor determines the performance prediction results of the candidate meta-structures of the heterogeneous graph based on the performance prediction prompt words. In addition, the small sample predictor needs to provide confidence in each performance prediction result , thus associating a performance prediction pair with each candidate metastructure of the heterogeneous graph . Intuitively, if the few-shot predictor believes that a candidate meta-structure is very similar to a corresponding meta-structure in the preset memory pool, it tends to assign higher confidence to the performance prediction result. This is because structural similarity is likely to indicate functional similarity. Through the few-shot predictor, the performance and confidence of the candidate meta-structure can be predicted based on the performance evaluation information of the graph neural network for training downstream tasks for historically selected meta-structures in the preset memory pool, thereby providing more information and guidance in the decision-making process, which helps to enhance the quality and interpretability of performance prediction pairs.

[0055] After receiving a set of candidate meta-structures of heterogeneous graphs, selecting cue words (including meta-structure selection records sampled from a preset memory pool) and performance prediction pairs, the semantic similarity-guided meta-structure selector makes a final decision and selects the expected best candidate meta-structure (selected meta-structure) to enter the next round of iteration. In this process, the semantic similarity-guided meta-structure selector will comprehensively consider the semantic meaning of the meta-structure, the performance prediction result of selecting the meta-structure, and the confidence of the performance prediction result, and weigh them when necessary to make the best decision.

[0056] As a preferred embodiment, the selected meta-structure is optimized based on a genetic algorithm, including: performing a performance evaluation on each selected meta-structure to obtain an evaluation result; the performance evaluation is performed by training a graph neural network in a downstream task through the selected meta-structure; the downstream tasks include node classification, link prediction, graph classification and recommendation system; poor meta-structures are eliminated from the selected meta-structures; poor meta-structures are meta-structures whose evaluation results do not meet preset evaluation conditions in the selected meta-structures; surviving meta-structures are propagated to obtain candidate meta-structures of an optimized heterogeneous graph; surviving meta-structures are meta-structures whose evaluation results meet preset evaluation conditions in the selected meta-structures.

[0057] In this embodiment, a derivative-free optimization framework based on a genetic algorithm is constructed to achieve stable performance improvement. Specifically, the genetic updater maintains a NA population of individuals, each representing a different selected meta-structure. In each generation, a GNN (Graph Neural Network) for a given downstream task is trained using each selected meta-structure for performance evaluation. After the evaluation is completed, the underperforming meta-structures (the meta-structures whose evaluation results do not meet the preset evaluation conditions in the selected meta-structures) will be eliminated from the population. The surviving meta-structures (the meta-structures whose evaluation results meet the preset evaluation conditions in the selected meta-structures) undergo a reproduction phase, in which the probability of replication occurring is proportional to their performance. In essence, this phase uses promising meta-structures to replenish the population to restore it to its original size. Both the elimination and reproduction processes reflect the mechanism of natural selection, which allows species to evolve in natural environments (iterative optimization at the population level). After obtaining the modified population ( N After selecting the meta-structure with better average performance, it is input into the large language model of meta-structure selection as the candidate meta-structure of the optimized heterogeneous graph to improve the meta-structure of each individual. In the evolutionary framework, this can be regarded as a targeted mutation method. This iterative optimization process allows the meta-structure in the population to gradually evolve and improve to adapt to the requirements of a given downstream task and find a better solution.

[0058] As a preferred embodiment, the discovered meta-structure is input into a large language model of differential interpretation to obtain a semantic interpretation of the output of the large language model of differential interpretation, including: determining a neighbor meta-structure based on the discovered meta-structure; the neighbor meta-structure is a meta-structure obtained after meta-structure modification and natural language encoding of the discovered meta-structure; the meta-structure modification method includes insertion operation, grafting operation and deletion operation; the discovered meta-structure and the neighbor meta-structure are respectively decomposed into structural attributes by the large language model of differential interpretation to obtain a discovered sub-structure and a neighbor sub-structure; the discovered sub-structure corresponds to the discovered meta-structure, and the neighbor sub-structure corresponds to the neighbor meta-structure; the graph neural network of the downstream task is trained by the discovered sub-structure and the neighbor sub-structure respectively to obtain performance results; the performance results are used to characterize the performance of the discovered sub-structure and the neighbor sub-structure in the downstream task; based on the performance results, a semantic interpretation is performed by the large language model of differential interpretation; the semantic interpretation includes structures in the discovered sub-structure that are beneficial to the performance improvement of the downstream task and structures that are not beneficial to the performance improvement of the downstream task.

[0059] Please refer to Figure 6a , Figure 6a Schematic diagram of the discovered meta-structures and corresponding semantic interpretations provided for this invention (in English).

[0060] Please refer to Figure 6b , Figure 6b Schematic diagram of the discovered meta-structures and corresponding semantic interpretations provided for the present invention (in Chinese).

[0061] In this embodiment, in order to take advantage of the excellent natural language generation capabilities of LLM, a differential interpretation large language model is designed to automatically generate human-understandable text explanations to explain why the discovered meta-structures achieve excellent performance. The differential interpretation large language model is guided by a Chain-of-Thought (CoT) style prompting process to distinguish the key structural attributes that contribute to the performance improvement. Specifically, first, according to the discovered meta-structure T Determine the neighbor meta-structure, which is the meta-structure obtained after meta-structure modification and natural language encoding of the discovered meta-structure, and encode each neighbor meta-structure in natural language. Then prompt the large language model of differential interpretation to decompose the structural attributes of the discovered meta-structure and the neighbor meta-structure, so as to comprehensively analyze the meaning and function of the sub-structure. Then, the graph neural network in the downstream task is trained by discovering sub-structures and neighbor sub-structures respectively, so as to quickly evaluate the discovered meta-structure T The performance of the meta-structures discovered by the difference is determined by comparing the performance of the meta-structures discovered by the difference and the performance of the neighbor meta-structures on the downstream tasks. T There are structures that are beneficial to the performance improvement of downstream tasks and structures that are not beneficial to the performance improvement of downstream tasks, which can reveal the complex relationship between the structural properties of the discovered meta-structure and the performance of downstream tasks, thereby assisting users in a comprehensive understanding and evaluation of the discovered meta-structure.

[0062] Four datasets covering different fields are used in the recommendation system: Amazon, Yelp, Douban, and LastFM.

[0063] In the node classification task, the goal is to predict the label of a node belonging to a specific type, such as determining the genre of a movie. To evaluate the effectiveness of the method, experiments were conducted on four widely adopted real-world datasets: ACM, IMDB, DBLP, and OAG-NN. In these datasets, the classification targets correspond to the paper topics of ACM, the movie genres of IMDB, the research fields of the authors of DBLP, and the paper publication venues of OAG-NN.

[0064] Among them, metapath2vec, HIN2Vec, HAN, RMSHRec, HERec, GEMS, DiffMG and PMMM are the results of the prior art, and ReStruct is the corresponding result of the present invention.

[0065] It can be seen from the experimental results in the recommendation system (Table 1) and the experimental results of the node classification task (Table 2) that the method of the present invention shows stronger predictability, interpretability and versatility in discovering the meta-structure of heterogeneous graphs than the methods of the prior art.

[0066] Table 1: Recommended AUC (%) for four datasets

[0067]

[0068] Table 2: Macro F1 scores (%) for node classification on four datasets

[0069]

[0070] The heterogeneous graph primitive structure discovery system based on a large language model provided by the present invention is described below. The heterogeneous graph primitive structure discovery system based on a large language model described below and the heterogeneous graph primitive structure discovery method based on a large language model described above can be referenced to each other.

[0071] Please refer to Figure 7 , Figure 7 A structural schematic diagram of a heterogeneous graph primitive structure discovery system based on a large language model provided by the present invention.

[0072] The present invention also provides a heterogeneous graph meta-structure discovery system based on a large language model, comprising: a determination module 1, used to determine candidate meta-structures of a heterogeneous graph; the candidate meta-structures of the heterogeneous graph contain semantic information; a selection module 2, used to input the candidate meta-structures of the heterogeneous graph into the large language model for meta-structure selection, and obtain the selected meta-structure output by the large language model for meta-structure selection; the large language model for meta-structure selection is used to evaluate and select the candidate meta-structures of the heterogeneous graph based on semantic similarity; an optimization module 3, used to optimize the selected meta-structure based on a genetic algorithm, repeatedly iteratively execute the steps of determining the candidate meta-structures of the heterogeneous graph and inputting the large language model for meta-structure selection, until a preset number of iterations is completed, and the discovered meta-structure is obtained; an interpretation module 4, used to input the discovered meta-structure into the large language model for differential interpretation, and obtain the semantic interpretation output by the large language model for differential interpretation; the large language model for differential interpretation is used to explain the relationship between the structural attributes of the discovered meta-structure and the performance in downstream tasks.

[0073] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8As shown, the electronic device may include: a processor (processor) 810, a communication interface (Communications Interface) 820, a memory (memory) 830 and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call the logic instructions in the memory 830 to execute a heterogeneous graph meta-structure discovery method based on a large language model, the method comprising: determining a candidate meta-structure of a heterogeneous graph; the candidate meta-structure of the heterogeneous graph contains semantic information; inputting the candidate meta-structure of the heterogeneous graph into the large language model for meta-structure selection to obtain a selected meta-structure output by the large language model for meta-structure selection; the large language model for meta-structure selection is used to evaluate and select the candidate meta-structures of the heterogeneous graph based on semantic similarity; optimizing the selected meta-structure based on a genetic algorithm, repeatedly iterating the steps of determining the candidate meta-structure of the heterogeneous graph and inputting the large language model for meta-structure selection until a preset number of iterations are completed to obtain a discovered meta-structure; inputting the discovered meta-structure into the large language model for differential interpretation to obtain a semantic interpretation output by the large language model for differential interpretation; the large language model for differential interpretation is used to explain the relationship between the structural attributes of the discovered meta-structure and the performance in downstream tasks.

[0074] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0075] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the heterogeneous graph meta-structure discovery method based on a large language model provided by the above methods, the method including: determining a candidate meta-structure of a heterogeneous graph; the candidate meta-structure of the heterogeneous graph contains semantic information; inputting the candidate meta-structure of the heterogeneous graph into a large language model for meta-structure selection to obtain a selected meta-structure output by the large language model for meta-structure selection; the large language model for meta-structure selection is used to evaluate and select the candidate meta-structures of the heterogeneous graph based on semantic similarity; optimizing the selected meta-structure based on a genetic algorithm, repeatedly iterating the steps of determining the candidate meta-structure of the heterogeneous graph and inputting the large language model for meta-structure selection until a preset number of iterations are completed to obtain a discovered meta-structure; inputting the discovered meta-structure into a large language model for differential interpretation to obtain a semantic interpretation output by the large language model for differential interpretation; the large language model for differential interpretation is used to explain the relationship between the structural attributes of the discovered meta-structure and the performance in downstream tasks.

[0076] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the heterogeneous graph meta-structure discovery method based on a large language model provided by the above-mentioned methods, the method comprising: determining a candidate meta-structure of a heterogeneous graph; the candidate meta-structure of the heterogeneous graph contains semantic information; inputting the candidate meta-structure of the heterogeneous graph into a large language model for meta-structure selection to obtain a selected meta-structure output by the large language model for meta-structure selection; the large language model for meta-structure selection is used to evaluate and select the candidate meta-structures of the heterogeneous graph based on semantic similarity; optimizing the selected meta-structure based on a genetic algorithm, repeatedly iterating the steps of determining the candidate meta-structure of the heterogeneous graph and inputting the large language model for meta-structure selection until a preset number of iterations are completed to obtain a discovered meta-structure; inputting the discovered meta-structure into a large language model for differential interpretation to obtain a semantic interpretation output by the large language model for differential interpretation; the large language model for differential interpretation is used to explain the relationship between the structural attributes of the discovered meta-structure and the performance in downstream tasks.

[0077] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0078] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0079] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for discovering heterogeneous graph structures based on a large language model, characterized in that: include: Determining a candidate meta-structure of a heterogeneous graph; the candidate meta-structure of the heterogeneous graph includes semantic information; Inputting the candidate meta-structures of the heterogeneous graph into a large language model for meta-structure selection to obtain a selected meta-structure output by the large language model for meta-structure selection; the large language model for meta-structure selection is used to evaluate and select the candidate meta-structures of the heterogeneous graph based on semantic similarity; Optimizing the selected meta-structure based on a genetic algorithm, repeatedly iteratively executing the step of determining the candidate meta-structure of the heterogeneous graph and the step of inputting the large language model of the meta-structure selection until a preset number of iterations are completed to obtain a discovered meta-structure; Inputting the discovered meta-structure into a differentially interpreted large language model to obtain a semantic interpretation output by the differentially interpreted large language model; the differentially interpreted large language model is used to explain the relationship between the structural attributes of the discovered meta-structure and the performance of downstream tasks; The large language model for meta-structure selection includes a small sample predictor and a semantic similarity-guided meta-structure selector; The step of inputting the candidate meta-structure of the heterogeneous graph into the large language model for meta-structure selection to obtain the selected meta-structure output by the large language model for meta-structure selection comprises: The candidate meta-structures and preset prompt words of the heterogeneous graph are input into the small sample predictor and the semantic similarity-oriented meta-structure selector respectively; the preset prompt words include performance prediction prompt words and selection prompt words; the performance prediction prompt words include meta-structure evaluation records sampled from a preset memory pool, and the selection prompt words include meta-structure selection records sampled from the preset memory pool; According to the performance prediction prompt words, a performance prediction pair of each candidate meta-structure of the heterogeneous graph is determined by the small sample predictor; the performance prediction pair is a data pair associating a performance prediction result of the candidate meta-structure of the heterogeneous graph and a confidence level of the performance prediction result; the confidence level is used to characterize the semantic similarity between the candidate meta-structure of the heterogeneous graph and the meta-structure sampled in the preset memory pool; According to the selection cue words and the performance prediction pairs, the selected meta-structure is determined from candidate meta-structures of the heterogeneous graph by the semantic similarity-guided meta-structure selector.

2. The method for discovering heterogeneous graph primitive structures based on a large language model according to claim 1, characterized in that: The step of determining a candidate metastructure of a heterogeneous graph comprises: Determine the initial meta-structure; Modifying the metastructure based on the initial metastructure to obtain a modified metastructure; the metastructure modification method includes insertion operation, grafting operation and deletion operation; The modified meta-structure is encoded in natural language based on the semantic information to obtain a candidate meta-structure of the heterogeneous graph.

3. The method for discovering heterogeneous graph primitive structures based on a large language model according to claim 1, characterized in that: The step of optimizing the selected meta-structure based on a genetic algorithm comprises: Performing performance evaluation on each of the selected meta-structures to obtain evaluation results; the performance evaluation is performed by training the graph neural network in the downstream task through the selected meta-structure; the downstream tasks include node classification, link prediction, graph classification and recommendation system; Eliminating poor meta-structures from the selected meta-structures; the poor meta-structures are meta-structures whose evaluation results do not meet preset evaluation conditions in the selected meta-structures; The surviving meta-structures are propagated to obtain candidate meta-structures of the optimized heterogeneous graph; the surviving meta-structures are meta-structures whose evaluation results meet preset evaluation conditions among the selected meta-structures.

4. The method for discovering heterogeneous graph primitive structures based on a large language model according to claim 1, characterized in that: The preset memory pool is used to store the historically selected meta-structure to train the performance of the graph neural network for the downstream task.

5. The method for discovering heterogeneous graph primitive structures based on a large language model according to any one of claims 1 to 4, characterized in that: The step of inputting the discovered meta-structure into a differentially interpreted large language model to obtain a semantic interpretation output by the differentially interpreted large language model includes: Determine a neighbor meta-structure according to the discovered meta-structure; the neighbor meta-structure is a meta-structure obtained by performing meta-structure modification and natural language encoding on the discovered meta-structure; the meta-structure modification includes an insertion operation, a grafting operation, and a deletion operation; Decomposing the discovered meta-structure and the neighbor meta-structure by using the differentially interpreted large language model to obtain a discovered sub-structure and a neighbor sub-structure; the discovered sub-structure corresponds to the discovered meta-structure, and the neighbor sub-structure corresponds to the neighbor meta-structure; The graph neural network in the downstream task is trained by the discovery substructure and the neighbor substructure respectively to obtain performance results; the performance results are used to characterize the performance of the discovery substructure and the neighbor substructure in the downstream task; Based on the performance results, semantic interpretation is performed through the large language model of differential interpretation; the semantic interpretation includes structures in the discovered substructure that are beneficial to improving the performance of the downstream task and structures that are not beneficial to improving the performance of the downstream task.

6. A heterogeneous graph structure discovery system based on a large language model, characterized in that: include: A determination module, used to determine a candidate meta-structure of a heterogeneous graph; the candidate meta-structure of the heterogeneous graph includes semantic information; A selection module is used to input the candidate meta-structures of the heterogeneous graph into a large language model for meta-structure selection to obtain a selected meta-structure output by the large language model for meta-structure selection; the large language model for meta-structure selection is used to evaluate and select the candidate meta-structures of the heterogeneous graph based on semantic similarity; An optimization module, configured to optimize the selected meta-structure based on a genetic algorithm, repeatedly and iteratively execute the step of determining the candidate meta-structure of the heterogeneous graph and the step of inputting the large language model of the meta-structure selection until a preset number of iterations are completed to obtain a discovered meta-structure; An interpretation module, used for inputting the discovered meta-structure into a large language model of differential interpretation to obtain a semantic interpretation output by the large language model of differential interpretation; The differentially explained large language model is used to explain the connection between the structural properties of the discovered meta-structure and the performance on downstream tasks; The large language model for meta-structure selection includes a small sample predictor and a semantic similarity-guided meta-structure selector; The step of inputting the candidate meta-structure of the heterogeneous graph into the large language model for meta-structure selection to obtain the selected meta-structure output by the large language model for meta-structure selection comprises: The candidate meta-structures and preset prompt words of the heterogeneous graph are input into the small sample predictor and the semantic similarity-oriented meta-structure selector respectively; the preset prompt words include performance prediction prompt words and selection prompt words; the performance prediction prompt words include meta-structure evaluation records sampled from a preset memory pool, and the selection prompt words include meta-structure selection records sampled from the preset memory pool; According to the performance prediction prompt words, a performance prediction pair of each candidate meta-structure of the heterogeneous graph is determined by the small sample predictor; the performance prediction pair is a data pair associating a performance prediction result of the candidate meta-structure of the heterogeneous graph and a confidence level of the performance prediction result; the confidence level is used to characterize the semantic similarity between the candidate meta-structure of the heterogeneous graph and the meta-structure sampled in the preset memory pool; According to the selection cue words and the performance prediction pairs, the selected meta-structure is determined from candidate meta-structures of the heterogeneous graph by the semantic similarity-guided meta-structure selector.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for discovering heterogeneous graph primitive structures based on a large language model as described in any one of claims 1 to 5 is implemented.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for discovering heterogeneous graph primitive structures based on a large language model as claimed in any one of claims 1 to 5 is implemented.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for discovering heterogeneous graph primitive structures based on a large language model as claimed in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Industrial chain risk assessment method of graph neural network

    CN118114989A

  • Heterogeneous social information network intelligent data service method

    CN118297741A