J oint LK : Joint Reasoning with Language Models and Knowledge Graphs for Commonsense Question Answering (2022)

Abstract: Existing KG-augmented models for commonsense question answering primarily focus on designing elaborate Graph Neural Networks (GNNs) to model knowledge graphs (KGs). However, they ignore (i) the effectively fusing and reasoning over question context representations and the KG representations, and (ii) automatically selecting relevant nodes from the noisy KGs during reasoning. In this paper, we propose a novel model, JointLK, which solves the above limitations through the joint reasoning of LM and GNN and the dynamic KGs pruning mechanism. Specifically, JointLK performs joint reasoning between LM and GNN through a novel dense bidirectional attention module, in which each question token attends on KG nodes and each KG node attends on question tokens, and the two modal representations fuse and update mutually by multi-step interactions. Then, the dynamic pruning module uses the attention weights generated by joint reasoning to prune irrelevant KG nodes recursively. We evaluate JointLK on the CommonsenseQA and OpenBookQA datasets, and demonstrate its improvements to the existing LM and LM+KG models, as well as its capability to perform interpretable reasoning.

## introduction commonsense question answering (csqa) requires systems to acquire different types of commonsense knowledge and reasoning skills, which is normal for humans, but challenging for machines @xcite . recently, large pre-trained language models (lms) have achieved remarkable success in many qa tasks and appear to use implicit (factual) knowledge encoded in their model parameters during fine-tuning @xcite . nevertheless, commonsense knowledge is self-evident to humans and is rarely expressed clearly in natural language @xcite , which makes it difficult for lms to learn commonsense knowledge from the pre-training text corpus alone. an extensive research path is to elaborately design graph neural networks (gnns) @xcite to perform reasoning over explicit structural common sense knowledge from external knowledge bases @xcite . related methods usually follow a retrieval-and-modeling paradigm. first, the knowledge subgraphs or paths related to a given question are retrieved by string matching or semantic similarity; such retrieved structured information indicates the relation between concepts or implies the process of multi-hop reasoning. second, the retrieved subgraphs are modeled by a well-designed graph neural network module @xcite @xcite to perform reasoning over knowledge graphs. however, these approaches have two main issues. first, the retrieved knowledge subgraph contains many noisy nodes. whether through simple string matching or semantic matching, in order to retrieve sufficient relevant knowledge, noise knowledge graph nodes will inevitably be included @xcite . especially with the increase of hop count, the number of irrelevant nodes will expand dramatically, raising the burden of the model. as the example in figure 1 , some graph nodes such as "wood", "burn", and "gas", although related to some entities in the questions and choice, can mislead the global understanding of the question. second, there are limited interactions between language representation and knowledge graph representation. specifically, existing lm+kg methods @xcite model question context and knowledge subgraphs in isolation by lms and gnns, and perform only one interaction in a shallow manner to fuse their representations at the output for prediction. we argue that the limited interaction between the two modalities is the main bottleneck that may prevent the model from understanding the complex question-knowledge relations necessary to answer the question correctly. based on the above consideration, we propose jointlk, a model that performs the fine-grained modal fusion and multi-layer joint reasoning between the language model and the knowledge graph (see figure 2 ). specifically, given a question and retrieved subgraphs, jointlk first obtain the representations of the two modalities by using an lm encoder and a gnn encoder respectively. then we design a joint reasoning module to generate fine-grained bidirectional attention maps between each question token and each kg node to fuse the information from each modality to the other. guided by the attention generated in the interaction process, the dynamic pruning module deletes irrelevant nodes to make the model reason along the correct knowledge path. multiple jointlk layers are stacked to form a hierarchy that supports multi-step interactions and recursive pruning. in summary, our contributions are three-fold: ## related work commonsense question answering is challenging because the required commonsense knowledge is rarely given in the context of questions and answer choices or encoded in the parameters of pre-trained lms. therefore, many works obtain the required knowledge from external sources (e.g., kgs, corpus) to augment csqa models. due to the heterogeneity between structured knowledge and unstructured text questions, there are currently two main research methods. some works @xcite @xcite unify the two modalities during model input, such as transforming structured knowledge into plain text through templates or transforming question context into structured graphs. however, the original structural/textual information will inevitably be lost during the conversion process. other works @xcite @xcite use lm and gnn to model the two modalities separately, and perform shallow interactions in the latter model stage, such as attentive pooling or simple concatenation of the two modal representations. although this method can retain the original information of question context and kgs, the limited interaction will affect the flow of information between the two modalities, so we mainly improve on this point. recently, qa-gnn @xcite explicitly views the qa context as an additional node, connects it and kg to form a joint graph, and mutually updates their representations through graphbased message passing. however, it pools the representation of the question context into a single node, which limits the updating of the text representation and fine-grained interaction between lm and gnn. compared with prior works, we retain the individual structure of both modalities, consider finegrained interaction between any token in question and any entity in kg through dense bidirectional attention, and perform multi-step joint reasoning by stacking several interaction layers. furthermore, we gradually prune the kg size in each stacked model layer under the guidance of attention weights generated in the interactions, making the reasoning path transparent and interpretable. ## methodology in this section, we introduce the task definition ( § 3.1) and our jointlk model. the model framework is shown in figure 2 . jointlk takes the query and the retrieved knowledge subgraph as input, and outputs a real value as the correctness score of the answer. the model is mainly composed of four parts: query encoder, gnn layer, joint reasoning module and dynamic pruning module, of which the latter three form a stack of n identical layers. we use a pre-trained language model to learn the query representation ( § 3.2), and use the gnn layer to learn the graph representation ( § 3.3). the joint reasoning module receives these two modalities' representations and then apply dense bidirectional attention to make information fusion and representation update for each token and node ( § 3.4). the lm-to-kg attention weights generated in reasoning represents the global importance of each node in the graph, so the dynamic pruning module prunes the graph layer by layer according to this weights and finally retains the most relevant nodes ( § 3.5). after n layers of iteration, the query representation and the trimmed graph representation are used to predict the answer ( § 3.6). ## conclusion in this work, we propose jointlk and provide a set of experiments to prove that (i) lm and kg interactive fusion can reduce the semantic gap between the two information modalities and make better use of kg for joint reasoning with lm. (ii) dynamic pruning module can recursively delete irrelevant subgraph nodes at each layer of jointlk to provide fine appropriate evidence. our results on commonsenseqa and openbookqa demonstrate the superiority of jointlk over other methods using external knowledge and the strong performance in performing complex reasoning. in addition, our research results can be broadly extended to other tasks that require kgs as additional background knowledge to augment lms, such as entity linking, kg completion and the recommendation system.