O-Edit: Orthogonal Subspace Editing for Language Model Sequential Editing

## Abstract

Abstract Large language models (LLMs) acquire knowledge during pre-training, but over time, this knowledge may become incorrect or outdated, necessitating updates after training. Knowledge editing techniques address this issue without the need for costly re-training. However, most existing methods are designed for single edits, and as the number of edits increases, they often cause a decline in the model’s overall performance, posing significant challenges for sequential editing. To overcome this, we propose Orthogonal Subspace Editing, O-Edit. This algorithm orthogonalizes the direction of each knowledge update, minimizing interference between successive updates and reducing the impact of new updates on unrelated knowledge. Our approach does not require replaying previously edited data and processes each edit knowledge on time. It can perform thousands of edits on mainstream LLMs, achieving an average performance improvement that is 4.2 times better than existing methods while effectively preserving the model’s performance on downstream tasks, all with minimal additional parameter overhead.

## 1 Introduction

Large language models (LLMs) are trained on vast amounts of textual data, enabling them to store extensive knowledge about various aspects of the human world, sparking the potential for general artificial intelligence. However, LLMs face significant challenges, including the propagation of inaccurate or outdated knowledge, as well as the generation of bias or harmful content (Cai et al., ; Chen et al., ; Wang et al., ). Given the substantial computational costs of re-training LLMs to address these issues, there has been growing interest in model editing techniques (Yao et al., ; Wang et al., ), which aim to update specific content within the model while minimizing computational costs. Existing model editing methods can be categorized into two main types: parameter-modifying methods that directly alter a small subset of model parameters (Dai et al., ; Meng et al., ; ; Hu et al., ; ; Gupta et al., ), and parameter-preserving methods that without changing the model parameters (Wang et al., ; Cai et al., ; Zheng et al., ). In this paper, we focus on parameter-modifying editing methods.

Most existing research focuses on editing models a single time (Han et al., ; Zhang et al., ). However, as real-world knowledge continuously evolves, models will need to be updated repeatedly to remain accurate. This shift has led to the concept of sequential model editing (Ma et al., ; Hu et al., ; Huang et al., ), which involves performing multiple knowledge edits to progressively update the model as new knowledge needs to be incorporated. Currently, sequential editing is often achieved through multiple iterations of single edits. Recent studies have shown that as the number of edits increases, the success rate of edits significantly declines and impairs the model’s general capabilities, such as reasoning and contextual understanding, thereby limiting the scalability of model editing (Gu et al., ; Gupta et al., ). This challenge is akin to adding new floors to an existing building—each addition risks compromising the overall stability. While some research has analyzed the bottlenecks of sequential editing from a theoretical perspective (Ma et al., ; Hu et al., ), there is still no effective solution to these problems. These unresolved issues pose significant obstacles to the practical implementation of model editing(^1^11For more details on related work, please refer to Appendix [A](#A1).).

To address the scalability issue of sequential editing, this paper introduces Orthogonal Subspace Editing (O-Edit), a simple yet effective method for sequentially editing language models. Our key insight is based on the observation that existing editing methods primarily perform updates within specific low-rank subspaces. Based on this premise, we assume that both the update directions from previous editing tasks and the directions of updates to the model’s implicit knowledge can be captured. Therefore, for the current editing knowledge, the direction of parameter updates should be chosen to minimize the impact on these prior update directions. O-Edit accomplishes this by projecting the update direction of the current knowledge into an orthogonal subspace, ensuring that the neural network’s output for previous knowledge remains unchanged while the projected direction remains effective for the current edit. To enhance O-Edit, we introduce O-Edit+, a post-processing method designed to ensure complete orthogonality between subspaces. We validate the effectiveness of our methods by utilizing two knowledge editing datasets and four downstream task datasets. Furthermore, our analysis, conducted from both experimental and theoretical perspectives, clearly demonstrates that strong orthogonality between each update matrix is crucial for enabling sequential editing. Figure [1](#S1.F1) illustrates how our methods adjust the update direction for each piece of knowledge.

Figure: Figure 1: O-Edit constrains the direction of each update to lie within an orthogonal subspace.
Refer to caption: /html/2410.11469/assets/x1.png

Our method offers four key advantages: (1) Efficiency: It requires minimal additional parameters while enabling hundreds or even thousands of sequential edits. (2) Privacy: There is no requirement to store the edited data itself, ensuring privacy during updates. (3) Timeliness: Our method allows for the immediate application of each edit, making it more practical. (4) Flexibility: Our method is compatible with existing sequential editing techniques, allowing for easy integration and adaptability to various scenarios.

Our main contributions are as follows: ① We introduce O-Edit and O-Edit+, two simple and efficient methods for sequential editing in large language models (LLMs) that can handle thousands of edits in orthogonal subspaces, effectively addressing the performance degradation issue encountered by existing approaches during multiple edits. ② Our methods significantly preserve model performance on downstream tasks, demonstrating their scalability and practicality even after numerous sequential edits in real-world continuous model update scenarios. ③ We show that the orthogonality between knowledge is essential for supporting sequential editing, providing a viable research direction for this task.

## 2 PRELIMINARIES

In this section, we introduce sequential model editing. Subsequently, in Section [3](#S3), we discuss two prominent knowledge editing techniques, ROME (Meng et al., ) and MEMIT (Meng et al., ), and extend them into the sequential editing method O-Edit. Finally, in Section [4](#S4), we further refine O-Edit by presenting O-Edit+, a more straightforward and effective approach for orthogonal sequential model editing.

We focus on the challenge of sequential model editing (SME) (Wang et al., ; Ma et al., ), which aims to enable large language models (LLMs) to undergo extensive sequential modifications, potentially involving hundreds or thousands of edits. The primary objective is to ensure that the model’s outputs align with human expectations across target queries, while simultaneously preserving the LLM’s pre-existing knowledge and capabilities. Let $f_{\Theta}:\mathbb{X}\rightarrow\mathbb{Y}$, parameterized by $\Theta$, denote a model function that maps an input $\mathbf{x}$ to its corresponding prediction $f_{\Theta}(\mathbf{x})$. The initial model, $f_{\Theta_{0}}$, is pre-trained on a large dataset $D_{\text{train}}$. When the LLM exhibits inaccuracies or requires updates, model editing becomes necessary, using a dynamic, time-evolving dataset $\mathcal{D}_{\text{edit}}=\{(\mathcal{X}_{e},\mathcal{Y}_{e})\mid(x_{1},y_{1}),\ldots,(x_{T},y_{T})\}$. At each time step $T$, a model editor (ME) applies the $T$-th edit, updating the previous model $f_{\Theta_{T-1}}$ to produce a new model $f_{\Theta_{T}}$, following the equation:

$$ $f_{\Theta_{T}}=\text{ME}(f_{\Theta_{T-1}},\mathbf{x}_{T},y_{T}),\quad\text{s.t.}\quad f_{\Theta_{T}}(\mathbf{x})=\begin{cases}y_{T}&\text{if }\mathbf{x}\in\mathcal{X}_{e},\\ f_{\Theta_{0}}(\mathbf{x})&\text{if }\mathbf{x}\notin\mathcal{X}_{e}.\end{cases}$ (1) $$

Eqn. [1](#S2.E1) indicates that after model editing, the LLM should correctly predict the current edit with $f_{\Theta_{T}}(\mathbf{x}_{T})=y_{T}$, while preserving previous edits $(\mathbf{x}_{<T},y_{<T})\in\mathcal{D}_{\text{edit}}$ are inaccessible to the editor, the model is still able to retain this edit. Additionally, the model should maintain the performance of the original model $f_{\Theta_{0}}$ on data outside the editing scope, $\mathbf{x}\notin\mathcal{X}_{e}$, particularly with respect to the general training corpus $D_{\text{train}}$.

Figure: Figure 2: The framework of O-Edit for sequential language model editing. (a) First, we compute gradients on a large amount of textual data without updating the model parameters. This step provides the gradient information necessary for updating model’s implicit knowledge. (b) Next, we impose constraints on the update directions for each piece of edited knowledge, ensuring these directions are orthogonal to each other as well as to the directions of the model’s implicit knowledge.
Refer to caption: /html/2410.11469/assets/x2.png

## 3 O-EDIT : SEQUENTIAL EDITING WITH GRADIENT PROJECTION MEMORY

In this section, we introduce O-Edit, as illustrated in Figure [2](#S2.F2). First, we discuss two key-value memory-based knowledge editing methods, ROME and MEMIT, followed by our optimization method, which incrementally edits new knowledge in orthogonal subspaces, while preserving previously edited knowledge.

### 3.1 Key-Value Memory Editing Method

In their study, (Meng et al., ) employed causal mediation analysis to identify that feed-forward neural networks (FFNs) play a crucial role in retaining factual knowledge. The FFN is decomposed into two matrices, represented as follows:

$$ $FFN^{l}(x)=W^{l}_{proj}\cdot\sigma(W^{l}_{fc}\cdot\gamma(a^{l}+h^{l-1}))$ (2) $$

Here, $a^{l}\in\mathbb{R}^{d}$ represents the output of the attention module at the $l$-th layer, and $h^{l-1}\in\mathbb{R}^{d}$ denotes the output of the previous layer. The matrices $W_{fc}^{l}\in\mathbb{R}^{d_{m}\times d}$ and $W_{proj}^{l}\in\mathbb{R}^{d\times d_{m}}$ serve as the parameter matrices for the FFN at the $l$-th layer. Here, $d_{m}$ is the dimension of the intermediate hidden state, $\sigma$ denotes the activation function, and normalizing nonlinearity $\gamma$.

Building on the key-value memory theory introduced in (Geva et al., ; ), the matrix $W^{l}_{fc}$ is responsible for identifying input patterns, which leads to the generation of the key vector $k\in\mathbb{R}^{d}_{m}$. In contrast, $W^{l}_{proj}$ retrieves the corresponding value vector $v\in\mathbb{R}^{d}$. This establishes $W^{l}_{proj}$ as a linear key-value memory system, where the set of key vectors $K=\{k_{1},k_{2},\ldots\}$ is associated with the corresponding set of value vectors $V=\{v_{1},v_{2},\ldots\}$. The relationship between the keys and values can be succinctly expressed as $WK=V$, thereby completing the transformation process.

Meng et al. () propose ROME, in which new knowledge is represented as a key-value pair $(k_{*},v_{*})$ and is integrated into the model by addressing the following constrained least squares problem:

$$ $\min\|\widetilde{W}K-V\|_{2}\quad\text{subject to}\quad\widetilde{W}{k_{*}}=v_{*},\quad\text{with}\quad\widetilde{W}=W+\Lambda(C^{-1}k_{*})^{T}.$ (3) $$

Here, $\Delta W=\Lambda(C^{-1}k_{*})^{T}$, $k_{*}$ represents the query associated with the knowledge to be edited, such as $x=\textit{“The president of the US is”}$, where $k_{*}$ corresponds to the hidden state of the last token (index $i$) of the subject (e.g., “US”). The key vector $k_{*}$ is defined as:

$$ $k_{*}=\frac{1}{N}\sum_{j=1}^{N}k(s_{j}+x),\quad\text{where }k(x)=\sigma\left(W_{fc}^{l}\gamma\left(a^{l}_{[x],i}+h_{[x],i}^{l-1}\right)\right),$ (4) $$

with $s_{j}$ representing prefix texts for robustness. The value vector $v_{*}$ denotes the edited knowledge result, for instance, “Harris” or “Trump”, computed as $v_{*}=\arg\min_{v}\mathcal{L}(v)$, where $\mathcal{L}(v)$ is given by:

$$ $\mathcal{L}(v)=\frac{1}{N}\sum_{j=1}^{N}-\log P_{(v=v_{*})}[o^{*}|p_{j}+x]+D_{KL}\left(P_{G(v=v_{*})}[x|p^{\prime}]\parallel P_{G}[x|p^{\prime}]\right).$ (5) $$

The first term serves to update the knowledge, while the second term preserves the essence of the subject. The objective is to modify the model’s response to the knowledge query, yielding an output $o^{*}$ (e.g., “Harris” or “Trump”). Additionally, $C=KK^{T}$ is a pre-computed constant that estimates the uncentered covariance of $k$, and $\Lambda=(v_{*}-Wk_{*})/(C^{-1}k_{*})^{T}k_{*}$ represents the residual error of the new key-value pair. Further details can be found in (Meng et al., ).

To manage editing intensity, (Meng et al., ) introduced MEMIT, which computes matrix updates by solving:

$$ $\widetilde{W}=W+Rk_{*}^{T}(C+k_{*}k_{*}^{T})^{-1},$ (6) $$

where $\Delta W=Rk_{*}^{T}(C+k_{*}k_{*}^{T})^{-1}$, $C=\lambda\cdot KK^{T}$, and $R=v_{*}-Wk_{*}\in\mathbb{R}^{d}$ is a column vector. The parameter $\lambda$ allows for adjusting the balance between new edits and the original knowledge. It is noteworthy that in both ROME and MEMIT, only $v_{*}$ is derived through the training process, and this operation will be optimized in subsequent steps. For additional implementation details regarding MEMIT, please refer to Appendix [B.3](#A2.SS3).

### 3.2 Towards an orthogonal editing method

Previous methods share a common feature: all new knowledge is updated within a shared space, which directly affects the weights of the model. If an update for new knowledge is applied without considering prior knowledge, the direction of this update can affect both the previously edited knowledge and the implicit knowledge within the model, potentially leading to catastrophic forgetting (Luo et al., ; Wang et al., ). Therefore, to effectively support sequential editing, the process of updating new knowledge should adhere to the following criteria:

Criterion 3.1: The update direction for each piece of knowledge should be orthogonal to the directions of previously edited knowledge, ensuring minimal interference with previously edited knowledge.

Criterion 3.2: The update direction for each piece of knowledge should be orthogonal to the implicit knowledge directions within the original model, ensuring minimal interference with the model’s existing implicit knowledge.

In the following sections [3.2.1](#S3.SS2.SSS1) and [3.2.2](#S3.SS2.SSS2), we will detail how we optimized ROME and MEMIT to fulfill the two criteria mentioned above within the context of sequential editing.

#### 3.2.1 The knowledge to be edited should be mutually orthogonal

Editing the First Piece of Knowledge: To comply with criterion 3.1, we implement the following steps in a sequential editing process. We commence by editing the first piece of knowledge using the pair $(x_{1},y_{1})$. Upon completion of this initial edit, we obtain an updated set of parameters $\Delta W_{\text{[total]}}=\Delta W_{[1]}$. To preserve this edited knowledge, we constrain the gradient update directions for subsequent edits. It is important to note that during the editing process with methods such as ROME and MEMIT, parameter adjustments are made without gradient computation, as the calculation of $v_{*}$ necessitates training, while the adjustment of $W_{p}roj$ occurs in a single step. Since ROME and MEMIT do not involve computing the gradient direction of the required update matrix, we draw on the insights from (Wang et al., ) and utilize $\Delta W_{\text{[total]}}$ to approximate the direction of model parameter updates. They argue that the gradient space from prior training tasks can be effectively captured by the update matrix. Next, we perform Singular Value Decomposition (SVD) on $\Delta W_{\text{[total]}}=U\Sigma V^{T}$ and extract the sub-matrix $\Delta W_{r}$ corresponding to the top $r$ singular values, defined as the Core Gradient Space (CGS) by (Saha et al., ). Updates along the CGS direction induce maximum changes in knowledge (Farajtabar et al., ), whereas updates in directions orthogonal to the CGS minimize interference with previously edited knowledge(^2^22For additional details on updating within orthogonal subspaces, please refer to Appendix [A.3](#A1.SS3) and [B.1](#A2.SS1).).

Editing the Subsequent Knowledge: To edit the second piece of knowledge using examples from $D_{\text{edit}}$, we first retrieve the bases of the Core Gradient Space (CGS). The new update direction must lie in the space orthogonal to the CGS:

$$ $\Delta W^{T}_{r}\cdot\Delta W_{[2]}=\mathbf{0}.$ (7) $$

This ensures that the column vector subspace of $W_{2}$ is orthogonal to the column vector subspace of $W_{r}$. Taking MEMIT as an example, the update in Eq.[6](#S3.E6) can be optimized as(^3^33Since Eqn.[3](#S3.E3) involves matrix right multiplication, $d$ denotes the column dimension and $d_{m}$ denotes the row dimension.):

$$ $\displaystyle\widetilde{W}$ $\displaystyle=W+(v_{*}-Wk_{*})k_{*}^{T}(C+k_{*}k_{*}^{T})^{-1},$ (8) where $\displaystyle\quad\Delta W^{T}_{r}\cdot(v_{*}-Wk_{*})k_{*}^{T}(C+k_{*}k_{*}^{T})^{-1}=\mathbf{0}.$ $$

Non-trivial solutions that approximately satisfy Eqn.[8](#S3.E8) can be obtained by training $v_{*}$, where Eqn.[5](#S3.E5) can be rewritten as:

$$ $\displaystyle\mathcal{L}(v)+\lambda_{1}f_{1}(\Delta W_{r};v).$ (9) $$

Here:

$$ $\displaystyle f_{1}=\text{sim}\left(\Delta W_{r},(v_{*}-Wk_{*})k_{*}^{T}(C+k_{*}k_{*}^{T})^{-1}\right),$ (10) $$

sim represents the cosine similarity function in column vector space, where each column vector lies in $\mathbb{R}^{d}$, and $\lambda_{1}$ serves as a hyperparameter that regulates the degree of orthogonality. Upon completion of the training of $v_{*}$, Eqn. [6](#S3.E6) is employed to determine the update parameter $\Delta W_{[2]}$. Following the update of the second piece of knowledge, the edited parameters are revised as follows:

$$ $\Delta W_{\text{[total]}}+=\Delta W_{[2]}.$ (11) $$

We then proceed to the next piece of new knowledge, repeating the same procedure as for the second piece. The value of $r$ increases linearly with each iteration of knowledge editing, defined as $r=\text{min}(1\times\text{Iteration},\text{rank}(\Delta W_{\text{[total]}}))$. We provide an efficient solution for Eqn. [10](#S3.E10) and an explanation for $r$ in Appendix [B.4](#A2.SS4).

#### 3.2.2 The edited knowledge should be orthogonal to the implicit knowledge

To adhere to criterion 3.2, we implement the following steps in the sequential editing process. We perform backpropagation on a large corpus of text to capture the model’s gradient information for the update direction of its internal implicit knowledge while freezing the original model’s (unedited) parameters, simulating the pre-training process without updating the model, as illustrated in the bottom right of Figure [2](#S2.F2). This computation is conducted on Wikipedia text, accumulating the gradient information by summing it. Appendix [C.1](#A3.SS1) provides a comparison for selecting the appropriate text. Notably, this involves actual gradient information rather than the approximate update direction used in Section [3.2.1](#S3.SS2.SSS1).

Once the gradient information $\nabla G\in\mathbb{R}^{d\times d_{m}}$ of the implicit knowledge is obtained, the update direction for knowledge editing should be orthogonal to $\nabla G$. Similar to Section [3.2.1](#S3.SS2.SSS1), we obtain the rank $q$ approximation of $\nabla G$, denoted as $\nabla G_{q}$, through SVD. We then subtract the projection of $\nabla G_{q}$ onto $W_{r}$ from $\nabla G_{q}$:

$$ $\nabla G_{q}=\nabla G_{q}-\Delta W_{r}(\Delta W^{T}_{r}\Delta W_{r})^{-1}\Delta W^{T}_{r}\nabla G_{q},$ (12) $$

to prevent knowledge conflicts (Xu et al., ; Jin et al., ) between the two. For instance, if $\Delta W_{r}$ contains the edited knowledge ”The President of the US is Harris/Trump”, while $\nabla G_{q}$ contains ”The President of the US is Biden”, the update directions for these two pieces of knowledge may conflict or even be completely opposite. In such cases, we prioritize preserving the knowledge in $\Delta W_{r}$ over $\nabla G_{q}$. The ultimate training objective is:

$$ $\displaystyle\text{loss}=\mathcal{L}(z)+\lambda_{1}f_{1}(\Delta W_{r};v)+\lambda_{2}f_{2}(\nabla G_{q};v),$ (13) $$

where:

$$ $\displaystyle f_{2}=\text{sim}\left(\nabla G_{q},(v_{*}-Wk_{*})k_{*}^{T}(C+k_{*}k_{*}^{T})^{-1}\right).$ (14) $$

The rank $q$ increases linearly with the number of iterations of knowledge editing, described by $q=\lambda_{3}\times\text{iteration}$, where $\lambda_{3}$ is a hyperparameter controlling the degree of constraints.

Eqn. [14](#S3.E14) represents the final optimization target. After obtaining $v_{*}$, we use Eqn. [6](#S3.E6) to solve for the update parameter. We then update the hyperparameters $r$, $q$, and $\Delta W_{\text{[total]}}$ for the next knowledge update.

## 4 O-EDIT+ : Towards More Efficient Sequential Model Editing

In Section [3](#S3), we introduced O-Edit, an algorithm for approximate orthogonal sequential knowledge editing. To further enhance the orthogonality between different pieces of knowledge, we propose O-Edit+, a post-processing method that eliminates the need for cosine similarity calculations. Specifically, for the second piece of knowledge, we compute $v_{*}$ using Eqn.[5](#S3.E5) and apply Eqn.[6](#S3.E6) to obtain the update parameter $\Delta W_{[2]}$. Subsequently, $\Delta W_{[2]}$ undergoes post-orthogonal processing, achieved as follows:

$$ $\displaystyle\Delta W_{[2]}$ $\displaystyle=\Delta W_{[2]}-\Delta W_{r}(\Delta W^{T}_{r}\Delta W_{r})^{-1}\Delta W^{T}_{r}\Delta W_{[2]},$ (15) $\displaystyle\nabla G_{q}$ $\displaystyle=\nabla G_{q}-\Delta W_{r}(\Delta W^{T}_{r}\Delta W_{r})^{-1}\Delta W^{T}_{r}\nabla G_{q},$ $\displaystyle\Delta W_{[2]}$ $\displaystyle=\Delta W_{[2]}-\nabla G_{q}(\nabla G^{T}_{q}\nabla G_{q})^{-1}\nabla G^{T}_{q}\Delta W_{[2]}.$ $$

The processed $\Delta W_{[2]}$ from Eqn.[15](#S4.E15) is then used as the update direction for the second piece of knowledge. Similar to O-Edit, we subsequently update the hyperparameters $r$, $q$, and $\Delta W_{\text{[total]}}$ for the next knowledge edit. We detail the computation process of Eqn.[15](#S4.E15) and the pseudo-code for O-Edit and O-Edit+ in Appendix [B.4](#A2.SS4). Readers can refer to Appendices [C.3](#A3.SS3) and [C.4](#A3.SS4) for details on hyperparameter selection.

## 5 Experiments

**Table 1: Main editing results for COUNTERFACT. $T$: Num Edits.**
| Method | COUNTERFACT |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| $T=200$ | $T=500$ | $T=1000$ | $T=1500$ |  |  |  |  |  |  |  |  |  |  |  |  |  |
| Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. |  |
| Mistral-7B |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| ROME | 0.72 | 0.53 | 0.31 | 0.52 | 0.30 | 0.18 | 0.14 | 0.21 | 0.28 | 0.10 | 0.06 | 0.15 | 0.27 | 0.07 | 0.05 | 0.13 |
| +R-Edit | 0.85 | 0.60 | 0.48 | 0.64 | 0.27 | 0.12 | 0.04 | 0.14 | 0.30 | 0.09 | 0.05 | 0.15 | 0.26 | 0.06 | 0.04 | 0.12 |
| +WilKE | 0.81 | 0.59 | 0.44 | 0.61 | 0.45 | 0.27 | 0.19 | 0.30 | 0.28 | 0.10 | 0.10 | 0.16 | 0.18 | 0.02 | 0.07 | 0.09 |
| +PRUNE | 0.76 | 0.51 | 0.28 | 0.52 | 0.35 | 0.21 | 0.21 | 0.26 | 0.42 | 0.12 | 0.05 | 0.20 | 0.33 | 0.15 | 0.22 | 0.23 |
| +O-Edit | 0.99 | 0.51 | 0.73 | 0.74 | 0.68 | 0.41 | 0.37 | 0.49 | 0.45 | 0.18 | 0.26 | 0.30 | 0.37 | 0.20 | 0.19 | 0.25 |
| +O-Edit+ | 0.94 | 0.47 | 0.76 | 0.72 | 0.65 | 0.38 | 0.41 | 0.48 | 0.49 | 0.21 | 0.29 | 0.33 | 0.41 | 0.21 | 0.24 | 0.29 |
| MEMIT | 0.93 | 0.67 | 0.41 | 0.67 | 0.50 | 0.35 | 0.10 | 0.32 | 0.28 | 0.10 | 0.06 | 0.15 | 0.19 | 0.06 | 0.05 | 0.10 |
| +R-Edit | 0.93 | 0.64 | 0.48 | 0.68 | 0.76 | 0.39 | 0.16 | 0.44 | 0.32 | 0.17 | 0.06 | 0.18 | 0.28 | 0.13 | 0.06 | 0.16 |
| +WilKE | 0.95 | 0.70 | 0.50 | 0.72 | 0.73 | 0.51 | 0.26 | 0.50 | 0.26 | 0.16 | 0.06 | 0.16 | 0.30 | 0.14 | 0.04 | 0.16 |
| +PRUNE | 0.83 | 0.53 | 0.47 | 0.61 | 0.76 | 0.52 | 0.29 | 0.52 | 0.65 | 0.45 | 0.22 | 0.44 | 0.43 | 0.27 | 0.12 | 0.27 |
| +O-Edit | 0.93 | 0.55 | 0.65 | 0.71 | 0.86 | 0.53 | 0.45 | 0.61 | 0.72 | 0.47 | 0.34 | 0.51 | 0.51 | 0.33 | 0.18 | 0.34 |
| +O-Edit+ | 0.89 | 0.61 | 0.78 | 0.76 | 0.81 | 0.55 | 0.60 | 0.65 | 0.68 | 0.39 | 0.55 | 0.54 | 0.61 | 0.42 | 0.53 | 0.52 |
| Llama3-8B |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| ROME | 0.75 | 0.48 | 0.14 | 0.46 | 0.69 | 0.45 | 0.05 | 0.40 | 0.75 | 0.46 | 0.02 | 0.41 | 0.47 | 0.28 | 0.02 | 0.31 |
| +R-Edit | 0.70 | 0.38 | 0.27 | 0.45 | 0.65 | 0.41 | 0.06 | 0.37 | 0.54 | 0.34 | 0.03 | 0.30 | 0.50 | 0.31 | 0.02 | 0.28 |
| +WilKE | 0.77 | 0.44 | 0.33 | 0.51 | 0.55 | 0.42 | 0.03 | 0.33 | 0.66 | 0.45 | 0.02 | 0.38 | 0.71 | 0.49 | 0.02 | 0.41 |
| +PRUNE | 0.90 | 0.57 | 0.33 | 0.60 | 0.77 | 0.50 | 0.24 | 0.50 | 0.83 | 0.41 | 0.21 | 0.48 | 0.81 | 0.35 | 0.19 | 0.45 |
| +O-Edit | 0.88 | 0.63 | 0.35 | 0.62 | 0.77 | 0.47 | 0.22 | 0.49 | 0.84 | 0.47 | 0.13 | 0.48 | 0.83 | 0.31 | 0.09 | 0.41 |
| +O-Edit+ | 0.86 | 0.61 | 0.37 | 0.61 | 0.81 | 0.52 | 0.24 | 0.52 | 0.86 | 0.49 | 0.19 | 0.51 | 0.87 | 0.50 | 0.13 | 0.50 |
| MEMIT | 0.85 | 0.51 | 0.22 | 0.52 | 0.50 | 0.35 | 0.10 | 0.32 | 0.28 | 0.10 | 0.05 | 0.14 | 0.18 | 0.06 | 0.05 | 0.10 |
| +R-Edit | 0.92 | 0.63 | 0.48 | 0.68 | 0.57 | 0.39 | 0.15 | 0.37 | 0.34 | 0.17 | 0.06 | 0.19 | 0.27 | 0.13 | 0.05 | 0.15 |
| + WilKE | 0.95 | 0.68 | 0.50 | 0.71 | 0.71 | 0.56 | 0.25 | 0.51 | 0.30 | 0.16 | 0.08 | 0.18 | 0.30 | 0.14 | 0.05 | 0.16 |
| +PRUNE | 0.82 | 0.52 | 0.47 | 0.60 | 0.76 | 0.52 | 0.38 | 0.55 | 0.64 | 0.44 | 0.32 | 0.47 | 0.42 | 0.27 | 0.22 | 0.30 |
| +O-Edit | 0.93 | 0.55 | 0.64 | 0.71 | 0.86 | 0.53 | 0.44 | 0.61 | 0.72 | 0.47 | 0.33 | 0.51 | 0.55 | 0.40 | 0.27 | 0.41 |
| +O-Edit+ | 0.88 | 0.53 | 0.76 | 0.72 | 0.84 | 0.51 | 0.45 | 0.60 | 0.81 | 0.50 | 0.31 | 0.54 | 0.79 | 0.44 | 0.28 | 0.50 |

### 5.1 Editing Experimental Settings and Evaluation Metrics

Datasets and Models. We utilize autoregressive LLMs, specifically Mistral-7B (Jiang et al., ) and Llama3-8B(^4^44[https://llama.meta.com/llama3](https://llama.meta.com/llama3)), for evaluation, along with the datasets ZsRE (Cao et al., ) and COUNTERFACT (Meng et al., ). The ZsRE dataset is a question-answering resource comprising examples that include a sentence to be edited, its back-translated equivalent, and an unrelated sentence. The COUNTERFACT dataset consists of counterfactual examples derived from Wikipedia, where the probability of the new target is lower than that of the original answer. Examples from both datasets are provided in Appendix [C.5](#A3.SS5).

Baseline. We selected ROME (Meng et al., ) and MEMIT (Meng et al., ) as baseline editors and compared our alternative methods, O-Edit and O-Edit+, with the following approaches: R-Edit (Gupta et al., ), which facilitates sequential editing by solving for a more accurate $k_{*}$; WilKE (Hu et al., ), which dynamically selects the optimal layer for editing; and PRUNE (Ma et al., ), which aims to enhance model robustness in sequential editing by adjusting the magnitude of singular values in $\Delta W_{\text{[total]}}$, requiring prior edits to accumulate to a predetermined number before processing. Details on these methods are provided in Appendix [C.2](#A3.SS2).

Metrics. Each edit example comprises an edit knowledge statement, consisting of an edit statement $\mathbf{x_{e}}$ and an edit target $\mathbf{y_{e}}$, its paraphrase sentences $\mathbf{x_{e^{\prime}}}$ for testing generalization, and an unrelated knowledge statement $\mathbf{x_{loc}}$ for testing locality. For the editing dataset $\mathcal{D}_{\text{edit}}=\{(\mathbf{x_{e}},\mathbf{y_{e}})\}$ with $T$ edits, we evaluate the final post-edit model $f_{\Theta_{T}}$ after the $T$-th edit example $(\mathbf{x_{T}},\mathbf{y_{T}})$. We assess the reliability and generalization of the model editor using the metrics Rel. (Edit Success Rate (Zhang et al., )) and Gen. (Generalization Success Rate), while Loc. (Localization Success Rate) evaluates specificity, defined as the post-edit model’s ability to maintain the output of the unrelated knowledge $\mathbf{x_{loc}}$. We report these metrics and their mean scores, which are formally defined as:

$$ $\text{Rel.}=\frac{1}{T}\sum_{t=1}^{T}\mathds{1}(f_{\Theta_{T}}(\mathbf{x}_{e}^{t})=\mathbf{y}_{e}^{t}),\text{Gen.}=\frac{1}{T}\sum_{t=1}^{T}\mathds{1}(f_{\Theta_{T}}(\mathbf{x}_{e^{\prime}}^{t})=\mathbf{y}_{e}^{t}),\text{Loc.}=\frac{1}{T}\sum_{t=1}^{T}\mathds{1}(f_{\Theta_{T}}(\mathbf{x}_{\text{loc}}^{t})=f_{\Theta_{0}}(\mathbf{x}_{\text{loc}}^{t})),$ (16) $$

where $\mathds{1}(\cdot)$ denotes the indicator function, indicating that we only consider the top-1 token during inference.

Main Results. The competitive performance of our methods is demonstrated in Tables [1](#S5.T1) and [10](#A3.T10), which compare results against four baselines in the COUNTERFACT and ZsRE settings. Our observations are as follows: ① ROME and MEMIT exhibit increased forgetting of both previously edited and unrelated knowledge as the number of edits rises. ② Some methods, although effective for a limited number of edits (up to 500), struggle to maintain a balance between edit quality and retention of unrelated knowledge as the number of edits increases. ③ O-Edit and O-Edit+ consistently outperform other methods in sequential editing tasks.

In the COUNTERFACT setting, with $T=200$, models edited with MEMIT and ROME still perform effective edits. However, as the number of edits exceeds 500, their performance declines rapidly. After 1,500 edits on Mistral-7B, MEMIT’s scores dropped to approximately 0.20 for Rel. and 0.05 for Loc., indicating substantial forgetting of both edited and unrelated knowledge. Although improved methods like PRUNE and WilKE showed competitive performance at $T=200$, they similarly failed to maintain a good balance across Rel., Gen., and Loc. at $T=1500$.

At $T=\{500,1000,1500\}$, O-Edit and O-Edit+ achieved the best results on both Mistral-7B and Llama3-8B. At $T=1500$ with Mistral-7B, O-Edit+ improved by 0.16 and 0.42 in Avg. over ROME and MEMIT, respectively, and by 0.06 and 0.25 over PRUNE, our closest competitor. Overall, while performance across methods is similar for smaller numbers of edits, O-Edit+ significantly reduces forgetting as the number of edits increases, effectively preserving both edited and unrelated knowledge. Results for ZsRE are provided in Figure [10](#A3.T10) in the Appendix.

### 5.2 Downstream Tasks Evaluation

Datasets. To investigate the side effects of sequential model editing on the downstream task abilities of LLMs, we adopted four representative tasks with corresponding datasets for assessment: Commonsense Reasoning using the SIQA (Sap et al., ), Content Analysis on the LAMBADA (Paperno et al., ), Question Answering with the CommonsenseQA (Talmor et al., ), and MATH on the GSM8K (Cobbe et al., ). Details of the prompts for each task are provided in Appendix [C.6](#A3.SS6).

Figure: Figure 3: The downstream task performance (%) of models edited by four editing methods with Mistral-7B and Llama3-8B on the COUNTERFACT dataset.
Refer to caption: /html/2410.11469/assets/x3.png

Main Results. Figure [3](#S5.F3) illustrates the downstream task performance of Mistral-7B and Llama3-8B after applying MEMIT and O-Edit+ in the COUNTERFACT setting. As shown by the gray line in Figure [3](#S5.F3), MEMIT maintains performance at a certain level when the number of edits is small ($T\leq 200$). However, as the number of edits exceeds 1000, MEMIT’s performance drastically declines, approaching zero (with results on CommonsenseQA resembling random guessing, both around 20%). In contrast, O-Edit and O-Edit+ effectively tackle this issue by implementing constraints that ensure orthogonality between the editing knowledge and the original model’s implicit knowledge, significantly reducing interference. With O-Edit+ applied for 200 edits, downstream task performance remains close to that of the unedited model, effectively preserving accuracy across various tasks. Even after 1,500 edits, O-Edit+ remains to outperform both MEMIT and PRUNE, demonstrating its robustness in maintaining downstream task performance over extended sequences of edits. This highlights the effectiveness of O-Edit+ in minimizing interference between edits, allowing models to retain high performance even in heavily edited environments.

Nevertheless, as the number of edits increases, extensive knowledge editing inevitably leads to diminished model performance, a phenomenon described by (Wang et al., ) as the “unbreakable triangle,” which asserts that no method can achieve perfect editing without compromising other aspects of the model’s performance. Despite this, O-Edit+ significantly mitigates this effect, offering superior performance retention compared to other editing methods such as MEMIT.

Figure: Figure 4: This figure illustrates the update directions of three editing methods on the COUNTERFACT dataset, with orthogonality values scaled by a factor of 10 for clarity. The horizontal and vertical axes represent the selected editing samples.
Refer to caption: /html/2410.11469/assets/x4.png

### 5.3 Further Analysis

How does O-Edit alter the direction of updates for each knowledge component? We evaluated the orthogonality among each update matrix, $\Delta W$, by examining the cosine similarity between the corresponding matrices after applying MEMIT, O-Edit, and O-Edit+. To conduct this evaluation, we randomly selected 50 edits and computed the absolute cosine similarity between their corresponding $\Delta W$ matrices. This was achieved by calculating the cosine similarity between the $V$ matrices derived from each $\Delta W$ after performing singular value decomposition. As illustrated in Figure [4](#S5.F4), without any constraints, there is a significant overlap in the update directions, which may cause subsequent edits to influence the directions of prior edits. O-Edit mitigates this overlap by training an appropriate $v_{*}$, while O-Edit+ achieves complete orthogonality between each update direction through post-processing.

How do edits disturb each other? To investigate the extent of interdependencies among knowledge updates during the sequential editing process, we preserved the update matrix $\Delta W_{i}$ for each $i$-th edit. Upon completion of the sequential editing, the model’s cumulative update matrix is computed as $\Delta W_{\text{[total]}}=\sum_{i=1}^{n}\Delta W_{i}$. For the $j$-th edit, we define $\Delta W_{\text{unrelated}}=\Delta W_{\text{[total]}}-\Delta W_{j}$, which excludes the update matrix $\Delta W_{j}$ corresponding to $k_{j}$. According to Hu et al. (), under ideal sequential editing, the knowledge vector $k_{j}$ used during the $j$-th edit should not activate any unrelated $\Delta W_{\not=j}$ (i.e., any update matrix other than $\Delta W_{j}$), meaning $\|\Delta W_{\text{unrelated}}\cdot k_{j}\|_{2}=0$. We calculate the activation score (AS) for each edit as $\|\Delta W_{\text{unrelated}}\cdot k_{j}\|_{2}$.

Figure: Figure 5: The activation score caused by unrelated parameters. X-axis: Number of edits.
Refer to caption: /html/2410.11469/assets/x5.png

As illustrated in Figure [5](#S5.F5), after 1,500 edits, the original method exhibited high activation scores (AS), with some values reaching approximately 2.5 and others exceeding 10. This indicates that in the original method, any unrelated $\Delta W_{\not=j}$ (i.e., any update matrix other than $\Delta W_{j}$) could significantly activate $k_{j}$, leading to a substantial deviation from the ideal state $v_{*}$ and resulting in the failure of MEMIT in sequential editing. In contrast, both O-Edit and O-Edit+ consistently achieved activation values below 2.5 for nearly all edits, with some values approaching zero. In Appendix [C.7](#A3.SS7), we analyze the reasons for this phenomenon from a mathematical derivation perspective, highlighting that the key lies in the orthogonality of the column subspaces of each update matrix.

Can any method of reducing $\Delta W_{\text{[total]}}$ improve the ability of sequential editing? Hu et al. () posits that $\|\Delta W_{\text{[total]}}\|_{2}$ is a key determinant of sequential editing, referred to as “toxicity”. A higher $\|\Delta W_{\text{[total]}}\|_{2}$ imposes greater constraints on sequential editing performance. O-Edit+ effectively reduces $\|\Delta W_{\text{[total]}}\|_{2}$ by diminishing projections in specific subspaces. Consequently, a plausible hypothesis is that any method capable of reducing $\|\Delta W_{\text{[total]}}\|_{2}$ could potentially enhance sequential editing performance. To evaluate this hypothesis, we compare O-Edit+ with four methods on COUNTERFACT: ➊ reducing the number of training steps to decrease $\|v_{*}-Wk_{*}\|_{2}$, thereby reducing $\|\Delta W_{\text{[total]}}\|_{2}$ with each edit; ➋ randomly deleting some values in the update parameters, setting them to zero; ➌ randomly selecting a set of orthogonal subspaces and removing the projection of $\Delta W_{i}$ onto them; ➍ multiplying the $\Delta W$ obtained by the original method by a coefficient $\eta$ that is less than 1, updating the matrix as $\Delta W=\eta\cdot\Delta W$. We adjust the hyperparameters to ensure that the $\|\Delta W_{\text{[total]}}\|_{2}$ generated by these methods approximates that of O-Edit+. As shown in Table [3](#S5.T3) and Appendix Table [9](#A3.T9), although these five methods yield a similar $\|\Delta W_{\text{[total]}}\|_{2}$, the first four fail to achieve effective sequential editing. This indicates that while reducing $\|\Delta W_{\text{[total]}}\|_{2}$ is a necessary but not sufficient condition for successful sequential editing, choosing the correct projection space to ensure minimal impact between knowledge is the key to the success of ours.

**Table 2: Comparison of different methods under two scenarios, $T$ = {500, 1500}**
| Mistral-7B | $T=500$ |  |  |  |  |
| --- | --- | --- | --- | --- | --- |
| Rel. | Gen. | Loc. | Avg. | $\|\cdot\|_{2}$ |  |
| MEMIT | 0.50 | 0.35 | 0.10 | 0.32 | 168 |
| Method ➊ | 0.41 | 0.22 | 0.44 | 0.36 | 106 |
| Method ➋ | 0.57 | 0.34 | 0.31 | 0.40 | 102 |
| Method ➌ | 0.60 | 0.37 | 0.30 | 0.42 | 109 |
| Method ➍ | 0.57 | 0.33 | 0.31 | 0.40 | 102 |
| O-Edit+ | 0.81 | 0.55 | 0.60 | 0.65 | 109 |
| Mistral-7B | $T=1500$ |  |  |  |  |
| Rel. | Gen. | Loc. | Avg. | $\|\cdot\|_{2}$ |  |
| MEMIT | 0.19 | 0.06 | 0.05 | 0.10 | 681 |
| Method ➊ | 0.20 | 0.08 | 0.09 | 0.12 | 355 |
| Method ➋ | 0.22 | 0.13 | 0.04 | 0.13 | 367 |
| Method ➌ | 0.18 | 0.10 | 0.06 | 0.11 | 366 |
| Method ➍ | 0.21 | 0.11 | 0.05 | 0.12 | 359 |
| O-Edit+ | 0.61 | 0.42 | 0.53 | 0.52 | 361 |

How does the degree of orthogonality between knowledge affect the effectiveness of sequential editing? To explore the impact of orthogonality on editing effectiveness, we modified the hyperparameters $\lambda_{1}$ and $\lambda_{2}\in\{0,1,10,20,50\}$ in O-Edit to adjust the degree of orthogonality between knowledge. As shown in Table [3](#S5.T3), increasing $\lambda_{1}$ and $\lambda_{2}$ improves the orthogonality between knowledge (see Eqn.[13](#S3.E13)), leading to enhanced editing performance. When $\lambda_{1}$ and $\lambda_{2}$ are set to 0, O-Edit degenerates into MEMIT. Even with $\lambda_{1}=1$, O-Edit outperforms MEMIT across all metrics. This improvement occurs because increased orthogonality ensures that edits are performed in independent subspaces, minimizing interference with previously edited knowledge and reducing catastrophic forgetting. When $\lambda_{1}$ and $\lambda_{2}$ reach 50, performance peaks, demonstrating an improvement of 0.24 in Mistral-7B and 0.31 in Llama3-8B compared to MEMIT. Higher values of $\lambda_{1}$ and $\lambda_{2}$ enhance the independence between editing directions, ensuring that new knowledge edits do not disrupt existing model knowledge. This indicates a positive correlation between orthogonality and editing effectiveness. For a more detailed comparison of hyperparameters in O-Edit and O-Edit+, please refer to Appendix [C.4](#A3.SS4).

## 6 Limitations

While O-Edit and O-Edit+ demonstrate robust sequential editing performance, several limitations persist. Due to computational constraints, we restricted our experiments to Mistral-7B and Llama3-8B, leaving the scalability of our methods on larger models untested. Additionally, constructing orthogonality between edits adds computational overhead, which may prolong editing times. However, O-Edit and O-Edit+ require maintaining only two additional matrices, making them both model-agnostic and compatible with other sequential editing techniques. Furthermore, we did not evaluate O-Edit and O-Edit+ against other editing methods, such as fine-tuning (FT), as these approaches tend to falter after only a few sequential edits, whereas ROME and MEMIT can support more extensive editing sequences. Despite these challenges, we believe our methods hold promising potential, particularly in the early stages of research on sequential model editing.

## 7 Conclusion

In this paper, we present two innovative methods—O-Edit and O-Edit+ that leverage orthogonal subspace editing for sequential knowledge editing in language models. These methods effectively mitigate catastrophic forgetting of both edited and existing knowledge by incrementally applying edits in orthogonal subspaces. Our methods distinguish themselves through their attention to data privacy, efficient parameter utilization, and strong generalization capabilities for downstream tasks. Comprehensive empirical evaluations indicate that O-Edit and O-Edit+ significantly outperform existing methods, establishing them as promising avenues for future advancements in sequential knowledge editing.

## Appendix A Related Work

### A.1 Knowledge Editing

From the perspective of whether model parameters are modified, (Yao et al., ) categorized knowledge editing methods into two major classes: preserving the model’s parameters and modifying the model’s parameters. This paper primarily focuses on the latter. On one hand, meta-learning has been used to predict parameter updates for networks, typically employing a hypernetwork to edit language models. (Cao et al., ) used a bidirectional LSTM to predict weight updates for editing, while (Mitchell et al., ) utilized low-rank decomposition of gradients to fine-tune language models, known as MEND, and (Tan et al., ) extended single-step edits to batch edits using a least squares method based on MEND. On the other hand, (Meng et al., ; Dai et al., ) employed a causal probe to localize knowledge within the intermediate layers of the model, demonstrating that editing in the MLP of the middle layers yields the best results. (Dai et al., ) performed knowledge editing by modifying the activation values of specific neurons. (Meng et al., ) used a constrained least squares method to precisely solve for the parameter updates required for editing and extended this approach to batch editing (Meng et al., ).

### A.2 Sequential Editing

Some studies have extended knowledge editing methods to sequential editing. From the perspective of modifying model parameters, (Ma et al., ) theoretically analyzed that the bottleneck limiting sequential editing in models lies in the condition number of matrices, and they attempted to support sequential editing by controlling the growth of the matrix condition number. (Hu et al., ) attributed the decline in performance during sequential editing to pattern mismatch, where different layers detect different patterns, making a single layer incapable of accommodating all the edited knowledge. Thus, they selected the optimal layer from multiple layers for editing. Additionally, (Hu et al., ) explored the root causes of failures in sequential editing, deriving a closed-form solution from linear associative memory. They posited that lossless sequential editing can only be achieved when the edited knowledge is completely orthogonal. From the perspective of adding additional parameters while freezing model parameters, SERAC (Mitchell et al., ) stores edits in memory. When an input is received, a classifier checks whether it corresponds to any cached edits. If a match is found, a counterfactual model uses the input and relevant edits to predict outputs. GRACE (Hartvigsen et al., ) uses semantic similarity in the model’s latent space by adding an offline key-value adapter at the selected layers, applying edits only to inputs that are similar to the keys cached in the encoding. WISE (Wang et al., ) uses a dual-parameter storage scheme, where the main memory is used for pre-trained knowledge and the side memory is designated for edited knowledge. By incorporating a knowledge sharding mechanism, it allows for editing knowledge in different parameter subspaces and merges them into the shared side memory without causing conflicts. In this paper, we consider the scenario of directly updating model parameters.

### A.3 Continual learning

The orthogonal concept presented in this paper is inspired by continual learning. Existing continual learning methods typically update all tasks within a shared vector space (Ke & Liu, ), which directly affects the model’s hidden layer outputs (Wang et al., ). Some studies (Farajtabar et al., ; Saha et al., ) have proposed a promising approach to address this issue by performing gradient descent optimization in directions orthogonal to the gradient subspaces of past tasks, effectively mitigating catastrophic forgetting. GPM (Saha et al., ) divides the gradient space into two key areas: the “Core Gradient Space” (CGS) and the “Residual Gradient Space” (RGS). By learning in the orthogonal directions of the CGS related to previous task inputs, it ensures minimal interference with past tasks. Based on GPM, TRGP (Lin et al., ) introduces a “trust region” concept to select old tasks relevant to new ones, reusing their frozen weights through scaled weight projections. By optimizing the scaling matrix and updating the model along orthogonal directions to the old tasks’ subspace, TRGP effectively facilitates knowledge transfer without forgetting. O-LoRA (Wang et al., ) suggests that parameter information updated through low rank can be approximately equivalent to gradient information, which expands the application scenarios of continual learning and enables effective learning even in scenarios where gradient information cannot be obtained.

## Appendix B algorithm

### B.1 Orthogonal Gradient Descent for Continual Learning

Consider a continual learning setting where tasks $\{T_{1},T_{2},T_{3},\ldots\}$ are learned sequentially without access to previous task data. Suppose that the model has been trained on $T_{A}$ in the usual way until convergence to a update parameter $w^{*}_{A}$. To mitigate the impact on $T_{A}$ while training on the next task $T_{B}$, Farajtabar et al. () propose to “orthogonalize” it in a way that the new update direction $\tilde{g}$ on $T_{B}$ satisfies:

$$ $\tilde{g}\perp\nabla f(x;w^{*}_{A}),\quad\forall x\in T_{A}.$ (17) $$

One can compute and store $\nabla f(x;w)$ for all $x\in T_{A}$ when training on $T_{A}$ is done. In a continual learning scenario involving multiple tasks, the direction of gradient updates is determined by:

$$ $\tilde{g}=g-\sum_{i=1}^{n_{A}}\operatorname{proj}_{\mathbf{g}_{i}}(g)=g-\sum_{i=1}^{n_{A}}\left\langle g,\mathbf{g}_{i}\right\rangle\mathbf{g}_{i}$ (18) $$

The new direction -$\tilde{g}$ is still a descent direction for $T_{B}$, meaning that there exists $\epsilon>0$ such that for any learning rate $0<\eta<\epsilon$, taking the step -$\eta\tilde{g}$ reduces the loss.

### B.2 Singular Value Decomposition and Rank- r 𝑟 r Approximation

Singular Value Decomposition (SVD) decomposes any matrix $W\in\mathbb{R}^{m\times n}$ into three matrices: $W=U\Sigma V^{T}$, where $U\in\mathbb{R}^{m\times m}$ and $V\in\mathbb{R}^{n\times n}$ are orthogonal matrices, and $\Sigma$ is a diagonal matrix containing the singular values $\sigma_{i}$ of $W$, ordered in descending magnitude. SVD is instrumental in solving the rank-$r$ approximation problem, where the goal is to find a matrix $\tilde{W}$ that minimizes $\|\tilde{W}-W\|_{2}$ subject to $\operatorname{rank}(\tilde{W})\leq r$. According to the Eckart–Young–Mirsky theorem (Eckart & Young, ), the optimal rank-$r$ approximation $\tilde{W}$ is given by $\tilde{W}=\sum_{i=1}^{r}\sigma_{i}u_{i}v_{i}^{T}$, obtained by truncating the SVD of $W$ to retain the top $r$ singular values and their corresponding singular vectors, where $r\leq\min\{m,n\}$.

### B.3 MEMIT

In this paper, we consider the scenario of editing one piece of knowledge at a time. Similar to ROME, MEMIT views $W^{l}_{\text{proj}}$ as a linear key-value memory for a set of vector keys $K=\{k_{1},k_{2},\ldots\}$ and corresponding vector values $V=\{v_{1},v_{2},\ldots\}$ by solving $WK=V$. It attempts to insert a new key-value pair $(k_{*},v_{*})$ into the model by solving the following constrained least squares problem:

$$ $\widetilde{W}=\underset{\hat{W}}{\operatorname{argmin}}\left(\left\|\hat{W}K-V\right\|_{2}+\left\|\hat{W}k_{*}-v_{*}\right\|_{2}\right).$ (19) $$

MEMIT solves Eqn. [19](#A2.E19) by applying the normal equation, which is expressed in block form:

$$ $\widetilde{W}\begin{bmatrix}K&k_{*}\end{bmatrix}\begin{bmatrix}K^{T}\\ k_{*}^{T}\end{bmatrix}=\begin{bmatrix}V&v_{*}\end{bmatrix}\begin{bmatrix}K^{T}\\ k_{*}^{T}\end{bmatrix},$ (10) $$

which expands to:

$$ $(W+\Delta)\left(KK^{T}+k_{*}k_{*}^{T}\right)=VK^{T}+v_{*}k_{*}^{T},$ (11) $$

$$ $WKK^{T}+Wk_{*}k_{*}^{T}+\Delta K^{T}K+\Delta k_{*}^{T}k_{*}=VK^{T}+v_{*}k_{*}^{T}.$ (12) $$

Under the condition $WK=V$, we can simplify to:

$$ $\Delta(KK^{T}+k_{*}k_{*}^{T})=v_{*}k_{*}^{T}-Wk_{*}k_{*}^{T},$ (20) $$

yielding:

$$ $\Delta=(v_{*}-Wk_{*})k_{*}^{T}(KK^{T}+k_{*}k_{*}^{T})^{-1}.$ (21) $$

Thus, the final update rule is:

$$ $\widetilde{W}=W+(v_{*}-Wk_{*})k_{*}^{T}(KK^{T}+k_{*}k_{*}^{T})^{-1}.$ (22) $$

Here, $(v_{*}-Wk_{*})\in\mathbb{R}^{d}$ is a column vector, and $k_{*}^{T}(KK^{T}+k_{*}k_{*}^{T})^{-1}\in\mathbb{R}^{d_{m}}$ is a row vector. By adjusting the hyperparameter $\lambda$, MEMIT balances the preservation of existing knowledge and the incorporation of new edits. Consequently, the updated equation is expressed as follows:

$$ $\widetilde{W}=W+(v_{*}-Wk_{*})k_{*}^{T}(\lambda KK^{T}+k_{*}k_{*}^{T})^{-1}.$ (23) $$

Like ROME, $KK^{T}$ is pre-cached by estimating the uncentered covariance of $k$ from a sample of Wikipedia text. The rank of the update matrix $\Delta W=(v_{*}-Wk_{*})k_{*}^{T}(\lambda KK^{T}+k_{*}k_{*}^{T})^{-1}$ obtained through ROME and MEMIT is 1.

In fact, MEMIT is a scalable extension of ROME. By increasing $\lambda$, MEMIT effectively enhances the retention of existing knowledge while also allowing for new updates. However, the restrictive conditions imposed by ROME, which require $k_{*}\widetilde{W}\equiv v_{*}$ as seen in Eqn. [3](#S3.E3), can be overly stringent and may lead to greater disruption of existing knowledge within the model.

### B.4 O-Edit and O -Edit+

We will provide a detailed explanation of the calculation formula for O-Edit. To explain how to compute Eqn. [10](#S3.E10), we first analyze the properties of the update matrices for each piece of knowledge. Based on the matrix property $\text{rank}(AB)\leq\min(\text{rank}(A),\text{rank}(B))$, the ranks of $\Lambda(C^{-1}k_{*})^{T}$ in Eqn. [3](#S3.E3) and $Rk_{*}^{T}(C+k_{*}k_{*}^{T})^{-1}$ in Eqn. [6](#S3.E6) are both 1. In the $i$-th edit, the rank of the cached $\Delta W_{\text{[total]}}\in\mathbb{R}^{d\times d_{m}}$ is at most $i$, with equality when each $k_{*}$ is linearly independent. After several edits, $\text{rank}(\Delta W_{\text{[total]}})=1\times\text{iteration}$, but as updates increase, $\text{rank}(\Delta W_{\text{[total]}})$ may fall below the iteration count. Therefore, $r$ is always equal to $\text{rank}(\Delta W_{\text{[total]}})$, and $\Delta W_{r}$ is $\Delta W_{\text{[total]}}$ itself.

During the computation process, we observe that $\Delta W^{T}_{r}=U_{\Delta W_{r}}\Sigma_{\Delta W_{r}}V^{T}_{\Delta W_{r}}$, where $U_{\Delta W_{r}}\in\mathbb{R}^{d_{m}\times r}$, $V_{\Delta W_{r}}\in\mathbb{R}^{d\times r}$, and $\Sigma_{\Delta W_{r}}$ is a diagonal matrix. Eqn. [7](#S3.E7) can be rewritten as:

$$ $U_{\Delta W_{r}}\Sigma_{\Delta W_{r}}V^{T}_{\Delta W_{r}}\cdot\Delta W_{[2]}=\mathbf{0}.$ (24) $$

We only need to ensure that $v_{*}-Wk_{*}$ is orthogonal to $V_{r}$. Therefore, Eqn. [10](#S3.E10) can be rewritten as:

$$ $\displaystyle f_{1}=\frac{1}{r}\sum_{i=0}^{r}\text{sim}(V_{\Delta W_{r}}[i],(v_{*}-Wk_{*})).$ (25) $$

The key reason for using cosine similarity instead of $V^{T}_{\Delta W_{r}}\cdot(v_{*}-Wk_{*})$ is that the latter may lead to trivial solutions, i.e., $v_{*}-Wk_{*}=\mathbf{0}$, while cosine similarity considers angular information. In fact, merely reducing the norm of $v_{*}-Wk_{*}$ does not effectively enhance the effectiveness of sequential editing. The success of O-Edit and O-Edit+ lies in identifying the correct update direction during the sequential editing process. For further details, see Further Analysis [5.3](#S5.SS3).

Furthermore, when calculating $\nabla G$, we utilized a large amount of natural text, resulting in $\nabla G$ being a high-rank matrix, which is distinct from $\Delta W_{\text{[total]}}$. We dynamically adjust $q$ to select the core gradient subspace (CGS) of $\nabla G$, defined as $\nabla G^{T}_{q}=U_{\nabla G_{q}}\Sigma_{\nabla G_{q}}V^{T}_{\nabla G_{q}}$. The purpose of this adjustment is to counteract the cumulative impact of edited knowledge on the implicit knowledge within the model as the number of edits increases. We adjust $q$ to increase linearly with the number of edits. In practice, we compute Eqn. [12](#S3.E12) by removing the projection of $V_{\nabla G_{q}}$ onto $V_{\Delta W_{r}}$:

$$ $V_{\nabla G_{q}}=V_{\nabla G_{q}}-V_{\Delta W_{r}}V^{T}_{\Delta W_{r}}V_{\nabla G_{q}}.$ (26) $$

Finally, we compute Eqn. [14](#S3.E14) as follows:

$$ $\displaystyle f_{2}=\frac{1}{q}\sum_{i=0}^{q}\text{sim}(V_{\nabla G_{q}}[i],(v_{*}-Wk_{*})).$ (27) $$

Next, we will provide a detailed explanation of the calculation formula for O-Edit+. To ensure that the column subspaces of $\Delta W_{r}$ and $\Delta W_{[2]}$ are orthogonal, it is sufficient to ensure that the projection of $\Delta W_{[2]}$ onto the standard orthogonal basis of the column space of $\Delta W_{r}$ is zero. Similar to O-Edit, $\Delta W_{r}$ is $\Delta W_{\text{[total]}}$, and $\nabla G_{q}$ is a high-rank matrix. Eqn. [15](#S4.E15) can be rewritten as:

$$ $\displaystyle\Delta W_{[2]}$ $\displaystyle=\Delta W_{[2]}-V_{\Delta W_{r}}V^{T}_{\Delta W_{r}}\Delta W_{[2]},$ (28) $\displaystyle V_{\nabla G_{q}}$ $\displaystyle=V_{\nabla G_{q}}-V_{\Delta W_{r}}V^{T}_{\Delta W_{r}}V_{\nabla G_{q}},$ $\displaystyle\Delta W_{[2]}$ $\displaystyle=\Delta W_{[2]}-V_{\nabla G_{q}}V^{T}_{\nabla G_{q}}\Delta W_{[2]}.$ $$

O-Edit and O-Edit+ are adaptations of ROME and MEMIT for sequential editing, and all experimental settings are consistent with those of ROME and MEMIT. Readers can refer to Algorithm [1](#alg1) and Algorithm [2](#alg2) for their pseudo-code.

Figure: Algorithm 1 Algorithm for Sequential Editing with O-Edit

Figure: Algorithm 2 Algorithm for Sequential Editing with O-Edit+

## Appendix C Experimental Setup

### C.1 How to choose an appropriate ∇ G q ∇ subscript 𝐺 𝑞 \nabla G_{q}

The core of our method lies in capturing the update direction of implicit knowledge within the model. Theoretically, if we view the model as a knowledge base (Petroni et al., ), the update direction should align with the gradient direction in which the model continues to learn from this knowledge. Thus, selecting the appropriate knowledge base is crucial for determining the model’s update gradient. We explored the following methods:

- •
We selected 100,000 pieces of unrelated knowledge from COUNTERFACT, which are outside the experimental test samples. This set, referred to as “locality_prompt” in Figure [7](#A3.F7), serves as the expected gradient direction.
- •
We utilized the knowledge employed by (Meng et al., ), which successfully identified how knowledge is stored within the model.
- •
For comparison, we randomly generated 100,000 text samples using ASCII codes.
- •
We also used Wikipedia as a knowledge source, as it is commonly chosen for pre-training in large language models (LLMs).

The experimental results are presented in Table [4](#A3.T4). We maintained consistency in the parameters related to $\Delta W_{\text{[total]}}$ across experiments, with the only variable being the source of the $\nabla G$ corpus. Randomly generated text yielded the poorest performance, while the ”locality_prompt” from COUNTERFACT achieved the second-best results, only surpassed by Wikipedia, which produced the best outcomes. These results also serve as reverse validation that the implicit knowledge within the model is embedded in its pre-training data.

**Table 4: Different corpus results for COUNTERFACT. $T$: Num Edits.**
| MEMIT | COUNTERFACT |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| $T=200$ | $T=500$ | $T=1000$ | $T=1500$ |  |  |  |  |  |  |  |  |  |  |  |  |  |
| Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. |  |
| Mistral-7B |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| Corpus➊ | 0.89 | 0.62 | 0.74 | 0.75 | 0.79 | 0.55 | 0.61 | 0.65 | 0.64 | 0.37 | 0.52 | 0.54 | 0.57 | 0.39 | 0.51 | 0.49 |
| Corpus➋ | 0.90 | 0.62 | 0.73 | 0.75 | 0.76 | 0.53 | 0.60 | 0.63 | 0.62 | 0.33 | 0.50 | 0.48 | 0.54 | 0.36 | 0.49 | 0.46 |
| Corpus➌ | 0.86 | 0.60 | 0.73 | 0.73 | 0.74 | 0.51 | 0.56 | 0.60 | 0.59 | 0.32 | 0.44 | 0.45 | 0.57 | 0.33 | 0.46 | 0.45 |
| Corpus➍ | 0.89 | 0.61 | 0.78 | 0.76 | 0.81 | 0.55 | 0.60 | 0.65 | 0.68 | 0.39 | 0.55 | 0.54 | 0.61 | 0.42 | 0.53 | 0.52 |
| Llama3-8B |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| Corpus➊ | 0.88 | 0.47 | 0.65 | 0.67 | 0.85 | 0.48 | 0.36 | 0.56 | 0.79 | 0.47 | 0.29 | 0.52 | 0.77 | 0.46 | 0.26 | 0.49 |
| Corpus➋ | 0.91 | 0.48 | 0.66 | 0.68 | 0.85 | 0.50 | 0.40 | 0.58 | 0.79 | 0.47 | 0.30 | 0.52 | 0.74 | 0.44 | 0.27 | 0.48 |
| Corpus➌ | 0.85 | 0.41 | 0.63 | 0.63 | 0.83 | 0.45 | 0.31 | 0.53 | 0.74 | 0.41 | 0.24 | 0.46 | 0.70 | 0.35 | 0.19 | 0.41 |
| Corpus➍ | 0.88 | 0.53 | 0.76 | 0.72 | 0.84 | 0.51 | 0.45 | 0.60 | 0.81 | 0.50 | 0.31 | 0.54 | 0.79 | 0.44 | 0.28 | 0.50 |

### C.2 Baseline Editing Methods

We selected five popular model editing methods as baselines:

- •
ROME (Meng et al., ) has been previously discussed. In this experiment, we edit the 8th layer, which is regarded as a crucial location for knowledge storage. We utilize second moment statistics $C\propto E[kk^{T}]$ computed from more than 100,000 samples of hidden states $k$ derived from tokens sampled across all Wikipedia text in context.
- •
MEMIT (Meng et al., )—the detailed computation process can be found in Appendix [B.3](#A2.SS3). We set $\lambda=15,000$ to balance the knowledge in the model with the knowledge required for editing. Other settings are consistent with those in ROME.
- •
R-Edit (Gupta et al., ) attributes the suboptimal performance of ROME and MEMIT to the inadequacy of the calculated $k_{*}$ in representing the subject of the queried knowledge. R-Edit enhances the calculation of $k_{*}$ in Eqs. [3](#S3.E3) and [6](#S3.E6) to address this issue.
- •
WilKE (Hu et al., ) argues that different types of knowledge should be distributed across various layers. For each piece of knowledge edited, WilKE first determines the optimal layer for editing and then applies either ROME or MEMIT to perform the edit. Due to the time and computational cost of finding the optimal layer, we restrict the editable layers in this paper to $l=\{5,6,7,8,9,10\}$.
- •
PRUNE (Ma et al., ) suggests that the key factor influencing sequential editing performance is the condition number of the matrix. PRUNE scales the singular values in $\Delta W_{\text{total}}$ that exceed the maximum singular value of the original model, ensuring that no singular value surpasses a specified threshold. We adhere to the experimental setup outlined in Ma et al. () and scale the larger singular values using the following method:
$F(\hat{\sigma}_{i})=\log_{1.2}(\hat{\sigma}_{i})-\log_{1.2}(\max{\{\sigma_{i}\}})+\max{\{\sigma_{i}\}}.$

**Table 5: Different orthogonal method results for COUNTERFACT. $T$: Num Edits.**
| Method | COUNTERFACT |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| $T=200$ | $T=500$ | $T=1000$ | $T=1500$ |  |  |  |  |  |  |  |  |  |  |  |  |  |
| Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. |  |
| Mistral-7B |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| MEMIT | 0.93 | 0.67 | 0.41 | 0.67 | 0.50 | 0.35 | 0.10 | 0.32 | 0.28 | 0.10 | 0.06 | 0.15 | 0.19 | 0.06 | 0.05 | 0.10 |
| ➊Only$\Delta W_{\text{[total]}}$ | 0.91 | 0.54 | 0.77 | 0.74 | 0.79 | 0.53 | 0.55 | 0.62 | 0.61 | 0.37 | 0.51 | 0.50 | 0.55 | 0.37 | 0.46 | 0.46 |
| ➋Only$\nabla G$ | 0.89 | 0.55 | 0.74 | 0.72 | 0.76 | 0.50 | 0.51 | 0.59 | 0.57 | 0.34 | 0.49 | 0.47 | 0.44 | 0.27 | 0.24 | 0.32 |
| ➌Without Eqn.[12](#S3.E12)([26](#A2.E26)) | 0.89 | 0.59 | 0.77 | 0.75 | 0.78 | 0.56 | 0.56 | 0.63 | 0.58 | 0.37 | 0.52 | 0.49 | 0.49 | 0.36 | 0.49 | 0.44 |
| O-Edit+ | 0.89 | 0.61 | 0.78 | 0.76 | 0.81 | 0.55 | 0.60 | 0.65 | 0.68 | 0.39 | 0.55 | 0.54 | 0.61 | 0.42 | 0.53 | 0.52 |
| Llama3-8B |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| MEMIT | 0.85 | 0.51 | 0.22 | 0.52 | 0.50 | 0.35 | 0.10 | 0.32 | 0.28 | 0.10 | 0.05 | 0.14 | 0.18 | 0.06 | 0.05 | 0.10 |
| ➊Only$\Delta W_{\text{[total]}}$ | 0.91 | 0.49 | 0.65 | 0.68 | 0.87 | 0.54 | 0.36 | 0.59 | 0.78 | 0.45 | 0.28 | 0.50 | 0.74 | 0.41 | 0.25 | 0.47 |
| ➋Only$\nabla G$ | 0.87 | 0.49 | 0.62 | 0.66 | 0.77 | 0.41 | 0.32 | 0.50 | 0.64 | 0.32 | 0.28 | 0.41 | 0.55 | 0.28 | 0.22 | 0.35 |
| ➌Without Eqn.[12](#S3.E12)([26](#A2.E26)) | 0.88 | 0.48 | 0.65 | 0.67 | 0.87 | 0.50 | 0.41 | 0.60 | 0.78 | 0.46 | 0.32 | 0.52 | 0.67 | 0.39 | 0.28 | 0.43 |
| O-Edit+ | 0.88 | 0.53 | 0.76 | 0.72 | 0.84 | 0.51 | 0.45 | 0.60 | 0.81 | 0.50 | 0.31 | 0.54 | 0.79 | 0.44 | 0.28 | 0.50 |

### C.3 Experiments Compute Resources time and hyperparameters

We used NVIDIA A100 40GB GPUs for the experiments. For Mistral-7B and LLaMA3-8B, ROME and MEMIT occupy about 35GB of memory and take about 2.5 hours to run 1500 edits. For O-Edit, running 1500 edits requires about 6 hours, while O-Edit+ takes about 5 hours.

For all experimental settings of O-Edit, we set $\lambda_{1}$ and $\lambda_{2}=50$. For O-Edit+, we set $\lambda_{3}=2$ for Mistral-7B and $\lambda_{3}=1$ for LLaMA-8B in MEMIT; $\lambda_{3}=2.5$ for both Mistral-7B and LLaMA3-8B in ROME. In the next Section [C.4](#A3.SS4), we conducted detailed ablation experiments and parameter selection experiments to further analyze the impact of hyperparameters on editing performance.

Another potential issue arises when $q$ exceeds the dimensions of the model ($\min(d,d_{m})$)(^5^55The dimension of $W_{proj}$ in both Mistral-7B and LLaMA3-8B is $\mathbb{R}^{4096\times 14336}$.). In this paper, we have considered 1500 edits. When the number of required edits exceeds this amount, $q$ can be constrained by setting it below a certain threshold to ensure the feasibility of performing additional edits. A smaller threshold for $q$ typically results in more effective edits, while a larger threshold tends to preserve the model’s ability to retain unrelated knowledge. However, in general, increasing the number of edits tends to cause greater degradation in the model’s performance.

### C.4 Ablation Experiments

First, we wanted to see if both $\Delta W_{\text{[total]}}$ and $\nabla G$ contributed effectively. We set up three baselines: ➊ using only $\Delta W_{\text{[total]}}$; ➋ using only $\nabla G$; and ➌ using both $\Delta W_{\text{[total]}}$ and $\nabla G$ without orthogonal processing for $\nabla G$ according to Eq.[12](#S3.E12)([26](#A2.E26)). The results are shown in Table [5](#A3.T5). We observed that while using either $\Delta W_{\text{[total]}}$ or $\nabla G$ alone yielded better results than the original method, their performance was still inferior to using both together. The lack of orthogonalization for $\nabla G$ led to knowledge conflicts within the model, resulting in inferior performance compared to O-Edit+.

Next, we compared the effects of different hyperparameter selections on editing performance between O-Edit and O-Edit+, as shown in Tables [6](#A3.T6) and [7](#A3.T7). In O-Edit+, two noteworthy phenomena were observed. First, MEMIT’s $\lambda_{3}$ is smaller than that of ROME due to ROME’s stronger constraints, which can degrade the performance of unrelated knowledge (Loc.) during sequential editing. Consequently, we opted for a larger $\lambda_{3}=2.5$ to mitigate ROME’s influence. Second, while a smaller $\lambda_{3}$ improves performance with MEMIT, it still negatively impacts unrelated knowledge, and a larger $\lambda_{3}$ affects the editing effect (Rel., Gen.). Therefore, selecting an appropriately sized $\lambda_{3}$ is crucial for optimal overall editing performance.

In the O-Edit setting, we compared the editing performance under four different settings. The results showed that stronger constraints led to better outcomes, as $\lambda_{1}$ and $\lambda_{2}$ effectively controlled the correlation between different edits. Larger $\lambda_{1}$ values resulted in smaller correlations between edits, while larger $\lambda_{2}$ values reduced the correlation between edited and implicit knowledge within the model.

**Table 6: Hpyerparameter selection results for O-Edit+. $T$: Num Edits.**
| Method | COUNTERFACT |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| $T=200$ | $T=500$ | $T=1000$ | $T=1500$ |  |  |  |  |  |  |  |  |  |  |  |  |  |
| Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. |  |
| Mistral-7B |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| ROME | 0.72 | 0.53 | 0.31 | 0.52 | 0.30 | 0.18 | 0.14 | 0.21 | 0.28 | 0.10 | 0.06 | 0.15 | 0.27 | 0.13 | 0.05 | 0.13 |
| $\lambda_{3}=1$ | 0.92 | 0.50 | 0.73 | 0.71 | 0.60 | 0.34 | 0.34 | 0.42 | 0.38 | 0.13 | 0.17 | 0.22 | 0.35 | 0.17 | 0.10 | 0.20 |
| $\lambda_{3}=2$ | 0.95 | 0.47 | 0.73 | 0.71 | 0.64 | 0.34 | 0.40 | 0.46 | 0.43 | 0.16 | 0.21 | 0.26 | 0.37 | 0.19 | 0.17 | 0.24 |
| $\lambda_{3}=2.5$ | 0.94 | 0.47 | 0.76 | 0.72 | 0.65 | 0.38 | 0.41 | 0.48 | 0.49 | 0.21 | 0.29 | 0.33 | 0.41 | 0.21 | 0.24 | 0.29 |
| MEMIT | 0.93 | 0.67 | 0.41 | 0.67 | 0.50 | 0.35 | 0.10 | 0.32 | 0.28 | 0.10 | 0.06 | 0.15 | 0.19 | 0.06 | 0.05 | 0.10 |
| $\lambda_{3}=1$ | 0.88 | 0.53 | 0.76 | 0.72 | 0.81 | 0.47 | 0.56 | 0.61 | 0.70 | 0.38 | 0.48 | 0.52 | 0.60 | 0.30 | 0.44 | 0.44 |
| $\lambda_{3}=2.5$ | 0.84 | 0.50 | 0.84 | 0.73 | 0.77 | 0.40 | 0.62 | 0.59 | 0.62 | 0.31 | 0.61 | 0.51 | 0.55 | 0.23 | 0.56 | 0.44 |
| $\lambda_{3}=2$ | 0.89 | 0.61 | 0.78 | 0.76 | 0.81 | 0.55 | 0.60 | 0.65 | 0.68 | 0.39 | 0.55 | 0.54 | 0.61 | 0.42 | 0.53 | 0.52 |
| Llama3-8B |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| ROME | 0.75 | 0.48 | 0.14 | 0.46 | 0.69 | 0.45 | 0.05 | 0.40 | 0.75 | 0.46 | 0.02 | 0.41 | 0.47 | 0.28 | 0.02 | 0.31 |
| $\lambda_{3}=1$ | 0.88 | 0.47 | 0.30 | 0.55 | 0.84 | 0.47 | 0.10 | 0.47 | 0.78 | 0.48 | 0.07 | 0.44 | 0.76 | 0.34 | 0.07 | 0.39 |
| $\lambda_{3}=2$ | 0.85 | 0.50 | 0.38 | 0.58 | 0.80 | 0.51 | 0.13 | 0.48 | 0.87 | 0.46 | 0.09 | 0.47 | 0.84 | 0.39 | 0.09 | 0.44 |
| $\lambda_{3}=2.5$ | 0.86 | 0.61 | 0.37 | 0.61 | 0.81 | 0.52 | 0.24 | 0.52 | 0.86 | 0.49 | 0.19 | 0.51 | 0.87 | 0.50 | 0.13 | 0.50 |
| MEMIT | 0.85 | 0.51 | 0.22 | 0.52 | 0.50 | 0.35 | 0.10 | 0.32 | 0.28 | 0.10 | 0.05 | 0.14 | 0.18 | 0.06 | 0.05 | 0.10 |
| $\lambda_{3}=0.5$ | 0.88 | 0.47 | 0.61 | 0.65 | 0.84 | 0.47 | 0.38 | 0.56 | 0.78 | 0.48 | 0.30 | 0.52 | 0.76 | 0.46 | 0.25 | 0.49 |
| $\lambda_{3}=2$ | 0.86 | 0.49 | 0.66 | 0.67 | 0.84 | 0.52 | 0.42 | 0.59 | 0.78 | 0.46 | 0.33 | 0.52 | 0.73 | 0.43 | 0.30 | 0.49 |
| $\lambda_{3}=1$ | 0.88 | 0.53 | 0.76 | 0.72 | 0.84 | 0.51 | 0.45 | 0.60 | 0.81 | 0.50 | 0.31 | 0.54 | 0.79 | 0.44 | 0.28 | 0.50 |

### C.5 Editing Datasets

- •
ZsRE question answering task (Levy et al., ) was first used for factual knowledge evaluation by (Cao et al., ), later being extended and adopted by (Mitchell et al., ). We conduct the experiment using the version provided by (Yao et al., ) in EasyEdit(^6^66[https://github.com/zjunlp/EasyEdit](https://github.com/zjunlp/EasyEdit)). Figure [6](#A3.F6) shows examples from ZsRE.
- •
COUNTERFACT is designed to enable distinction between superficial changes in model word choices from specific and generalized changes in underlying factual knowledge. Figure [7](#A3.F7) shows examples from COUNTERFACT.

**Table 7: Hpyerparameter selection results for O-Edit. $T$: Num Edits.**
| Method | COUNTERFACT |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| $T=200$ | $T=500$ | $T=1000$ | $T=1500$ |  |  |  |  |  |  |  |  |  |  |  |  |  |
| Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. |  |
| Mistral-7B |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| MEMIT | 0.93 | 0.67 | 0.41 | 0.67 | 0.50 | 0.35 | 0.10 | 0.32 | 0.28 | 0.10 | 0.06 | 0.15 | 0.19 | 0.06 | 0.05 | 0.10 |
| $\lambda_{1},\lambda_{2}=1$ | 0.95 | 0.66 | 0.52 | 0.68 | 0.74 | 0.36 | 0.29 | 0.46 | 0.40 | 0.24 | 0.11 | 0.25 | 0.39 | 0.19 | 0.08 | 0.22 |
| $\lambda_{1},\lambda_{2}=10$ | 0.93 | 0.62 | 0.54 | 0.70 | 0.89 | 0.50 | 0.35 | 0.58 | 0.54 | 0.26 | 0.18 | 0.31 | 0.45 | 0.22 | 0.10 | 0.26 |
| $\lambda_{1},\lambda_{2}=20$ | 0.93 | 0.53 | 0.62 | 0.69 | 0.87 | 0.52 | 0.36 | 0.58 | 0.64 | 0.39 | 0.24 | 0.42 | 0.47 | 0.26 | 0.13 | 0.29 |
| $\lambda_{1},\lambda_{2}=50$ | 0.93 | 0.55 | 0.65 | 0.71 | 0.86 | 0.53 | 0.45 | 0.61 | 0.72 | 0.47 | 0.34 | 0.51 | 0.51 | 0.33 | 0.18 | 0.34 |
| Llama3-8B |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| MEMIT | 0.85 | 0.51 | 0.22 | 0.52 | 0.50 | 0.35 | 0.10 | 0.32 | 0.28 | 0.10 | 0.05 | 0.14 | 0.18 | 0.06 | 0.05 | 0.10 |
| $\lambda_{1},\lambda_{2}=1$ | 0.96 | 0.52 | 0.43 | 0.63 | 0.83 | 0.59 | 0.16 | 0.52 | 0.62 | 0.49 | 0.08 | 0.40 | 0.35 | 0.27 | 0.08 | 0.23 |
| $\lambda_{1},\lambda_{2}=10$ | 0.97 | 0.47 | 0.53 | 0.65 | 0.90 | 0.55 | 0.35 | 0.60 | 0.72 | 0.51 | 0.18 | 0.47 | 0.45 | 0.33 | 0.10 | 0.29 |
| $\lambda_{1},\lambda_{2}=20$ | 0.96 | 0.42 | 0.57 | 0.65 | 0.90 | 0.54 | 0.41 | 0.61 | 0.75 | 0.52 | 0.22 | 0.49 | 0.45 | 0.35 | 0.15 | 0.31 |
| $\lambda_{1},\lambda_{2}=50$ | 0.93 | 0.55 | 0.64 | 0.71 | 0.86 | 0.53 | 0.44 | 0.61 | 0.72 | 0.47 | 0.33 | 0.51 | 0.55 | 0.40 | 0.27 | 0.41 |

Figure: Figure 6: Sample of ZsRE Dataset
Refer to caption: /html/2410.11469/assets/x6.png

Figure: Figure 7: Sample of COUNTERFACT Dataset
Refer to caption: /html/2410.11469/assets/x7.png

### C.6 DOWNSTREAM TASKS SETTINGS

To explore the side effects of sequential model editing on the general abilities of LLMs, four
representative tasks with corresponding datasets were adopted for assessment, including: Commonsense Reasoning on the SIQA (Sap et al., ), which is a benchmark for testing social commonsense intelligence. Content Analysis on the LAMBADA (Paperno et al., ), which is a collection of narrative paragraphs that requires computational models to track information across a broader discourse. Question Answering on the CommonsenseQA (Talmor et al., ), it requires the model be capable of making reasonable inferences under given common sense conditions. MATH on the GSM8K (Cobbe et al., ), a dataset of 8.5K high-quality linguistically diverse grade school math word problems. The prompts for each downstream task were illustrated in Table [8](#A3.T8). We utilized OpenCompass(^7^77[https://github.com/open-compass/opencompass](https://github.com/open-compass/opencompass)) to conduct our evaluations.

**Table 8: The prompts to LLMs for evaluating their zero-shot performance on these general tasks.**
| Task | Prompt |
| --- | --- |
| SIQA | prompt=<br>“{question} A. {A} B. {B} C. {C} Answer:” |
| LAMBADA | prompt=“Please complete the following sentence: {sentence}” |
| CommonsenseQA | prompt=<br>“{question} A. {A} B. {B} C. {C} D. {D} E. {E} Answer:” |
| GSM8K | prompt = “<br>Question: {question}<br>Let’s think step by step.<br>Answer:” |

**Table 9: The results of different method with similar $\|\Delta W_{\text{[total]}}\|_{2}$. $T$: Num Edits.**
| Method | COUNTERFACT |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| $T=200$ | $T=500$ | $T=1000$ | $T=1500$ |  |  |  |  |  |  |  |  |  |  |  |  |  |
| Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. |  |
| Mistral-7B |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| MEMIT | 0.93 | 0.67 | 0.41 | 0.67 | 0.50 | 0.35 | 0.10 | 0.32 | 0.28 | 0.10 | 0.06 | 0.15 | 0.19 | 0.06 | 0.05 | 0.10 |
| Method ➊ | 0.88 | 0.50 | 0.70 | 0.69 | 0.41 | 0.22 | 0.44 | 0.36 | 0.27 | 0.14 | 0.11 | 0.17 | 0.20 | 0.08 | 0.09 | 0.12 |
| Method ➋ | 0.83 | 0.44 | 0.67 | 0.64 | 0.57 | 0.34 | 0.31 | 0.40 | 0.35 | 0.21 | 0.08 | 0.21 | 0.22 | 0.13 | 0.04 | 0.13 |
| Method ➌ | 0.86 | 0.47 | 0.61 | 0.64 | 0.60 | 0.37 | 0.30 | 0.42 | 0.31 | 0.17 | 0.11 | 0.20 | 0.18 | 0.10 | 0.06 | 0.11 |
| Method ➍ | 0.84 | 0.55 | 0.61 | 0.67 | 0.57 | 0.33 | 0.31 | 0.40 | 0.29 | 0.19 | 0.11 | 0.20 | 0.21 | 0.11 | 0.05 | 0.12 |
| +O-Edit+ | 0.89 | 0.61 | 0.78 | 0.76 | 0.81 | 0.55 | 0.60 | 0.65 | 0.68 | 0.39 | 0.55 | 0.54 | 0.61 | 0.42 | 0.53 | 0.52 |
| Llama3-8B |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| MEMIT | 0.85 | 0.51 | 0.22 | 0.52 | 0.50 | 0.35 | 0.10 | 0.32 | 0.28 | 0.10 | 0.05 | 0.14 | 0.18 | 0.06 | 0.05 | 0.10 |
| Method ➊ | 0.74 | 0.33 | 0.58 | 0.32 | 0.32 | 0.11 | 0.51 | 0.31 | 0.24 | 0.08 | 0.34 | 0.22 | 0.13 | 0.07 | 0.18 | 0.12 |
| Method ➋ | 0.83 | 0.50 | 0.24 | 0.52 | 0.72 | 0.37 | 0.08 | 0.39 | 0.44 | 0.19 | 0.08 | 0.23 | 0.40 | 0.13 | 0.08 | 0.20 |
| Method ➌ | 0.82 | 0.49 | 0.28 | 0.53 | 0.72 | 0.35 | 0.08 | 0.38 | 0.46 | 0.21 | 0.03 | 0.23 | 0.32 | 0.17 | 0.02 | 0.17 |
| Method ➍ | 0.77 | 0.41 | 0.44 | 0.54 | 0.69 | 0.32 | 0.06 | 0.36 | 0.47 | 0.23 | 0.31 | 0.33 | 0.37 | 0.15 | 0.09 | 0.21 |
| +O-Edit+ | 0.88 | 0.53 | 0.76 | 0.72 | 0.84 | 0.51 | 0.45 | 0.60 | 0.81 | 0.50 | 0.31 | 0.54 | 0.79 | 0.44 | 0.28 | 0.50 |

Figure: Figure 8: The activation score caused by update parameter itself. X-axis: Num edits.
Refer to caption: /html/2410.11469/assets/x8.png

**Table 10: Main editing results for ZsRE. $T$: Num Edits.**
| Method | COUNTERFACT |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| $T=200$ | $T=500$ | $T=1000$ | $T=1500$ |  |  |  |  |  |  |  |  |  |  |  |  |  |
| Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. | Rel. | Gen. | Loc. | Avg. |  |
| Mistral-7B |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| ROME | 0.82 | 0.41 | 0.38 | 0.53 | 0.32 | 0.22 | 0.08 | 0.20 | 0.30 | 0.17 | 0.06 | 0.18 | 0.31 | 0.15 | 0.06 | 0.17 |
| +R-Edit | 0.95 | 0.49 | 0.47 | 0.64 | 0.27 | 0.18 | 0.08 | 0.17 | 0.31 | 0.13 | 0.05 | 0.16 | 0.31 | 0.15 | 0.06 | 0.17 |
| +WilKE | 0.88 | 0.44 | 0.43 | 0.58 | 0.41 | 0.27 | 0.10 | 0.26 | 0.27 | 0.17 | 0.06 | 0.17 | 0.29 | 0.19 | 0.05 | 0.17 |
| +PRUNE | 0.92 | 0.30 | 0.82 | 0.68 | 0.77 | 0.32 | 0.53 | 0.54 | 0.36 | 0.19 | 0.34 | 0.30 | 0.33 | 0.21 | 0.27 | 0.27 |
| +O-Edit | 0.99 | 0.42 | 0.73 | 0.71 | 0.77 | 0.41 | 0.51 | 0.49 | 0.45 | 0.18 | 0.29 | 0.31 | 0.35 | 0.20 | 0.20 | 0.25 |
| +O-Edit+ | 0.99 | 0.46 | 0.75 | 0.73 | 0.80 | 0.45 | 0.51 | 0.60 | 0.68 | 0.42 | 0.32 | 0.47 | 0.43 | 0.16 | 0.25 | 0.28 |
| MEMIT | 0.95 | 0.50 | 0.38 | 0.61 | 0.52 | 0.37 | 0.14 | 0.34 | 0.31 | 0.20 | 0.06 | 0.19 | 0.24 | 0.10 | 0.06 | 0.13 |
| +R-Edit | 0.96 | 0.49 | 0.41 | 0.62 | 0.40 | 0.19 | 0.40 | 0.44 | 0.32 | 0.22 | 0.06 | 0.20 | 0.26 | 0.16 | 0.07 | 0.16 |
| +WilKE | 0.99 | 0.50 | 0.47 | 0.65 | 0.75 | 0.47 | 0.23 | 0.48 | 0.25 | 0.20 | 0.06 | 0.17 | 0.28 | 0.15 | 0.04 | 0.16 |
| +PRUNE | 0.83 | 0.53 | 0.47 | 0.61 | 0.76 | 0.52 | 0.29 | 0.52 | 0.65 | 0.45 | 0.22 | 0.44 | 0.43 | 0.27 | 0.12 | 0.27 |
| +O-Edit | 0.97 | 0.40 | 0.65 | 0.67 | 0.88 | 0.42 | 0.43 | 0.57 | 0.76 | 0.41 | 0.39 | 0.52 | 0.61 | 0.33 | 0.18 | 0.37 |
| +O-Edit+ | 0.94 | 0.33 | 0.80 | 0.69 | 0.82 | 0.33 | 0.60 | 0.58 | 0.69 | 0.31 | 0.54 | 0.51 | 0.60 | 0.26 | 0.51 | 0.43 |
| Llama3-8B |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| ROME | 0.84 | 0.63 | 0.23 | 0.56 | 0.69 | 0.62 | 0.03 | 0.44 | 0.73 | 0.60 | 0.03 | 0.45 | 0.74 | 0.63 | 0.02 | 0.46 |
| +R-Edit | 0.86 | 0.51 | 0.38 | 0.58 | 0.62 | 0.57 | 0.10 | 0.43 | 0.56 | 0.47 | 0.01 | 0.35 | 0.56 | 0.47 | 0.02 | 0.35 |
| +WilKE | 0.75 | 0.37 | 0.28 | 0.47 | 0.50 | 0.38 | 0.05 | 0.31 | 0.60 | 0.50 | 0.02 | 0.37 | 0.66 | 0.55 | 0.01 | 0.40 |
| +PRUNE | 0.90 | 0.57 | 0.33 | 0.60 | 0.77 | 0.50 | 0.24 | 0.50 | 0.83 | 0.41 | 0.21 | 0.48 | 0.79 | 0.36 | 0.18 | 0.44 |
| +O-Edit | 0.94 | 0.66 | 0.51 | 0.70 | 0.77 | 0.51 | 0.22 | 0.50 | 0.78 | 0.47 | 0.16 | 0.47 | 0.77 | 0.48 | 0.14 | 0.46 |
| +O-Edit+ | 0.91 | 0.47 | 0.55 | 0.52 | 0.82 | 0.46 | 0.27 | 0.52 | 0.84 | 0.49 | 0.25 | 0.53 | 0.82 | 0.42 | 0.24 | 0.49 |
| MEMIT | 0.93 | 0.63 | 0.30 | 0.62 | 0.75 | 0.65 | 0.03 | 0.48 | 0.53 | 0.40 | 0.04 | 0.32 | 0.33 | 0.23 | 0.04 | 0.20 |
| +R-Edit | 0.94 | 0.62 | 0.25 | 0.60 | 0.82 | 0.69 | 0.10 | 0.53 | 0.65 | 0.55 | 0.06 | 0.42 | 0.52 | 0.41 | 0.03 | 0.32 |
| + WilKE | 0.98 | 0.42 | 0.70 | 0.70 | 0.78 | 0.65 | 0.10 | 0.51 | 0.61 | 0.50 | 0.07 | 0.40 | 0.52 | 0.42 | 0.05 | 0.33 |
| +PRUNE | 0.97 | 0.56 | 0.50 | 0.67 | 0.87 | 0.60 | 0.43 | 0.63 | 0.56 | 0.34 | 0.40 | 0.43 | 0.46 | 0.30 | 0.29 | 0.35 |
| +O-Edit | 0.96 | 0.42 | 0.52 | 0.63 | 0.90 | 0.49 | 0.41 | 0.60 | 0.77 | 0.51 | 0.32 | 0.53 | 0.55 | 0.40 | 0.27 | 0.40 |
| +O-Edit+ | 0.97 | 0.40 | 0.59 | 0.65 | 0.85 | 0.37 | 0.46 | 0.56 | 0.73 | 0.32 | 0.38 | 0.48 | 0.65 | 0.29 | 0.36 | 0.43 |

### C.7 Further experiment and discussion

In this section, we first experiment with the interaction between the $j$-th $k_{j}$ and $\Delta W_{j}$. Then, we analyze the reasons for the smaller value of $\|\Delta W_{\text{unrelated}}\cdot k_{j}\|_{2}$ discussed in Section [5.3](#S5.SS3) regarding O-Edit and O-Edit+. We then compare the similarities and differences between our method and that of (Hu et al., ).

Activation on $\Delta W_{\text{own}}$

In contrast to the second paragraph of Section [5.3](#S5.SS3), we aim to further understand the interaction between the $j$-th $k_{j}$ and $\Delta W_{j}$. We calculate the activation score (AS) for each edit as $\|\Delta W_{j}\cdot k_{j}\|_{2}$ ($\|\Delta W_{\text{own}}\cdot k_{j}\|_{2}$), as illustrated in Figure [8](#A3.F8). After 1500 edits, the activation values in MEMIT gradually increase with the number of edits due to the significant activation value $\|\Delta W_{<j}\cdot k_{j}\|_{2}$ ($\|\Delta W_{\text{unrelated}}\cdot k_{j}\|_{2}$). This phenomenon occurs because completing an edit requires a larger activation value to counteract the influence of previous edits, resulting in a vicious cycle and ultimately poor sequential editing performance. In contrast, the activation values for $\|\Delta W_{<j}\cdot k_{j}\|_{2}$ ($\|\Delta W_{\text{unrelated}}\cdot k_{j}\|_{2}$) in O-Edit and O-Edit+ remain consistently low, indicating that a large activation value for $\|\Delta W_{\text{own}}\cdot k_{j}\|_{2}$ is not necessary to complete a new edit. Consequently, although the activation values are small, O-Edit and O-Edit+ allow for a greater number of effective edits.

Theoretical analysis

Considering MEMIT, we derive from the equations $\Delta W_{\text{[total]}}=\sum_{i=1}^{n}\Delta W_{i}$ and $\Delta W_{\text{unrelated}}=\Delta W_{\text{[total]}}-\Delta W_{j}$ that:

$$ $\displaystyle\|\Delta W_{\text{unrelated}}$ $\displaystyle\cdot k_{j}\|_{2}=\|(\Delta W_{\text{[total]}}-\Delta W_{j})\cdot k_{j}\|_{2}$ (29) $\displaystyle=\left\|\sum_{\begin{subarray}{c}i=1,i\neq j\end{subarray}}^{n}\Delta W_{i}\cdot k_{j}\right\|_{2}$ $\displaystyle=\left\|\sum_{\begin{subarray}{c}i=1;i\neq j\end{subarray}}^{n}R_{i}k_{*;i}^{T}(\lambda KK^{T}+k_{*;i}k_{*;i}^{T})^{-1}\cdot k_{j}\right\|_{2}$ $\displaystyle=\sum_{\begin{subarray}{c}i=1;i\neq j\end{subarray}}^{n}\left(R_{i}k_{*;i}^{T}(\lambda KK^{T}+k_{*;i}k_{*;i}^{T})^{-1}k_{j}\right)^{T}\sum_{\begin{subarray}{c}i=1;i\neq j\end{subarray}}^{n}R_{i}k_{*;i}^{T}(\lambda KK^{T}+k_{*;i}k_{*;i}^{T})^{-1}k_{j}$ $\displaystyle=\sum_{\begin{subarray}{c}i=1;i\neq j\end{subarray}}^{n}k^{T}_{j}\left((\lambda KK^{T}+k_{*;i}k_{*;i}^{T})^{-1}\right)^{T}k_{*;i}R^{T}_{i}\sum_{\begin{subarray}{c}i=1;i\neq j\end{subarray}}^{n}R_{i}k_{*;i}^{T}(KK^{T}+k_{*;i}k_{*;i}^{T})^{-1}k_{j}$ $$

Since $R$ is a column vector, $R^{T}$ is a row vector. For any $R_{n}$ and $R_{m}$ where $n\neq m$, the updates in O-Edit and O-Edit aim to ensure that each update matrix $\Delta W$ is orthogonal in the column space, leading to $R^{T}_{n}\cdot R_{m}\rightarrow 0$. Consequently, the value of Eqn. [29](#A3.E29) is smaller than that of MEMIT.

Differences and Similarities with Hu et al. ()

From the perspective of activating $\|\Delta W_{\text{unrelated}}\cdot k_{j}\|_{2}$, (Hu et al., ) emphasizes the reduction of this metric’s activation value through orthogonal row space. They aim to achieve smaller activation values using the expression $\sum_{\begin{subarray}{c}i=1;i\neq j\end{subarray}}^{n}k_{*;i}^{T}(\lambda KK^{T}+k_{*;i}k_{*;i}^{T})^{-1}k_{j}\rightarrow 0$. However, since the variables $K$ and $k_{*}$ are predetermined, their orthogonality cannot be optimized through training methods. To address this, they suggest selecting bottom layers with lower row orthogonality. Yet, this method undermines the extensibility of editing techniques, as knowledge is not solely stored in the lower layers of the model (Li et al., ; Meng et al., ; Geva et al., ; ).

In contrast, O-Edit and O-Edit+ tackle this issue by focusing on orthogonal column space, providing a practical algorithm that supports multiple consecutive edits. These methods can achieve column space orthogonality between update matrices at any layer, effectively reducing $\|\Delta W_{\text{unrelated}}\cdot k_{j}\|_{2}$ and facilitating expansion to multi-layer editing.

## Peer Reviews

confidence: 3
contribution: 2
initial_rating: 5
presentation: 3
questions: Have you explored the influences of context lengths on knowledge editing?
soundness: 3
strengths: 1. The results look excellent compared to previous approaches.
2. The paper is well-written and easy to follow.
3. The analysis is comprehensive, which helps to understand the key insights of the proposed method.
summary: This paper introduces O-Edit and O-Edit+, two methods for sequential knowledge editing in large language models (LLMs) that address the challenge of catastrophic forgetting during multiple edits. The key idea lies in performing edits in orthogonal subspaces, ensuring that new knowledge updates minimally interfere with both previously edited knowledge and the model's implicit knowledge. The methods work by projecting update directions into orthogonal subspaces and using post-processing techniques to maintain complete orthogonality between different knowledge updates. Through extensive experiments on Mistral-7B and Llama3-8B models using the COUNTERFACT and ZsRE datasets, the authors demonstrate that their approaches significantly outperform existing methods like ROME and MEMIT, especially when handling large numbers of sequential edits (up to 1,500). The methods also better preserve model performance on downstream tasks while requiring minimal additional parameters. The paper provides theoretical and experimental evidence showing that strong orthogonality between update matrices is crucial for successful sequential editing, offering a promising direction for future research in this area.
weaknesses: 1. The method is only evaluated on two datasets. It would be interesting to see results on more scenarios where knowledge editing is important.
2. Although the idea of orthogonal subspace editing looks interesting, I am wondering is it possible to ensure the orthogonality of the direction of each knowledge update when the editing number scales to the millions level? In updating a pre-training LLM, I think it is meaningful to investigate knowledge editing where the training corpus is so large that the number of edits is hard to count.

---

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: **Main Questions**
* *Q1*: There is a research [1] indicating that existing editing methods are not suitable for multi-hop editing. This could be due to conflicts between new and old knowledge. So, I have the following question: can O-Edit and O-Edit+ in this article be applied to multi-hop editing tasks with orthogonal subspace?
* *Q2*: I want to delve deeper into the issue of forgetting previous edited knowledge in O-Edit and O-Edit+. I hope the author studies the issue of forgetting previous edited knowledge when editing up to 1500 pieces of knowledge.

**Minor Questions**
* *Q3*: Do O-Edit and O-Edit+ incur additional time costs?


$Ref$:

[1]  Mquake: Assessing knowledge editing in language models via multi-hop questions. (2023)
soundness: 2
strengths: * Logical consistency: based on the assumption that knowledge from orthogonal domains has minimal mutual influence, the author has proposed two methods, O-Edit and O-Edit+, respectively. Furthermore, O-Edit+ ensures a stronger orthogonality between different knowledge. Experimental results also demonstrate that O-Edit+ exhibits superior performance.
* Innovative: the use of orthogonal subspaces to enhance sequence editing is not only novel but also intuitive.
* The ablation study demonstrates that the method proposed in the paper indeed brings performance improvement.
summary: The author finds that the update weights of existing knowledge editing methods are within low-rank subspaces. Based on this, the author proposed two knowledge editing methods (O-Edit & O-Edit+) based on orthogonal subspaces to handle sequence editing. O-Edit and O-Edit+ both aim to ensure that the current updates aligns vertically with the previous updates and the original knowledge. O-Edit introduces new loss function to ensure orthogonality, while O-Edit+ directly guarantees orthogonality between different knowledge. The author demonstrates through experiments that ensuring the orthogonality of knowledge helps improve the performance of existing methods in sequence editing.
weaknesses: **Main Weaknesses**

The effectiveness of O-Edit and O-Edit+ in sequence editing needs further validation.

* *W1*: In Line 51, the author says "there is still no effective solution to these problems". However, some progress [1, 2] has been made in sequence editing. I suggest the author compares these methods to demonstrate the effectiveness of O-Edit and O-Edit+ in sequence editing.
* *W2*: I suggest the author to increase the number of sequence edits T, in order to explore the limits of O-Edit and O-Edit+. GRACE [1] can make the number of editing to 3,000.

**Minor Weaknesses**
* *W3*: Previous work [3] has found that increase in the norm of edited parameters leads to a decrease in model performance and edit failures. Therefore, I suggest conducting additional experiments to demonstrate that O-Edit and O-Edit+ can suppress the increase in the weight norm.

**Missing References**
* A Survey on Knowledge Editing of Neural Networks. (2023)
* Editing Large Language Models: Problems, Methods, and Opportunities. (2023)



$Ref$:

[1] Aging with GRACE: Lifelong Model Editing with Discrete Key-Value Adaptors. (2023)

[2] WISE: Rethinking the Knowledge Memory for Lifelong Model Editing of Large Language Models. (2024)

[3] Model Editing at Scale leads to Gradual and Catastrophic Forgetting. (2024)

---

confidence: 4
contribution: 3
initial_rating: 5
presentation: 2
questions: - I found that as the number of edits increases, the loc metric significantly decreases. Is this because the 7B model has a smaller dimensionality? Could you investigate the relationship between O-Edit's loc and the number of edits with different model sizes?
- Additionally, what are your thoughts on the fact that different vectors are almost orthogonal at higher dimensions? Does this mean that the effect is not significant in larger models?
- For methods like ROME and MEMIT that modify model parameters, they usually have better portability. Could you explore how the portability of your method changes after multiple edits?

In summary, this paper presents a significant advancement in sequential knowledge editing by proposing an orthogonal subspace approach. However, expanding the evaluation to more datasets, detailing computational costs, and exploring broader theoretical insights would enhance the paper’s depth and practical relevance. Additionally, addressing the questions raised could provide valuable insights for future work. Overall, this is a promising direction, deserving further investigation.
soundness: 2
strengths: - This paper proposed an innovative knowledge editing approach to address the challenge of continuous editing.
- Continuous editing of the model is achieved without introducing additional parameters.
- The theoretical derivations are detailed and convincing.
summary: This paper proposes a novel approach to continuous editing by orthogonalizing the direction of each knowledge update, thereby minimizing interference between successive updates and reducing the impact of new updates on unrelated knowledge. This results in performance improvements while effectively maintaining the model’s performance on downstream tasks.
weaknesses: - The primary experiment was conducted using only CounterFact dataset, without performing tests on a broader set of datasets.
- There is no further elaboration on the time and computational costs associated with O-Edit.
- It would be beneficial to analyze and compare the advantages of O-Edit over other knowledge editing methods such as WiSE and GRACE.
- I noticed that generalization is reduced at T=200. I think this is due to your constraints leading to insufficient thoroughness in editing, which increases generation and decreases localization.
- The theoretical validity of the CGS needs further exploration, such as investigating the relationship between CGS and the offset of the model's hidden state.

Meta-review: This paper presents O-Edit and O-Edit+, two methods for sequential knowledge editing in large language models (LLMs) that mitigate catastrophic forgetting during multiple edits.  The approaches involve projecting update directions into orthogonal subspaces and employing post-processing to maintain strict orthogonality between updates. Extensive experiments on Mistral-7B and Llama3-8B models using the COUNTERFACT and ZsRE datasets show that O-Edit and O-Edit+ outperform baselines like ROME and MEMIT, particularly in handling up to 1,500 sequential edits. Theoretical and experimental results underscore the importance of strong orthogonality in update matrices, highlighting a promising avenue for sequential knowledge editing in LLMs.  While the idea of projecting update directions into orthogonal subspaces is promising, achieving fully orthogonal subspaces within large language models remains a significant technical challenge. Given the rapid advancements in this field, the authors are encouraged to revise the paper thoughtfully based on the reviewers' feedback.

Decision: Reject