Semi-parametric Prompt-Generation for Model Editing
Authors: Harshavardhan Kamarthi
Yen-Chang Hsu
Yilin Shen
Hongxia Jin
Venue: Submitted to ICLR 2023 (2023)
Keywords: Model Editing
Prefix Tuning
Fine-tuning

Abstract: Large Language models are used in various downstream tasks with great success. However, changing specific knowledge or beliefs of a model (a.k.a. model editing) efficiently to revise inaccurate predictions while not affecting all other cases is still challenging. Most previous methods compute gradients to change the model. These strategies generally work, paying the cost of high computing and memory complexity. The semi-parametric strategy has recently shown its effectiveness in alleviating the complexity via introducing memory to store the edits of knowledge. However, the memory does not have a proper mechanism to be utilized by a large pre-trained language model, limiting its generalizability to more complicated model editing scenarios. This work proposes a prompt generation mechanism to bridge
the gap. Our method encodes the edits as prefix prompts for language models, then has the large pre-trained language model perform inference with the prompts. In other words, the model is edited by prompts without changing model parameters. Our method, SEPROG, significantly outperforms state-of-art methods by up to 20% on entailed edit benchmarks and provides up to 30% better performance over gradient-based methods on non-entailed benchmarks. These advantages are achieved with much less computation and memory consumption, proving prompt generation’s great potential in model editing problems.

Under review as a conference paper at ICLR 2023
SEMI-PARMMETRCE PROMPT-GENERATION FOR MODEL EDITING
Anonymous authors Paper under double-blind review
ABSTRACT
Large Language models are used in various downstream tasks with great success. However, changing specific knowledge or beliefs a model (a.k.a. model editing) efficiently revise inaccurate predictions while not affecting all other cases still challenging. Most previous methods compute gradients to change the model. These strategies generally work, paying the cost of high computing and memory complexity. The remi-parametric strategy has recently shown its effectiveness in alleviating the complexity via introducing memory to store the edits of knowledge. However, the memory does not have proper mechanism to be utilized by a large pre-trained language model, limiting its generalizability to more complicated model editing scenarios. This work proposes prompt generation mechanism to bridge the gap. Our method encodes the edits as prefix prompts for language models, then has the large pre- pre-trained language model perform inference with the prompts. In other words, the model is edited by prompts without changing model parameters. Our method, SEPROG, significantly outperforms state-of-art methods by up 20% on entailed edit benchmarks and provides up to 30% better performance over gradient-basee methods on non-entailed benchmarks. These advantages are achieved with much less computation and memory consumption, proving prompt generation's 's great potential in model editing problems.
INTRODUCTION
Large pre-trained language models (Devlin et al. 2018 Lewis et al. 2019 Radford et al. 2019 Liu al. 2019) have shown tremendous success on wide variety downstream tasks (Brown et al. 2020) such as language generation, fact-checking, summarization, etc. These successes due to their ability to capture world-scaled knowledge by pre-train pre-training on massive corpora (Petroni et al. 2019) well as their effectiveness in fine-tuning adapt arbitrary downstream tasks.
However, modifying the underlying beliefs of large language models with a desired degree of control is still open problem (Hase et al. (021). The need to evolve the model's 's beliefs may range from reflecting simple factual changes about the world (such as changing the capital of a country) to updating entailed relationships between knowledge entities (such as deducing properties of new species based on its biological taxonomy). The problem setting of Model Editing (Mitchell et al.) 2021 Sinitsin al., 2020) formulates the challenge well. Specifically, given a small sample edit data (e.g., description of factual changes), the goal is to make the model provide updated predictions for inputs that are semantically related to the edit data (i.e., in-scope data), while retaining the same beliefs for inputs outside the scope of edit data (i.e., out-scope data).
Previous model editing strategies learn gradient- gradient-based optimizer (Mitchell al. 202 or a model that can quickly adopt the edits via gradient descents (Sinitsin et al. 2020 Hase et al.] These methods achieve significant success with few edits, but their accuracy falls quickly with a larger amount of edits. The interference between edits may be a cause, but controlling the beliefs through the space of model parameters introduces unmanageable complexity. One obvious side-effectt is scalability. Mitchell et al. (202T) has shown it is non-trivial to generate the gradients by neural networks or impractical to compute the gradient of gradients (i.e., hypergradients) for learning the fast adapting models beyond billions of parameters.
recent work, SERAC (Mitchell et al. 2022), tackles model editing using a semi with explicit memory store the edit data. SERAC first classifies whether input is in-scope or
semi- parametric approach

---

Under review as a conference paper at ICLR 2023
out-s. If a case is out-scope (i.e., unrelated to the edit data), SERAC uses the base model for predictions. In the in-scope case, SERAC uses an additional model (named counterfactual model in the original paper) for predictions. The counterfactual model extracts the most similar edit in the memory, then uses the edit together with the input for generating predictions. SERAC updates only its memory when there new edits; therefore, it avoids maneuvering the model parameter space. This strategy is, therefore, scalable and agnostic to the base model. However, the two branches in SERAC make predictions independently, isolating the counterfactual model from leveraging the knowledge of the base model, which was trained with massive corpora. In other words, the design has no knowledge sharing between the branches, making an entailed prediction less likely for the edit-related (in-scope) inputs. This limitation is convoluted with the challenge of training generalizable classifier to distinguish in-ooutsscope, causing the strategy to stumble on harder cases (examined later sections).
This work proposes SEPROG (Semi-paramerie above strategies while minimizing the limitations: (1) scalable base model size; (2) scalable edit dataset size; (3) good generalizability to hard edits (4) low cost to train and inference. Inspired by the non-parametric neural models (Graves et al. 2014] Garnelo et al. 2018a), which stores training data (or edits) rather than model parameters, our semi- parametreiiicc approach stores latent representations of the edit data as well as leverages the information from pre-trained base model. Our approach also builds on recent advances in prompt-tuning methods (Li & Liang] 2021 Lester al., (02TD.
PromrttCieneration) to retain the good parts of the
which convert task descriptions (or the edits) to real-valued prefix for language inputs. These two ideas lead to an end-to-end solution to change the belief of a model with encoder-decoder structures
(Lewis et al. 2019 Raffel et al. 2020), Our method generates edit datasct-specific embeddings by leveraging the encoder, then injects the embeddings as the prefix of inputs the decoder (Figure T As result, SEPROG does not change the base model after deployment (the advantage of SERAC) while still using the base model to generate predictions on both in- in-scope and out-scope inputs. The inference of in-scope inputs therefore can leverage the world knowledge of the base model to achieve better generalization on hard edits (the advantage of gradient basee methods). Our contributions are summarized as follows:
We propose a novel model editing method that leverages both prompting and coni-parametric strategies.
We examined 6 model editing strategies on 3 evaluation aspects: (1) small/large amount of edit data; (2) easy/hard edits; (3) cost of training/inferenee. This comprehensive comparison shows that the dominant strategy is yet to come, but SEPROG's well-balanced advantages in all 3 aspects make it the best frontier in the current solution space.
2 MODEL EDITING PROBLEM
Let Mosse be large pre-trained language model trained on task T with dataset Dy (ui, vi) !PT!! The goal of model editing is to update the beliefs of Mhose with a set of K edit descriptors 2' k In the case of question-answerte 2f
the edit descriptor could be a question- answer pair [2] v.]. The edited model will need to provide updated answers for questions that are semantically related to data in 2e while not changing its predictions for inputs unrelated to Z
Formally, we are given model Muase : R" + R" trained on dataset Dy. Let ((2²)== [[x,
be the set of inputs whose predictions are affected by information edit descriptor 2", i., labels y is different for datapoints in I(=5) due to updated information from z (Note that 2 E I(=*)).
Let (z=²) C Dr be set of inputs whose predictions are not affected by zf. Then we define I(Z²) = U.. I(2*) as the in- scope data and O(z") = U.- ((2)) out-scope data.
The goal of model-editing is to derive an edited model Medst from Mbuse such that:
1. Medit outputs the revised predictions for in-scope data (1'/V arg max, (ylaa)Medaa)
I(Z")):
2. The changes in the output probability distribution should be small for out-scope inputs. In other words, the KL-Divergence between Muase and Medst's 's predictions is small: min K [p([,1,, Muase) [1p[((( Medat).
2

---

Under review as a conference paper at ICLR 2023
Decader input ambeddings
Base
Base Encoder
Edase
b(xz)
Diase
h
MLP
(r Z
(if e()) > 0.5)
Prefix Promot
b(x)
h
b(x)
b 2r
hi
h
Easi
Encoder
Cross- Attention
h(#)
MLP
((x))
Edit descriptors Z
embeddingg
Edit Selection Module
Figure I: Overview of a version of SEPROG pipeline. The weights of pre-trained base encoder Bbose and decoder Disse are fixed (denoted by Green). SEPROG (denoted by Orange) consists of Edit encoder Eedit that encodes edit descriptors, Edit selection module that extracts relevant information related to input z from edit descriptors and classifies x as in-scope or out-scope with probability e(z). If in-scope, SEPROG generates prefix prompts pr Z²) to concatenate with input to base decoder.
3 SEPROG: MODEL EDITING VIA PREFIX PROMPT GENERATION
3.1 OVERVIEW
Our approach assumes that the base model Mbase is an encoder-decoder architecture with encoder Faase and decoder Dhose- Many widely used language models fall in this category (Raffel et al. 2020 Lewis al.) 2019 Brown et al., 2020). Unlike most previous works on model-editing that altered the weights of the base model (Mitchell al. 2021 2022; Sinitsin et al.) 2020), SEPROG trains neural model to learn to generate prompt embeddings (Z x) based on the edit descriptors Z" and input The generated prompt pr relevant to input so that the model can use the edit information to provide updated beliefs. This prompt is prepended to the token embeddings input for decoder Drase inform the model to provide updated predictions.
provides information the parts of the edit descriptors
3.2 MODEL ARCHITECTURE
SEPROG contains 3 modules to generate the prompt: 1) Edit encoder 2) Edit selection module and 3) Prompt output decoder.
Edit Encoder Edit encoder Epdit converts each of the edit descriptors 2f to fixed-sized embed- dings hç:
h Endit(z))
Any encoder style architecture like BERT (Devlin al. 2018) encoders of seq2seq architecture can be used based on the task and the base model.
Edit selection module Given the set embeddings edit descriptors H [hş) and encoding of input x as b(x) = Ebose (x), edit module first selects the most relevant edit descriptor via cross-ateention:
h(x) Cross W War)((x), H²)
where W att learnable weight matrix that performs linear transform on b(x).
Since the input a maybe either in-scope or out-scope, we also introduce an edit classifier module that predicts if I is in-scope using information from cross-altention layer:
<(x:
(N @ b(x)))

---

Under review as a conference paper at ICLR 2023
where NN is a simple forward neural network with last layer returning a scalar, + is concatena- tion operator and a is the sigmoid function. Therefore, e(x) E [0, 1] is the probability of z belonging to in-scope set (Z")).
Prompt Output Decoder Given the relevancy information h(z) of edit descriptors Z to input a as well as likelihood e(x) that æ is in-scope, we now leverage this information to generate prompts pr(2, 2 E RPxd where is the number of prompt embeddings and d is the input token embedding dimension of base decoder Dbase.
First note that we only produce the prompts if e(x) > 0.5, i.c., the model classifies x as in-scope. We feed-forward neural network N N prrompp that produces a p d dimensional embedding:
pr(x, Z*) = N N Nprompp( (h(z)).
Since the prompt is fed into the unchanged base decoder Doase. the decoder leverages information from the prompt as well its prior knowledge from pre-training effectively provide updated output predictions.
3.3 TRAINING THE MODEL
The training of SEPROG learns only the 3 modules that output h(x),, e(x).. and pr(z, Z*) with frozen base model (Eaare and Drase). The modules are optimized with two losses: scope classification loss and prompt guidance loss.
Scope classífication loss module ( Watt, CrossAttention and N.) are optimized with this loss to predict the in-scope likelihood e(z):
The weights of edit encoder Eedit and the components of edit selection
Lee = -Ez [B(x,]e2(25) log e(x) Bie,leor log e(=))]
Prompt Guidance Loss All the components of SEPROG used to generate in-scope prompts will be jointly optimized with Lpg to change the output from Drase:
Ppg = E2- [[],) log PDn..r (ylpr(x, 2²), Ex)se()))]
(6)
For each in-scope input v. obtain base encoder output Ebass (1)) and generate prompt par, 2 from SEPROG which is fed as prefix to Dbase- The output predictions of Daase are optimized towards updated ground-truth y by tuning the parameters of SEPROG. The total training loss is linear combination of both losses with hyperparameter A:
L = XLsc (1 A)Cpg
4 RELATED WORK
Model Editing Editing model beliefs based on a small set of out-t--distributtio samples has been an active area of research with recent advances in the effectiveness of using large pre-trained models on wide range of NLG and NLU tasks. Most straightforward approaches involve fine-tuning a full set or partial subset of model weights (Zhu et al.) 2020). However, these approaches overfit to edit datasets while degrading performance on out-scope data. [Sinitsin et al. (2020) propose a gradient- based meta-learning approach based MAML (Finn al. (017)) of learning to learn update model weights for new edit dataset during test-time while retaining performance on out-scope datasets. This method, however, is prohibitively expensive for large models with > 107 parameters. Another alternative line of work (Mitchell et al.) [202]] De Cao et al. 2021 Hase et al. (202)) for learning to update model weights instead learn independent smaller neural networks that input gradients of model weights on edit task and provide refined gradients. Since these methods do not retrain model weights, they are relatively scalable but still computationally expensive to train. Moreover, they do not adapt to edit datasets for large sizes. SERAC (Mitchell et al.) (022)) propose an alternative gradient-fred model-agnostic approach for editing where they classify each input as related to the edit dataset and allocate out-scope inputs to underlying base models while using a separate counterfactual model for dealing with in-scope inputs. While this method effectively deals with benchmarks that have simple factual edits in edit datasets and similarity between edit dataset and input is easy to detect they fail on more complex scenarios involving complex relations between input and edit such as entailment or leveraging nuanced world knowledge from the base model.
4

---

Under review as a conference paper at ICLR 2023
Neural non- non-parametrie Models In the general machine learning setup, most models are parametric, iee, we learn the optimal set of parameters for function fe that learns a mapping X' - y that fits the data D {x.. h. Non-parametric models, in contrast, the training data to directly derive functional: y = [x;; D). Memory or retrieval based models (Graves et al., 2014: Rastogi et al. Yogatama al. 2021) fall into this category-
2022
Neural Process based models (Garnelo et al. 2018a b) leverage this explicit dependency of the model's functional with the dataset towards multi-task learning and zero-shot meta-learning problems. At a high level, neural process models learn a latent embedding for each task based on the training dataset of the task. This task embedding in turn used by decoder to provide predictions for test inputs related to the given task. Since these methods explicitly model dependency of training data in the predictive process they are used in various applications where modeling these dependencies improves inductive bias of such models (Rastogi et al. 2022) or provide robust and interpretable predictions (Kamarthi et al. 2021)
Prompt based fine-tuning Using human-generated prompts as prefixes to inputs has shown to be an effective method of zero-shot tuning of large-scale models to specific downstream tasks (Brown) et al., 2020) without requiring any update to model parameters. However, these approaches are limited by the length of input prompts and the requirement of expert human prompting, which may be sub-optimal for some tasks.
Li & Liang (02T)) propose to learn optimal hidden activation prefixes for transformer layers of language models that are fine-tuned for the given downstream task (without changing model weights). They show surprisingly similar performance to explicit fine-tuning while optimizing a very small number of parameters of prefix activations. [ester al. (202T) instead proposed optimize only prefix word embeddings for each task showing similar downstream performance with an even lesser number of parameters to optimize. [iu al. (202I) further generalizes this approach beyond prefixes to have prompts between inputs and output. While prompt tuning methods mostly focus on training prompt embeddings for specific tasks, we study prompt generation to produce prompts specific to the input given the edit descriptors to inform the base model of updated belief from the batch of edit descriptors that are relevant to input.
EXPERIMENT SETUP
5.1 DATASETS
Table 1: Examples from Copy datasets (zsRE, FEVER, Wikipedia) and Entailed Datasets (LeapOrThough, Wikidata5m).
Dataset
Data Type
Input
Label
zsRE
Edit Descriptor
Who the Sun Public License named after?
Sun Micro Deviees Sun Miero Devices
In-Scope
The Sun Puhlic I License has heen named for whom?
Out-Scope
What continent is Mount Whillans found on?
Antartica
In 1985, Cyndi Lauper won the best New Artist
FEVER
Edit Descriptor
False
Award at the 27th Grammy Awards.
the 27th Grammy Awards 1985 Cyndi
In-Scope
False
Lauper the Best New Artisi Award.
Out-Scope
Tetris has sold millions of copies.
False
Wikipedia
Edit Descriptor
Du Fu's mother died shortly after he was born, and he was partially raised by his aunt....
Text Generation
(Same as in-scope)
While scientific experiments performed by Clementine
Out-Scope
and Lunar Prospector could indicate the presence water...
TeapOrThought
Edi Descriptor
A viper vertebrate.
True
Simple In-Scope
Viper is example of a vertebrate.
True
Entailed In- In-Scope
A viper has a brain.
Truc
Out-Scope
A Goldfish has a fin.
True
Wikidatašm
Edit Descriptor
Mary Good has relation 'award received to
Garvan-Olin Modal Garvan-Olin Medal Arkansas
Simple In-Scope
Mary Good has relation "winner of" to
Hard Out-Scope
Mary Good has relation 'educated at' to
We experiment with two types of datasets: Copy-edit datasets (easy edits) and Entail-edit datasets (hard edits), each of which are shown to be effective with memory- based (Mitchell et al., (022) and gradient-based methods (Mitchell et al. 2021 Sinitsin al. 2020). respectively.
5

---

Under review as a conference paper at ICLR 2023
Copy-edit datasets These datasets are designed such that the inputs of in-scope datapoint [x', y/] have very similar imput x' (rephrases) to the input x" edit descriptors [x=,2%] and the output ground truth of these in-scope examples are identical to the output of edit descriptor (v' y²). In other words, Copy-edit datasets require Meda to simply map the in-scope input to the relevant edit descriptor and copy the label from the edit-descriptor. We include the following copy-edi datasets:
1. zRRE Question Answering: It contains 151631 questions based on factual knowledge from Wikipedia (Levy et al. 2017). We use the train/validation/test split similar to De Cao et al. (021). The in-scope ipputs rephrased questions with the same answer.
2. FEVER Fact-checking (Thorne al. 2018): It contains 115409 factual claims with True/False labels. In-seope data include rephrases of updated fact x in the edit-descriptor.
3. Wikipedia Text Generation: For each edit descriptor input xº taken from WikiText- 103, an alternate 10-token completion generated from pre-trained distilGPT-2 model is chosen as output. There are no alternate in-scope inputs; therefore, this tests whether the model can replicate y².
Entail-edit datasets These datasets were chosen such that in in-scope examples have complex entail- ment relationships with edit descriptors and require retaining and leveraging additional knowledge from beliefs of the base model. These benchmarks may include hard out-scope data related to edit descriptors but with a different label. We evaluate on following 2 datasets used in Hase et al. (021)
1. heapOfThought (LoT): This dataset introduced by Talmor et al. (0200) consists of claims labeled true or false based supporting facts.
2. WikidataSm: This benchmark uses relational database (Wang al. 2021 similar to Hase et al. (2021) to build this dataset. The database contains triplets (01, T, 02) where o and 02 are objects with relation r. In general cases, triplet (01, r, 02) is not related to triplet (0r, , 0s): therefore, having (01, 02) as an edit should not affect the prediction of (01, r', rr, 03), unless r' is paraphrase of r. This property allows the benchmark test Medit's 's ability in discriminating the hard out-scope inputs (with unrelated r') from in-scope inputs (with paraphrased r).
We provide examples from each dataset in Table
5.2 BASELINE METHODS
We includes four pradient-based (1 4) and one memory-basee methods. Each of them may target different aspects model editing problem and have specific strength. We compare all of them under coherent experimental setting. These methods are:
1. FT: It directly fine-tunes the model with edit descriptor using the total loss L (Equation 7
2. ENN (Sinitsin et al. 2020): Editable Neural Networks (ENN) uses a bi-level optimization meta-lcarning similar to MAML (Finn et al. 2017)) to make the base model adaptable to simple fine-tuning with edit descriptors.
3. SLAG (Hase et al. 2021): It extends the learned optimizer method from De Cao al. (001) for a larger amount of edits and entailed edits.
4. MEND Mitchell et al.
202T): is state-of-art method that learns a special neural networks to generate the gradient update for specific layers of the base model during fine-tuning
5. SERAC (Micchell et al. (022 The of- memory- based method performs particularly effectively on copy-edit datasets.
5.3 BACKBONE MODEL AND TASK-SPECIIS ARCHITECTURE
For base models, similar to Mitchell et al. 2022 2021
we use pre-trained T5 model (Ra nc) for ZSRE, BERT (Devlin et al.] 2018) for FEVER and DistilGPT2 (Sanh et al. 2019) for Wikipedia gener-
fel et al.] 2020 (google/I5-aaree ww-1aage--------
maaet-base-uncee
ation. Similar Hase et al. (021)
BART (Lewis al. 2019)

---

Under review as a conference paper at ICLR 2023
Table Average Edit Success (ESf) and Drawdown (DDJ) of SEPROG and baselines. Each value is the averaged results from edit batch size (1.4, 4, 10, 20, 64, 128). The Avg. column, which is the average of all datasets.
Copy-edit dataset
Entail-edit dataset
Avg.
ZSRE
FEVER
Wikipedia
LoT
Wikidata5m
Method
DD
DD
DD
ES
ES
ES
DD
FT
0.58
0.38
0.65
0.47
0.82
0.15
0.46
0.36
0.49
0.45
0.50
0.47
ENN
0.67
0.27
0.72
0.31
0.86
0.13
0.56
0.25
0.63
0.37
0.59
0.27
SLAG
0.69
0.33
0.77
0.30
0.87
0.17
0.72
0.27
0.49
0.43
0.61
0,46
MEND
0.73
0.24
0.68
0.18
0.89
0.07
0.71
0.26
0.67
0.33
0.68
0.34
SERAC
0.76
0.15
0.95
0.07
0.96
0.05
0.97
0.18
0.43
0.22
0.47
0.24
SEPROG
0.78
0.18
0.78
0.18
0.91
0.06
0.83
0.23
0.72
0.26
0.67
0.18
for LeapOfThought and WikidataSm. We edit only the last two layers of the backbone models' encoders and decoders for all gradient-based methods. For both ZSRE and Wikipedia generation, we use t5-amall 1 for the edit encoder due its small computational complexity and memory consumption. We use peart-base-uncaaae for FEVER and facebook /bart -base encoder for LeapOfThought and WikidataSm.
5.4 EVALUATION METRICS
Following prior works (Sinissin al. 2020 De Cao
2021 Hase al. 2021 Mitchell et al. 2021 2022), we use Edit Success (ES) and Drawdown (DD) evaluation metrics.
Edit Success (ES) measures the ability of the model to change its predictions on in-scope inputs based on edit descriptors. For a model Medit with edit descriptors 2", the edit success is defined as the average times the prediction of the model is an exact match to the ground truth of in-scope input:
E.S (7*) = Els.eiez((z)) (Modie (x) = =y}
Drawdown(DD) defined as:
measures model's ability to retain similar predictions for out-scope inputs. DD
DD (7e) TE ( y)
RESULTS
6.1 MODEL EDITING PERFORMANCE
To analyze the performance of SEPROG and baselines edit batches of varying sizes, evaluate for batch sizes in (1, 4, 10, 20, 64, 1283. The average Edit Success (ES) and Drawdown (DD) are reported in Table 2 On copy-edit datasets. SERAC significantly outperforms other models both ES and DD due to the easier task of classifying in-scope and out-scope data and copying labels of relevant edit descriptors for in-scope inputs. In the case of entail-edit datasets, on average (over all batch sizes) SEPROG outperforms baselines by 1-7% in ES and has comparable drawdown to best performing models. We will now look at the performance of models across varying edit batch sizes as shown in Figure 2
Performance on copy-edit datasets across batch size SERAC consistently outperforms all other models across varying batch sizes due reasons discussed above. However, observe that SEPROG consistently outperforms all other gradient-based baselines in both ES and DD for larger edit batch sizes (64 and 128) with 7-30% better ES and 14-20% DD. This is due to our approach of generating prompts based on the automatic selection of relevant edit descriptors and providing these prompts as prefixes to the decoder without changing the weights of the base model.
Performance entail-edit dataset across batch sizes Unlike the previous case, SERAC's performance is poor entail-edit datasets that require knowledge from the base model to deal with entailed predictions for ic-seope inputs. For larger batches (64 and 128), SEPROG outperforms all
7

---

Under review as a conference paper at ICLR 2023
Z3RE
Wispadie
2
SUnDo
Sus
butch diss
Wikipodla
LespOrmhought
8
8.
Satch San
Sanch Ston
Dircn Stee
Birsh Sbw
Satch Stn
Figure 2: ES and DD of SEPROG and baselines across varying edit batch sizes.
baselines in ES with 13-20% better scores. Meanwhile, SEPROG's DD performance is comparable to SERAC, both of which outperform gradient-basee baselines. Therefore, due to the combination of separate edit descriptor retrieval mechanism well leveraging information from base model, SEPROG overcomes shortcomings of both memory-baut -based and gradient-base baselines to provide state-of-art performance on entail-edit datasets for large edit batches.
6.2 EFFICIENCY OF SEPROG
A major issue with the deployment of gradient-based methods is their large compute and memory requirements, making it prohibitively expensive for editing large language models. For example, ENN needs to compute hypergradients methods like MEND and SLAG use a separate set neural networks to modify gradient updates of the base model, computing the hypergradients to train these neural networks is still expensive and consumes much memory.
model weights during the training of the base model. While
Memory- methods, like SERAC and SEPROG, act wrappers around the base model without updating the base model's weights. Moreover, while SERAC trains a separate counterfactual model to deal with ic-sc inputs, SEPROG only learns generate prefix prompts and does not need to train another language model. However, SEPROG needs to calculate gradients of the decoder model derive the intermediate gradients V pr(2,20) w.r.t the input prompt.
Table 3: Average Wall time and peak GPU memory use during training and inference loop for a single batch of size 64.
Training
Inference
Models
Time (ms.)
Memory (GB)
Time (ms.)
Memory
NA
NA
1262
8.9
ENN
8948
22
653
4.8
SLAG
2157
9.2
629
5.2
MEND
1755
9.4
517
5.5
SERAC
235
3.6
57
3.4
SEPROG
4.6
84
2.9
To measure the compute and memory requirement during editing of large language model, we measure the time it takes and the peak GPU memory usage during training and inference for single batch of size 64 of 7SRE dataset (with T5 base model) on an NVIDIA Tesla V100 GPU with 32 GB (Results VRAM in Table (Results for additional batch sizes are in Appendix Section C) During training, we observe that the time and memory requirements of SEPROG are around times and times lesser than the most efficient gradient-based baselines, respectively. SERAC is observed to be 1.8 and 1.2 times more efficient than SEPROG for compute time and memory usage respectively. However, during inference, SEPROG uses the least memory since it does not need to calculate gradients like cradient-based methods or use two separate language models for in-scope and out-scope inputs like SERAC.
8

---

Under review as a conference paper at ICLR 2023
6.3 ABLATION STUDIES
Ablation variants of SEPROG We study the effectiveness of prompt-generatiee without fine- tuning model weights as well the efficacy of edit classifier modules using the following variants of SEPROG:
:U-FINETUNE:
We use generated prefixes from SEPROG and fine-tune the base model.
SP-NOCLASSIFFER:: We remove the edit classifier (Equation 3 and do not use Scope Classification Loss.
We have scope classification during training but remove it in inference. In other words, the generated prefix will always inject into the decoder, no matter whether the input in-scope or out-scope.
SP-NOSELECT:
Prefix-tuning has shown to be an efficient method tuning a large language model Li Liang (202T). Moreover, [L & Liang (202T) and et al. (202T) showed that they are more generalizable to domain transfers and don't t overfit to training data. Therefore, SP-FINETUNE is designed to test the hypothesis that using prompt generation alone is more effective method of preventing overfitting and handling large edit batches than updating model weights on new datasets. We also test the efficacy of having& separate classifier module avoid interference between in-scope and out-scope inputs during training and inference through SP-NOCLASSIFIER and SP-NOSELECT, respectively.
FEVER
Z3RE
Wispedia
LeapOrThaught
Wikidat55m
sp-ii-uus
gid PEFTTTAAA TUNE
31-406 TUNE
04
Baton Bize
butn Suz
butth dice
datn Suzo
FEVER
ZSRE
Wikipedia
LaspOrThought
Wikddatamm
0.2
PNERCIANE WAREE
0
Bonn
Borth
Figure 3: ES and DD of SEPROG and ablation variants across varying edit batch sizes.
Edit performance of the ablation variants We compare ES and DD for all edit batch sizes in Figure On average, we observe that SEPROG outperforms the best performing variant in both ES and DD by 5% and 31 %, respectively. For larger batch sizes of 64 and 128, we observe 8% better ES and 24% better DD on average. NOCLASSIFIER is the worst performing model in terms of DD, showing the efficacy of the edit classifier module both for tuning the
followed by modules of SEPROG via additional signal for learning supervision as well as for selecting when to append prefix prompts.
CONCLUSION
We proposed SEPROG, prefix generation model for effective model editing over large edit batch sizes. SEPROG overcomes the scalability issues of gradient-base based methods and inflexibility of memory-based approaches by directly leveraging the base model for adapting to edit dataset by providing appropriate prefix prompts based on the relevance of input to edit dataset. We observed up to 30% improvement in edit performance over gradient- 20% better scores than all state-of-art models for harder entail-edit datasets with large edit batches. Due to our prefix generation model, learning over a much smaller number of parameters SEPROG is also 2-3 times more efficient than gradient- maddennt-baedd approaches.
models on copy-edit datasets and up to
REFERENCES
Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are

---

Under review as a conference paper at ICLR 2023
shw- learners. Advances in neural information processing systems, 33:1877-1901, 2020.
Nicola De Cao, Wilker Aziz, and Ivan Titov. Editing factual knowledge in language models. arXiv preprint wrXiv:2104008166 2021.
Jacob Devlin, Ming-Wor Wing-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep
bidirectional transformers for language understanding. arXiv preprint arXiv11810004805, 2018. |
6
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agmostic meta-learning for fast adaptation of deep networks. In International conference on machine learning, pp. 1126-1135 PMLR, 2017.
6
Marta Garnelo, Dan Rosenbaum, Christopher Maddison, Tiago Ramalho, David Saxton, Murray Shanahan, Yee Whye Teh, Danilo Rezende, and SM Ali Eslami. Conditional neural processes, In International Conference on Machine Learning. pp.
PMLR, 201 8a. 2
Marta Garnelo, Jonathan Schwarz, Dan Rosenbaum, Fabio Viola, Danilo J Rezende, SM Eslami, and Yee Whye Teh. Neural processes. arXiv preprint arXiv:1807.01660 2018b.
Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. arXiv preprint arXiv: 1410.5400 2014. 5
Peter Hase, Mona Diab, Asli Celikyilmaz, Xian Li, Zomitsa Kozareva, Veselin Stoyanov, Mohit Bansal, and Srinivasan Iyer. Do language models have beliefs? methods for detecting, updating, and visualizing model beliefs. arXiv preprint arXiv:2111. (tt::2111.13653 13654, 2021.
12
Harshavardhan Kamarthi, Lingkai Kong, Alexander Rodríguez, Chao Zhang, and B Aditya Prakash. When in doubt: Neural non-parametric uncertainty quantification for epidemic forecasting. Ad- vances in Neural Information Processing Systems, 19:19996-19887, 2021. [5]
Diederik P Kingma and Jimmy Ba. Adam: method for stochastic optimization. arXiv preprint
14266994,,.6980, 2014. 12
Brian Lester, Rami A1-Rfou, and Noah Constant. The power of scale for parameter-efffiient prompt tuning. arXiv preprint urXiv:2104.00 104600691, 2021.
Omer Levy, Minjoon Seo, Eunsol Choi, and Luke Zettlemoyer. Zero-shot relation extraction via reading comprehension. In Proceedings of the 2 Conference on Computational Natural Language Learning (CoNLL 2017), pp. 333-342, Vancouver, Canada, August 2017. Association for Computational Linguistics. doi: 10. 1855/\11K11--00344 URL http:tts////caattoooll/
org/K17-1034
Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov, and Luke Zettlemoyer. Bart: Denoising natural language generation, translation, and comprehension. arXiv preprint arXiv: 2019.
pre-training for
2
Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. arXiv preprint arXiv:2101. 101000999, 2021. 2
12
Xiao Liu, Yanan Zheng, Zhengxiao Du Ming Ding, Yujie Qian, Zhilin Yang, and Jie Tang. Gpt understands, too. arXiv preprint arXiv: 10..22103...8..... 10385, 2021. 55]
Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoeer and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint
2019. [
Eric Mitchell, Charles Lin, Antoine Bosselut, Chelsea Finn, and Christopher D Manning. Fast model editing scale. arXiv preprint a 10. 10.1v:2 2021.
12
Eric Mitchell, Charles Lin, Antoine Bosselut, Christopher D Manning, and Chelsea Finn. Memory- based model editing at scale. International Conference on Machine Learning, pp. 15817-15831.
PMLR, 2022.
12
10

---

Under review as a conference paper at ICLR 2023
Fabio Petroni, Tim Rocktäschel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, Alexander H Miller, and Sebastian Riedel. Language models as knowledge bases? arXiv preprint 2019. !
01066,
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAl blog, 1(8):9 2019, I
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, al. Exploring the limits transfer learning with unified text-to-text transformer. J. Mach. Learn. Res., 2 (1140):1167, 2020.
2 3
Richa Rastogi, Yuntian Deng, Ian Lee, Mert Sabuncu, and Volodymyr Kuleshov. Semi-parametric deep neural networks in linear time and memory. ar preprint arXiv:2205. 2022. 5
Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. In NeurIPS EMC² Workshop, 2019.
Anton Sinitsin, Vsevolod Plokhotnyuk, Dmitriy Pyrkin, Sergei Popov, and Artem Babenko. Editable neural networks. arXiv preprint vxXiv2204.003345 2020.
7
Alon Talmor, Oyvind Tafjord, Peter Clark, Yoav Goldberg, and Jonathan Berant. Leap-of thhuthht: Teaching pre- pre-trrined models to systematically reason over implicit knowledge. Advances in Neural Information Processing Systems, 33: 33:20227-20237, 2020. 6
James Thorne, Andreas Vlachos, Christos Christodoulopoulos. and Arpit Mittal. FEVER: large- scale dataset for fact extraction and VERification. In NAACL-IILT, 2018. G
Xiaozii Wang, Tianyu Gao, Zhaocheng Zhu, Zhengyan Zhang. Zhiyuan Liu, Juanzi Li, and Jian Tang. Kepler: A unified model for knowledge embedding and pre-trained language representation. Transactions of the Association for Computational Linguistics, 9:176-194, 2021. 6
Dani Yogatama, Cyprien de Masson d' Autume, and Lingpeng Kong. Adaptive semiparametric language models. Transactions of the Association for Computational Linguistics, 9:362-373, 2021.
Chen Zhu Ankit Singh Rawat, Manzil Zaheer, Srinadh Bhojanapalli, Daliang Li, Felix Yu, and Sanjiv Kumar. Modifying memories in transformer models. arXiv preprint arXiv:2012.00.50 2020.

---

Under review as a conference paper at ICLR 2023
Appendix for Semi-parametric Prompt-Generation for Model Edit- ing
A DATASET AND BASELINE CODE
The copy-edit datasets were sourced from Mitchell et al. (2021 LeapOrThought dataset was
constructed based on code from Hase et al. 2021 We also use the same train/validattonntest splits as in the official data sources.
We use the code for all gradient- based methods except SLAG from the official code of Mitchell et al. (2021) We used official implementation of SLAG from the authors Hase et al. (2021)² Since the official implementation for AC is not publicly available at the time of writing, we implemented based on details from Mitchell et al. (2022) and observed the results to be similar to that reported in the paper.
B HYPERPARAMETERS
Architecture Details We appended single feed-forward layer of 768 units all edit encoders such that h E 768 The learnable weight W an of CrossAllentiin has dimensions 768 x d where d is the output dimensions of b(x)) from base encoder Exuse. NN,, is two-layer feed-forward with all hidden and output layers having 768 units. While larger prefix-length p generally provides better performance (Li Liang 202T). we found the marginal performance gains be minimal for p greater than 32 in all benchmarks.
benchmarks, we used an Adam optimizer (Kingma & Ba 2014) with linear warm-up in learning rate over the first 200 epochs and gradient clipping threshold set at 5.0. use early stopping with the patience of 200 epochs over total loss on the validation data for copy-edit datasets and 1000 epochs for entail-edit datasets. For each benchmark, over learning rate and À and found that the learning rate between 1e-5 and le-4 and À E [0.1, 0.5) provided good performance. During training, sample the same number of in-scope and out-scope samples per batch and we use only in-scope examples to derive prompt guidance loss whereas we use both for scope classification loss.
Training specifics
mostly tuned
C TRAINING AND INFERENCE TIMES FOR VARYING BATCH SIZES
Table 4: Average Wall time and peak GPU memory during training and inference loop for single batch of size 32.
Training
Inference
Models FT
Time (ms.)
Memory (GB)
Time (ms.)
Memory
NA
NA
922
6.8
ENN
7229.5
18.3
419
4.1
SLAG
5883
6.95
495
4,2
MEND
3108
7.65
351
5.1
SERAC
194
3.3
48
3.3
SePropTe
109
3.8
69
2.8
12

---

Under review as a conference paper at ICLR 2023
Table 5: Average Wall time and peak GPU memory use during training and inference loop for single batch of size 64.
Training
Inference
Modcls
Time (ms.)
Memory (GB)
Time (ms.)
Memory
FT
NA
NA
1262
8.9
ENN
653
4.8
SLAG
2157
9.2
629
5.2
MEND
1755
9.4
517
5.5
SERAC
235
3.6
57
3.4
SEPRoG
127
4.6
84
2.9
Table 6: Average Wall time and peak GPU memory use during training and inference loop for single butch of size 128.
Training
Inference
Models FT
Time (ms.)
Memory (GB)
Time (ms.)
Memory
NA
NA
1955
14.6
ENN
12385
29.4
1056
6.9
SLAG
7391
13.7
897
7.2
MEND
5482
12,9
840
6,4
SERAC
317
4.2
69
3.7
SePropTe
169
6.5
103
3.1
13


Reviews:
[{"review_id": "rLwKqq7Zpn", "reviewer": "Reviewer_k5Q7", "summary": "", "questions": "", "limitations": "", "rating": 5, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "", "summary_of_the_paper": "The paper aims to solve the model editing problem via training prefix prompts and using them together with a frozen language model for inference. The proposed approach, SEPROG, is less computationally heady and requires less memory than gradient-based approaches. SEPROG outperforms state-of-the-art methods by 20% on entailed edit benchmarks and provides up to 30% better performance over gradient-based methods on non-entailed benchmarks.", "summary_of_the_review": "The proposed idea to address the model editing problem is easy and simple to follow. The experimental results are not compelling enough compared to existing approaches. ", "strength_and_weaknesses": "### Strength\n- The approach is simple and easy to follow. The method visualization is clear. \n- I like that the authors did a thorough analysis to understand the training and inference efficiency of the baselines and the proposed approach. This is extremely useful for understanding the practicability of the approaches.\n\n### Weaknesses\n- The writing is not very clear, and I have a bunch of questions throughout reading the paper.\n    - The concept of entailed predictions is explained in the experiment section, but the concept starts to be used in the introduction. It causes a bit of misunderstanding. \n    - The authors should provide better justifications for the selection of the base models. Is it because different tasks require different base encoders? Or simply for a fair comparison to previous works? And why can we not simply use one structure for the framework? The necessity of using different kinds of encoders for different tasks hurts the generalization ability of the approach. \n    - Why is performance so sensitive to batch size? Does one batch always contain examples of one edit description or could be any in-scope and out-of-scope examples? Why are the proposed approach and baselines behave differently for Copy-edit datasets and Entail-edit datasets in terms of a change of batch size?\n    - Table 2 caption is confusing. Is the average performance averaged over both datasets and batch size, or averaged over datasets on one batch size?\n- The results in Table 2 and Table 3 show that the approach is comparable to SERAC in terms of performance and training/inference cost but not significantly better. \n", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}, {"review_id": "TpKSiiaHL7", "reviewer": "Reviewer_EG39", "summary": "", "questions": "", "limitations": "", "rating": 3, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "", "summary_of_the_paper": "This paper proposes a semi-parametric approach which trains neural network to recognize in-scope and out-scope data, and generating prompts that enables editing the response of the base model. The result is on par with state-of-the-art in most cases, while the training time and inference memory seem better.", "summary_of_the_review": "I feel model editing is an interesting problem to study, but the proposed method lack novelty, and the result did not show significant improvements over existing approaches. I look forward to the improvements in the next version.", "strength_and_weaknesses": "The proposed method is intuitive and utilizes the power of neural networks to generate good prompts. However, the performance is often not better than SERAC, as shown in Table 2. The success of the end-to-end system depends on the correct prediction from the edit classifier module, as well as the effectiveness of the prompt output decoder, which seems quite challenging to me. I expect that to be effective, the SEPROG modules require additional training every time when we want to edit a new set of facts, which makes it less flexible. ", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "2: The contributions are only marginally significant or novel.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}, {"review_id": "MXvkkBJWdCQ", "reviewer": "Reviewer_8Z3Z", "summary": "", "questions": "", "limitations": "", "rating": 3, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "", "summary_of_the_paper": "This paper provides a method for model editing, how to locally update the output of the model to exhibit desirable properties.\nIt builds on SERAC, which consists of three parts:  cache edits, an edit scope classifier, and a counterfactual model that overrides the base language model. A scope classifier determines when the output of the base language model will be in scope, and a counterfactual model determines what should be edited. \nThis paper argues that having separate counterfactual and base models is inefficient, since we want to share knowledge between them. \nTo address this problem, this paper proposes to use the prompted base model as the “counterfactual model”. \nThe main claim of the paper is that doing so will achieve better generalization on hard edits.\nUnfortunately, the experiments do not support the claim. ", "summary_of_the_review": "This paper presents an extension to SERAC, a model editing algorithm.  Unfortunately, the extension is neither theoretically justified nor empirically significant.", "strength_and_weaknesses": "Strength\n- Model editing is an important and high-impact problem, which is the focus of this paper. \n\n- The use of prompted language models as counterfactual models is an interesting research direction.  \n\nWeakness\n\n\n- This is a minor extension or a special case of SERAC and there’s no overwhelming evidence that this is better than the original model. (See table 2 & 3)\n\n\n- The writing can be improved. The paper assumes the reader has detailed knowledge of SERAC and the entire literature on model editing. In order to understand what this paper is about, I have read the SERAC paper.\nIn order to reach a broader audience, the authors should motivate the model editing problem in the introduction and then clearly explain SERAC and its limitations in the second part.\n\n\nSome other specific examples related clarity.\n\n- The sentence“ Good parts of the above strategies while minimizing its limitations” is vague: what  are the good parts, and what are the limitations? How is this paper addressing the limitations?\n\n- How is this a “semi-parametric’ model? This was never defined?\n\n- Figure 2 and 3 are near impossible to read\n\n- Table 3 might be interpreted too generously. I would not say that SEPROG is twice as fast as SERAC looking at it. The table also only reports the results for batch size 64, and not the others. ", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "2: Several of the paper’s claims are incorrect or not well-supported.", "technical_novelty_and_significance": "1: The contributions are neither significant nor novel.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}]

Author rebuttal:

Decision: Reject