Learn Together: Joint Multitask Finetuning of Pretrained KG -enhanced LLM for Downstream Tasks (2025)

Abstract: Recent studies have shown that a knowledge graph (KG) can enhance text data by providing structured background knowledge, which can significantly improve the language understanding skills of the LLM. Besides, finetuning of such models shows solid results on commonsense reasoning benchmarks. In this work, we introduce expandable Joint Multitask Finetuning on Pretrained KG-enchanced LLM approach for Question Answering (QA), Machine Reading Comprehension (MRC) and Knowledge Graph Question Answering (KGQA) tasks. Extensive experiments show competitive performance of joint finetuning QA+MRC+KGQA over single task approach with a maximum gain of 30% accuracy.

## introduction large language models (llms), pretrained on extensive text corpus, have demonstrated high performance across a wide range of natural language processing (nlp) tasks. however, despite their success in various applications, these models have notable shortcomings. studies show that llms frequently fail to accurately recall factual information and tend to generate hallucinations -statements that are false or misleading. furthermore, llms pretrained on general text data may not effectively apply domain-specific knowledge without additional training on relevant datasets. to improve the efficiency of large language models (llms) and address the aforementioned challenges, a promising solution is to integrate llms with knowledge graphs @xcite . knowledge graphs represent factual information in a structured format, using triples composed of a head entity, a relation, and a tail entity. kgs are widely applied across various domains due to their structured, interconnected representation of data, offering a more comprehensive and interpretable view of information and facilitating easier interaction with it. there are several strategies to integrate llms with @xcite . the first approach involves enhancing large language models using knowledge graphs. in this approach, kgs can be incorporated during the pretraining and inference stages of the llm to enrich its linguistic representations with external knowledge and provide insights into its reasoning process. for example, the ernie @xcite and kalm (corby rosset, 2021) architectures leverage this method by feeding pairs of sentences and corresponding entities from the knowledge graph into the llm, subsequently training the model to predict relationships between these entities. the second approach takes the opposite direction-strengthening knowledge graphs using llms. this technique aims to enhance the productivity of kgs and improve their performance in kg-related tasks. for example, the authors of the qa-gnn @xcite architecture employ a graph neural network (gnn)-based model to jointly analyze the input context and kg information through message passing. the input text information is transformed into a special node via a pooling operation and then connected with other entities in the kg. another model, greaselm @xcite , facilitates deeper interaction between text tokens and kg entities. information from both modalities propagates to each other, allowing representations of linguistic context to be grounded in structured world knowledge and enabling linguistic nuances in context to inform graph knowledge representations. another increasingly popular way to leverage the benefits of llms and kgs simultaneously is to integrate these models into a single framework where they can mutually reinforce each other. in this framework, llms are used to understand natural language, while kgs serve as a knowledge base providing factual information. the dragon (deep bidirectional language-knowledge graph pretraining) architecture @xcite exemplifies this approach by pretraining a deeply integrated language-knowledge foundation model using both text and kgs at scale. this self-supervised model processes text segments and their corresponding kg subgraphs, integrating information from both modalities bidirectionally. since dragon demonstrated superior performance in commonsense reasoning and tasks involving complex reasoning compared to the qa-gnn and greaselm baselines, we decided to investigate the effectiveness of this model within the frameworks of the machine reading comprehension (mrc) task, the knowledge graph question answering (kgqa) task, and the combined mrc+qa+kgqa task. this study tests the hypothesis that training on the combined mrc+qa+kgqa task will yield better performance, as the model learns to solve tasks of different types, which in turn aids in solving each task individually. by leveraging the complementary strengths of both textual and structured knowledge understanding, the integrated approach is expected to enhance the model's reasoning capabilities. ## related work in this work, we consider tasks from the field of natural language processing, such as mrc, qa and kgqa. these tasks are crucial as they represent key challenges in language understanding, demanding models to comprehend, interpret, and interact with text in a meaningful way. addressing these tasks advances neural networks' capabilities in processing human language. the machine reading comprehension (mrc) task involves developing systems capable of automatically understanding and processing textual passages to accurately answer questions about the content. this necessitates advanced natural language processing techniques to capture the semantics, context, and nuances of the text, facilitating effective question answering. prominent large language models, including @xcite , palm 2 @xcite , and claude 2 from anthropic, have demonstrated consistently high performance in this domain. question answering (qa) is the process of providing answers to asked questions, while refraining from attempting to answer questions outside the context provided. in addition to large language models trained using few-shot learning (similar to the mrc task), architectures with fewer parameters can also handle the qa task effectively. for example, grapeqa @xcite enhances commonsense question-answering by combining pretrained language models with knowledge graphs reasoning. it addresses two key challenges faced by typical approaches: difficulty in capturing all qa information in the working graph (wg) and inclusion of irrelevant kg nodes. grapeqa introduces two improvements to the wg: prominent entities for graph augmentation identifies relevant text chunks from qa pairs and augments the wg with corresponding lm latent representations, and context-aware node pruning removes less relevant nodes. these enhancements allow grapeqa to consistently outperform its predecessor qa-gnn @xcite , demonstrating notable improvements on datasets such as openbookqa @xcite and com-monsenseqa @xcite . another model, kear @xcite , extends the transformer architecture with an external attention mechanism, integrating external knowledge from sources like knowledge graphs, dictionaries, and training data. this additional knowledge is retrieved using the input as the key and then integrated with the input. kear achieves this without altering the model architecture, opting for text-level concatenation for external attention. knowledge graph question answering (kgqa @xcite ) involves the task of responding to natural language queries by utilizing the structured information stored within a knowledge graph. the goal is to provide accurate and contextually appropriate answers to a wide range of natural language questions by effectively navigating the interconnected nodes and relationships within the knowledge graph. methods for solving kgqa problems can be broadly categorized into two types: information retrieval-based (ir-based) and semantic parsingbased (sp-based). sp-based methods adopt a parsethen-execute approach, starting with semantic analysis to parse the relations and entities in complex questions. next, they construct logical formulas by translating the subgraph into an executable format, such as sparql. finally, these methods use the query language to interact with the knowledge graph, retrieving and presenting the results. while sp-based methods are often praised for their interpretability due to the intermediate step of generat-ing detailed logic forms, they face computational challenges, especially with complex questions that involve multiple relations. this results in a larger search space and increased computational cost. ir-based approaches to knowledge graph question answering (kgqa) typically involve several steps. first, they extract a question-specific subgraph from the knowledge graph, including all relevant entity nodes and relation edges without generating an executable logic formula. next, they use a question representation module to encode user-question tokens into low-dimensional vectors. following this, an extracted-graph-based reasoning module applies a semantic matching algorithm to aggregate information from the subgraph, concentrating on the neighborhood of the central entity. finally, an answer-ranking module ranks the entity scores within the subgraph to predict the top-ranked entities as the final answers. in developing our own approach for multitask finetuning, which integrates a language model with a knowledge graph, several foundational ir-based methods for the kgqa task were considered. for instance, rce-kgqa @xcite focuses on enhancing reasoning by leveraging both explicit and implicit relational chains within the knowledge graph. embedkgqa @xcite addresses knowledge graph sparsity by integrating external knowledge and utilizing kg embedding techniques, which improves performance in multi-hop kgqa tasks. srn @xcite approaches kgqa as a sequential decision problem and employs reinforcement learning to effectively search for paths within knowledge graphs. additionally, kvmemnn @xcite introduces a key-value retrieval mechanism that enables neural dialogue agents to interact seamlessly with knowledge bases across various domains. these methods were considered for their valuable concepts to form a strategy for finetuning the model on the kgqa and joint task. our study is not intended to be a direct comparison with all the models listed in this section. ## discussion & limitations all finetuning experiments were performed on english-language datasets. this is due to the fact that searching for datasets with overlapping languages for all three tasks (qa, mrc and kgqa) is difficult. thus, there are a large number of multilingual datasets for qa and mrc tasks, and a limited number of such datasets for the kgqa task, which is associated with the difficulty of translating the entire knowledge graph into another language. at the moment, we were only able to use the qald-9-plus @xcite dataset, which con-tains questions in 10 languages, but has a small size (about 1.5 thousand questions), as well as the mlpq @xcite dataset, which covers only chinese, english and french, but contains about 300 thousand questions. moreover, we made a test to check if the expand of data for the same task can make the same improvement as the adding other nlp-task. we trained our backbone on two qa datasets -csqa and obqa but the performance become 6 to 10% worse than both of them in pair with mrc dataset dream. ## conclusion & future work the paper presented expandable joint multitask finetuning on pretrained kg-enhanced llm approach which aims to improve the performance of language models in a variety of language understanding tasks. we proposed a new multitask learning framework which jointly finetunes a language model with a knowledge graph enhanced objective on a few tasks and easily expanded to new nlp-tasks. the paper provides a detailed description of the proposed approach and presents experimental results demonstrating its effectiveness. our results show strong improvements of synergized qa, mrc and kgqa tasks on each other with a maximun gain of 30% accuracy. we plan to extend our experimental setup by pretrained llama v2 encoder. we also plan to conduct finetuning experiments on multilingual datasets containing english, chinese, french, and other languages.