FAME : Towards Factual Multi-Task Model Editing (2024)

Abstract: Large language models (LLMs) embed extensive knowledge and utilize it to perform exceptionally well across various tasks. Nevertheless, outdated knowledge or factual errors within LLMs can lead to misleading or incorrect responses, causing significant issues in practical applications. To rectify the fatal flaw without the necessity for costly model retraining, various model editing approaches have been proposed to correct inaccurate information within LLMs in a cost-efficient way. To evaluate these model editing methods, previous work introduced a series of datasets. However, most of the previous datasets only contain fabricated data in a single format, which diverges from real-world model editing scenarios, raising doubts about their usability in practice. To facilitate the application of model editing in real-world scenarios, we propose the challenge of practicality. To resolve such challenges and effectively enhance the capabilities of LLMs, we present FAME, an authentic, comprehensive, and multi-task dataset, which is designed to enhance the practicality of model editing. We then propose SKEME, a model editing method that uses a novel caching mechanism to ensure synchronization with the real world. The experiments demonstrate that our method performs excellently across various tasks and scenarios, confirming its practicality.

## introduction large language models (llms) have achieved remarkable capabilities across various domains and are extensively utilized in practical applications @xcite @xcite . the extensive utilization of llms makes it essential for them to provide precise information. however, llms may still provide erroneous information due to incorrect, outdated knowledge stored within the model @xcite . such erroneous information can have significant repercussions within critical domains like medical diagnostics and legal consultations, underscoring the importance of rectifying errors in language models. to avoid costly retraining and to efficiently correct the outputs of llms, model editing has been proposed @xcite @xcite . to evaluate model editing methods, previous works have introduced a series of datasets @xcite @xcite . almost all of these datasets set the target as incorrect answers, which affects the model's practical performance and contradicts the original purpose of model editing. as shown in figure 1 , when the user asks "who is the president of america?", llms produce incorrect output due to outdated knowledge. previous datasets @xcite @xcite modified them to other wrong targets (for example, tom cruise). moreover, these datasets are all composed of data in a single format with a single task like qa @xcite or sentence completion @xcite , which leads to a disparity between experiments and practical applications. to promote the capability of model editing in practical applications, we introduce a novel criterion: practicality. practicality refers to the capacity of data and methods to be functional in realworld applications. this entails that data should be factual, diverse, and of high quality, and methods should be efficient and general across tasks. these requirements collectively ensure the effectiveness and applicability of model editing in practical applications. to address the practical shortcomings in the previous benchmark, which mainly include incorrect knowledge and limited task formats, we introduce fame, a factual, extensive model editing benchmark with practicality. fame comprises 128k real data items, including various tasks with singlehop and multi-hop questions. in response to incorrect knowledge, we extract factual data items from wikidata @xcite and dbpedia @xcite and employ multiple rounds of manual verification to ensure the accuracy of data items. to prevent limited task formats, we incorporate tasks from existing datasets like qa @xcite , fact-check @xcite , multi-hop qa @xcite , and introduce new tasks such as cloze and dialogue, making our evaluation more comprehensive. fame enhances the model's ability to solve realworld problems and cross-domain issues and enables a complete evaluation of the effectiveness of model editing. aimed at tackling the deficiency in the practicality of previous methods, we introduce skeme. skeme utilizes a novel caching mechanism and receives information from diverse sources to ensure synchronization with the real world, allowing for the application of skeme in real-world scenarios. the caching mechanism tackles the challenges posed by large-scale data and diverse tasks. to evaluate the practicality of model editing methods, we first introduce a new metric, sure, which considers both accuracy and side effects and is adaptable to scenarios. we then evaluate whether each method can meet the basic requirements of model editing (section 7). subsequently, we discuss the performance of model editing methods in real-world scenarios (section 8). the conclusion indicates that previous methods either exhibit side effects or struggle to handle complex scenarios, while only skeme consistently outperformed others across all experimental conditions, demonstrating the superiority of skeme in real-world scenarios. the main contributions of this paper are as follows: ## problem definition the objective of model editing is to modify the knowledge contained in a model, allowing the model to engage in reasoning processes based on the edited knowledge, while not affecting the output related to the unedited knowledge. based on previous work @xcite , we define model editing to express the goal as follows. an input-output pair is defined as (x, y), and a model is represented by a function f : @xmath0, where x represents the input set and y represents the output set. let i(x, y) denotes the set of descriptions semantically equivalent to (x, y), and ex(x, y) be the set of input-output pairs that the model can possess with i(x, y) as prior knowledge. then, let o(x, y) represent the portion outside i(x, y) and ex(x, y). appendix c provides an example of the definition. formally, let (subject, relation, object) be a factual triple, denoted as (s, r, o). consider an inputoutput pair as (x, y), where x is effectively a combination of s and r. a model is represented by a function f : @xmath1, where x represents the input set and y represents the output set. we use the prime notation to denote semantically equivalent elements. specifically, for any t in the set {s, r, o, x, y}, let t ′ be any element that is semantically equivalent to t, and let t ′ be the set of all such t ′ . notice that @xmath2. then, we can define i(x, y) as i(x, y) = {(x ′ , y ′ )|x ′ ∈ x ′ and y ′ ∈ y ′ }. (1) to define ex(x, y), let's represent a fact triple as tr(s, r, o), abbreviated as tr, and s is the set of all fact triples. also, define the multiplication operation * for two sets of fact triples a and b as the join operation: by transforming s and r into x, and o into y, we derive ex(x, y). after defining i(x, y) and ex(x, y), we can define o(x, y) as o(x, y) = ∁ s (i(x, y) ∪ ex(x, y)) (6) where ∁ s represents the complement within the set s. the definition of model editing can be summarized as follows: (x f , y f ) denotes the fact that is being edited, while (x e , y e ) represents the input and output. fame: a practical model editing benchmark fame (factual multi-task model editing) is a benchmark comprising 128k factual data items. we utilize these data items to construct both single-hop and multi-hop questions. for single-hop questions, we include six forms: qa, sentence completion, cloze test, multiple-choice questions, fact check, and locality test. for multi-hop questions, we include multi-hop questions and dialogues. the previous work introduced qa, sentence completion, fact check, and multi-hop questions (zhang et al., name isc. tasks total re. source hop cho. fc. clo. dia. com. qa zsre 270k 120 wd. si. counterfact 2.2k 24 wd. si. mquake-cf 9.2k 37 wd. mu. mquake-t 1.8k 6 wd. mu. fame (ours) 128k 86 wd. & db. si. & mu. the construction of fame is divided into two steps: (1) collect real fact triples; (2) create diverse tasks using the collected triple. to ensure the data quality of fame and its reflection of the real world, we conducted multiple rounds of manual verification and correction in various aspects. for more details, please refer to appendix a.1. ## skeme: a model editing method for real-world applications to accommodate practical model editing and meet the need for utilizing real-world facts and adapting to diverse tasks, we propose skeme (structured knowledge retrieved by exact matching and reranking editing), a model editing method that first incorporates a caching system to efficiently store and retrieve real-world knowledge, which is collected from diverse data sources. besides, skeme utilizes entity extraction to exclude irrelevant content brought by diverse input formats, enhancing its performance across various tasks. ## analysis considering the complexity of real world, besides single fact edits, we design a series of research questions (rqs) to evaluate the method's ability to edit multiple facts. we discuss fact transitions (rq1), e.g., the u.s. president transitioning from @xmath3, fact inference (rq2), e.g., inferring the fact "the first lady of the u.s. is jill biden" from the given facts "the u.s. president is biden" and "biden's spouse is jill biden", fact with substantial quantity (rq3), e.g., needing to update thousands of facts and fact from various benchmarks (rq4), e.g., facts from other ## conclusion we introduce the practicality requirement for model editing and created a novel benchmark fame, which embodies practicality with factual data and diverse tasks. we propose a model editing method, skeme, that proves effective across various llms and tasks. the experiments demonstrate that previous model editing methods struggle in dealing with real-world challenges, while skeme successfully addresses these challenges. we hope that our work will advance the field of model editing and inspire further research in this area. next, based on the obtained r, we use code in figure 6 and 7 to collect triples (s, r, o) from wikidata and dbpedia. we filter out triples that may cause ambiguity, including two aspects: two different items having the same name or a specific entity's relation corresponding to multiple objects. relevant discussions can be found in appendix a.1.2. lastly, we manually extract 100 distinct triples and verify them against other data sources such as government websites to ensure the accuracy and real-world relevance of our collected triples. the results show that 96% of the data is correct. hence, we can infer that fame can reasonably reflect realworld scenarios.