Rule mining method and device for graph neural network, equipment and storage medium

By identifying negative nodes in a graph neural network, extracting negative key subgraphs, and recognizing common graph patterns, negative prediction rules are generated, solving the interpretability problem of negative prediction in graph neural networks and realizing a transparent decision-making process.

CN122047447APending Publication Date: 2026-05-15SHENZHEN INST OF COMPUTING SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610504002.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-16
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing graph neural networks lack interpretability when making negative predictions, making it difficult to uncover the underlying rules.

Method used

By identifying negative nodes in the graph data, extracting negative key subgraphs, recognizing common graph patterns, and searching for reference graph patterns that reach a threshold based on the common graph patterns, obtaining the set of pattern attribute predicates, and generating corresponding negative prediction rules.

Benefits of technology

It makes the negative prediction process of graph neural networks transparent, generating human-readable, verifiable, and traceable rules, thus making the decision-making process of graph neural networks transparent.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122047447A_ABST
    Figure CN122047447A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of graph data, and relates to a rule mining method and device for a graph neural network, equipment and a storage medium. Wherein negative nodes in the graph data are determined, and the negative nodes are nodes for making negative prediction by the graph neural network; for each negative node, extracting a negative key sub-graph which enables the graph neural network to make negative prediction from the graph data; identifying a common graph mode between the negative key sub-graphs, and based on the common graph mode, searching a reference graph mode with rule measurement reaching a measurement threshold; and obtaining a mode attribute predicate set corresponding to the reference graph mode, and generating a negative prediction rule corresponding to the graph neural network according to the mode attribute predicate set. According to the invention, the negative prediction rule after the negative prediction of the graph neural network can be mined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of graph data technology, and in particular to a method for rule mining of graph neural networks, a device for rule mining of graph neural networks, a computer device, and a computer-readable storage medium. Background Technology

[0002] In recent years, graph neural networks (GNNs) have been widely applied in various real-world scenarios due to their ability to simultaneously model entity features and relational structures. These applications include risk control and credit approval in finance, as well as user-item interaction modeling and social relationship-enhanced recommendation systems. When a GNN makes a negative prediction, people naturally want to understand the underlying reasons, such as why their paper was rejected or their application failed. Therefore, there is an urgent need for interpretable rule mining mechanisms to uncover the negative prediction rules that drive GNNs to make negative predictions. Summary of the Invention

[0003] This application provides a method for mining rules in a graph neural network, a device for mining rules in a graph neural network, a computer device, and a computer-readable storage medium, which can mine the negative prediction rules behind the negative predictions made by the graph neural network.

[0004] In a first aspect, embodiments of this application provide a rule mining method for graph neural networks, comprising: Identify the negative nodes in the graph data; negative nodes are those that the graph neural network makes negative predictions for. For each negative node, extract the negative key subgraph from the graph data that enables the graph neural network to make a negative prediction; Identify common graph patterns among negative key subgraphs, and based on these common graph patterns, search for reference graph patterns whose rule metrics reach the metric threshold. Obtain the set of pattern attribute predicates corresponding to the reference graph pattern, and generate negative prediction rules corresponding to the graph neural network based on the set of pattern attribute predicates.

[0005] Secondly, embodiments of this application provide a rule mining apparatus for graph neural networks, comprising: The node determination module is used to determine negative nodes in graph data. Negative nodes are the nodes that the graph neural network makes negative predictions for. The subgraph extraction module is used to extract the negative key subgraph from the graph data for each negative node, which enables the graph neural network to make a negative prediction. The pattern search module is used to identify common graph patterns among negative key subgraphs and, based on these common graph patterns, search for reference graph patterns whose rule metrics reach the metric threshold. The rule generation module is used to obtain the set of pattern attribute predicates corresponding to the reference graph pattern, and generate negative prediction rules corresponding to the graph neural network based on the set of pattern attribute predicates.

[0006] Optionally, in one embodiment, the pattern search module is used to identify candidate common graph patterns that appear at a frequency threshold in the negative key subgraph; for each candidate common graph pattern, a first occurrence frequency of the candidate common graph pattern in the negative key subgraph is calculated, and a second occurrence frequency of the candidate common graph pattern in the positive key subgraph corresponding to the positive node is calculated; and candidate common graph patterns with a first occurrence frequency greater than a second occurrence frequency are determined as common graph patterns.

[0007] Optionally, in one embodiment, the pattern search module is used to perform topological merging of different common graph patterns with negative nodes as the merging center to obtain an initial graph pattern; determine the node merging operation with the highest reward value for the initial graph pattern and execute the node merging operation; iterate until a reference graph pattern with the rule metric reaching the metric threshold is obtained, and the reward value is calculated based on the change in rule metric of the initial graph pattern before and after the node merging operation is executed.

[0008] Optionally, in one embodiment, the pattern search module is used to select at least two common graph patterns from all common graph patterns and add them to the pattern candidate set; using the negative node as the merging center, the different common graph patterns in the pattern candidate set are topologically merged to obtain an initial graph pattern; the pattern search module is also used to add new common graph patterns to the pattern candidate set after iterative execution until a reference graph pattern whose rule metric reaches the metric threshold is obtained, and to re-obtain the reference graph pattern corresponding to the pattern candidate set, until no reference graph pattern whose rule metric reaches the metric threshold can be obtained.

[0009] Optionally, in one embodiment, the rule generation module is further configured to, for each attribute predicate in the pattern attribute predicate set, calculate the third occurrence frequency of the attribute predicate in the negative node and calculate the fourth occurrence frequency of the attribute predicate in the positive node; if the third occurrence frequency of the attribute predicate is greater than the fourth occurrence frequency, then the attribute predicate is retained; otherwise, the attribute predicate is deleted from the pattern attribute predicate set.

[0010] Optionally, in one embodiment, the rule generation module is further configured to evaluate the perplexity of each attribute predicate in the pattern attribute predicate set; if the perplexity of the attribute predicate is lower than the perplexity threshold, the attribute predicate is retained; otherwise, the attribute predicate is deleted from the pattern attribute predicate set.

[0011] Optionally, in one embodiment, the rule generation module is further configured to, in ascending order of perplexity, take the attribute predicates in the conjunctive pattern attribute predicate set one by one as leaders, until the leaders and negative predictions are established as subsequent negative prediction rules.

[0012] Thirdly, the computer device provided in the embodiments of this application includes a processor and a memory. The memory stores a computer program that can run on the processor. When the processor runs the computer program, it implements the rule mining method of the graph neural network provided in the embodiments of this application.

[0013] Fourthly, the computer-readable storage medium provided in the embodiments of this application stores a computer program, which, when executed by a processor, implements the rule mining method of the graph neural network provided in the embodiments of this application.

[0014] The graph neural network rule mining scheme provided in this application identifies negative nodes in graph data, which are the nodes that the graph neural network makes negative predictions. For each negative node, it extracts the negative key subgraphs that enable the graph neural network to make negative predictions from the graph data; identifies common graph patterns among the negative key subgraphs; and searches for reference graph patterns whose rule metrics reach a certain threshold based on these common graph patterns. It then obtains a set of pattern attribute predicates corresponding to the reference graph patterns and generates negative prediction rules corresponding to the graph neural network based on these pattern attribute predicates. In this way, by mining the common structural features implicit in the negative nodes of the graph data and transforming them into formal predicate logic expressions, it ultimately forms human-readable, verifiable, and traceable negative prediction rules, making the "black box" decision-making process of the graph neural network transparent. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a schematic diagram of the structure of the graph data involved in this application; Figure 2 This is a schematic diagram of an application environment for the rule mining method of graph neural networks provided in this application embodiment; Figure 3 This is a flowchart illustrating the rule mining method for graph neural networks provided in an embodiment of this application; Figure 4 This is an example diagram of a combination diagram pattern in an embodiment of this application; Figure 5This is an example diagram of a search reference diagram pattern in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of the rule mining device for graph neural networks provided in the embodiments of this application; Figure 7 This is a schematic diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation

[0017] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0018] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0019] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0020] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0021] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0022] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0023] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0024] To facilitate understanding of the technical solution of this application, the following is a brief explanation of some of the technical terms involved in this application.

[0025] Please refer to Figure 1 Graph data is a data structure that uses nodes and edges to represent entities and relationships. It can be used to model complex relationship networks in the real world and is widely used in fields such as social networks, e-commerce, biomedicine, and finance. For example, in the e-commerce field, graph data can represent users, products (nodes) and their browsing and purchasing behaviors (edges). Its core lies in giving semantics to nodes / edges through labels and attributes. Graph data can be represented as G=(V,E,L).

[0026] V is the set of all nodes in the graph data, and the number of nodes is finite. These nodes represent entities in the real world (such as users, products, accounts, genes, hosts, servers, etc.). For example, the e-commerce graph data of an e-commerce business system might contain nodes... (User A), Node (Product B), etc.; the transaction graph data in the financial business system may contain nodes. (Account X), Node (Account Y), etc.

[0027] E is the set of all edges in the graph data, where each edge ( ) indicates from node To the node A directed edge represents the relationship between nodes. For example, in the e-commerce graph data of an e-commerce business system, an edge ( ) may represent a node (User A) browsed the node (Product B); Edges in the transaction graph data of the financial business system ( ) may represent a node (Account X) to node (Account Y) Transfer.

[0028] L represents a function that assigns labels (a type of marker used to identify or classify nodes / edges) to nodes and edges, where the label categories are a finite set. node L( ) Represents a node Tags such as "user" for user nodes and "item" for product nodes; for edges L( ) Labels representing edge e, such as "browse" for browsing edge, "transfer" for transfer edge, and so on.

[0029] A represents a point. The value of the A attribute on the node, such as the age of the user node, the price of the product node, etc. .A represents an edge The values ​​that the A attribute can take, such as the duration of browsing behavior or the amount of money transfer behavior.

[0030] Graph Neural Networks (GNNs) are deep learning models specifically designed for processing graph data. They aggregate neighboring node information through message passing mechanisms to learn representations of nodes, edges, or the entire graph. Their core lies in iteratively updating node embeddings, bringing semantically similar nodes closer together in the latent space. This supports downstream tasks such as classification, link prediction, and anomaly detection. Common GNN architectures include GCN and GAT. For example, for graph data from social networks, GNNs can predict potential friendships between users or identify abnormal account behavior; for graph data in financial scenarios, GNNs can predict potential transaction risks; and for graph data in the biomedical field, GNNs can predict potential drug-target interactions between molecules.

[0031] To illustrate the technical solution of this application, specific embodiments are described below.

[0032] Please refer to Figure 2 , Figure 2This is a schematic diagram illustrating an application environment for the graph neural network rule mining method provided in this application. As one implementation, the graph neural network rule mining method provided in this application can be applied to a server 100, which is connected to a terminal device 200 via a network. The network serves as the medium for providing a communication link between the server 100 and the terminal device 200, and can include various connection types, such as wired communication links, wireless communication links, etc. This application embodiment does not limit this type of connection.

[0033] It should be noted that, Figure 2 The server 100, network, and terminal device 200 shown are merely illustrative. Depending on actual needs, there can be any number of servers 100. For example, the server 100 can be implemented by a standalone physical server, a server cluster consisting of multiple servers, or a distributed system, etc., and the terminal device 200 can be any device such as a mobile phone, tablet, desktop computer, or laptop.

[0034] In some embodiments, on one hand, the terminal device 200 may generate a rule mining request in response to a user operation and send it to the server 100, instructing the server 100 to mine negative prediction rules for a specified graph neural network. On the other hand, after receiving the rule mining request from the terminal device 200, the server 100, according to the instructions of the rule mining request, determines the negative nodes in the graph data on which the graph neural network relies for prediction; the negative nodes are the nodes on which the graph neural network makes negative predictions; for each negative node, it extracts the negative key subgraphs that enable the graph neural network to make negative predictions from the graph data; it identifies common graph patterns among the negative key subgraphs, and based on the common graph patterns, searches for reference graph patterns whose rule metrics reach a metric threshold; it obtains the pattern attribute predicate set corresponding to the reference graph pattern, generates a negative prediction rule corresponding to the graph neural network based on the pattern attribute predicate set, and returns it to the terminal device 200, which then displays the negative prediction rule to the user.

[0035] Please refer to Figure 3 , Figure 3 This is a flowchart illustrating a rule mining method for graph neural networks provided in an embodiment of this application, as shown below. Figure 3 As shown, the process of the rule mining method of this graph neural network can be as follows: In S110, negative nodes in the graph data are identified. Negative nodes are the nodes that the graph neural network makes negative predictions for.

[0036] The following section uses the server as the execution entity to elaborate on the rule mining method of graph neural networks provided in this application.

[0037] In this embodiment, the server can receive an input rule mining request, which instructs the execution of negative prediction rule mining on a specified graph neural network. The source and format of the rule mining request are not limited here, as long as it explicitly specifies the graph neural network to be mined.

[0038] After receiving a rule mining request, the server first identifies the negative nodes in the graph data on which the graph neural network relies for prediction. These negative nodes are the nodes on which the graph neural network makes negative predictions.

[0039] For example, in an approval scenario, a negative node could be an applicant node in the graph data that has been negatively predicted as "approval not approved" by a graph neural network; or, in a job search scenario, a negative node could be a job seeker node in the graph data that has been negatively predicted as "not hired" by a graph neural network, and so on.

[0040] It should be noted that in other embodiments, the server may also actively trigger the rule mining process, such as by automatically starting it based on a preset period, data update events, or anomaly detection signals, etc.

[0041] In S120, for each negative node, the negative key subgraph that enables the graph neural network to make a negative prediction is extracted from the graph data.

[0042] For each negative node in the graph data, the server further extracts a key subgraph from the graph data that enables the graph neural network to make a negative prediction. This key subgraph contains the negative node and its most discriminative neighboring nodes and edge structure. This key subgraph is denoted as the negative key subgraph of the negative node.

[0043] The server can take each negative node as the center and gradually expand the subgraph structure along its first-order, second-order, and even multi-order neighborhoods. By combining gradient backpropagation or attention weights, the nodes and edges that contribute the most to the negative prediction are selected to obtain the most discriminative negative key subgraph.

[0044] In addition, the server can also directly call the subgraph extraction tool to extract negative key subgraphs based on the preset interpretability algorithm. There is no limitation on the selection of interpretability algorithm here, as long as it can ensure that the extracted subgraph truly reflects the negative prediction basis in terms of semantics and structure. For example, algorithms such as GNNExplainer, PGM-Explainer or SubgraphX ​​can be used.

[0045] It should be noted that, in specific implementation, the negative key subgraph extracted by the server must meet the constraints of minimality, fidelity, and readability to ensure that it has business interpretability while retaining the original predictive and discriminative capabilities.

[0046] In S130, common graph patterns among negative key subgraphs are identified, and based on these common graph patterns, reference graph patterns whose rule metrics reach the metric threshold are searched.

[0047] After extracting the negative key subgraphs for each negative node, the server performs pattern alignment and generalization abstraction on all subgraphs to extract frequently co-occurring topological structures, forming common graph patterns among the negative key subgraphs. For example, if the topological structure "user nodes connect to multiple company nodes" appears repeatedly in multiple negative key subgraphs, then this topological structure is generalized into a common graph pattern.

[0048] Subsequently, the server combines different common graph patterns according to the configured pattern combination strategy, and selects the combined graph patterns that meet the rule measurement thresholds based on rule metrics such as support and confidence; these are then designated as reference graph patterns. For example, please refer to... Figure 4 , Figure 4 The left side shows two common graph patterns: “Node x0 (User) → Node x1 (Job)” and “Node x0 (User) → Node x2 (Company)”. The right side shows a combined graph pattern of the two: “Node x0 (User) → Node x1 (Job) ∧ Node x0 (User) → Node x2 (Company)”.

[0049] Support refers to the percentage of frequency of a composite graph pattern in all negative key subgraphs. For example, if the composite graph pattern appears 35 times in 100 negative key subgraphs, the support is 35%.

[0050] The confidence level refers to the proportion of the frequency of the combined graph pattern and its corresponding attribute predicate appearing together in all negative key subgraphs. In other words, it is the proportion of all negative key subgraphs in which the combined graph pattern is satisfied and its corresponding attribute predicate is simultaneously true. For example, if the combined graph pattern appears in 35 negative key subgraphs, but the attribute predicate corresponding to the combined graph pattern is true in only 28 negative key subgraphs, then the confidence level is 80%.

[0051] It should be noted that the embodiments of this application do not limit the specific rule-based measurement indicators to be selected, as long as they can effectively characterize the statistical significance and semantic consistency of the composite graph pattern in the negative key subgraph. For example, indicators such as lift, coverage, or F1-score can also be introduced as supplements to balance the rarity and discriminative power of the pattern. The measurement threshold can be dynamically set according to the business risk tolerance. For example, in the financial risk control scenario, the support threshold should not be lower than 20% and the confidence threshold should not be lower than 75%, to ensure that the reference graph pattern has both statistical robustness and decision credibility.

[0052] In S140, the set of pattern attribute predicates corresponding to the reference graph pattern is obtained, and a negative prediction rule corresponding to the graph neural network is generated based on the set of pattern attribute predicates.

[0053] As shown above, after the server finds a reference graph pattern whose rule metric reaches the metric threshold, it further matches subgraph instances with the same structure as the reference graph pattern from the graph data. If the subgraph instance is a subgraph instance corresponding to a negative node, the attribute predicates about the node attributes in the subgraph instance are extracted to obtain the pattern attribute predicate set corresponding to the reference graph pattern.

[0054] Among them, attribute predicates can include comparison predicates (such as "debt-to-equity ratio > 80%", etc.), equivalence predicates (such as "industry category = real estate", "enterprise nature = private", etc.), and topological predicates (such as "there are at least two related guarantors", etc.).

[0055] After obtaining the set of pattern attribute predicates corresponding to the reference graph pattern, the server generates a negative prediction rule for the graph neural network based on this set of pattern attribute predicates and the reference graph pattern. The form of this negative prediction rule is not limited here. For example, the negative prediction rule can be expressed using implication logic: φ=Q[ , ](X→¬M( )); Where φ represents the negative prediction rule; Q indicates the reference diagram mode. This represents an abstract node that needs to be predicted. This represents the adjacent nodes connected to this node. Refer to the graph pattern Q to describe the nodes. and nodes The topological relationships that should be satisfied between them; X represents the set of rule attribute predicates, which is the precursor of the implication and is obtained by combining the attribute predicates in the pattern attribute predicate set. It is used to limit the attributes of nodes in the reference graph pattern. ¬M( ) is the successor of the implication, representing the graph neural network M for nodes. Make a negative prediction.

[0056] Optionally, in one embodiment, identifying common graph patterns among negative key subgraphs includes: Identify candidate common graph patterns that appear at a frequency threshold in negative key subgraphs; For each candidate common graph pattern, calculate the first occurrence frequency of the candidate common graph pattern in the negative key subgraph, and calculate the second occurrence frequency of the candidate common graph pattern in the positive key subgraph corresponding to the positive node; Candidate common graph patterns whose first occurrence frequency is greater than the second occurrence frequency are identified as common graph patterns.

[0057] To improve the ability of the identified common graph patterns to distinguish negative predictions, embodiments of this application provide an optional pattern recognition strategy.

[0058] It should be noted that in this embodiment, in addition to extracting the negative key subgraph of negative nodes, the server also extracts the positive key subgraph of positive nodes. The positive nodes are the nodes in the graph data that the graph neural network makes positive predictions. The specific method of extracting the positive key subgraph of positive nodes will not be described here. It can be implemented accordingly by referring to the method of extracting the negative key subgraph of negative nodes in the above embodiment.

[0059] When identifying common graph patterns among negative key graphs, the server first identifies topologies whose frequency in the negative key graphs reaches a frequency threshold, and generalizes these topologies as candidate common graph patterns. Then, for each candidate common graph pattern, the server further calculates its frequency in the negative key graphs, denoted as the first frequency, and calculates its frequency in the positive key graphs, denoted as the second frequency. If the first frequency of a candidate common graph pattern is greater than the second frequency, the server determines it as a valid common graph pattern, thus ensuring its strong negative discriminative power.

[0060] In other embodiments, the server may further improve the robustness of the discrimination by determining a candidate common graph pattern as a valid common graph pattern only when the first occurrence frequency of a candidate common graph pattern is greater than the second occurrence frequency and the difference between the two is greater than or equal to a preset difference threshold.

[0061] Optionally, in one embodiment, based on common graph patterns, searching for reference graph patterns whose rule metrics reach a metric threshold includes: Using the negative node as the merging center, different common graph patterns are topologically merged to obtain the initial graph pattern; Identify the node merging operation with the highest reward value for the initial graph pattern and execute the node merging operation; iterate until a reference graph pattern is obtained where the rule metric reaches the metric threshold. The reward value is calculated based on the change in rule metric before and after the execution of the node merging operation for the initial graph pattern.

[0062] To improve the search efficiency and generalization ability of reference graph patterns, this application provides an optional pattern search strategy.

[0063] The server first uses the negative node as the merging center to perform topological merging of the identified different common graph patterns. In other words, the subgraph structures of each common graph pattern are overlapped and merged at the negative node, thereby constructing an initial graph pattern that covers the core features of different common graph patterns with the negative node as the center.

[0064] Subsequently, based on a preset reward function, the server calculates the reward value corresponding to each feasible node merging operation according to the rule metric changes before and after feasible node merging operations in the initial graph pattern, and selects the node merging operation with the highest reward value to execute; this process is repeated until the rule metric of the initial graph pattern reaches the metric threshold, and finally a reference graph pattern with high discriminativeness and strong generalization is generated.

[0065] It should be noted that the embodiments of this application do not limit the selection of rule measurement indicators or the specific form of the reward function. For example, taking support and confidence as rule measurement indicators, the reward function can be designed as follows: if the node merging operation causes the support to be lower than the support threshold, the reward value is negative; if the node merging operation causes the support to be higher than the support threshold and the confidence to increase, the reward value is the confidence increase; if the node merging operation causes the support to be higher than the support threshold but the confidence to decrease, the reward value is zero.

[0066] For example, please refer to Figure 5 , Figure 5 The top section shows three common graph patterns: “Node x0 (User) → Node x3 (Company)”, “Node x0 (User) → Node x1 (Account) ∧ Node x0 (User) → Node x2 (User) ∧ Node x2 (User) → Node x1 (Account)”, and “Node x0 (User) → Node x5 (User) ∧ Node x0 (User) → Node x4 (User) ∧ Node x5 (User) → Node x4 (User)”. Figure 5 The middle section shows the initial graph pattern with the negative node x0 as the merging center. By topologically overlapping the three nodes at node x0, all adjacency relationships and path structures are preserved. Figure 5 The lower part shows the reference graph pattern obtained after iterative optimization through the node merging operation with the highest reward value, where node x2 and node x5 are merged into the same abstract node x2.

[0067] Optionally, in one embodiment, different common graph patterns are topologically merged using the negative node as the merging center to obtain an initial graph pattern, including: Select at least two common graph patterns from all common graph patterns and add them to the pattern candidate set; Using the negative node as the merging center, the different common graph patterns in the pattern candidate set are topologically merged to obtain the initial graph pattern; After iterative execution continues until a reference graph pattern is obtained where the rule metric reaches the metric threshold, the process also includes: Add new common graph patterns to the pattern candidate set and re-acquire the reference graph patterns corresponding to the pattern candidate set until no reference graph patterns whose rule metrics reach the metric threshold can be obtained.

[0068] To further improve the search efficiency of reference graph patterns, this application proposes an optional pattern search strategy. Unlike the pattern search strategies provided in the above embodiments, this application does not include all common graph patterns in the topology merging at once, but instead adopts an incremental pattern search method.

[0069] In the initial iteration, the server can select at least two common graph patterns from all common graph patterns to add to the pattern candidate set. There is no limitation on the selection criteria. For example, the top N (positive integers greater than or equal to 2) common graph patterns can be selected based on descending support and added to the pattern candidate set. In each subsequent iteration, the newly added common graph patterns also follow the same strategy.

[0070] For the pattern candidate set, the server uses the negative node as the merging center to perform topological merging of different common graph patterns in the pattern candidate set to obtain the initial graph pattern; then iteratively executes the node merging operation until a reference graph pattern with a rule metric reaching a preset threshold is obtained, thus completing the construction of the reference graph pattern for this round of pattern candidate set.

[0071] Then, the server adds new common graph patterns to the pattern candidate set and re-executes the topology merging and iterative optimization process to try to obtain new reference graph patterns until no reference graph pattern that meets the metric threshold can be obtained.

[0072] It is understood that the obtained reference graph pattern may not be unique in the embodiments of this application. Therefore, when generating negative prediction rules, the server will generate negative prediction rules corresponding to each reference graph pattern.

[0073] Optionally, in one embodiment, before generating the negative prediction rule corresponding to the graph neural network based on the pattern attribute predicate set, the method further includes: For each attribute predicate in the pattern attribute predicate set, calculate the third occurrence frequency of the attribute predicate in the negative nodes and the fourth occurrence frequency of the attribute predicate in the positive nodes. If the third occurrence frequency of the attribute predicate is greater than the fourth occurrence frequency, then the attribute predicate is retained; otherwise, the attribute predicate is deleted from the pattern attribute predicate set.

[0074] To improve the interpretability of the subsequently generated negative prediction rules, this application embodiment also performs validity filtering on the pattern attribute predicate set.

[0075] Specifically, for each attribute predicate in the preliminary set of pattern attribute predicates, the server calculates the frequency of occurrence of the attribute predicate in negative nodes, denoted as the third frequency, and calculates the frequency of occurrence of the attribute predicate in positive nodes, denoted as the fourth frequency. If the third frequency of occurrence of the attribute predicate is greater than the fourth frequency, it indicates that the attribute predicate has a stronger ability to distinguish negative nodes and is retained; otherwise, the attribute predicate is deleted.

[0076] The above method filters the set of pattern attribute predicates to ensure that the final generated negative prediction rules have stronger discriminative power and business interpretability.

[0077] Optionally, in one embodiment, before generating the negative prediction rule corresponding to the graph neural network based on the pattern attribute predicate set, the method further includes: For each attribute predicate in the set of pattern attribute predicates, evaluate the perplexity of that attribute predicate; If the perplexity of an attribute predicate is lower than the perplexity threshold, the attribute predicate is retained; otherwise, it is removed from the set of pattern attribute predicates.

[0078] To further improve the interpretability of the subsequently generated negative prediction rules, this application embodiment also provides another optional filtering strategy. Unlike the frequency-based filtering strategy in the above embodiments, this application embodiment performs filtering based on perplexity.

[0079] Perplexity measures the consistency of attribute predicates in the reference graph pattern. Intuitively, perplexity reflects the semantic association strength between attribute predicates and negative predictions. Lower perplexity means that attribute predicates and negative predictions have higher consistency and stronger discriminative power.

[0080] In practical implementation, the server can leverage the prior knowledge of the large language model to evaluate the perplexity of each attribute predicate in the pattern attribute predicate set. For example, the server can construct natural language text in the form of "structural semantics of the reference graph pattern + attribute predicates + negative prediction results," input it into the large language model, and instruct the large language model to output the perplexity of this natural language text, i.e., the perplexity of the attribute predicates. For instance, the constructed natural language text might be: "Job seeker node x0, adjacent nodes..." All are weakly associated subgraphs with low job matching degree and non-homologous topologies; at the same time, job seeker node x0 does not possess the professional practical skills required for the job; therefore, job seeker node x0 will be judged as rejected by the graph neural network. Please calculate the perplexity of this text. After inputting this text into the large language model, the large language model will, based on its deep modeling of the causal relationship between "job matching," "skill deficiency," and "hiring decision" in its training corpus, give the perplexity value of the text, thereby quantifying the correlation strength between the attribute predicate "lack of professional practical skills" and the negative prediction of "rejection."

[0081] For an attribute predicate in the pattern attribute predicate set, if the server evaluates that the perplexity of the attribute predicate is lower than the perplexity threshold, then the attribute predicate is considered to be highly correlated with negative prediction in semantic logic and is retained; if the server evaluates that the perplexity of the attribute predicate is higher than or equal to the perplexity threshold, then the attribute predicate is considered to be weakly correlated with negative prediction and is deleted from the pattern attribute predicate set.

[0082] Optionally, in one embodiment, generating a negative prediction rule corresponding to the graph neural network based on the pattern attribute predicate set includes: In ascending order of perplexity, attribute predicates in the set of conjunctive pattern attribute predicates are taken as precedents until the precedent and the negative prediction rule as the successor are established.

[0083] In this embodiment, after filtering the set of pattern attribute predicates based on perplexity, the implied expression of the negative prediction rule is constructed by concatenating them in ascending order of perplexity: when the attribute predicate with the lowest perplexity is used as the leader alone, if the implied expression formed by it and the negative prediction as the successor is true, then the concatenation stops; otherwise, the attribute predicate with the second lowest perplexity is introduced to participate in the concatenation until the implied expression is true.

[0084] For example, taking a job application scenario, suppose that after filtering the set of pattern attribute predicates, three attribute predicates remain: P1 (lack of professional practical skills), P2 (less than three years of work experience), and P3 (mismatch in educational background). Their perplexity in ascending order is P1→P2→P3. Then, we first check whether P1→"reject hiring" holds true under the condition of satisfying the reference graph pattern. If it holds true, we get the negative prediction rule "if professional practical skills are lacking, then reject hiring". If it does not hold true, we then check whether (P1∧P2)→"reject hiring" holds true under the condition of satisfying the reference graph pattern, and so on.

[0085] It should be noted that, in contrast to the original set of pattern attribute predicates corresponding to the reference graph pattern, the attribute predicates used to construct the negative prediction rule are combined from this set of pattern attribute predicates to form a new set corresponding to the negative prediction rule, which is denoted as the rule attribute predicate set.

[0086] The negative prediction rules constructed through the above conjunction mechanism can ensure that the generated negative prediction rules have both minimum necessity and maximum explanatory power, thus constructing an interpretable, traceable, and verifiable causal reasoning chain.

[0087] Optionally, in one embodiment, the mined negative rules can also be applied to downstream tasks. After generating negative prediction rules corresponding to the graph neural network based on the pattern attribute predicate set, the method further includes: When the graph neural network makes a negative prediction for the current node, a candidate space is constructed with the current node as the pivot. The candidate space contains a subset of candidate nodes corresponding to each of the other pattern variables of the reference graph pattern except for the current node. The subset of candidate nodes contains candidate nodes in the graph data that match both the reference graph pattern and the set of rule attribute predicates. Search the candidate space for the candidate node with the highest perturbation cost-effectiveness and the corresponding graph perturbation operation, and update the candidate space after performing the graph perturbation operation on the candidate node; iterate until at least one subset of candidate nodes in the candidate space is empty; Based on the graph perturbation operations searched during the iteration process, a counterfactual explanation corresponding to the current node is generated.

[0088] When the graph neural network makes a negative prediction for the current node, the server constructs a candidate space with the current node as the pivot based on the generated negative prediction rules. This candidate space contains subsets of candidate nodes corresponding to each pattern variable in the reference graph pattern, excluding the current node. Each subset of candidate nodes consists of candidate nodes in the graph data that satisfy the topological structure of the reference graph pattern and the constraints of the set of predicates for rule attributes. The method for constructing the candidate space is not limited here; strategies such as traversal search, heuristic sampling, or graph embedding nearest neighbor retrieval can be used.

[0089] It is understandable that if a subset of candidate nodes in the candidate space is empty, it means that no candidate node can be found in the graph data to form a complete matching instance that satisfies the negative prediction rule with the current node. In other words, the negative prediction rule has failed in this graph data. Therefore, the embodiments of this application transform the problem of whether the reverse prediction rule is valid into the problem of whether the subset of candidate nodes is empty, thereby simplifying the complex graph structure satisfiability verification into a lightweight set empty operation.

[0090] In the case where the candidate space is still valid (i.e., all candidate node subsets are not empty), the server iteratively executes: Search the candidate space for the candidate node with the highest perturbation cost-effectiveness and the corresponding graph perturbation operation (such as attribute adjustment operation and edge deletion operation for the candidate node), and execute the graph perturbation operation for the candidate node. Then update the subset of each candidate node in the candidate space, that is, remove other candidate nodes that no longer satisfy the reference graph pattern and rule attribute predicate set constraints due to the graph perturbation operation on the candidate node with the highest perturbation cost-effectiveness.

[0091] It should be noted that the execution of the above perturbation operation does not mean an actual perturbation of the original graph data, but only a hypothetical perturbation at the logical level. This hypothetical perturbation does not change the real graph structure, and its purpose is to verify under what perturbation conditions the negative prediction rule will fail.

[0092] As shown above, when the server fails in the candidate space, that is, when at least one subset of candidate nodes in the candidate space is empty, it performs deduplication on the graph perturbation operations searched during the iteration process, and then generates an interpretable counterfactual path based on the deduplicated graph perturbation operations: if the "searched graph perturbation operation" is executed, the original negative prediction will be transformed into a positive prediction, and this counterfactual path is the counterfactual explanation with the lowest cost.

[0093] Optionally, in one embodiment, constructing the candidate space with the current node as the pivot includes: Using the current node as the pivot, for each other pattern variable, filter the candidate nodes in the graph data that match that other pattern variable to obtain an initial subset of candidate nodes for that other pattern variable; For each initial subset of candidate nodes for other pattern variables, forward pruning and backward pruning are performed based on the structural constraints of the reference graph pattern and the semantic constraints of the rule attribute predicate set to obtain the subset of candidate nodes for that other pattern variable.

[0094] The server first uses the current node as a pivot and, for each other pattern variable in the reference graph pattern, filters the graph data for candidate nodes that match that other pattern variable, thus obtaining an initial subset of candidate nodes for that other pattern variable.

[0095] Furthermore, the server performs directed acyclic transformation on the reference graph pattern, identifies the dependencies between pattern variables, and constructs a topological order. For example, the server assigns the current node as the 0th level of the topological order, sets other pattern variables directly connected to the current node as the 1st level, and so on, determining the topological level of other pattern variables layer by layer until all other pattern variables are assigned to their corresponding levels, and all edges point from the upper level to the lower level, with no reverse edges or cycles.

[0096] Subsequently, the server performs forward pruning based on this topological order: for each layer's subset of candidate nodes, based on the structural constraints of the reference graph pattern and the semantic constraints of the rule attribute predicate set, only candidate nodes that can form a valid path with the upper-layer candidate nodes are retained; then, after completing all forward pruning, backward pruning is performed from the deepest layer in reverse, based on the structural constraints of the reference graph pattern and the semantic constraints of the rule attribute predicate set, in reverse checking whether the upper-layer candidate nodes can still support the validity of the lower-layer candidate nodes, deleting upper-layer candidate nodes that cannot support the validity of the lower-layer candidate nodes, and obtaining the subset of candidate nodes for the other pattern variables.

[0097] Optionally, in one embodiment, searching the candidate node with the highest perturbation cost-effectiveness and the corresponding graph perturbation operation in the candidate space includes: For each candidate node in the candidate space, if the degree of the candidate node is greater than or equal to the degree threshold, the attribute adjustment operation is determined to be the graph perturbation operation corresponding to the candidate node; otherwise, the edge deletion operation is determined to be the graph perturbation operation corresponding to the candidate node. For each candidate node in the candidate space, obtain the node reduction magnitude of the graph perturbation operation corresponding to the candidate node on each subset of candidate nodes, and obtain the expected cost of the graph perturbation operation corresponding to the candidate node. Based on the maximum node reduction magnitude and the expected cost, calculate the perturbation cost-effectiveness of the candidate node.

[0098] To minimize the execution cost of generating counterfactual interpretations, embodiments of this application provide an optional perturbation search strategy.

[0099] For each candidate node in the candidate space, the server first obtains the degree of the candidate node. If the degree of the candidate node is greater than or equal to the degree threshold, the attribute adjustment operation that makes the attribute of the candidate node no longer satisfy the semantic constraints of the rule attribute predicate set is determined as the corresponding graph perturbation operation. If the degree of the candidate node is less than the degree threshold, the edge deletion operation that makes the candidate node no longer satisfy the structural constraints of the reference graph pattern is determined as the corresponding graph perturbation operation.

[0100] Subsequently, for each candidate node in the candidate space, the server calculates the expected cost and expected effect of the graph perturbation operation corresponding to the candidate node. The expected cost is quantified by the importance of the attribute to be adjusted by the attribute adjustment operation (e.g., the imp weight can be used for quantification) or the number of edges to be deleted by the edge deletion operation. The expected effect is quantified by the reduction of the number of candidate nodes in the subset caused by the graph perturbation operation.

[0101] For example, the expected cost can be expressed as: ; in, The attributes that represent the pattern variable x. ( ) represents the imp weight of attribute xA. Represents the balance coefficient ( N represents the number of edges involved in the edge deletion operation.

[0102] The expected effect can be expressed as: ; in, This represents the expected effect of candidate node v. Indicates the attenuation coefficient ( K represents the shortest path length from candidate node v to the current node. This represents the number of remaining candidate nodes in the subset of candidate nodes for the pattern variable x after the graph perturbation operation. This represents the number of candidate nodes in the subset of candidate nodes for pattern variable x before the perturbation. This represents the retention rate of the candidate node subset of the pattern variable x after the graph perturbation operation. This indicates the extent to which the candidate node subset of the pattern variable x is reduced after the graph perturbation operation. Then, the maximum node reduction of the subset of all candidate nodes in the entire candidate space is used... The reduction magnitude of the largest node is weighted to reflect the impact of path distance on effect decay.

[0103] After calculating the expected cost and expected effect of each candidate node, the server calculates the ratio between the expected effect and expected cost of each candidate node to obtain the perturbation cost-effectiveness of each candidate node, and selects the candidate node with the highest perturbation cost-effectiveness based on this.

[0104] Optionally, in one embodiment, for each candidate node in the candidate space, if the degree of the candidate node is greater than or equal to a degree threshold, then the attribute adjustment operation is determined to be a graph perturbation operation corresponding to the candidate node; otherwise, the edge deletion operation is determined to be a graph perturbation operation corresponding to the candidate node, including: Obtain the set of feasibility constraints corresponding to the business scenario. The set of feasibility constraints includes attribute adjustability rules and edge deleteability rules. For each candidate node in the candidate space, if the degree of the candidate node is greater than or equal to the degree threshold, then the attribute adjustment operation that satisfies the attribute adjustability rule is determined to be the graph perturbation operation corresponding to the candidate node; otherwise, the edge deletion operation that satisfies the edge deleteability rule is determined to be the graph perturbation operation corresponding to the candidate node.

[0105] To enhance the practicality of counterfactual interpretation, embodiments of this application introduce feasibility constraints of business scenarios during the perturbation search process to ensure that the perturbation operation of the selected graph can be executed in actual business.

[0106] The server first obtains a set of feasibility constraints corresponding to the business scenario. This set of constraints can consist of a subset of attribute adjustability rules and a subset of edge deleteability rules. Attribute adjustability rules constrain which node attributes are allowed to be modified and their adjustment range, while edge deleteability rules constrain which edges are allowed to be deleted and their deletion conditions. For example, in a financial risk control scenario, attribute adjustability rules may prohibit modification of immutable fields such as user ID number and registration time, while only allowing adjustment of dynamic indicators such as credit score and debt ratio; edge deleteability rules restrict the deletion of non-core relationship edges (such as temporary marketing associations) and prohibit the severing of key topologies such as real-name authentication and the lending main chain, and so on. Similarly, in an e-commerce recommendation scenario, attribute adjustability rules may prohibit modification of static profile fields such as user gender and year of birth, allowing only adjustment of behavioral characteristics such as browsing frequency and add-to-cart preferences; edge deleteability rules restrict the weakening of non-high-frequency interaction edges (such as accidental click relationships) and prohibit the removal of user-product main purchase paths or strongly associated edges in the favorites list, and so on.

[0107] Correspondingly, for each candidate node in the candidate space, if the degree of the candidate node is greater than or equal to the degree threshold, then under the constraint of the attribute adjustability rule, the attribute adjustment operation is determined to be the graph perturbation operation corresponding to the candidate node; if the degree of the candidate node is less than the degree threshold, then under the constraint of the edge deleteability rule, the edge deletion operation is determined to be the graph perturbation operation corresponding to the candidate node.

[0108] Optionally, in one embodiment, the method for generating counterfactual explanations provided in this application further includes: Generate explanatory reasons corresponding to the counterfactual interpretation.

[0109] To further enhance the interpretability of counterfactual explanations, embodiments of this application also generate explanatory reasons corresponding to the counterfactual explanations. The form of the explanatory reasons is not limited here, and can be in the form of natural language description, logical rule expression or visual diagram.

[0110] For example, the explanation reason generated by the server can consist of the following three parts: Rule identifiers are used to characterize the negative prediction rules that are broken by each graph perturbation operation in the counterfactual interpretation; The object of destruction is used to characterize the attribute predicate or structural constraint destroyed by each graph perturbation operation in the counterfactual interpretation. Function description: used to characterize the specific mechanism by which each graph perturbation operation in the counterfactual explanation changes the prediction result.

[0111] Optionally, in one embodiment, the method for generating counterfactual explanations provided in this application further includes: Based on the set of rule attribute predicates, obtain the highest perturbation cost-effectiveness for perturbing the attributes of the current node; If the highest perturbation cost-effectiveness corresponding to the current node is less than the highest perturbation cost-effectiveness corresponding to the candidate space, then proceed to iterative execution until at least one subset of candidate nodes in the candidate space is empty; Otherwise, adjust the operation based on the attribute with the highest perturbation cost-effectiveness corresponding to the current node, and generate a counterfactual interpretation corresponding to the current node.

[0112] In this embodiment, the current node is also included as an optional perturbation object in the counterfactual explanation generation process. Specifically, the server obtains the highest perturbation cost-effectiveness for perturbing the attributes of the current node based on the set of rule attribute predicates. This involves evaluating the cost-effectiveness of attribute adjustment operations that would cause the current node's own attributes to no longer satisfy the semantic constraints of the set of rule attribute predicates, and identifying the highest cost-effectiveness among them. Subsequently, the server compares the highest cost-effectiveness of perturbation corresponding to the current node with the highest cost-effectiveness of perturbation corresponding to the candidate space: if the highest cost-effectiveness of perturbation corresponding to the current node is lower, iterative execution continues until at least one subset of candidate nodes in the candidate space is empty; if the highest cost-effectiveness of perturbation corresponding to the current node is greater than or equal to the highest cost-effectiveness of perturbation corresponding to the candidate space, a counterfactual explanation corresponding to the current node is generated directly based on the attribute adjustment operation with the highest cost-effectiveness of perturbation corresponding to the current node, thereby skipping the candidate space iteration and significantly improving the explanation generation efficiency.

[0113] For example, in the job application scenario, when the graph neural network determines that an applicant is "rejected", the attribute adjustment operation with the highest perturbation cost-effectiveness for the applicant node is "to change the lack of 'AI capability' to the presence of 'AI capability'". The corresponding counterfactual interpretation can be "if the applicant has AI capability, the application will be accepted".

[0114] As described above, the graph neural network rule mining scheme provided in this application identifies negative nodes in the graph data, which are the nodes that the graph neural network makes negative predictions. For each negative node, it extracts the negative key subgraphs that enable the graph neural network to make negative predictions from the graph data; identifies common graph patterns among the negative key subgraphs; and searches for reference graph patterns whose rule metrics reach a certain threshold based on these common graph patterns. It then obtains a set of attribute predicates corresponding to the reference graph patterns and generates negative prediction rules corresponding to the graph neural network based on these attribute predicate sets. In this way, by mining the common structural features implicit in the negative nodes of the graph data and transforming them into formal predicate logic expressions, it ultimately forms human-readable, verifiable, and traceable negative prediction rules, making the "black box" decision-making process of the graph neural network transparent.

[0115] To facilitate better implementation of the above graph neural network rule mining method, this application also provides a corresponding graph neural network rule mining device. The meanings of the terms used are the same as in the above graph neural network rule mining method; for specific implementation details, please refer to the descriptions in the above method embodiments.

[0116] Please refer to Figure 6 , Figure 6 This is a schematic diagram of the structure of a graph neural network rule mining device provided in an embodiment of this application. The graph neural network rule mining device may include a node determination module 210, a subgraph extraction module 220, a pattern search module 230, and a rule generation module 240, wherein... The node determination module 210 is used to determine the negative nodes in the graph data. The negative nodes are the nodes that the graph neural network makes negative predictions for. The subgraph extraction module 220 is used to extract, for each negative node, a negative key subgraph from the graph data that enables the graph neural network to make a negative prediction. The pattern search module 230 is used to identify common graph patterns among negative key subgraphs and, based on the common graph patterns, search for reference graph patterns whose rule metrics reach the metric threshold. The rule generation module 240 is used to obtain the set of pattern attribute predicates corresponding to the reference graph pattern, and generate negative prediction rules corresponding to the graph neural network based on the set of pattern attribute predicates.

[0117] Optionally, in one embodiment, the pattern search module 230 is used to identify candidate common graph patterns whose frequency in the negative key graph reaches a frequency threshold; for each candidate common graph pattern, the first occurrence frequency of the candidate common graph pattern in the negative key graph is calculated, and the second occurrence frequency of the candidate common graph pattern in the positive key graph corresponding to the positive node is calculated; the candidate common graph pattern whose first occurrence frequency is greater than the second occurrence frequency is determined as a common graph pattern.

[0118] Optionally, in one embodiment, the pattern search module 230 is used to perform topological merging of different common graph patterns with negative nodes as the merging center to obtain an initial graph pattern; determine the node merging operation with the highest reward value for the initial graph pattern and execute the node merging operation; iterate until a reference graph pattern with the rule metric reaching the metric threshold is obtained, and the reward value is calculated based on the change in rule metric of the initial graph pattern before and after the node merging operation is executed.

[0119] Optionally, in one embodiment, the pattern search module 230 is used to select at least two common graph patterns from all common graph patterns and add them to the pattern candidate set; with the negative node as the merging center, the different common graph patterns in the pattern candidate set are topologically merged to obtain an initial graph pattern; the pattern search module is also used to add new common graph patterns to the pattern candidate set after iterative execution until a reference graph pattern with a rule metric reaching the metric threshold is obtained, and to re-obtain the reference graph pattern corresponding to the pattern candidate set, until no reference graph pattern with a rule metric reaching the metric threshold can be obtained.

[0120] Optionally, in one embodiment, the rule generation module 240 is further configured to, for each attribute predicate in the pattern attribute predicate set, calculate the third occurrence frequency of the attribute predicate in the negative node and calculate the fourth occurrence frequency of the attribute predicate in the positive node; if the third occurrence frequency of the attribute predicate is greater than the fourth occurrence frequency, then the attribute predicate is retained; otherwise, the attribute predicate is deleted from the pattern attribute predicate set.

[0121] Optionally, in one embodiment, the rule generation module 240 is further configured to evaluate the perplexity of each attribute predicate in the pattern attribute predicate set; if the perplexity of the attribute predicate is lower than the perplexity threshold, the attribute predicate is retained; otherwise, the attribute predicate is deleted from the pattern attribute predicate set.

[0122] Optionally, in one embodiment, the rule generation module 240 is further configured to, in ascending order of perplexity, take the attribute predicates in the conjunctive pattern attribute predicate set one by one as the leader, until the leader and the negative prediction are established as the subsequent negative prediction rule.

[0123] It should be noted that the information interaction and execution process between the above modules are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.

[0124] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 7 As shown, the computer device includes: at least one processor ( Figure 7The diagram shows only one of the following: a memory and a computer program stored in the memory and capable of running on at least one processor. When the processor executes the computer program, it implements the steps in the above-described embodiment of the rule mining method for graph neural networks.

[0125] This computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 7 The examples of computer devices are merely examples and do not constitute a limitation on computer devices. Computer devices may include more or fewer components than shown, or combinations of certain components, or different components, such as network interfaces, displays, and input devices.

[0126] The processor referred to can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0127] Memory includes readable storage media, internal memory, etc., wherein internal memory can be the RAM of a computer device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of a computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory can include both internal storage units and external storage devices of the computer device. Memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. Memory can also be used to temporarily store data that has been output or will be output.

[0128] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0129] The implementation of all or part of the processes in the methods of the above embodiments can also be accomplished by a computer program product. When the computer program product is run on a computer device, it enables the computer device to execute the steps in the above method embodiments.

[0130] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0131] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0132] In the embodiments provided in this application, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0133] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0134] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for rule mining using graph neural networks, characterized in that, include: Identify the negative nodes in the graph data, whereby the negative nodes are those from which the graph neural network makes negative predictions; For each negative node, extract the negative key subgraph from the graph data that enables the graph neural network to make a negative prediction; Identify common graph patterns among negative key subgraphs, and based on the common graph patterns, search for reference graph patterns whose rule metrics reach a metric threshold; Obtain the set of pattern attribute predicates corresponding to the reference graph pattern, and generate a negative prediction rule corresponding to the graph neural network based on the set of pattern attribute predicates.

2. The rule mining method for graph neural networks according to claim 1, characterized in that, The identification of common graph patterns among negative key subgraphs includes: Identify candidate common graph patterns that appear at a frequency threshold in negative key subgraphs; For each candidate common graph pattern, calculate the first occurrence frequency of the candidate common graph pattern in the negative key subgraph, and calculate the second occurrence frequency of the candidate common graph pattern in the positive key subgraph corresponding to the positive node; The candidate common graph pattern whose first occurrence frequency is greater than the second occurrence frequency is determined as the common graph pattern.

3. The rule mining method for graph neural networks according to claim 1, characterized in that, The reference graph pattern for which the search rule metric reaches the metric threshold based on the common graph pattern includes: Using the negative node as the merging center, different common graph patterns are topologically merged to obtain the initial graph pattern; The node merging operation with the highest reward value for the initial graph pattern is determined and executed; the operation is iterated until a reference graph pattern with a rule metric reaching a metric threshold is obtained, and the reward value is calculated based on the change in rule metric of the initial graph pattern before and after the node merging operation is executed.

4. The rule mining method for graph neural networks according to claim 3, characterized in that, The process of merging different common graph patterns using negative nodes as the merging center to obtain an initial graph pattern includes: Select at least two common graph patterns from all common graph patterns and add them to the pattern candidate set; Using the negative node as the merging center, the different common graph patterns in the pattern candidate set are topologically merged to obtain the initial graph pattern; After the iterative execution continues until a reference graph pattern is obtained where the rule metric reaches the metric threshold, the process further includes: Add new common graph patterns to the pattern candidate set and re-acquire reference graph patterns corresponding to the pattern candidate set until no reference graph pattern with a rule metric reaching the metric threshold can be obtained.

5. The rule mining method for graph neural networks according to claim 1, characterized in that, Before generating the negative prediction rule corresponding to the graph neural network based on the pattern attribute predicate set, the method further includes: For each attribute predicate in the set of pattern attribute predicates, calculate the third occurrence frequency of the attribute predicate in the negative nodes and the fourth occurrence frequency of the attribute predicate in the positive nodes. If the third occurrence frequency of the attribute predicate is greater than the fourth occurrence frequency, then the attribute predicate is retained; otherwise, the attribute predicate is deleted from the set of pattern attribute predicates.

6. The rule mining method for graph neural networks according to claim 1, characterized in that, Before generating the negative prediction rule corresponding to the graph neural network based on the pattern attribute predicate set, the method further includes: For each attribute predicate in the set of pattern attribute predicates, evaluate the perplexity of that attribute predicate; If the perplexity of the attribute predicate is lower than the perplexity threshold, the attribute predicate is retained; otherwise, the attribute predicate is deleted from the set of pattern attribute predicates.

7. The rule mining method for graph neural networks according to claim 6, characterized in that, The step of generating negative prediction rules corresponding to the graph neural network based on the pattern attribute predicate set includes: In ascending order of perplexity, attribute predicates in the set of pattern attribute predicates are successively combined as leaders until the leader and the negative prediction rule as the successor are established.

8. A rule mining device for graph neural networks, characterized in that, include: A node determination module is used to determine negative nodes in graph data, wherein the negative nodes are nodes for which the graph neural network makes negative predictions; The subgraph extraction module is used to extract, for each negative node, a negative key subgraph from the graph data that enables the graph neural network to make a negative prediction. The pattern search module is used to identify common graph patterns among negative key subgraphs, and based on the common graph patterns, search for reference graph patterns whose rule metrics reach the metric threshold. The rule generation module is used to obtain a set of pattern attribute predicates corresponding to the reference graph pattern, and generate negative prediction rules corresponding to the graph neural network based on the set of pattern attribute predicates.

9. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program that can run on the processor, and the processor, when running the computer program, implements the rule mining method of the graph neural network as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the rule mining method of a graph neural network as described in any one of claims 1 to 7.