An intermediate inference attention-based multi-hop knowledge base question answering IR-MT model

By introducing an intermediate inference attention mechanism, the IR-MT model solves the problems of increasing candidate path numbers and lack of supervision in intermediate steps in multi-hop knowledge base question answering, achieving more efficient knowledge base question answering performance.

CN116166779BActive Publication Date: 2026-05-05STATE GRID GREEN ENERGY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
STATE GRID GREEN ENERGY CO LTD
Filing Date
2022-12-22
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing multi-hop knowledge base question answering models suffer from problems such as an explosive increase in the number of candidate paths and a lack of supervision signals for intermediate step inference in large-scale knowledge graphs, leading to unstable model performance.

Method used

We adopt a multi-hop knowledge base question answering IR-MT model based on intermediate reasoning attention. Through the IR-MH model reasoning module and answer generation module, we dynamically update the reasoning instructions at each step by utilizing the intermediate reasoning state, which promotes close interaction between the reasoning state and the reasoning instructions at the intermediate step and provides effective attention feedback.

Benefits of technology

It significantly improves the reasoning performance of multi-hop knowledge base question answering, alleviates the predicament of lack of intermediate supervision signals, and enhances the overall question answering efficiency of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116166779B_ABST
    Figure CN116166779B_ABST
Patent Text Reader

Abstract

The application discloses a multi-hop knowledge base question answering IR-MT model based on intermediate reasoning attention, relates to the technical field of knowledge base question answering, and comprises a retrieval source construction module, a question representation module, an IR-MH model reasoning module and an answer generation module. First, the subgraph of a specific question is acquired from a knowledge graph according to the question, and then a sorting algorithm is executed to gradually acquire answers starting from a theme entity. On the basis of the retrieval multi-hop knowledge base question answering framework, the application introduces an intermediate reasoning attention mechanism, pays more attention to the part that has not been answered in the previous number of jumps in the original question in the process of generating each jump reasoning instruction, the weight of the attention is related to the last jump reasoning state, the reasoning state of the intermediate step can be fully utilized, the reasoning instruction of each step is dynamically updated, the close interaction between the reasoning state of the intermediate step and the reasoning instruction is promoted, and an effective attention feedback is provided for the optimization of the intermediate step reasoning instruction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge base question answering technology, specifically a multi-hop knowledge base question answering IR-MT model based on intermediate reasoning attention. Background Technology

[0002] Early research on multi-hop knowledge base question answering tasks largely employed a pipeline framework. While this relation-chain-based approach excels at single-hop knowledge base question answering, it falters when dealing with multi-hop knowledge base question answering tasks on large-scale knowledge graphs. Firstly, the number of candidate paths (relationships) grows exponentially with path length (relationship hops), making relation computation impractical for large-scale knowledge graphs. More importantly, the model fails to balance the path length required to process the original question, i.e., when inference terminates.

[0003] To address the shortcomings of pipeline frameworks, an end-to-end multi-hop knowledge base question answering framework has recently attracted widespread attention from researchers. Depending on the technological paradigm, it can be divided into traditional neural network models based on key-value pair modeling and emerging graph neural network models. Although the end-to-end framework alleviates the deficiencies of the pipeline framework, the lack of supervision signals for intermediate steps leads to performance instability. The lack of supervision signals in the intermediate steps of multi-hop inference means that the model can only receive feedback from the final answer, and the inference instructions for intermediate steps cannot be effectively optimized, weakening the forward propagation of the inference state. Most existing research methods employ global attention to help the model learn the inference instructions for each hop, which has proven ineffective in weakly supervised tasks. To solve these problems, this invention proposes a multi-hop knowledge base question answering model based on intermediate inference attention, building upon the existing retrieval-based multi-hop knowledge base question answering framework. Summary of the Invention

[0004] This invention aims to address at least one of the technical problems existing in the prior art. To this end, this invention proposes a multi-hop knowledge base question answering model based on intermediate inference attention. The IR-MT model can fully utilize the inference state of intermediate steps, dynamically update the inference instructions at each step, promote a close interaction between the inference state of intermediate steps and the inference instructions, and provide an effective attention feedback for optimizing the inference instructions of intermediate steps.

[0005] To achieve the above objectives, according to an embodiment of the first aspect of the present invention, a multi-hop knowledge base question answering IR-MT model based on intermediate reasoning attention is proposed, including a retrieval source construction module, a question representation module, an IR-MH model reasoning module, and an answer generation module;

[0006] The question representation module is used to receive user input of the question Q = {w1, w2, ..., w}. n};

[0007] The retrieval source construction module is used to address the initial question Q = {w1, w2, ..., w...} n}, by understanding the knowledge base K = {(e s A subgraph is constructed by considering the following relationships: r, e0)}, where the subgraph includes multiple candidate entities;

[0008] The IR-MH model inference module is used to extract the answer entity from all candidate entities in the subgraph using the IR-MH model, and transmit the extracted answer entity to the answer generation module for display.

[0009] The IR-MH model inference module consists of an instruction component and an inference component; the instruction component sends instruction vectors to the inference component, and the inference component infers entity distribution and learns entity representations.

[0010] Furthermore, the retrieval source construction module specifically includes:

[0011] The Personalized PageRank algorithm is run on the topic entities to retrieve subgraphs, where the topic entities are {e0|e0∈Q}; subgraph retrieval is used to answer each question.

[0012] Furthermore, the specific working steps of the instruction component are as follows:

[0013] The instruction component first transforms the given initial question Q into a series of instruction vectors that control the reasoning process; the input of the instruction component consists of the word vector of the initial question Q and the instruction vector of the previous reasoning step; the initial instruction vector is set to the zero vector.

[0014] Furthermore, the instruction component employs a pre-trained BERT model to obtain the word vector representation of the initial question Q, and then maps it to the task-specific word vector space through a bidirectional LSTM network to obtain the final question vector representation H. l j ,in l represents the length of the initial problem Q.

[0015] Furthermore, the instruction vector for each reasoning step is represented by i. k The specific calculation process is as follows:

[0016]

[0017]

[0018] in These are the parameters that need to be trained; H is the word vector representation of the initial question Q, and s k-1 This is the reasoning state vector of the previous reasoning step; The intermediate inference attention weights are used; by repeating the above process, a list of instruction vectors is obtained. The instruction vector for the next n reasoning steps.

[0019] Furthermore, the specific working steps of the inference component are as follows:

[0020] In the IR-MT model, the instruction vector i is obtained through the instruction component. k Then, it is used as a guidance signal for the inference component; wherein the input of the inference component includes the instruction vector i for the current step. k And the reasoning state s of the previous reasoning step. k-1 This includes the entity distribution pk-1 and the entity vector representation {e}. k-1};

[0021] The output of the inference component includes the entity distribution pk and the entity vector representation {e} for the current inference step. k}, where e 0 The subject entity.

[0022] Furthermore, the relation r extraction result for each inference step is calculated as follows:

[0023]

[0024] Where R is the set of candidate relations for the current reasoning step. The question vector is concatenated with the reasoning instruction vector from the previous stage, and F is the classification model;

[0025] The fact triple given in the knowledge base, and its relationship with the instruction vector i of the current reasoning step. k The matched vector representation is calculated as follows:

[0026]

[0027] Among them W R Let r be a training parameter; then, use the probability of relation r in the current inference step as the attention weight to obtain the relation aggregation score passed from the previous step:

[0028]

[0029] in, Let p(r) be the set of possible fact triples in the knowledge base, and p(r) be the probability of each relation in the candidate relation set; then... The entity distribution e output by the previous reasoning state k-1Combined, obtain the entity distribution of the current inference state:

[0030]

[0031] Where FFN is the forward propagation network; the probability of obtaining the final answer entity is calculated as follows:

[0032] P k =softmax((e k ) T w)(7)

[0033] Where w is a parameter for training.

[0034] Furthermore, a multi-hop knowledge base question answering IR-MT method based on intermediate inference attention is applied to the aforementioned multi-hop knowledge base question answering IR-MT model based on intermediate inference attention, including:

[0035] First, receive the initial question Q = {w1, w2, ..., w} input from the user. n};

[0036] The source builder module is used to address the initial problem Q = {w1, w2, ..., w} n}, by understanding the knowledge base K = {(e s A subgraph is constructed by considering the following relationships: r, e0)}, where the subgraph includes multiple candidate entities;

[0037] The IR-MH model reasoning module extracts the answer entity from all candidate entities in the subgraph using the IR-MH model, and then transmits the extracted answer entity to the answer generation module for display.

[0038] Furthermore, an electronic device includes a processor, a memory, and a computer program stored in the memory; the processor executes the computer program to perform the aforementioned method for multi-hop knowledge base question answering based on intermediate inference attention (IR-MT).

[0039] Furthermore, a readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the aforementioned method for multi-hop knowledge base question answering IR-MT based on intermediate inference attention.

[0040] Compared with the prior art, the beneficial effects of the present invention are:

[0041] This invention, based on a multi-hop knowledge base question-answering framework, introduces an intermediate inference attention mechanism. During the generation of each inference instruction, it pays greater attention to the unsolved portion of the original question from previous hops, with the weight of this attention related to the inference state of the previous hop. This fosters close interaction between the inference state and the inference instructions at intermediate steps, providing effective attention feedback for optimizing these instructions. The IR-MH model significantly alleviates the lack of intermediate supervision signals in question-answering tasks based on integrated energy service knowledge graphs, resulting in a marked improvement in inference performance. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, 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 the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 This is a schematic diagram of the principle of a multi-hop knowledge base question answering IR-MT model based on intermediate inference attention according to the present invention.

[0044] Figure 2 This is a schematic diagram of the structure of the IR-MH model inference module in this invention. Detailed Implementation

[0045] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0046] like Figure 1 As shown, a multi-hop knowledge base question answering IR-MT model based on intermediate inference attention includes a retrieval source construction module, a question representation module, an IR-MH model inference module, and an answer generation module;

[0047] The question representation module is used to receive user input of the question Q = {w1, w2, ..., w}. n The retrieval source construction module is used to address the initial problem Q = {w1, w2, ..., w}. n}, by understanding the knowledge base K = {(e s A subgraph is constructed from the given information (r, e0)}, wherein the subgraph includes multiple candidate entities; specifically including:

[0048] The Personalized PageRank algorithm is run from the topic entities to retrieve the subgraph, where the topic entities are {e0|e0∈Q}; subgraph retrieval is used to answer each question; finally, the IR-MH model inference module is used to extract the answer entity from all candidate entities in the subgraph using the IR-MH model proposed in this invention;

[0049] like Figure 2 As shown, the IR-MH model inference module mainly consists of an instruction component (inference instructions) and an inference component (inference state). The instruction component sends instruction vectors to the inference component, which infers the entity distribution and learns entity representations.

[0050] The specific working steps of the instruction component are as follows:

[0051] The instruction component first transforms a given natural language question into a series of instruction vectors that control the inference process. The input to the instruction component consists of the word vectors of the initial question Q and the instruction vectors from the previous inference step. The initial instruction vectors are set to zero.

[0052] This invention employs a pre-trained model BERT to obtain the word vector representation of the initial question Q, and then maps it to the word vector space of a specific task through a bidirectional LSTM network to obtain the final question vector representation H. l j ,in l represents the length of the initial problem Q. The instruction vector for each reasoning step is represented by i. k The specific calculation process is as follows:

[0053]

[0054]

[0055] in These are the parameters that need to be trained. H is the word vector representation of the initial question Q, and s k-1 This is the reasoning state vector of the previous reasoning step. The core idea of ​​the intermediate inference attention weight proposed in this paper is to focus on specific parts of the query when learning the instruction vectors of different inference steps. Inspired by the influence of previously completed inference answers on subsequent inference questions when performing multi-hop question answering, this paper proposes an intermediate inference attention method. When generating inference instruction vectors, it dynamically updates the question representation using the inference state vectors of previous inference steps so that it can incorporate previous instruction vector information. By repeating the above process, we can obtain a list of instruction vectors. The instruction vector for the next n reasoning steps.

[0056] The specific working steps of the inference component are as follows:

[0057] In the IR-MT model, the instruction vector i is obtained through the instruction component. k Then, it is used as a guidance signal for the inference component; wherein the input of the inference component includes the instruction vector i for the current step. k And the reasoning state s of the previous reasoning step. k-1 This includes the entity distribution pk-1 and the entity vector representation {e}. k-1};

[0058] The output of the inference component includes the entity distribution pk and the entity vector representation {e} for the current inference step. k}, where e 0 The subject entity is defined as [the entity being considered]. It is important to emphasize that the reasoning path (i.e., the relationship path connecting the subject entity and the answer entity) determines the final reasoning result. The relationship r extracted at each reasoning step is calculated as follows:

[0059]

[0060] Where R is the set of candidate relations for the current reasoning step. The question vector is concatenated with the reasoning instruction vector from the previous stage, and F is the classification model;

[0061] The fact triple given in the knowledge base, and its relationship with the instruction vector i of the current reasoning step. k The matched vector representation can be calculated as follows:

[0062]

[0063] Among them W R Let be a trainable parameter. Then, we use the probability of relation r in the current inference step as the attention weight to obtain the relation aggregation score passed from the previous step:

[0064]

[0065] in, Let p(r) be the set of possible fact triples in the knowledge base, and let p(r) be the probability of each relation in the candidate relation set. Then... The entity distribution e output by the previous reasoning state k-1 Combined, obtain the entity distribution of the current inference state:

[0066]

[0067] Where FFN is the forward propagation network. We obtain the final entity probability calculation as follows:

[0068]

[0069] Where w is a trainable parameter;

[0070] The R-MH model reasoning module is used to transmit the final answer entity obtained to the answer generation module for display.

[0071] A multi-hop knowledge base question answering IR-MT method based on intermediate inference attention is applied to the aforementioned multi-hop knowledge base question answering IR-MT model based on intermediate inference attention, including:

[0072] First, receive the initial question Q = {w1, w2, ..., w} input from the user. n};

[0073] The source builder module is used to address the initial problem Q = {w1, w2, ..., w} n}, by understanding the knowledge base K = {(e s A subgraph is constructed by considering the following relationships: r, e0)}, where the subgraph includes multiple candidate entities;

[0074] The IR-MH model reasoning module extracts the answer entity from all candidate entities in the subgraph using the IR-MH model, and then transmits the extracted answer entity to the answer generation module for display.

[0075] An electronic device includes a processor, a memory, and a computer program stored in the memory; the processor executes the computer program to perform the aforementioned method for multi-hop knowledge base question answering based on intermediate inference attention (IR-MT).

[0076] A readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method for multi-hop knowledge base question answering IR-MT based on intermediate inference attention.

[0077] The multi-hop knowledge base question answering model in this invention is primarily based on information retrieval: The information retrieval-based multi-hop knowledge base question answering method first retrieves a subgraph of the specific question from the knowledge graph, then executes a ranking algorithm to progressively obtain answers starting from the topic entity. Simultaneously, based on the retrieval-based multi-hop knowledge base question answering framework, an intermediate reasoning attention mechanism is introduced. During the generation of each hop reasoning instruction, greater attention is paid to the unresolved portion of the original question from previous hops, with the weight of this attention related to the reasoning state of the previous hop. This fosters a close interaction between the reasoning state and the reasoning instructions in intermediate steps, and provides effective attention feedback for optimizing intermediate step reasoning instructions.

[0078] The above formulas are all numerical calculations after removing dimensions. The formulas are obtained by software simulation based on a large amount of data and are closest to the real situation. The preset parameters and preset thresholds in the formulas are set by those skilled in the art according to the actual situation or obtained by simulation based on a large amount of data.

[0079] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0080] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to any specific implementation. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims

1. A multi-hop knowledge base question answering IR-MT model based on intermediate inference attention, characterized in that, It includes a retrieval source construction module, a question representation module, an IR-MH model inference module, and an answer generation module; The question representation module is used to receive the initial question Q={w1,w2,…,w...} input by the user. n }; The retrieval source construction module is used to address the initial question Q={w1,w2,…,w n }, by understanding the knowledge base K={(e s A subgraph is constructed by considering the following relationships: r, e0)}, where the subgraph includes multiple candidate entities; The IR-MH model inference module is used to extract the answer entity from all candidate entities in the subgraph using the IR-MH model, and transmit the extracted answer entity to the answer generation module; the IR-MT model inference module includes an instruction component and an inference component; the instruction component is used to convert the initial question Q into an instruction vector and send the instruction vector to the inference component; The inference component deploys an IR-MH model, which is used to infer entity distribution and learn entity representation based on instruction vectors, extract answer entities from all candidate entities in the subgraph, and transmit the answer entities to the answer generation module. The result of relation extraction r for each reasoning step is calculated as follows: (3) Where R is the set of candidate relations for the current reasoning step. The question vector is concatenated with the reasoning instruction vector from the previous stage, and F is the classification model; The fact triple given in the knowledge base, and its relationship with the instruction vector i of the current reasoning step. k The matched vector representation is calculated as follows: (4) Among them W R Let r be a training parameter; then, use the probability of relation r in the current inference step as the attention weight to obtain the relation aggregation score passed from the previous step: (5) Where, N e Let p(r) be the set of possible fact triples in the knowledge base, and p(r) be the probability of each relation in the candidate relation set; then... The entity distribution e output by the previous reasoning state k-1 Combined, obtain the entity distribution of the current inference state: (6) Where FFN is the forward propagation network; the probability of obtaining the final answer entity is calculated as follows: (7) Where w is a parameter for training; The answer generation module is used to display the answer entity.

2. The multi-hop knowledge base question answering IR-MT model based on intermediate inference attention as described in claim 1, characterized in that, The retrieval source construction module specifically includes: The Personalized PageRank algorithm is run on the topic entities to retrieve subgraphs, where the topic entities are {e0|e0∈Q}; subgraph retrieval is used to answer each question.

3. The multi-hop knowledge base question answering IR-MT model based on intermediate inference attention as described in claim 1, characterized in that, The instruction component uses a pre-trained model BERT to obtain the word vector representation of the initial question Q, and then... By mapping it to the word vector space of a specific task through a bidirectional LSTM network, the final question vector representation H is obtained. l j ,in , where l represents the length of the initial problem Q.

4. The multi-hop knowledge base question answering IR-MT model based on intermediate inference attention as described in claim 1, characterized in that, The instruction vector for each inference step is represented by i. k The specific calculation process is as follows: (1) (2) in , , These are the parameters that need to be trained; H is the initial problem. Q Word vector representation, s k-1 This is the reasoning state vector of the previous reasoning step; The intermediate inference attention weights are used; by repeating the above process, a list of instruction vectors is obtained. The instruction vector for the next n reasoning steps.

5. The multi-hop knowledge base question answering IR-MT model based on intermediate inference attention according to claim 4, characterized in that, in, The specific working steps of the inference component are as follows: In the IR-MT model, the instruction vector i is obtained through the instruction component. k Then, it is used as a guidance signal for the inference component; wherein the input of the inference component includes the instruction vector i for the current step. k And the reasoning state s of the previous reasoning step. k-1 , including entity distribution p k-1 and entity vector representation {e k-1 }; The output of the inference component includes the entity distribution p of the current inference step. k and entity vector representation {e k },in e 0 The subject entity.

6. A multi-hop knowledge base question answering IR-MT method based on intermediate inference attention, characterized in that, Applied to the multi-hop knowledge base question answering IR-MT model based on intermediate inference attention as described in any one of claims 1-5, the method includes: First, receive the initial question Q={w1,w2,…,w...} from the user. n }; The source builder module is used to address the initial problem Q={w1,w2,…,w n }, by understanding the knowledge base K={(e s A subgraph is constructed by considering the following relationships: r, e0)}, where the subgraph includes multiple candidate entities; The IR-MH model reasoning module extracts the answer entity from all candidate entities in the subgraph using the IR-MH model, and then transmits the extracted answer entity to the answer generation module for display.

7. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory; when the processor executes the computer program, it performs a multi-hop knowledge base question answering IR-MT method based on intermediate inference attention as described in claim 6.

8. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the multi-hop knowledge base question answering IR-MT method based on intermediate inference attention as described in claim 6.

Citation Information

Patent Citations

  • Reinforced learning knowledge graph reasoning method and device based on graph convolutional neural network

    CN111581343A

  • Knowledge graph embedding-based interpretable multi-hop question and answer method and system

    CN114168719A