Editing Factual Knowledge in Language Models

31495

Authors

nan

Abstract

AbstractThe factual knowledge acquired during pre-training and stored in the parameters of Language Models (LMs) can be useful in downstream tasks (e.g., question answering or textual inference). However, some facts can be incorrectly induced or become obsolete over time. We present KnowledgeEditor, a method which can be used to edit this knowledge and, thus, fix ‘bugs’ or unexpected predictions without the need for expensive re-training or fine-tuning. Besides being computationally efficient, KnowledgeEditordoes not require any modifications in LM pre-training (e.g., the use of meta-learning). In our approach, we train a hyper-network with constrained optimization to modify a fact without affecting the rest of the knowledge; the trained hyper-network is then used to predict the weight update at test time. We show KnowledgeEditor’s efficacy with two popular architectures and knowledge-intensive tasks: i) a BERT model fine-tuned for fact-checking, and ii) a sequence-to-sequence BART model for question answering. With our method, changing a prediction on the specific wording of a query tends to result in a consistent change in predictions also for its paraphrases. We show that this can be further encouraged by exploiting (e.g., automatically-generated) paraphrases during training. Interestingly, our hyper-network can be regarded as a ‘probe’ revealing which components need to be changed to manipulate factual knowledge; our analysis shows that the updates tend to be concentrated on a small subset of components. Source code available at https://github.com/nicola-decao/KnowledgeEditor

Keywords

nan

Full Content

Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6491–6506 November 7–11, 2021. c⃝2021 Association for Computational Linguistics 6491 Editing Factual Knowledge in Language Models Nicola De Cao 1,2, Wilker Aziz 1, Ivan Titov 1,2 1University of Amsterdam, 2University of Edinburgh { nicola.decao, w.aziz, titov } @uva.nl Abstract The factual knowledge acquired during pre- training and stored in the parameters of Lan- guage Models (LMs) can be useful in down- stream tasks (e.g., question answering or tex- tual inference). However, some facts can be incorrectly induced or become obsolete over time. We present KNOWLEDGEEDITOR, a method which can be used to edit this knowl- edge and, thus, fix ‘bugs’ or unexpected pre- dictions without the need for expensive re- training or fine-tuning. Besides being com- putationally efficient, KNOWLEDGEEDITOR does not require any modifications in LM pre- training (e.g., the use of meta-learning). In our approach, we train a hyper-network with con- strained optimization to modify a fact without affecting the rest of the knowledge; the trained hyper-network is then used to predict the weight update at test time. We show KNOWL- EDGEEDITOR’s efficacy with two popular ar- chitectures and knowledge-intensive tasks: i) a BERT model fine-tuned for fact-checking, and ii) a sequence-to-sequence BART model for question answering. With our method, chang- ing a prediction on the specific wording of a query tends to result in a consistent change in predictions also for its paraphrases. We show that this can be further encouraged by ex- ploiting (e.g., automatically-generated) para- phrases during training. Interestingly, our hyper-network can be regarded as a ‘probe’ re- vealing which components need to be changed to manipulate factual knowledge; our analysis shows that the updates tend to be concentrated on a small subset of components.1 1 Introduction Using pre-trained transformer-based Language Models (LMs; Vaswani et al., 2017; Devlin et al., 2019; Radford et al., 2019; Lewis et al., 2020; Raf- fel et al., 2020; Brown et al., 2020) has recently 1Source code available at https://github.com/ nicola-decao/KnowledgeEditor Updated prediction Retain previous knowledge Regular predictions KnowledgeEditor Figure 1: Left: a model f with parameters θ prefers a prediction y for input x (e.g., y is the mode/argmax of a discrete distribution parameterized by f(x; θ)). Right: our method uses a hyper-network g to update the pa- rameters of f to θ′ such that f(x; θ′) prefers an alterna- tive prediction a without affecting the prediction y′ of any other input x′ ̸= x. Our model edits the knowledge about x stored in the parameters of f. become a standard practice in NLP. Factual knowl- edge induced during pre-training can help in down- stream tasks, but it can also be incorrect or become obsolete over time (e.g., not reflecting changes of heads of states or country populations). Developing reliable and computationally efficient methods for bug-fixing models without the need for expensive re-training would be beneficial. See Figure 2 for an example of revising the memory of a model that initially misremembered Namibia’s capital. Unlike conventional Knowledge …

Content truncated to 500 words

Labeled Text

AbstractThe factual knowledge acquired during pre-training and stored in the parameters of Language Models (LMs) can be useful in downstream tasks (e.g., question answering or textual inference). However, some facts can be incorrectly induced or become obsolete over time. We present KnowledgeEditor, a method which can be used to edit this knowledge and, thus, fix ‘bugs’ or unexpected predictions without the need for expensive re-training or fine-tuning. Besides being computationally efficient, KnowledgeEditordoes not require any modifications in LM pre-training (e.g., the use of meta-learning). In our approach, we train a hyper-network with constrained optimization to modify a fact without affecting the rest of the knowledge; the trained hyper-network is then used to predict the weight update at test time. We show KnowledgeEditor’s efficacy with two popular architectures and knowledge-intensive tasks: i) a BERT model fine-tuned for fact-checking, and ii) a sequence-to-sequence BART model for question answering. With our method, changing a prediction on the specific wording of a query tends to result in a consistent change in predictions also for its paraphrases. We show that this can be further encouraged by exploiting (e.g., automatically-generated) paraphrases during training. Interestingly, our hyper-network can be regarded as a ‘probe’ revealing which components need to be changed to manipulate factual knowledge; our analysis shows that the updates tend to be concentrated on a small subset of components. Source code available at

Publication Details

Paper ID:
31495
Year:
2021
Publication:
TIPSTER
Publication Type:
conf
DOI:
nan