A common sense reasoning framework based on attention-guided enhancement of hybrid knowledge graph

By using a hybrid knowledge graph-guided enhancement framework, which leverages multi-head attention and graph neural networks for information interaction and aggregation, the limitations of noise knowledge filtering and information fusion in commonsense question answering are addressed, thereby improving the efficiency and interpretability of commonsense question answering.

CN116050523BActive Publication Date: 2026-03-17TIANJIN UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310044752.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-30
Publication Date
2026-03-17
Estimated Expiration
2043-01-30

AI Technical Summary

Technical Problem

Existing commonsense question answering methods suffer from problems when using knowledge graphs, such as difficulty in filtering noisy knowledge, high complexity of multi-hop reasoning paths, lack of global perspective in information fusion, and neglect of the role of graph structure. These issues limit the efficiency and interpretability of the models in commonsense reasoning and question answering.

Method used

We adopt an attention-guided enhancement framework based on hybrid knowledge graphs. By encoding question-option pairs through a pre-trained language model, we select reasoning subgraphs, utilize multi-head attention mechanisms and graph neural networks for global node information interaction and local information aggregation, and combine hybrid attention mechanisms for knowledge aggregation and propagation, thereby expanding the information reception domain and improving reasoning ability.

Benefits of technology

It significantly improves model performance on multiple-choice common sense question answering tasks, improving by 0.52% compared to strong baseline models. It also achieves remarkable results with low training resources, especially performing well under complex problems and low-resource conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116050523B_ABST
    Figure CN116050523B_ABST
Patent Text Reader

Abstract

The application provides a common sense reasoning framework based on a mixed knowledge graph and attention guidance enhancement, comprising a pre-trained text encoder, a retrieval common sense knowledge graph module, a knowledge interaction guidance module, a common sense knowledge aggregation and propagation module and an answer and explanation module; the pre-trained text encoder encodes a group of questions q-option c i The encoding representation is obtained; the retrieval graph module filters common sense reasoning subgraphs according to the questions and the options, and takes the encoding representation of the question-option pair as the global node of the subgraph; the knowledge interaction guidance module extracts the question-option nodes in each reasoning subgraph, allows the global nodes of multiple reasoning subgraphs to mutually transmit information, and obtains the representation of a new question-option node through steps, important reasoning information is obtained in the common sense knowledge aggregation stage, and the nodes in the reasoning subgraph feel non-local information in the knowledge interaction guidance module, so that the information source and the receiving domain of the model reasoning process are expanded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of external knowledge graph knowledge fusion and commonsense question answering. Specifically, it proposes an attention-guided enhanced commonsense reasoning framework based on hybrid knowledge graphs and verifies the performance of the method on a multiple-choice commonsense question answering task. Technical Background

[0002] Pre-trained language models enhanced by knowledge graphs (KGs) have performed well in the field of common sense reasoning. Taking common sense question answering tasks as an example, existing methods usually estimate the confidence score of an option separately based on the common sense knowledge graph retrieved for each option, without considering the interference effect between different options. In addition, some models that model the path between questions and options are easily affected by the sparsity and size of the knowledge graph. Therefore, graph neural networks are widely used to implicitly capture relevant common sense knowledge from knowledge graphs. However, the retrieved knowledge graphs often contain a lot of noisy knowledge, and how to effectively filter noisy knowledge has become a research challenge.

[0003] Some early works mainly used common networks such as LSTM[1] and RGCN[2] to model the k-hop path between the question and the option separately, so as to realize multi-hop reasoning, such as RNs[3], KagNet[4], MHGRN[5]. This kind of approach provides the possibility for question answering, explanation and reliable prediction, but the k-hop path grows with the nodes in a polynomial and exponential manner, and the time complexity is high, which limits its ability to integrate rich external knowledge. This makes the method have certain limitations in terms of interpretability and efficiency, and still needs to be improved.

[0004] With the deepening research on graph neural networks and pre-trained language models, different graph algorithms and pre-training strategies have been used to learn relevant common sense knowledge on knowledge graphs. For example, QAGNN[6] and GREASELM[7] use language models to estimate the importance of entities in the retrieved knowledge graph under given context, and at the same time, they build a joint reasoning graph based on the GAT[8] network to update node representations. This method makes full use of the ability of language models to select effective knowledge graphs and then uses graph structures to effectively aggregate important information. GREASELM further improves the performance of the model in question answering tasks and the ability to handle complex problems by conducting multi-level deep interaction between language models and graph neural networks. However, it is worth noting that the external knowledge fusion and reasoning process of each option is independent of each other and lacks global perspective. Moreover, when fusing common sense knowledge of graph structures, it often ignores the different effects of different edges on the reasoning process. This makes the model have certain limitations in the process of common sense knowledge fusion and reasoning. This method still needs to be improved.

[0005] Recently, methods based on global-local attention information aggregation and hybrid graph networks have been proposed. Based on the ideas of this type of model, this application attempts to explore a knowledge graph-enhanced commonsense reasoning framework that can more efficiently perform information interaction between different subgraphs and aggregate more effective node feature expressions from the knowledge graph.

[0006] This invention uses question-option pairs as global nodes of the reasoning subgraph, filters out global nodes of all subgraphs, and uses Multi-HeadAttention[9] and HighwayNetwork

[10] to calculate the interactive feature representation nodes. At this time, each subgraph global node integrates information from the other subgraphs. Then, in order to obtain more effective node feature representations in their respective subgraphs, the hybrid attention mechanism designed in this invention is used to aggregate and propagate effective knowledge on the knowledge graph to obtain updated node features. After multiple layers of continuous enhancement, important option information is also preserved and transmitted. Compared with the previous knowledge graph-based enhancement model, this method expands the information receptive field of each option to the global level. At the same time, a hybrid attention mechanism is added during message aggregation and propagation on the knowledge graph. The two methods benefit from each other and significantly improve the performance on relevant multiple choice common sense question answering datasets.

[0007] [References]

[0008] [1]Hochreiter S,Schmidhuber J.Long short-term memory[J].Neuralcomputation,1997,9(8):1735-1780.

[0009] [2]Schlichtkrull M,Kipf TN,Bloem P,et al.Modeling relational data with graph convolutional networks[C] / / European semantic webconference.Springer,Cham,2018:593-607.

[0010] [3]Santoro A, Raposo D, Barrett DG, et al. A simple neural network module for relational reasoning[J]. Advances in neural information processing systems, 2017, 30.

[0011] [4]Bill Yuchen Lin,Xinyue Chen,Jamin Chen,and Xiang Ren.2019.KagNet:Knowledge-Aware Graph Networks for Commonsense Reasoning.In Proceedings ofthe 2019 Conference on Empirical Methods in Natural Language Processing andthe 9th International Joint Conference on Natural Language Processing(EMNLP-IJCNLP),pages 2829–2839,Hong Kong,China.Association for ComputationalLinguistics.

[0012] [5]Yanlin Feng,Xinyue Chen,Bill Yuchen Lin,Peifeng Wang,Jun Yan,andXiang Ren.2020.Scalable Multi-Hop Relational Reasoning for Knowledge-AwareQuestion Answering.In Proceedings of the 2020 Conference on Empirical Methodsin Natural Language Processing(EMNLP),pages 1295–1309,Online.Association forComputational Linguistics.

[0013] [6]MichihiroYasunaga,Hongyu Ren,Antoine Bosselut,Percy Liang,and JureLeskovec.2021.QA-GNN:Reasoning with Language Models and Knowledge Graphs forQuestion Answering.In Proceedings of the 2021 Conference of the NorthAmerican Chapter of the Association for Computational Linguistics:HumanLanguage Technologies,pages 535–546,Online.Association for ComputationalLinguistics.

[0014] [7]Zhang X,Bosselut A,Yasunaga M,et al.GreaseLM:Graph REASoningEnhanced Language Models for Question Answering[C].International ConferenceonLearning Representations,2022.

[0015] [8] P,Cucurull G,Casanova A,et al.Graph attention networks[C].InternationalConference onLearning Representations,2018.

[0016] [9]Vaswani A,Shazeer N,Parmar N,et al.Attention is all you need[J].Advances in neural information processing systems,2017,30.

[0017]

[10] Srivastava RK, Greff K, Schmidhuber J. Highway networks [C]. International Conference on Machine Learning, 2016. Summary of the Invention

[0018] This invention provides an attention-guided enhanced commonsense reasoning framework based on hybrid knowledge graphs. First, the question and options are concatenated and encoded using a pre-trained language model to obtain a set of global node representation vectors. Then, based on entity retrieval in the question-option relationship, each reasoning subgraph is obtained. Through guided interactive representation of each global node, new nodes with global information awareness are obtained, thereby expanding the information reception domain of each subgraph node. Message aggregation and propagation based on a hybrid attention mechanism are performed within the subgraphs to further aggregate more important reasoning information. This results in significant performance improvements on relevant multiple-choice commonsense question-answering datasets, and even under experimental conditions with complex questions and low training resources, it surpasses strong baseline models.

[0019] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0020] A commonsense reasoning framework based on attention-guided enhancement using a hybrid knowledge graph is provided. The framework includes: a pre-trained text encoder, a commonsense knowledge graph retrieval module, a knowledge interaction guidance module, a commonsense knowledge aggregation and dissemination module, and an answer and explanation module; wherein:

[0021] The pre-trained text encoder addresses a set of question q-options c. i Encode and represent:

[0022]

[0023] The commonsense knowledge graph retrieval module filters reasoning subgraphs based on entity words appearing in the questions and options, and encodes the question-option pairs. As a global node in the subgraph;

[0024] The knowledge interaction guidance module extracts the question-option nodes from each reasoning subgraph, allows global nodes of multiple reasoning subgraphs to exchange information, and obtains a new representation of the question-option nodes.

[0025] The common sense knowledge aggregation and dissemination module is a process of weighted aggregation of edge features of the knowledge graph and information transmission between nodes through graph neural networks.

[0026] The knowledge interaction guidance module and the common sense knowledge aggregation and dissemination module based on the hybrid attention mechanism expand the information reception domain of each subgraph node through multi-layered global knowledge interaction guidance and local knowledge aggregation and dissemination process iteration.

[0027] The answer and explanation module combines the initial question-option representation, the subgraph global node representation of the last layer, and the subgraph global pooling representation, and uses the SoftMax classifier to predict the confidence scores of multiple options.

[0028] Furthermore, the knowledge interaction guidance module obtains the representation process of the new question-option node;

[0029] The nodes of each reasoning subgraph are extracted and stacked to form an embedding matrix C.

[0030] The overall question-option embedding is mapped into three matrices, Q, K, and V, through three linear layers:

[0031] Q = C l W Q K=C l W K V=C l W V

[0032] Where: C l Representing the stacked problem in layer l - option embedding of the overall representation; W Q W K W V W is a linear mapping layer;

[0033] A multi-head attention mechanism is used to obtain the global node representations of each inference subgraph, and the attention coefficients between each option are obtained based on the attention matrix.

[0034] α ij =MHA(Q T K T V T )

[0035] Among them: MHA is the multi-head attention mechanism;

[0036] The information flow of each global node in the reasoning subgraph is controlled by the following formula: the gating coefficient η controls the proportion of the original information flow, and the attention weight is used to update the node feature representation after interaction.

[0037]

[0038] η=σ(C l W+b)

[0039] Where: ⊙ represents the Hadamard product; σ represents the sigmoid activation function.

[0040] Furthermore, the common sense knowledge aggregation and dissemination module performs a weighted aggregation of key edge features and node features on the reasoning knowledge graph through a graph neural network;

[0041] The attention weights of all edges are calculated using the global problem-option nodes in the inference subgraph.

[0042] The embedding representation of each edge is obtained by reasoning about the type of the edge in the subgraph and the types of the nodes at both ends;

[0043] The feature representation of the source node is updated by fusing attention-weighted edge features and features of the source node;

[0044] r st =f r (e st u s u t )

[0045]

[0046]

[0047]

[0048]

[0049] Among them, e st u s u t These represent the one-hot encodings of edge and node types, respectively. st f represents the edge features between nodes s and t. * It is a two-layer perceptron, where l is the number of layers in the graph neural network. It is a representation of the aggregation of edge features of nodes i and j with global node features. It is the correlation coefficient between different edges. It is the neighbor node passed in by node t. It is the initial embedding encoding of node s. It is a new node representation that incorporates weighted edge features;

[0050] By utilizing a multi-head attention mechanism to update the node information within the reasoning knowledge graph, new node embedding representations are obtained:

[0051]

[0052]

[0053]

[0054] Where: || indicates concatenation. This represents the normalized attention weight coefficients, which incorporate the node's degree feature d. s In this way, the node features returned at the end contain important node and edge feature information.

[0055] Beneficial effects

[0056] Compared with existing technologies, the beneficial effects of the technical solution of this invention are as follows: This invention utilizes a knowledge interaction guidance module to enable global nodes of different subgraphs to interact with each other, thereby expanding the information reception domain of each subgraph. Furthermore, the hybrid attention mechanism proposed in this invention achieves a certain improvement in the aggregation of important information in the knowledge graph, which is also verified by the final ablation experiment results. Finally, this application further validates its framework on a multiple-choice commonsense question answering task. Compared with the current strongest baseline model GREASELM, the framework of this application achieves a 0.52% performance improvement on the CommonsenseQA dataset task using the same pre-trained language model. Simultaneously, under experimental conditions of low training resources and solving complex problems, it also shows significant performance improvements compared to some strong baseline models (QAGNN, GREASELM). Attached Figure Description

[0057] Figure 1 This is a structural diagram of the attention-guided enhanced commonsense reasoning framework based on hybrid knowledge graphs, as described in this invention.

[0058] Figure 2 This is a structural diagram of a knowledge interaction guidance module. Detailed Implementation

[0059] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings. Those skilled in the art will understand that, with technological advancements and the emergence of new scenarios, the technical solution of the present invention is equally applicable to similar technical problems.

[0060] This invention discloses an attention-guided enhanced commonsense reasoning framework based on a hybrid knowledge graph. The framework includes a pre-trained text encoder, a commonsense knowledge graph retrieval module, a knowledge interaction guidance module, a commonsense knowledge aggregation and dissemination module, and an answer and explanation module. This commonsense reasoning framework takes multiple-choice commonsense question answering as an example. First, based on the entities appearing in the question and options, it selects neighboring nodes within 3 hops in the ConceptNet commonsense knowledge graph as the reasoning subgraph for each option. Then, it uses a pre-trained language model to score the importance of each retrieved node, thus pruning the reasoning subgraph to a reasonable size. For each reasoning subgraph, the commonsense knowledge aggregation and propagation module uses a graph attention network and a hybrid attention mechanism of nodes and edges to continuously aggregate important reasoning information. Then, in order to guide the global interaction of local information in the reasoning subgraph, in the knowledge interaction guidance module, the framework uses a multi-head attention mechanism and a Highway network to guide the self-attention interaction between global nodes in each reasoning subgraph to obtain new semantic representations. At the same time, the two-stage aggregation and interaction can be superimposed on multiple layers. Finally, in the answer and explanation module, the global nodes of all reasoning subgraphs are predicted and scored using a SoftMax classifier, and the guidance attention distribution of the intermediate reasoning layer can be obtained to improve the interpretability of the results. This invention designs a hybrid attention mechanism, which obtains more important reasoning information in the common sense knowledge aggregation stage, and at the same time allows nodes in the reasoning subgraph to perceive non-local information in the knowledge interaction guidance module, thereby expanding the information source and receiving domain of the model's reasoning process and further improving the model's common sense reasoning ability.

[0061] First, a set of question-option encoded representations is obtained using a pre-trained model, and then... <cls>The token output serves as a representation vector for each option. Then, based on the entities appearing in the question-option pairs, important reasoning knowledge graphs are extracted and filtered from the ConceptNet commonsense knowledge graph. <cls>The output is treated as the global node [CNode] of each option reasoning subgraph, so as to fully explore the interference effect between different options and the ability of the hybrid knowledge graph. In order to train the subsequent message aggregation and propagation process on a better input signal and expand the information receiving domain of the global nodes of each subgraph, this invention introduces a knowledge interaction guidance module. In this module, the stacked question-option embedding representation is first mapped into three QKV matrices by three linear layers and distributed in different hidden spaces. The new representation of the global nodes of each subgraph and the attention weight between options are obtained by using a multi-head attention mechanism. Then, some information is filtered by HighwayNetwork while ensuring sufficient gradient backflow. Finally, the interactive feature representation node is obtained. At this time, each subgraph global node integrates the information of the other subgraphs.

[0062] The common sense knowledge aggregation and dissemination module is performed on a knowledge graph, utilizing graph neural networks to aggregate key reasoning information. Generally, structured knowledge is more efficient than unstructured text in representing common sense knowledge; therefore, this invention proposes a hybrid attention mechanism using nodes and edges to iteratively aggregate reasoning information. Specifically, firstly, global nodes in a subgraph are linked to all nodes in the retrieved subgraph. To further utilize edge information, this application uses the edge type and the types of its two endpoints to obtain the embedding representation of each edge. Simultaneously, the edge weight can be used to scale the information flow on that edge. Therefore, this application integrates attention-weighted edge features and source node features to update the feature representation of the source node. Here, the edge attention weight calculation directly uses global node information to calculate the relevance score, resulting in a strongly contextualized representation of all nodes in the subgraph. Finally, a multi-head attention graph attention network is used on the reasoning subgraph to aggregate and disseminate node information. Degree features are added when calculating the local node attention weights. After standardization, the final node feature representation is obtained.

[0063] In the answer and explanation module, the initial question-option representation, the global node representation of the subgraph in the last layer, and the attention pooling representation of the subgraph are combined to integrate the information of the pre-trained language model, the subgraph interaction guidance, and the reasoning subgraph. Finally, the SoftMax classifier is used to predict the confidence scores of multiple options. At the same time, during the prediction of each sample, the changes in the attention distribution between options in the intermediate process are output, which also provides a certain degree of interpretability for the answer.

[0064] In summary, this invention provides a commonsense reasoning framework enhanced by attention guidance based on a hybrid knowledge graph. This framework proposes a knowledge interaction guidance module and a hybrid attention mechanism based on a knowledge graph. First, a set of question-option pairs is encoded using a pre-trained language model, and then their respective reasoning subgraphs are retrieved and filtered, with question-option nodes serving as global nodes within these subgraphs. Next, global nodes with global information awareness are obtained through knowledge interaction. Finally, the hybrid attention mechanism aggregates important reasoning information on the knowledge graph, ultimately significantly improving the model's ability to answer multiple-choice commonsense questions and solve complex problems. Furthermore, the framework in this application achieves consistent performance improvements even with low training resources.

[0065] See Figure 1 The overall structure diagram of this method is shown; Figure 2 The diagram shows the structure of the knowledge interaction guidance module. The steps of this invention in a specific multiple-choice common-sense question-and-answer task are as follows:

[0066] (1) Using a pre-trained language model to process a set of questions q-options c i Encode and represent:

[0067]

[0068] (2) The graph retrieval module extracts all entities within three hops from the ConceptNet commonsense knowledge graph based on the entities appearing in the question and options. It then uses a language model to score all entities and selects the top 200 entities as the reasoning subgraph for each option. Simultaneously, it encodes the question-option pairs. [CNode] serves as the global node of the subgraph.

[0069] (3) To enable the subsequent message aggregation and propagation process to be trained on a better input signal and to expand the information reception domain of the global nodes in each subgraph, this invention introduces a knowledge interaction guidance module. In this module, the [CNode] nodes in each reasoning subgraph are first extracted and stacked to form an embedding matrix C. Then, three linear layers are used to map the overall question-option embedding C into three matrices Q, K, and V. The corresponding formulas are as follows:

[0070] Q = C l W Q K = C l W K V = C l W V

[0071] α ij =MHA(Q T ,K T V T )

[0072]

[0073] η=σ(C l W+b)

[0074] C l This represents a stacked problem in the l-th layer - options embedding the overall representation. This indicates the new expression after the knowledge interaction guidance module, W. Q W K W V W is a linear mapping layer, MHA is a multi-head attention mechanism, σ represents the sigmoid activation function, and ⊙ represents the Hadamard product.

[0075] (4) The new global node representations are returned to their respective subgraphs. Graph neural networks are used to aggregate and pass messages within the subgraphs. To fully utilize edge information to enhance the aggregation of key reasoning information, this application uses the edge type and the types of the nodes at both ends to obtain the embedding representation of each edge. Simultaneously, the edge weight can be used to scale the information flow on that edge. Therefore, this application integrates attention-weighted edge features and source node features to update the feature representation of the source node. The corresponding formula is as follows:

[0076] r st =f r (e st u s u t )

[0077]

[0078]

[0079]

[0080]

[0081] Among them, e st u s u t These represent the one-hot encodings of edge and node types, respectively. st f represents the edge features between nodes s and t. * It is a two-layer perceptron, where l is the number of layers in the graph neural network. It is a representation of the aggregation of edge features of nodes i and j with global node features. It is the correlation coefficient between different edges. It is the neighbor node passed in by node t. It is the initial embedding encoding of node s. It is a new node representation that incorporates weighted edge features. In the hybrid knowledge graph, the node features in the commonsense reasoning subgraph are integrated with scaled edge information, becoming strongly "contextualized".

[0082]

[0083] Embed the representation into the new node.

[0084]

[0085]

[0086] Where || represents splicing. This represents the normalized attention weight coefficients, which incorporate the node's degree feature d. s In this way, the node features returned at the end contain important node and edge feature information.

[0087] (6) Then, through multi-layered global knowledge interaction guidance and local knowledge aggregation and dissemination process, important reasoning information is continuously enhanced, while expanding the information receiving domain of each subgraph node.

[0088] (7) Combining the initial question and options, C represents the answer. LM Global node representation of the last level subgraph Attention pooling representation of subgraphs The three components integrate information from a pre-trained language model, subgraph interaction guidance, and inference subgraphs, and finally use the SoftMax classifier to predict confidence scores for multiple options.

[0089]

[0090] (8) The effectiveness of this invention was verified on two multiple-choice commonsense question-answering datasets, CommonsenseQA and OpenbookQA. First, let's introduce the knowledge graph-enhanced commonsense question-answering task. Regarding the datasets, CommonsenseQA is a benchmark dataset for commonsense reasoning, containing 12,102 five-choice questions. These questions require not only surface-level language understanding but also a certain level of commonsense background knowledge to answer. Its official test set is not publicly available. To facilitate rapid verification, this application adopted the in-house (IH) dev / test partitioning scheme from the KagNet work. OpenbookQA also relies on certain external knowledge, containing 5,957 questions requiring a certain level of scientific background knowledge to answer. This application adopted the official data partitioning. Referring to previous work, this application utilizes ConceptNet as its commonsense knowledge base. The reasoning subgraphs extracted during the reasoning process are all obtained from this knowledge graph, where the initial embedding representations of node entities are derived from the MHGRN work.

[0091] In the experiments presented in this section, accuracy was used as the evaluation metric for all datasets. For the basic pre-trained language model, RoBERTa-large was used. The dimension D of the graph neural network and knowledge interaction layer was set to 200, the number of layers L was set to 5, and the Dropout per layer was set to 0.2. The number of attention heads was set to 8, and the optimizer used for training was RAdam. Different learning rates were used for the language model and graph network module: {1e-5, 2e-5, 3e-5} and {5e-4, 1e-3, 2e-3}. The specific experimental results are as follows.

[0092] Table 1. Experimental results of each model on the CommonsenseQA task.

[0093]

[0094] Table 2 shows the experimental results of each model on the OpenBookQA task.

[0095]

[0096]

[0097] As shown in the table above, this application observes that the series of models enhanced by external knowledge graphs achieve consistent performance improvements compared to those using only language models. Furthermore, the method in this application outperforms previous models overall, and the improvement is significant when compared with similar methods such as QA-GNN. This indicates that the method in this application is effective for common sense reasoning tasks by utilizing global information interaction between internal options.

[0098] In addition, to verify the actual function of each module in the framework and its effect under low resource settings, this invention also conducted ablation experiments on the modules and experiments under conditions of limited training labeled data. The experimental results on the CommonsenseQA dataset are as follows.

[0099] Table 3 Ablation experimental results for each module in the model.

[0100]

[0101] As can be seen from the table above, adding edge and node attention improves the results by 0.79%, indicating that some edge and node features are not conducive to reasoning and need to be judged and filtered in this application. In addition, adding a knowledge interaction guidance module between graph network layers has achieved a significant performance improvement (+1.23%), which demonstrates the importance of global information interaction in the reasoning process. KIL(PLM) also obtained a good initial representation of the problem-option node, which is also crucial for the subsequent common sense reasoning process.

[0102] Table 4. Experimental results under different proportions of training data.

[0103]

[0104]

[0105] As shown in the table above, the method of this application still achieved the best test performance under the condition of a small proportion of labeled training data. This also shows that the combination of global information from different reasoning subgraphs and the integration of important edge information in this invention can help common sense reasoning under low resource settings.

[0106] Finally, to further analyze whether the performance improvement of the present invention is reflected in problems requiring complex reasoning, this application defines the complexity of reasoning for different problems, such as negative interrogative sentences and complex interrogative sentences with more prepositions or entities. The experimental results on IHdev in CommonsenseQA are shown in Table 5.

[0107] Table 4. Experimental results on different types of complex problems.

[0108]

[0109] As shown in the table above, the method in this application achieves a significant performance improvement (+3.51%, +0.88%) compared to the QA-GNN and GREASELM models in solving problems with negation words, demonstrating its advantage in negation reasoning. Meanwhile, the number of prepositions in the question usually reflects the number of explicit reasoning constraints. The experimental results in the table show that the method in this application achieves consistent performance improvements across problems with different numbers of prepositions. The number of entities in the question indicates the size of the retrieved reasoning subgraph, showing some improvement in the majority of problems with 10 or fewer entities, and achieving similar results to the previous best model for a small portion of problems with more than 10 entities.

[0110] This invention is not limited to the embodiments described above. The above description of specific embodiments is intended to illustrate and explain the technical solution of this invention. The specific embodiments described above are merely illustrative and not restrictive. Without departing from the spirit and scope of the claims, those skilled in the art can make many specific modifications based on this invention, and these modifications all fall within the scope of protection of this invention.< / cls> < / cls>

Claims

1. A hybrid knowledge graph based attention guided augmented common sense reasoning framework, characterized in that, The framework comprises a pre-trained text encoder, a common sense knowledge graph retrieval module, a knowledge interaction guiding module, a common sense knowledge aggregation and propagation module, and an answer and explanation module. The pre-trained text encoder encodes a set of questions q-options c i to an encoded representation: ; The retrieval common sense knowledge graph module performs reasoning subgraph screening according to entity words appearing in the question and the options, and encodes the question-option pair as global nodes of the subgraph; The knowledge interaction guiding module is used to extract the question-option nodes in each reasoning subgraph, allow the global nodes of the multiple reasoning subgraphs to transmit information to each other, and obtain the representation of the new question-option nodes. The nodes in each reasoning subgraph are extracted and stacked to form an embedding matrix C, The overall question-option embedding is mapped to three matrices Q, K, and V through three linear layers, i.e. The whole problem-option embedding mapping is projected into three matrices Q, K, V by three linear layers ​ wherein: represents the stacked problem-option embedding overall representation in the layer; is a linear mapping layer; The new representation of the global nodes of each reasoning subgraph is obtained through the multi-head attention mechanism, and the attention coefficients between the options are obtained according to the attention matrix, i.e. ; wherein: ; The information flow control of the global nodes of each reasoning subgraph is performed through the following formula: gating coefficient The gating coefficient controls the proportion of the original information flow, and the attention weight is used to update the node feature representation after interaction. ; ; wherein: denotes a Hadamard product; denotes a sigmoid activation function; The common sense knowledge aggregation and propagation module is used to perform weighted aggregation of edge features of the knowledge graph and information transmission between nodes through a graph neural network. The knowledge interaction guiding module and the common sense knowledge aggregation and propagation module are iterated through multi-layer global knowledge interaction guiding and local knowledge aggregation and propagation processes, thereby expanding the information receiving domain of each subgraph node. The answer and explanation module is used to combine the initial question-option representation, the last layer of subgraph global node representation, and the global pooling representation of the subgraph, and use a SoftMax classifier to predict the confidence scores of multiple options.

2. The attention-guided enhanced common sense reasoning framework based on a hybrid knowledge graph according to claim 1, characterized in that: The common sense knowledge aggregation and propagation module is used to perform weighted aggregation of key edge features and node features of the reasoning knowledge graph through a graph neural network. The global question-option nodes in the reasoning subgraph are used to calculate the attention weights of all edges. The embedding representation of each edge is obtained through the type of the edge and the types of the two end nodes. The feature representation of the source node is updated by fusing the weighted edge features and the features of the source node. ; where, are one-hot encodings representing edge and node types, respectively, denote node and edge features between them, is a two-layer perceptron, is the number of layers of the graph neural network, is a node and edge feature and global node feature aggregation, is a correlation coefficient between different edges, is a node t’s incoming neighbor node, is a new node representation that incorporates weighted edge features; The node information in the reasoning knowledge graph is updated through the multi-head attention mechanism to obtain the new node embedding representation. ; ; ; wherein: represents concatenation, represents normalized attention weight coefficients, wherein the degree feature of the node is added so that the finally returned node features contain important node and edge feature information.

Citation Information

Patent Citations

  • Text question and answer model based on knowledge enhancement graph neural network

    CN114969278A

  • Knowledge reasoning question and answer method fusing semantic information

    CN115470333A