A multi-hop knowledge graph question answering method based on structural pruning and semantic fusion

By combining the KN non-uniform pruning strategy and node-level gating units, the problems of critical path truncation and noise accumulation in multi-hop knowledge graph question answering are solved, achieving more efficient and accurate answer acquisition.

CN123115363APending Publication Date: 2026-11-17CHONGQING UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611624438.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-20
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing multi-hop knowledge graph question answering methods ignore the structural importance of key edges adjacent to seed entities and answer entities when constructing local subgraphs using a uniform random discarding strategy. This leads to the random truncation of key reasoning paths and a lack of explicit awareness of question semantics, resulting in noise accumulation and information overload.

Method used

A method based on structural pruning and semantic fusion is adopted. Key reasoning paths are preserved through the KN non-uniform pruning strategy, and node-level gating units are introduced for semantic modulation. A filtering subgraph is constructed, and forward expansion and backward aggregation are performed layer by layer. The answer is sorted by combining the question semantics.

Benefits of technology

It effectively reduces the probability of reasoning paths being truncated, improves the accuracy and efficiency of multi-hop reasoning, and is particularly robust under incomplete knowledge graph conditions, significantly improving the accuracy and recall of answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123115363A_ABST
    Figure CN123115363A_ABST
Patent Text Reader

Abstract

The application discloses a multi-hop knowledge graph question answering method based on structure pruning and semantic fusion, and belongs to the technical field of knowledge graph question answering. The method takes seed entities and answer entities in a question as cores, determines a protection node set according to key structure protection hop numbers, retains key facts associated with the protection nodes, performs non-uniform pruning on the rest of the facts according to a non-key fact discarding ratio, and constructs a filtered subgraph. Forward expansion and reverse aggregation are performed layer by layer on the filtered subgraph to obtain a structure-enhanced representation. Meanwhile, node representations and question semantic vectors are fused to generate a node-level gating unit, the node scores are semantically modulated and normalized, the next-hop node distribution is updated layer by layer, and candidate entities are sorted to obtain an answer. The method can reduce subgraph redundancy while retaining key reasoning paths, suppress question-irrelevant nodes, and improve the accuracy and robustness of multi-hop knowledge graph question answering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge graph question answering technology, and in particular to a multi-hop knowledge graph question answering method based on structural pruning and semantic fusion. Background Technology

[0002] Knowledge graphs are a typical multi-relation graph structure where entities are interconnected through various semantic relationships. Due to their typically large scale and complex structure, accurately querying knowledge graphs using natural language has long been a challenging problem. The corresponding machine learning task is Knowledge Graph Question Answering (KGQA), which aims to perform complex reasoning on the graph to locate the target node that can answer a given natural language question. Existing KGQA methods are generally based on two main technical approaches: one is semantic parsing methods, whose core idea is to first convert the natural language question into a logical query that can be executed on the knowledge graph, and then execute the query on the given knowledge graph to obtain the answer. This type of method relies on real logical form annotations or query execution results as supervision signals during the training phase, making it sensitive to incomplete knowledge graph settings. The other approach is information retrieval methods, which locate the answer node by directly reasoning and retrieving on the graph without logical form annotation, but require a high level of ability to rank and discriminate candidate nodes. In recent years, more and more research has begun to focus on complex problems that require multi-hop reasoning on knowledge graphs to arrive at the correct answer, namely multi-hop knowledge graph question answering tasks.

[0003] In multi-hop knowledge graph question answering tasks, methods based on graph neural networks (GNNs) typically define the task as sequentially propagating from seed nodes to the answer node within a local subgraph related to the question. These methods first identify the topic entities in the question as seed nodes, extract a local subgraph containing the answer node from the knowledge graph, and then progressively expand the search scope from the inside out on the local subgraph based on a message-passing mechanism, continuously aggregating path-related information into the node representation. Therefore, the stability and accuracy of the local subgraph largely determine the reliability of the subsequent reasoning process. However, as the number of reasoning steps increases, the size of the relevant subgraph expands rapidly, and redundant structures unrelated to the key reasoning path introduce additional noise into subsequent message propagation and reasoning, exacerbating noise accumulation and information overload problems.

[0004] Furthermore, existing methods generally employ a uniform random discarding strategy during the local subgraph construction stage. This involves randomly discarding a portion of fact edges in the subgraph with a fixed probability, indiscriminately, to enhance the model's generalization ability. However, this uniform random discarding strategy treats all edges equally, neglecting the structural importance of key edges adjacent to the seed entity and the answer entity. It easily truncates the core reasoning path connecting the seed entity and the answer entity during multi-hop graph traversal, introducing severe structural noise into the model due to a lack of effective supervision signals. This results in key reasoning paths being randomly truncated during training and unstable supervision signals. Simultaneously, during multi-hop message propagation, existing methods lack explicit awareness of question semantics, allowing irrelevant noise entities to continuously aggregate into the candidate set, leading to redundant reasoning graphs and divergent answer distributions. Therefore, how to fully preserve key reasoning paths while reducing redundant structures, and how to explicitly utilize question semantics to suppress irrelevant entities during multi-hop reasoning, are pressing technical problems that need to be solved in this field. Summary of the Invention

[0005] This invention aims to at least solve the technical problems existing in the prior art, and in particular, it innovatively proposes a multi-hop knowledge graph question answering method based on structural pruning and semantic fusion.

[0006] To achieve the above-mentioned objectives of this invention, this invention provides a multi-hop knowledge graph question answering method based on structural pruning and semantic fusion, comprising the following steps:

[0007] S1. Determine the K-hop protection node set based on the seed entity set, the answer entity set, and the critical structure protection hop number K. Retain the protection facts associated with the K-hop protection node set, and perform non-uniform pruning on the non-protection facts according to the non-critical fact discard ratio N to obtain the filtered subgraph.

[0008] S2, Generate node-level gating units based on node representations and problem semantic vectors, and use the node-level gating units to perform semantic modulation and normalization on the unnormalized scores of nodes to obtain the next-hop node distribution;

[0009] S3, perform forward expansion and reverse aggregation layer by layer on the filtered subgraph to obtain a structurally enhanced representation, and combine the node-level gating unit to update the next-hop node distribution layer by layer to sort the candidate entities and obtain the answer.

[0010] In the preferred embodiment of the above technical solution, determining the K-hop protection node set in S1 includes: taking the union of the seed entity set and the answer entity set as the core protection node set; starting from the core protection node set, performing a neighborhood expansion on the local knowledge subgraph that does not exceed the number of critical structure protection hops K, and adding the expanded entities to the K-hop protection node set.

[0011] In the preferred embodiment of the above technical solution, the protected facts and the unprotected facts in S1 are determined in the following way: the fact that the endpoint entity belongs to the K-hop protected node set is determined as a protected fact, and the remaining facts are determined as unprotected facts; the protected facts are at least used to preserve the key reasoning path connecting the seed entity set and the answer entity set.

[0012] In a preferred embodiment of the above technical solution, the non-uniform pruning in S1 includes: determining a target retention quantity based on the number of facts in the local knowledge subgraph and the non-critical fact discard ratio N; when the number of protected facts does not reach the target retention quantity, selecting a corresponding number of facts from the non-protected facts to supplement them; and constructing the filter subgraph from the retained protected facts and the selected non-protected facts.

[0013] In the preferred embodiment of the above technical solution, the non-uniform pruning in S1 is performed during the training phase; during the training phase, the critical structure protection hop count K is set to a positive integer, and the non-critical fact discard ratio N is set to be greater than zero; during the inference phase, the non-critical fact discard ratio N is set to zero, and multi-hop inference is performed on the local knowledge subgraph that retains all facts.

[0014] In the preferred embodiment of the above technical solution, the critical structure protection hop count K and the non-critical fact discard ratio N in S1 are jointly determined based on the verification results; by traversing multiple candidate parameter combinations, and based on at least one of multi-hop question answering performance, subgraph compression degree and critical reasoning path retention degree, the target parameter combination is selected from the candidate parameter combinations.

[0015] In a preferred embodiment of the above technical solution, the node-level gating unit generated in S2 includes: fusing the node representation and the problem semantic vector to obtain a semantic fusion feature; performing a nonlinear mapping on the semantic fusion feature to obtain a gating weight that characterizes the degree of semantic relevance between the node and the current problem, and using the gating weight as the node-level gating unit.

[0016] In a preferred embodiment of the above technical solution, the semantic modulation and normalization in S2 includes: reweighting the unnormalized scores of nodes according to the node-level gating unit to obtain gating scores; and normalizing the gating scores of each candidate node in the filtering subgraph to obtain the next-hop node distribution for the next layer of inference.

[0017] In the preferred embodiment of the above technical solution, the forward expansion in S3 includes: generating edge messages based on the connection relationships between nodes, the problem semantic vector, and the upstream node state; weighting and aggregating the edge messages according to the distribution of the next-hop nodes corresponding to the previous layer, and merging the aggregation result with the original state of the node to obtain a forward update representation.

[0018] In the preferred embodiment of the above technical solution, the reverse aggregation in S3 includes: constructing a local subtree with the node as the root, generating a backflow message within the local subtree; aggregating the backflow message to obtain a backflow summary, and fusing the backflow summary with the forward update representation obtained by the forward expansion to obtain the structure-enhanced representation.

[0019] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:

[0020] A seed-answer-aware KN (KN Non-uniform Pruning) non-uniform pruning mechanism is designed. This mechanism limits the protection range of the key neighborhood between the seed entity and the answer entity by controlling the pruning intensity of redundant facts through the proportion of discarded non-key facts (N). When constructing the local reasoning subgraph, it prioritizes the protection of key reasoning paths, reducing noise caused by truncated reasoning paths at the structural level. This improves reasoning accuracy while ensuring model generalization ability and reasoning efficiency. A node-level gating unit, jointly determined by node representation and question semantic vector, is introduced to semantically modulate candidate nodes. This dynamically suppresses question-irrelevant nodes and strengthens semantic filtering of answer-related nodes during multi-hop processes, resulting in a more focused final answer distribution. The proposed structure-aware subgraph filtering module and semantic gating module are compared with several representative methods and ablation analysis is performed on the Web Question Answering Semantic Parsing Dataset (WebQuestionsSP, WebQSP) and the Complex Web Question Answering Dataset (ComplexWebQuestions, CWQ). The results show that the proposed module can stably improve multi-hop reasoning performance.

[0021] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0022] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0023] Figure 1 This is the overall flowchart of the present invention;

[0024] Figure 2 This is the overall framework diagram of the present invention;

[0025] Figure 3 This is a process diagram of the discarding strategy of the present invention;

[0026] Figure 4 This is a comparison diagram of node filtering before and after the present invention. Detailed Implementation

[0027] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0028] Knowledge graphs are multi-relation directed graphs composed of real-world triples, formalized as follows: ,in For knowledge graphs, For a collection of entities, For a set of relations, For a set of fact triples. Each triple is a set of fact triples. Represents head entity Tail-end entity There is a relationship From a graphical perspective, it can be understood as... point to Relationship tags are The directed edges, the entity set is always denoted as The fact / side structure is always composed of A unified portrayal.

[0029] Multi-hop knowledge graph question answering follows the KGQA standard protocol: the input is a human natural language question. The objective is to... (The sentence is incomplete and requires more context to be fully translated.) Retrieve the set of entities that answer the question. Following standard procedure, first, start from the question... The algorithm identifies subject entities and assumes that these entities are mapped to entities via an entity linking algorithm. The corresponding nodes in the [database], these nodes are called seed entities, and are represented as [symbol]. ,in This is a set of seed entities. The seed entities are derived from... Extracting problem-related subgraphs This makes the answer entity Included Among them , These are the entity set and edge set corresponding to the problem-related subgraph, respectively. Let be the set of answer entities. Based on reasoning complexity, KGQA tasks can be divided into two categories: the first category consists of simple problems where the answer can be directly obtained by matching a single triple in the KG; the second category consists of multi-hop problems that require associating multiple triples in the knowledge graph and undergoing multiple steps of reasoning to derive the answer.

[0030] like Figures 1 to 3As shown, this invention provides a multi-hop knowledge graph question answering method based on structural pruning and semantic fusion. This method consists of three core components: a KN non-uniform pruning subgraph filtering module, a semantic gating module, and a two-stage semantic reasoning module. For the input natural language question and its topic entities, a question semantic vector is obtained through a question encoder, and a local subgraph related to the question is extracted from the knowledge graph. Based on this, the KN non-uniform pruning subgraph filtering module is introduced. Using seed entities and labeled answers in the question as the core, the key structural protection range is determined according to the protection hop number K. Only non-critical areas outside the protection range are sampled at the discard ratio N, thereby reducing graph density while preserving complete and effective reasoning paths. Subsequently, node representations are initialized in the node embedding layer based on relation frequency and entity importance. The two-stage semantic reasoning module employs a neural tree search mechanism. Its forward expansion and backward aggregation processes add a question semantic-based gating mechanism, adaptively assigning gating weights to each entity, suppressing noisy entities irrelevant to the question, and strengthening nodes and paths related to the answer. Finally, during the answer prediction stage, candidate entities are scored and ranked to mitigate the impact of noise, thereby selecting the entity that best matches the semantics of the question from the inference graph as the final answer. The specific implementation steps are as follows:

[0031] S1. Construct a filtering subgraph based on the KN non-uniform pruning strategy: Set the number of hops for key structure protection K and the proportion of discarding non-key facts N. Construct a core protection node set from the seed entity set and the answer entity set in the question, and determine the K-hop protection node set on the local knowledge subgraph according to the number of hops K. Divide the facts in the local knowledge subgraph into protected facts associated with entities in the K-hop protection node set and the remaining non-protected facts. Retain all protected facts, and perform non-uniform pruning sampling only on non-protected facts according to the non-key fact discarding proportion N, so that the endpoint entities of the retained facts constitute the filtering subgraph.

[0032] In multi-hop knowledge graph question answering, the model's correct predictions typically rely on one or more key inference links from the seed entity to the answer entity. Existing methods often employ fact discarding when constructing the local fact graph, uniformly and randomly discarding fact edges with a fixed probability. While the uniform random discarding strategy is simple to implement and has a regularization effect, it has significant drawbacks in multi-hop scenarios. If all edges are deleted with equal probability, key facts connecting the seed entity or the answer entity may also be discarded, leading to the complete truncation of correct inference paths during some training iterations. This makes it difficult for the model to obtain stable and effective supervision signals and introduces significant noise.

[0033] To improve the robustness of reasoning under pruning conditions, a KN non-uniform pruning strategy is proposed in the subgraph construction stage. The core idea is to use K to limit the range of key hops around the seed entity and answer entity that need to maintain structural stability, and to use N to limit the proportion of discarded non-key facts. This explicitly protects the key edge structure associated with the seed entity and answer entity, and only performs random edge deletion in weakly related regions. Unlike uniform pruning, which applies the same discard probability to all fact edges, KN ​​non-uniform pruning ensures that key protected facts and non-key facts have different retention probabilities, thereby reducing the probability of key reasoning paths being truncated.

[0034] Given There are 10 training samples, and the local knowledge subgraph corresponding to the i-th sample is denoted as . ,in For a local entity set, It is a set of local facts. Each fact is represented as a triple. in , These are the indices of the head entity and the tail entity in the local entity space, respectively. Let the relation be of type ; let the total number of local facts be . .make This represents the set of seed entities identified and mapped from the question text. Additionally, it uses the answer distribution vector. Indicate whether a local entity is an answer, where the first is true if and only if the second is true. When an entity is the answer This yields the set of answer entities. , This is a local entity index.

[0035] First, construct the initial core protection node set. This set contains key entities whose neighborhood structure needs to be kept stable during training. Starting from the initial core protection node set, a neighborhood expansion of no more than K hops is performed along the fact edges on the local knowledge subgraph to obtain the K-hop protection node set. The protection hop number K is used to control the protection range of key structures: the smaller K is, the more focused the protection range, which is more conducive to reducing graph density; the larger K is, the wider the protection neighborhood, but it may introduce redundant facts brought by super-hub nodes. Subsequently, the fact set is divided according to whether it is connected to a K-hop protection node, defining the protection fact set as:

[0036] ;

[0037] All fact edges associated with the seed entity, answer entity, or their extended protected nodes in the K-hop protected node set are marked as key edges and preserved; when K is 1, the protection range degenerates to the one-hop neighborhood of the seed entity and answer entity. Correspondingly, the unprotected fact set is: , The K-hop key structure of the seed and answer entities on the local graph was captured, and It mainly consists of redundant structures weakly related to the semantics of question and answer. Let N be the proportion of non-critical facts discarded. If structural importance is not considered, the baseline number of facts retained under a uniform random discarding strategy is:

[0038] ;

[0039] Where N represents the proportion of non-critical facts discarded. Let be the total number of local facts for the i-th sample. This is the floor function.

[0040] To ensure that all protected facts are not deleted, the actual target number to retain is set as follows:

[0041] ;

[0042] when When the KN non-uniform pruning strategy retains the same total amount as uniform discarding, it additionally guarantees that key edges will be retained; when In such cases, the deletion intensity on that sample should be appropriately reduced to ensure complete protection of the seed and key structures of the answer. Next, deletion should only be performed on the non-protected fact set. Random sampling is performed on the above. Let This represents the number of facts that need to be supplemented from the non-protected fact set. If... ,but ,in For the sampled non-protected subset of facts; otherwise, from Uniform sampling without replacement This fact has been obtained The final set of retained facts is:

[0043] ;

[0044] To obtain the corresponding set of subgraph nodes, take the endpoint entities of all retained edges. ,in This is the filtered set of entities. For existential quantifiers, the symbol is... The result is a logical OR operation, leading to a cleaner filter subgraph with more stable key inference links. .

[0045] The aforementioned KN non-uniform pruning strategy only takes effect during the training phase, and the subgraph construction behavior differs fundamentally between the training and inference phases. During training, the proportion of non-critical facts discarded, N, is set to a positive value greater than zero, and the critical structure protection hop count, K, is set to a positive integer. The non-uniform pruning logic in the subgraph construction module is triggered, and the system uses the labeled answer entity set and seed entity set of the current training sample to jointly construct the core protection node set. The model then expands to K-hop protection nodes, dividing fact edges into critical and non-critical edges, and performs structure-aware non-uniform pruning. Answer annotation is used here to provide a more stable and focused supervisory signal during training, preventing critical reasoning paths connecting to the correct answer from being truncated during random discarding. During the inference phase, the proportion N of non-critical facts discarded is fixed at zero, the conditional branches of non-uniform pruning are not triggered, and all fact edges in the subgraph are fully preserved, meaning the model performs multi-hop inference on the complete original subgraph. By guiding the model to learn on cleaner, more complete local subgraphs during training, the model parameters converge to a state more sensitive to critical reasoning links. During the inference phase, the converged model parameters directly act on the complete subgraph, efficiently locating answer nodes using the structure-aware capabilities gained during training, without relying on any external annotation information.

[0046] As a specific implementation, the number of protected hops K and the proportion of discarded non-critical facts N constitute two elastic factors for KN non-uniform pruning. K controls the number of hops retained for critical structures centered on seed entities and answer entities, while N controls the pruning intensity for non-critical facts outside the protected area. By jointly adjusting K and N, a balance can be achieved between subgraph structural integrity, graph density, and model generalization ability.

[0047] Taking the example of the example person's country of birth and its official language in a natural language problem, the protected node set includes the seed node (example person) and the answer node (example language). The standard inference chain is that the example person points to the example country via their birthplace, and then to the example language via the official language. When a one-hop protection strategy is adopted, the critical edges directly adjacent to the seed node and the answer node are fully preserved, while interfering paths outside the one-hop protection range are filtered out. The preserved subgraph structure is concise and the signal is complete.

[0048] Expanding the protection radius to two hops might force a large number of irrelevant facts related to super-hub nodes such as a country or province into the retained subgraph. For example, redundant edges related to national attributes, other people, or statistical data could dilute the semantic signal that clearly points to the correct answer with noise. Therefore, K is not necessarily better the larger it is, but needs to be selected in combination with the task hop count of the dataset, the subgraph size, and the performance of the validation set.

[0049] S2 concatenates the node representation with the question semantic vector, generates node-level gating units through the Sigmoid function, performs semantic modulation and normalization on the unnormalized node scores, and obtains the next-hop node distribution.

[0050] As a reusable component within the framework of this invention, the semantic gating module accepts node representations and question semantic vectors, outputs semantic weights that affect node scores, and is decoupled from specific reasoning structures, thus allowing for flexible embedding into multi-hop reasoning layers. In multi-hop reasoning, although forward expansion and backward aggregation can propagate and integrate graph structure information layer by layer, relying solely on structure propagation often introduces a large number of candidate nodes irrelevant to the question semantics, resulting in redundancy and noise accumulation in the reasoning graph, and causing the answer distribution to diverge. To address this, a question semantic-driven message fusion gating mechanism is proposed. In each layer of reasoning, candidate nodes undergo semantic-level soft filtering, dynamically suppressing irrelevant nodes and strengthening nodes relevant to the answer, making subsequent reasoning more focused.

[0051] In the In layered reasoning, after two phases of updates—forward expansion and backward aggregation—the node representation is obtained. The unnormalized score for each node is calculated by the two-stage semantic reasoning module. The gating mechanism is inserted after forward expansion and reverse aggregation. After semantic modulation, the distribution is normalized to generate the next-hop distribution; where , Let be the total number of reasoning layers. Let the semantic vector of the question obtained from the question encoding be... For each node Define its splicing features as ,in Node representation With question semantic vector The splicing characteristics, Let be the set of real numbers, and d be the dimension represented by the node. The dimension of the problem semantic vector is then used to generate node-level gating units:

[0052] ;

[0053] in , For learnable parameters, It is a sigmoid activation function; The gating weight determines whether a node should be retained under the current problem semantics: a weight closer to 0 indicates a stronger tendency to suppress the node, while a weight closer to 1 indicates a stronger tendency to reinforce it. This gating is applied to the unnormalized score to generate the gating score and the next-hop node distribution.

[0054] ;

[0055] in The gating score is calculated. Finally, all candidate nodes in the filtered subgraph are normalized to obtain the... Next-hop node distribution of layer output:

[0056] ;

[0057] in, As a candidate node, It is an exponential function, and .

[0058] S3 performs forward expansion and reverse aggregation layer by layer on the filtered subgraph to obtain the structurally enhanced representation. After calculating the unnormalized score, it calls the gating function of S2 to generate the next-hop node distribution. After stacking layer by layer, it scores and sorts the candidate entities to obtain the final answer.

[0059] This step constructs a complete multi-hop reasoning process on the filtered subgraph obtained in S1, and embeds the semantic gating module defined in S2 into the forward expansion and backward aggregation of each search layer, forming a collaborative reasoning framework that is structurally simple and semantically focused. Multi-hop reasoning is performed after obtaining a more compact local subgraph, and semantic gating is introduced at each layer to semantically reweight the candidate distribution. The two-stage semantic reasoning module, as an important part of the reasoning at each layer, uses the question semantic vector... The previous layer's node representation and distribution are taken as input, and the updated node representation and next-hop distribution are output, used for multi-hop search with progressively refined layers. Represented as nodes, The probability distribution of nodes in the previous layer can be considered as the soft front of the current layer, used to control the information propagation intensity during forward expansion. The forward expansion phase starts from the currently active nodes and pushes the search boundary outward along the graph structure. For any directed fact edge... Construct a problem-conditional edge message:

[0060] ;

[0061] in For the first Layer from node Pointing to node Side message; It is a lightweight multilayer perceptron (MLP) used to jointly encode relational semantics, problem semantics, and upstream node states into propagable edge-level information; For relationship The embedding vector of the node. Aggregate its ingress neighbor messages in the filter subgraph and use the upper layer distribution. Weighting is applied to suppress noise propagation from low-correlation nodes:

[0062] ;

[0063] in For nodes Aggregated messages, For nodes The set of incoming neighbors is then aggregated. The aggregation result is then fused with the original node state to obtain the forward update representation:

[0064] ;

[0065] in The forward fusion function represents one layer of an MLP; For the upper level node express; For nodes The forward update representation is used. The forward expansion stage primarily encodes evidence for path expansion from the seed towards the future. Representations obtained solely through forward expansion tend to be biased towards historical paths and struggle to utilize potential constraints in unreached regions. To address this, a reverse aggregation stage is introduced at the same layer: from the local subtree formed by forward expansion, deeper structural semantics are fed back as contextual signals to the upper-level nodes. Specifically, for each node... The structure is based on it and its depth does not exceed local subtree And generate backup messages on the edges of the subtree:

[0066] ;

[0067] in Local subtree edge Backup messages on; It is a reverse aggregation encoding function; For nodes The forward update representation; Embedding of edge relationships; For nodes For the root, depth not exceeding The local subtree. Then, the backup information from the subtree is back-aggregated to obtain the reflow summary:

[0068] ;

[0069] in It is the max pooling aggregation function. For nodes The reflow summary is used to emphasize reflow patterns that have stronger constraints on the current problem. Finally, the reflow summary is fused with the forward representation to obtain the structure-enhanced representation of this layer:

[0070] ;

[0071] in This is the fusion function for forward representation and backflow summary.

[0072] The structurally enhanced representation simultaneously incorporates bidirectional information from historical expansion evidence and future subtrees, thereby improving multi-hop discrimination capabilities. After completing the two-stage structural update, semantic selection is performed uniformly: the node representation with enhanced structure is selected first. Then, calculate the unnormalized score for all candidate nodes:

[0073] ;

[0074] in The scoring function is implemented as a linear layer. The semantic gating module is then called to obtain the next-hop distribution. The two-stage semantic reasoning module ensures that the output distribution of each layer is simultaneously constrained by both structural propagation and problem semantic selection: forward expansion advances the search boundary along the graph structure, backward aggregation returns context constraints from local subtrees, and semantic gating performs soft filtering on the node representations updated in the two stages. This is achieved through stacking... Layers enable multi-hop reasoning that is refined layer by layer on the filtered subgraph.

[0075] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.

[0076] Example

[0077] 1. Experimental Setup

[0078] 1.1 Dataset

[0079] For multi-hop KGQA tasks, this invention selects two widely used benchmark datasets: WebQuestionsSP (WebQSP) and ComplexWebQuestions (CWQ).

[0080] WebQSP is a classic dataset for knowledge graph question answering, built on Freebase (a free knowledge graph platform). It contains 4737 natural language questions and their corresponding answers. Answers are obtained through entity and relation reasoning within the knowledge graph, typically requiring up to two hops of reasoning to reach the correct answer. The dataset covers various question types, such as factual queries, counting questions, and path-based reasoning questions. The dataset is divided into training and test sets, containing 3098 and 1639 questions respectively. Following existing work, an additional 250 questions are allocated to the training set as a validation set for model selection and hyperparameter tuning.

[0081] CWQ is a benchmark dataset specifically designed for complex KGQA scenarios and can be considered an extended version of WebQSP. This dataset contains 34,689 questions, and its question structure is significantly more complex than that of WebQSP. Queries in CWQ typically involve multiple-hop reasoning, nested queries, comparison operations, counting constraints, and other complex reasoning patterns, placing higher demands on the model's reasoning depth and semantic understanding capabilities on the knowledge graph. A significant portion of the questions in the dataset require up to four hops of reasoning on the knowledge graph to obtain the final answer, making it highly suitable for evaluating the performance of multi-hop KGQA models in complex reasoning scenarios.

[0082] Table 1. Statistics for WebQSP and CWQ

[0083]

[0084] 1.2 Implementation Details

[0085] To ensure the reliability of the experimental results, different parameters were configured specifically for different datasets. Considering the differences in the complexity of natural language problems and the required graph inference depth, the core multi-hop tree search module of the model was adaptively adjusted. For the WebQSP dataset, which favors short-link inference, the number of inference layers of the neural tree search was set to... The local subtree depth in the reverse aggregation phase is set to For the CWQ dataset, which has a more complex problem structure and requires more inference hops, the number of inference layers is increased to capture a broader knowledge graph context. Increase to 3 levels, and correspondingly expand the subtree depth to [value missing]. For the initial encoding of natural language problems, the RoBERTa pre-trained language model is used to extract the problem's semantic vector. In the node feature initialization stage, this invention initializes the node embedding representation based on relation frequency and entity importance. This representation is then frozen as a constant during subsequent training, validation, and testing stages, effectively ensuring numerical stability during training. Furthermore, for the KN non-uniform pruning module proposed in this invention, the protection hop count K and the proportion of discarded non-critical facts N are used as key hyperparameters controlling the subgraph structure range and sparsity. In this embodiment, the candidate protection hop count K includes at least 1, 2, and 3, and the candidate non-critical fact discard proportion N includes at least 20% and 30%. The K and N combinations that meet the preset conditions are selected based on the validation set performance.

[0086] 1.3 Baseline Method

[0087] In the performance comparison experiment, the following baseline was used for comparison.

[0088] KV-MemNN (Miller et al., 2016): It stores triple knowledge in a key-value pair structure and supports queries in the form of a memory network after vectorization, enabling the model to effectively retain and retrieve semantic evidence related to the question.

[0089] GraftNet (Sun et al., 2018): It supplements the graph content by introducing external knowledge, extracts subgraphs from the subject entities involved in the problem, and uses graph neural networks to perform multi-hop reasoning on the subgraphs.

[0090] SGReader (Xiong et al., 2019): First, it accumulates entity knowledge in a subgraph related to the question, then reconstructs the question in the latent semantic space, and uses the entity knowledge to read the text, ultimately achieving the fusion of knowledge and textual evidence to predict the answer.

[0091] PullNet (Sun et al., 2019): Starting with the topic entities identified in natural language problems, it gradually expands related entities to construct knowledge subgraphs, and finally uses graph convolutional neural networks to extract answers.

[0092] EmbedKGQA (Saxena et al., 2020): Embeds natural language questions and knowledge graphs into a unified representation space and selects the entity with the highest score as the answer through a link prediction method.

[0093] TransferNet (Shi et al., 2021): It activates relationships through a question-guided attention mechanism and gradually propagates scores between entities through score transfer, thereby achieving transparent and interpretable multi-hop reasoning.

[0094] NSM (He et al., 2021): It uses graph convolutional reasoning to construct a neural state machine to traverse the graph step by step; BiNSM introduces a teacher network to provide intermediate entity distributions as supervision, guiding the student network to learn a more reasonable answer selection path.

[0095] SR+NSM (Zhang et al., 2022): Proposes a plug-and-play subgraph retrieval module, which, when combined with NSM, significantly improves knowledge coverage and retrieval performance.

[0096] NuTrea (Jung et al., 2023): proposed Neural Tree Search, which uses a tree search scheme to consider a broader KG context when searching for paths to the answer node.

[0097] BRDIA (Hyeong et al., 2025): By dynamically adjusting bidirectional instructions, it constructs comprehensive and reliable contextual information, thus better integrating knowledge graphs with natural language queries.

[0098] 2. Experimental Results

[0099] 2.1 Main Experiment

[0100] The method of this invention is compared with experimental results from other baselines. Following the evaluation practices of existing work, the model that achieves best performance on the validation set is tested. In experiments on the WebQSP dataset, the Hits@1 (hit rate @1) metric reaches 78.28%, and the F1 metric is 74.33%; on the CWQ dataset, the Hits@1 metric is 58.68%, and the F1 metric reaches 53.99%, outperforming the comparison models on all evaluation metrics. Compared to the current state-of-the-art BRDIA model, on the WebQSP dataset, the Hits@1 score is improved by 0.38 percentage points, and the F1 score by 1.03 percentage points; on the CWQ dataset, the Hits@1 score is improved by 3.98 percentage points, and the F1 score by 2.19 percentage points. The performance of the F1 metric verifies the comprehensive improvement effect of the method of this invention on the overall prediction accuracy and recall of the answer set.

[0101] Table 2 Comparison with different baselines

[0102]

[0103] 2.2 Incomplete Subgraph Experiment

[0104] In practical applications, knowledge bases are usually constructed or maintained manually, making it difficult to guarantee their completeness. Therefore, varying degrees of omissions and noise are inevitable. To evaluate the robustness of the method of this invention in such incomplete knowledge graph scenarios, a common practice is to intentionally and randomly delete some triples from the original knowledge graph, i.e., from... In a set of triples of the form [formula missing], a specific proportion of edges and corresponding structures are removed to simulate knowledge gaps in real-world environments. Based on this idea, this embodiment aims to systematically examine the performance of the method of the present invention on knowledge graphs with missing relationships or sparse connections.

[0105] This embodiment follows the experimental settings in the literature and uses the same incomplete knowledge graph dataset. This dataset is constructed from samples in WebQSP, retaining only approximately [50%, 30%, 10%] of triples from the original free knowledge graph to form graph structures with varying sparsity, thus progressively increasing the interference of knowledge gaps on the reasoning process. Table 3 shows that, among various graph neural network models specifically designed for incomplete knowledge graph scenarios, the method of this invention achieves optimal or near-optimal performance in most settings. This result benefits from the elimination of non-critical edge interference weakly related to the question's semantics in the subgraph filtering mechanism, and the fusion of information from the forward expansion and backward aggregation stages through a two-stage adaptive gating mechanism. This maintains strong robustness and reasoning reliability even in knowledge graphs with missing relationships and significant structural noise.

[0106] Table 3 Incomplete Subgraph Experiments

[0107]

[0108] 2.3 Ablation Experiment

[0109] To quantitatively evaluate the independent contribution of each module to the overall performance, ablation experiments were conducted on the two core components of the method of this invention on the WebQSP and CWQ benchmark datasets: the KN Non-uniform Pruning (KN) perceptual module and the Semantic-Gated Reasoning (SGR) component in the two-stage semantic reasoning module.

[0110] KN ablation setting. This removes KN non-uniform pruning and the seed-answer-aware key edge protection mechanism, degenerating subgraph construction to uniformly and randomly discard all fact edges, without distinguishing between key and non-key edges. Under this setting, inference paths connecting seed and answer entities are truncated during training with the same probability as ordinary edges, forcing the model to infer on subgraphs with more noisy structures.

[0111] SGR ablation settings. Remove the node-level gating network based on the problem semantic vector, i.e., no longer use... To input gating weights, semantic modulation is applied to node scores, and the normalized scores from the original two-stage semantic reasoning module are directly used for candidate ranking. Under this setting, the multi-hop reasoning process does not impose explicit suppression on semantically irrelevant nodes, and the importance of candidate entities is entirely determined by graph structure propagation.

[0112] Table 4 Ablation Experiment

[0113]

[0114] (1) Both KN and SGR components bring significant and stable performance improvements. The complete K-N+SGR model improves Hits@1 and F1 by 3.23% and 3.81% respectively on WebQSP compared to the baseline without any enhancements, and the improvement further expands to 5.52% and 3.89% on CWQ, indicating that the two improvements are more effective in more complex multi-hop scenarios. In particular, the KN non-uniform pruning module, by jointly adjusting the number of protected hops K and the discard ratio N, reduces the subgraph size and discards non-critical edges while retaining key inference paths, enabling the model to perform inference on cleaner subgraphs.

[0115] (2) There is a synergistic gain between the two components. On WebQSP, the performance loss of removing both components simultaneously is greater than the sum of the losses when removing them individually, showing a positive interaction; on CWQ, the contributions of the two components are approximately additive. The above results indicate that there is a positive interaction effect between KN non-uniform pruning and SGR: a cleaner subgraph structure provides a higher quality candidate set for semantic gating, and the precise suppression of semantic gating, in turn, allows the boundary effect of structural pruning to be fully utilized.

[0116] 2.4KN elasticity factor hyperparameter test

[0117] To further verify the impact of the number of protection hops K and the proportion of non-critical facts dropped N on model performance, joint tests were conducted on multiple K and N combinations on the validation set. The test results are shown in Table 5, where Hits@1 is denoted as H1.

[0118] Table 5. Hyperparameter Test of KN Elastic Factor

[0119]

[0120] As shown in Table 5, under the condition that the proportion of non-critical facts discarded N is the same, increasing the number of protection hops K from 1 to 2 or 3 does not continuously improve performance. This indicates that an excessively large protection radius will force the retention of a large number of neighborhood facts that are irrelevant to the critical inference path, increasing graph density and diluting the effective semantic signal. In contrast, one-hop protection can achieve a better balance between reducing redundant structures and retaining critical paths. This result is consistent with the design goal of KN non-uniform pruning, that is, by limiting the protection range of critical structures and sampling only non-critical areas, a more compact and focused filter subgraph can be obtained.

[0121] 2.5 Subgraph Structure Analysis

[0122] The quality of the subgraph directly determines the upper limit of subsequent multi-hop inference. To systematically verify that the KN non-uniform pruning subgraph filtering module proposed in this invention can completely preserve key inference paths while reducing graph density, an in-depth analysis of the changes in local subgraphs before and after filtering is conducted from two dimensions: quantitative structural statistics and path integrity verification.

[0123] Quantitative structural statistics: For each sample, record the number of edges and entities in the subgraph before filtering. And the number of edges and entities in the filtered subgraph The compactness of the structure is measured by the reduction in the number of edges and entities. At the same time, the local structure of the subgraphs before and after filtering for typical samples is given to visually demonstrate how the filtering strategy reduces redundant edges and irrelevant nodes while maintaining the structure of key neighborhoods.

[0124] Table 6 Comparison of Subgraph Filtering Strategy Before and After

[0125]

[0126] The following patterns can be observed from Table 6: (1) The edge compression rate is highly consistent with the preset non-critical fact discard ratio N, indicating that the KN non-uniform pruning is consistent with uniform discard in terms of macroscopic retention and does not introduce additional information loss; (2) The node compression rate is significantly lower than the edge compression rate, indicating that most of the deleted edges connect low-degree redundant nodes in the graph, while the key entities with high connectivity, namely the entities in the K-hop protected neighborhood of the seed node and the answer node, are almost completely preserved; (3) The number of nodes in sample 32 remains unchanged before and after filtering, indicating that all nodes in this sample are connected to key entities through at least one protected edge, and the structure is highly dense. The method of this invention mainly plays the role of noise reduction at the edge level in such samples.

[0127] Figure 4 It comprehensively demonstrates the feature changes of the entire sample before and after filtering. For example... Figure 4 As shown in the distribution comparison diagram (a) in the figure, the median of the overall distribution of both the number of edges and the number of entities has shifted significantly downward, macroscopically confirming the effective reduction in graph density; while Figure 4The sample-level scatter plot in (b) clearly shows that, regardless of the size of the initial local subplot, the number of all samples after filtering strictly converges below the absolute retention baseline. This strongly demonstrates that the KN non-uniform pruning strategy has high robustness and universality when facing samples of various heterogeneous sizes.

[0128] Critical Path Retention Rate (CPRR): For each training sample, the proportion of the shortest inference paths from the seed entity to the answer entity that remain intact after KN non-uniform pruning is calculated.

[0129] ;

[0130] in, This represents the number of training samples included in the statistics. For the first The set of shortest reasoning paths from seed entity to answer entity in each sample; This represents the single shortest reasoning path; This represents the set of facts contained in the path; To retain the set of facts after filtering.

[0131] The critical path retention rate is calculated only for samples where the answer entity exists in the subgraph; other samples are excluded because the factor graph does not cover the answer node. Compared to a uniform random discard strategy, the critical path retention rate of the method in this invention is expected to be significantly higher, thus directly demonstrating the effectiveness of KN non-uniform pruning in targeted protection of critical edges. Comparisons are shown in Table 7.

[0132] Table 7 Critical Path Retention Rate

[0133]

[0134] Based on the quantitative statistics and path integrity analysis above, the KN non-uniform pruning strategy of this invention exhibits consistent advantages. Firstly, it achieves a balance between structural compactness and information preservation. The edge compression rate shown in Table 6 closely matches the preset non-critical fact discard ratio N, indicating that the method of this invention does not deviate from the compression target of uniform discarding in terms of macroscopic retention, and that highly connected critical entities and their K-hop protected neighborhoods are completely preserved. Secondly, it provides targeted protection of critical path inference paths. The comparison results in Table 7 show that, under the same compression rate, the uniform random discarding strategy only achieves critical path retention rates of 78.5% and 74.0% for WebQSP and CWQ, respectively, indicating a significant risk of inference chain breakage. In contrast, the method of this invention, by prioritizing the protection of critical edges associated with seed entities and answer entities, increases the critical path retention rates on the two datasets to 100% and 96.2%, respectively. This result verifies that the method of this invention can selectively delete redundant edges.

[0135] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims

1. A multi-hop knowledge graph question answering method based on structural pruning and semantic fusion, characterized in that, Includes the following steps: S1. Determine the K-hop protection node set based on the seed entity set, the answer entity set, and the critical structure protection hop number K. Retain the protection facts associated with the K-hop protection node set, and perform non-uniform pruning on the non-protection facts according to the non-critical fact discard ratio N to obtain the filtered subgraph. S2, Generate node-level gating units based on node representations and problem semantic vectors, and use the node-level gating units to perform semantic modulation and normalization on the unnormalized scores of nodes to obtain the next-hop node distribution; S3, perform forward expansion and reverse aggregation layer by layer on the filtered subgraph to obtain a structurally enhanced representation, and combine the node-level gating unit to update the next-hop node distribution layer by layer to sort the candidate entities and obtain the answer.

2. The method according to claim 1, characterized in that, The determination of the K-hop protection node set in S1 includes: taking the union of the seed entity set and the answer entity set as the core protection node set; starting from the core protection node set, performing a neighborhood expansion on the local knowledge subgraph that does not exceed the number of critical structure protection hops K, and adding the expanded entities to the K-hop protection node set.

3. The method according to claim 1, characterized in that, The protected facts and the unprotected facts in S1 are determined as follows: the fact that the endpoint entity belongs to the set of K-hop protected nodes is determined as a protected fact, and the remaining facts are determined as unprotected facts; the protected facts are used at least to preserve the key reasoning path connecting the set of seed entities and the set of answer entities.

4. The method according to claim 1, characterized in that, The non-uniform pruning in S1 includes: determining the target retention quantity based on the number of facts in the local knowledge subgraph and the non-critical fact discard ratio N; when the number of protected facts does not reach the target retention quantity, selecting a corresponding number of facts from the non-protected facts to supplement them; and constructing the filter subgraph from the retained protected facts and the selected non-protected facts.

5. The method according to claim 1, characterized in that, The non-uniform pruning described in S1 is performed during the training phase; during the training phase, the critical structure protection hop count K is set to a positive integer, and the non-critical fact discard ratio N is set to be greater than zero; during the inference phase, the non-critical fact discard ratio N is set to zero, and multi-hop inference is performed on the local knowledge subgraph that retains all facts.

6. The method according to claim 1, characterized in that, The critical structure protection hop count K and the non-critical fact discard ratio N mentioned in S1 are jointly determined based on the verification results; by traversing multiple candidate parameter combinations, and based on at least one of multi-hop question answering performance, subgraph compression degree and critical reasoning path retention degree, the target parameter combination is selected from the candidate parameter combinations.

7. The method according to claim 1, characterized in that, The node-level gating unit generated in S2 includes: fusing the node representation and the question semantic vector to obtain semantic fusion features; performing nonlinear mapping on the semantic fusion features to obtain gating weights that characterize the degree of semantic relevance between the node and the current question; and using the gating weights as the node-level gating unit.

8. The method according to claim 1, characterized in that, The semantic modulation and normalization described in S2 include: reweighting the unnormalized scores of nodes according to the node-level gating unit to obtain gating scores; and normalizing the gating scores of each candidate node in the filtering subgraph to obtain the next-hop node distribution for the next layer of inference.

9. The method according to claim 1, characterized in that, The forward expansion described in S3 includes: generating edge messages based on the connection relationships between nodes, the problem semantic vector, and the upstream node state; weighting and aggregating the edge messages according to the distribution of the next-hop nodes corresponding to the previous layer, and merging the aggregation result with the original state of the nodes to obtain the forward update representation.

10. The method according to claim 1, characterized in that, The reverse aggregation described in S3 includes: constructing a local subtree with the node as the root, generating a backflow message within the local subtree; aggregating the backflow message to obtain a backflow summary, and fusing the backflow summary with the forward update representation obtained by the forward expansion to obtain the structure-enhanced representation.