KILM : Knowledge Injection into Encoder-Decoder Language Models (2023)

Abstract: Large pre-trained language models (PLMs) have been shown to retain implicit knowledge within their parameters. To enhance this implicit knowledge, we propose Knowledge Injection into Language Models (KILM), a novel approach that injects entity-related knowledge into encoder-decoder PLMs, via a generative knowledge infilling objective through continued pre-training. This is done without architectural modifications to the PLMs or adding additional parameters. Experimental results over a suite of knowledge-intensive tasks spanning numerous datasets show that KILM enables models to retain more knowledge and hallucinate less while preserving their original performance on general NLU and NLG tasks. KILM also demonstrates improved zero-shot performances on tasks such as entity disambiguation, outperforming state-of-the-art models having 30x more parameters.

## introduction large pre-trained language models (plms) @xcite @xcite have achieved great success across all nlp tasks. however, recent studies also reveal that plms are susceptible to memorizing the pretraining corpora rather than capturing the knowledge within them @xcite @xcite . particularly for generation tasks, plms are notorious for hallucinating text that is factually incorrect or hard to verify @xcite @xcite . to address these issues, one approach is to retrieve relevant knowledge and integrate it explicitly with plms @xcite . another direction is incorporating the additional knowledge sources into the pre-training step @xcite @xcite . while the former suffers from the issue of falling back on the models themselves without retrieved information @xcite , knowledge-focused pre-training can be complementary to those methods @xcite and shows its advantage on generalization. in this paper, we propose an approach for injecting knowledge into encoder-decoder plms, such as bart, as a continued pre-training process. we refer to it as knowledge injection into language models (kilm). instead of introducing additional parameters to plms or modifying the model architectures to incorporate additional knowledge, kilm infills knowledge sentences by adopting a novel knowledge infilling objective that includes a knowledge reconstruction step in addition to the original pre-training objectives of bart. the aim of kilm is to teach plms additional content about concepts and entities that they encounter in a given context, so that the models are able to ground an entity mention with additional information and "describe" what that entity is (see figure 1 ). it should be emphasized that in this process, the context is especially important for cases when an entity mention can refer to multiple entities, e.g., titanic which can refer to the british ship or to the 1997 movie. we utilize the short descriptions of entities in wikipedia which comprise of entity definitions as the knowledge source ( §3.1). although there are existing works leveraging similar knowledge for plm enhancement, they ignore the relationship among entities, contexts, and entity-centric knowledge, and restrict their applications to nlu tasks. in contrast, we propose a distinct structure ( §3.2) to augment wikipedia articles with short descriptions of the entity mentions in the context, thus model this essential relationship, so as to force plms to learn the correlation among entities and contexts, and differentiate between the entities with similar surface forms during the joker is a comic book series published by dc comics starring the supervillain the joker. it ran for nine issues from may-june 1975, with a tenth previously unpublished ... ## related work knowledge-enhanced lms to enhance plms' use of knowledge, a number of work has attempted to augment them with external knowledge sources, such as knowledge graphs (kgs) @xcite . some recent work introduced additional non-parametric memories into the models @xcite to obtain entity embeddings and modified the model structures to accommodate extra information @xcite , while others changed the masking schema with the additional information @xcite , or converted the external kgs into natural language text as an additional pre-training corpus @xcite @xcite @xcite . modeling with text linking and enrichment our motivation bears similarity to text linking @xcite @xcite during pre-training and text enrichment @xcite . modeling the links between documents or metadata is motivated by the fact that plms, pre-trained on plain text, are not directly trained to capture inter-dependencies between documents. the similarity between the above tasks and ours lies in the ways humans implicitly link information when reading or generat-ing language. however, the former tasks are restricted to relationships within the text, while our goal is to ground the concepts and entities to their related descriptions in encyclopedic resources. pre-training with hypertext besides plms that are pre-trained with natural language corpora, htlm @xcite directly pre-trains simplified crawled html data based on bart models and cm3 @xcite extends htlm into a multimodal setting with causal masked language modeling. the target of htlm and cm3 is to better leverage the enormous webscraped data source for pre-training. in contrast, our work aims to leverage hypertext to explore how to inject extra knowledge into plms with a customdesigned structure to furnish advantages to plms in performing knowledge-intensive tasks. ## methodology although kilm is model-agnostic and could be used for any plm (more on this in §5), in this work, due to high computation costs, we focus on applying kilm to bart @xcite . ## experiments we start by exploring the performance of bart+kilm on knowledge-intensive tasks ( §4.2). later, we also demonstrate that kilm does not degrade the original language modeling skills of bart in both nlu and nlg benchmarks ( §4.3). 2 the comparison between the text infilling and sentence permutation objectives shows the advantage of the former objective over the latter @xcite , so we only preserve the text infilling objective for kilm to simplify the continued pre-training task. ## discussions roles of introduced special tokens the introduced special tokens to mark beginning and end of entities (<ent>, </@xmath0, </@xmath1, which inserts entitycentric knowledge into pre-training corpora, thus injects knowledge in plms. we discuss the roles of these special tokens from the following aspects: entity knowledge probing: this distinct structure in kilm provides a tool for probing the entityrelated knowledge retained in plms. to demonstrate this, we probe bart+kilm by prompting it to generate short descriptions for entities in validation set foot_6 of the pre-training corpus. the probing format and the corresponding results are shown in appendix a.1 and table a1 . bart+kilm achieve around 60 unigram f1 scores with no performance gap with the data samples from a subset of the training set. these results indicate that we can easily recall the entity description knowledge in different contexts without sensitivity to prompt designs. it is shown that the proposed pre-training structure is the main contributor of the improvements on entity-related datasets, especially in zeroshot manner. by leveraging the introduced special tokens, the knowledge retained in plms can be more efficiently leveraged on downstream tasks. ## conclusion in this paper, we propose a novel method, kilm, to inject entity-related knowledge into large plms through continued pre-training. our approach enhances the performance of the original plms on knowledge-intensive tasks, especially in zero-and few-shot settings, while not causing catastrophic forgetting of the knowledge in the origianl plms. the proposed distinct structure for entity knowledge shows its effectiveness on flexibly probing the injected knowledge in different contexts.