Locate-then-edit for Multi-hop Factual Recall under Knowledge Editing

## Abstract

Abstract The locate-then-edit paradigm has shown significant promise for knowledge editing (KE) in Large Language Models (LLMs). While previous methods perform well on single-hop fact recall tasks, they consistently struggle with multi-hop factual recall tasks involving newly edited knowledge. In this paper, leveraging tools in mechanistic interpretability, we first identify that in multi-hop tasks, LLMs tend to retrieve implicit subject knowledge from deeper MLP layers, unlike single-hop tasks, which rely on earlier layers. This distinction explains the poor performance of current methods in multi-hop queries, as they primarily focus on editing shallow layers, leaving deeper layers unchanged. To address this, we propose IFMET, a novel locate-then-edit KE approach designed to edit both shallow and deep MLP layers. IFMET employs multi-hop editing prompts and supplementary sets to locate and modify knowledge across different reasoning stages. Experimental results demonstrate that IFMET significantly improves performance on multi-hop factual recall tasks, effectively overcoming the limitations of previous locate-then-edit methods.

## 1 Introduction

Large Language Models (LLMs) like ChatGPT (Achiam et al., ) and LLaMA-2 (Touvron et al., ) have emerged as powerful knowledge bases, demonstrating remarkable abilities in both factual knowledge representation and reasoning over complex queries (Etezadi & Shamsfard, ). However, as the need for updating and correcting knowledge within these models grows, research on knowledge editing (KE) has gained significant attention, focusing on cost-effective ways to modify specific information in LLMs (Mazzia et al., ). KE methods can be broadly classified into two categories based on whether they alter the original model weights: weight-preserving (Zhong et al., ) and weight-modifying approaches (Meng et al., ; ). Weight-preserving methods aim to modify the model’s outputs by integrating external memory or leveraging strategies such as in-context learning without altering the underlying weights (Cheng et al., ; ). In contrast, weight-modifying methods directly change the model’s internal weights to update the stored knowledge. Weight-modifying methods can be further categorized into learning-based and optimization-based methods. Learning-based methods update weights using gradients but face challenges such as overfitting and poor generalization. Optimization-based methods, such as ROME (Meng et al., ) and MEMIT (Meng et al., ), have introduced the “locate-then-edit” paradigm, which first identifies the knowledge storage layers and then adjusts their weights through optimization techniques to achieve the desired knowledge modification.

Compared to weight-preserving methods and learning-based weight-modifying approaches, the locate-then-edit paradigm offers precise editing of the model’s internal knowledge with low computational costs (Zhang et al., ). However, despite the success of locate-then-edit methods in single-hop fact recall tasks (Li et al., ), they share a common limitation Zhong et al. (): The post-edited model struggles with multi-hop factual recall tasks involving the newly edited knowledge (see Table 3 for details). For example, after changing the knowledge “The capital of Spain” from “Madrid” to “Hartford”, the model correctly answers $Q_{1}=\text{``What is the capital city of Spain?''}$. However, when posed with the multi-hop question $Q_{2}=\text{``What is the capital city of the country where Pablo Picasso
holds citizenship?''}$, it still responds with “Madrid” (Figure 1 (b)). This discrepancy raises a natural question: Has the locate-then-edit approach reached its limits for multi-hop factual recall tasks, or does it still hold unexplored potential?

Figure: Figure 1: (a) The existing locate-then-edit KE method updates new fact to the shallow layers of the model using a single-hop edit template. (b) For multi-hop fact recall tasks, especially when the edited fact is in the second or subsequent hops, the hops typically access the deeper layers which outputs the unmodified knowledge. (c) Our method introduces a prefix hop for each single-hop edit, creating a two-hop edit template. We utilize this new template to perform a furtherance edit, targeting the deeper layers for more effective knowledge updating.
Refer to caption: x1.png

To answer this question, we first explored the mechanisms of the pre-edited model when handling single-hop and multi-hop factual recall tasks to gain insights. Using the example mentioned, we attempt to illustrate how the model reasons with the implicit subject “Spain” in $Q_{2}$, compared to the explicit mention in $Q_{1}$. We first use LogitLens (nostalgebraist, ; Dar et al., ) to interpret the information encoded in each layer’s hidden states by projecting them into the output vocabulary space. We find that at the last token position, the information of the implicit subject accumulates before the final answer, which is significantly different from the single-hop scenario. We then conduct causal intervention experiments (Li et al., ) to further confirm the influence of the implicit subject on the final answer.

Based on this, we further explore the mechanism of how the implicit subject influences the prediction of the final answer. By using causal intervention, our results indicate that in the multi-hop scenario, the implicit subject guides the emergence of the final answer by retrieving relevant knowledge from the later MLP layers. This contrasts sharply with the single-hop cases (Meng et al., ; ), where the subject information is used to retrieve information from earlier MLP layers. Based on this difference, we provide an explanation for the unsatisfactory performance of the existing locate-then-edit methods for multi-hop tasks: Previous methods leveraging single-hop prompts for editing are insufficient as they only update the relevant knowledge in the shallow MLP layers but fail to propagate the changes to deeper layers. The model retains some of the old single-hop knowledge that only activated by additional implicit multi-hop fact recall mechanisms.

Based on these observations, we developed an advanced locate-then-edit KE method specifically designed to modify knowledge in both shallow and deep MLP layers, which we named Interpretability-Guided Furtherance Model Editing in a Transformer (IFMET). IFMET introduces a supplementary set for edit instances and generates multi-hop editing prompts, surpassing the limitations of single-hop prompts used in previous locate-then-edit approaches. This supplementary set helps us locate pre-existing knowledge that appears in later hops by leveraging the differences between the reasoning mechanism for single-hop and multi-hop queries. By leveraging each edit instance and its corresponding multi-hop editing prompt, IFMET locates and edits the knowledge stored in both earlier and later MLP layers, effectively addressing cases where the knowledge to be edited appears either in the first or subsequent hops during reasoning, as illustrated in Figure 1.
Our contributions can be summarized as follows:

- •
We first identified key differences in the mechanisms the model uses for reasoning in single-hop versus multi-hop fact recall tasks. In multi-hop scenarios, unlike single-hop cases, the model prioritizes inferring the implicit subject at the last token position, which guides the generation of the final answer.
- •
Next, we pinpointed the components of the implicit subject that influenced the final answer within the later MLP layers. We demonstrated that the absence of edited knowledge of these components significantly impacted the model’s performance.
- •
We propose IFMET, an advanced locate-then-edit KE method specifically designed to modify knowledge in both shallow and deep MLP layers using single and multi-hop edit prompts. Experimental results confirm the effectiveness of our method, showing that it successfully overcomes the limitations of previous locate-then-edit approaches in handling multi-hop factual recall tasks.

Due to the space limit, we refer readers to Appendix A for previous work.

## 2 Preliminaries

Notations. We define the set of knowledge as $\mathcal{K}=\{(s,r,o)\}\subseteq\mathcal{E}\times\mathcal{R}\times\mathcal{E}$, where $\mathcal{E}$ and $\mathcal{R}$ denote the set of entities and relations respectively. Each tuple $(s,r,o)\in\mathcal{K}$ represents that the corresponding entity of subject entity $s$ under relation $r$ is object entity $o$. An editing instance can be described in the form of a triplet: $e=\left(s,r,o\to o^{*}\right)$, where $o^{*}$ denotes the new edited object in place of the original object $o$ related to $s$ through $r$.

Multi-hop factual recall $Q$ requires multi-step reasoning to reach the final answer. Its reasoning process is composed of a chain of knowledge $C=\left(s_{1},r_{1},o_{1}\right)\oplus\dots\oplus\left(s_{n},r_{n},o_{n}\right)$, where $s_{1}$ is the start subject that is explicitly given in the question, $o_{n}$ is the final answer, and $\oplus$ used for chain adjacent reasoning steps which means the subject $s_{i+1}$ is identical to the object $o_{i}$ of preceding reasoning step. In order to better explore how the language model recalls multi-hop questions, we categorize the reasoning step into two types: explicit recall step $(s_{1},r_{1},o_{1})$ and implicit recall steps $\{\left(s_{2},r_{2},o_{2}\right),\dots,\left(s_{n},r_{n},o_{n}\right)\}$. The inference information required by the former subject $s_{1}$ explicitly appears in the prompt, while the subjects of the latter $s_{2}...s_{n}$ need to be inferred to obtain, which are called implicit subjects.

### 2.1 Factual Recall Tasks

Format of Factual Recall Tasks.
Factual recall tasks refer to verifying whether the model $\mathcal{M}$ can correctly provide the final answer to a single-hop question or a multi-hop factual recall $Q$. Based on the two forms of declarative sentences and interrogative sentences, there are two different formats of factual recall tasks: Cloze-Format $Q_{cloze}$ and QA-Format $Q_{qa}$. For instance, given two-hop questions with the knowledge chain like (Paradiso, author, Dante Alighieri) $\oplus$ (Dante Alighieri, country of citizenship, Italy), $Q_{cloze}$ can be “The author of Paradiso is a citizen of”, while $Q_{qa}$ is “What country does the author of Paradiso hold citizenship in?”. If the model’s final answer is the same as the answer to the question, the recall is considered successful, which can be represented as $\mathcal{M}(Q_{cloze})=o_{n}$ or $\mathcal{M}(Q_{qa})=o_{n}$.

Multi-hop Factual Recall under Knowledge Editing. This task assesses whether the post-edited model can effectively leverage the updated knowledge for reasoning in multi-hop fact recall tasks. Given an edit $e=\left(s,r,o\to o^{*}\right)$, the edit prompt $T_{r}(s)$ and a chain of facts $C_{e}$ which includes $\left(s,r,o\right)$ as one of its components. After the post-edited model must leverage the new factual knowledge $\left(s,r,o^{*}\right)$ to answer the multi-hop query. For example, given edit (Paradiso, author, Dante Alighieri $\to$ Mark Twain), the model’s response of “The author of Paradiso is a citizen of” should change from the original answer Italy to the new answer USA.

### 2.2 Mechanistic Interpretation Tools

LogitLens.
LogitLens (nostalgebraist, ) is a framework for interpreting the hidden states (activations) of language models such as GPT (Brown et al., ) by examining the logits (the raw prediction scores before they are transformed into probabilities) and corresponding probabilities. Specifically, for the hidden state $h^{i}_{l}$ at the $l$-th layer and position $i$, the logits $s^{i}_{l}$ and probabilities $p^{i}_{l}$ over the output vocabulary set $V$ are defined as follows:

$$ $\begin{cases}s^{i}_{l}=W_{U}h^{i}_{l}\in\mathbb{R}^{|V|},\\ p^{i}_{l}=\text{softmax}\left(s^{i}_{l}\right)\end{cases}$ $$

where $W_{U}$ denotes the unembedding matrix, which is the same matrix used in the final layer of the model for prediction. LogitLens aids in the decomposition of model predictions, elucidating the contributions from various input components such as MLPs and attention heads. This decomposition can be explored by modifying $h^{i}_{l}$ to the output from MLP $m^{i}_{l}$ or attention heads $a^{i}_{l}$, where $h^{i}_{l}=h^{l-1}_{i}+m^{i}_{l}+a^{i}_{l}$. (^1^11We employ GPT variants such as GPT-J Wang & Komatsuzaki () that position attention in parallel to the MLP, which mathematically equates to models that calculate MLP sequentially after the attention module, as discussed in Brown et al. ().) LogitLens posits that probabilities and logits provide insights into how the model prioritizes different potential tokens, as indicated by the proportion of related information. Specifically, we define $\text{Info}(h^{i}_{l},j)$ as the information related to token $j\in V$ contained in $h^{i}_{l}$, positively correlated with $s^{i}_{l}[j]$ and $p^{i}_{l}[j]$. To account for the probability variations across different layers, we define $\text{Info}(h^{i}_{l},j)$ as the layer-wise min-max normalized probability (Li et al., ), where $L$ is the total number of layers:

$$ $\begin{cases}p^{i}_{max}[j]=\max\limits_{\{l=1,\ldots,L\}}p^{i}_{l}[j],\\ p^{i}_{min}[j]=\min\limits_{\{l=1,\ldots,L\}}p^{i}_{l}[j],\\ \text{Info}(h^{i}_{l},j)=\frac{p^{i}_{l}[j]-p^{i}_{min}[j]}{p^{i}_{max}[j]-p^{ i}_{min}[j]}\end{cases}$ $$

Causal Intervention on Hidden States.
Causal intervention on hidden states Li et al. (; ) involves deliberately altering specific hidden states in a model to observe the resulting changes in various metrics, thereby helping to establish cause-and-effect relationships. This process includes three pivotal components: the intervention operation $\mathcal{I}$ to be conducted, the target hidden state $\mathcal{H}$ selected for intervention, and the effect metric IE which measures the change caused by the intervention $\mathcal{I}$. In this paper, the possible hidden states $\mathcal{H}$ for intervention include the layer hidden states $h$, the output hidden states from MLPs $m$, and the output hidden states from attention heads $a$. We use the change in probability $p^{i}_{l}[j]$ from LogitLens as the effect metric IE, which quantifies the change in the probability of predicting the target token $j$ at layer $l$ for a specific position $i$. This metric enables us to determine whether specific components or tokens, have a causal influence on the model’s predictions.

Figure: (a) Two-hop
Refer to caption: x2.png

## 3 Mechanisms of Knowledge Storage and Reasoning

In this section, we will explore the reasoning mechanisms of the pre-edited model for both single-hop and multi-hop factual recall tasks. By comparing the knowledge utilization processes, we identify the reasons behind the suboptimal performance in multi-hop tasks and explain why the post-edited model tends to output the original answer instead of the new edited one. Specifically, we focus on two-hop tasks to better illustrate these distinctions. Experiments are conducted using a subset of single and two-hop data from MQuAKE-CF (Zhong et al., ) with the GPT-J (6B) model (Wang & Komatsuzaki, ). More detailed information about the data and experimental setup is provided in Appendix B.1.1.

### 3.1 How the Pre-edited Model Reasons Fact Recall Tasks

For a multi-hop fact recall task, the knowledge chain is represented as $C=\left(s_{1},r_{1},o_{1}\right)\oplus\dots\oplus\left(s_{n},r_{n},o_{n}\right)$. The model may employ multiple strategies to answer such tasks, including the formation of a single super-relation (Ju et al., ) $(s_{1},r_{mul},o_{n})$, where $r_{mul}=r_{1}\to\dots\to r_{n}$, or by segmenting the task into one explicit recall step followed by several implicit recall steps to answer step-by-step. Previous research (Hou et al., ) suggests that models typically engage in reasoning by considering each single-hop recall individually.

Based on this understanding, we hypothesize that the model will prioritize deducing the implicit subjects $\{s_{2},\dots,s_{n}\}$ and subsequently recall the final answer $o_{n}$ based on the last implicit subject $s_{n}$. The subsequent sections aim to verify this hypothesis by examining the model’s behavior in structured multi-hop fact recall tasks.

Interpretation via Hidden Representations.
We use LogitLens to examine the accumulation of information related to the implicit subject $s_{2}$ and the final answer $o_{2}$ in the two-hop scenario. The model’s predictions for $o_{2}$, are derived from the last token of the prompt, where crucial information about the resolved implicit subject $s_{2}$ should be propagated (Biran et al., ). Therefore, we focus on the hidden state $h_{l}$ at the $l$-th layer of the last token position, analyzing $\text{Info}(h_{l},s_{2})$ and $\text{Info}(h_{l},o_{2})$ as measures of the information related to $s_{2}$ and $o_{2}$ contained in $h_{l}$. Intuitively, these metrics quantify how much information about $s_{2}$ and $o_{2}$ accumulates in the hidden state. The results, depicted in Figure 2(a), show that $\text{Info}(h_{l},s_{2})$ gradually reaches its peak during middle layers [15-17], while $\text{Info}(h_{l},o_{2})$ increases and peaks during later layers [21-23]. This pattern suggests that, in multi-hop tasks, the implicit subject $s_{2}$ is processed during the middle layers before reaching the final answer $o_{2}$.

To explore if single-hop fact recalls $(s,r,o)$ follow the same trend as in multi-hop cases, we conducted a similar experiment using LogitLens. The results, shown in Figure 2(b), indicate that $\text{Info}(h_{l},s)$ significantly increases after layer 24 and peaks at layer 27, whereas $\text{Info}(h_{l},o)$ consistently reaches its peak during layers 21,22,23. This finding implies that there is no significant peak for the subject information before the final answer probability begins to accumulate, suggesting that the accumulation process of the final answer in single-hop cases may not be significantly correlated with the subject information at the last token.

Figure: (a) Causal intervention results of layer hidden state in last token position.
Refer to caption: x4.png

Causal Intervention.
Next, we explore whether the appearance of $s_{2}$ guides the subsequent information accumulation process of the final answer $o_{2}$. To this end, we aim to identify which layers facilitate this influence. We propose an intervention experiment where we reduce the information content of $s_{2}$ at the last token position and observe the changes in the output probability of the final answer in the last prediction layer.

Specifically, we replace the hidden state $h_{l}$ in layer $\ell$ of the last token with $h^{*}_{l}$, and the corresponding logits $s_{l}$ ($=W_{U}h_{l}$) and $s^{*}_{l}$ ($=W_{U}h^{*}_{l}$) for $h_{l}$ and $h^{*}_{l}$, respectively. $s^{*}_{l}$ is defined as:

$$ $s^{*}_{l}[j]=\begin{cases}\min(s_{l}[j]),&\text{if }j\in s_{2}\\ s_{l}[j],&\text{otherwise},\end{cases}$ (1) $$

where we minimize the logits corresponding to the tokens in $s_{2}$ without altering the values of other tokens, aiming to diminish the effect of $s_{2}$. This setup allows us to describe the process through a causal intervention framework, where the intervention $\mathcal{I}_{h}$ and the effect $IE_{h}$ are defined as follows:

$$ $\displaystyle\mathcal{I}_{h}:h^{*}_{l}=h_{l}+\operatorname*{arg\,min}_{\Delta h _{l}}\|W_{U}(h_{l}+\Delta h_{l})-s^{*}_{l}\|^{2},\quad IE_{h}=p_{L}[j]-p_{L}^{ E}[j],\quad j\in o_{2},$ (2) $$

where $L$ is the last layer, $p_{L}[j]$ denotes the original output probability of $o_{2}$ in the $L$-th layer, and $p^{E}_{L}[j]$ is the probability after the intervention is applied. This approach illustrates how the hidden states and probabilities are expected to change when the logits are modified to $s^{*}$. For computational efficiency, we opt to approximate $h^{*}_{l}$ using a combination of least squares and minimum-norm methods (Lawson & Hanson, ) (further details are provided in Appendix B.2).

For comparison, we also randomly select an irrelevant token $j\notin s_{2}\cup o_{2}$ to execute the intervention as the control group.
Figure 3(a) presents the outcomes of our intervention experiments across all layers, where a brighter color signifies a stronger intervention effect.
We found a clear positive impact from intervening in layers [17-19] for the experimental group, in contrast to no significant effects observed in the control group across all layers. This suggests that the information of $s_{2}$ encoded in the intermediate layers plays a crucial role in the probability accumulation process of $o_{2}$. We also do the same causal intervention experiments for single-hop fact recall (see Appendix  B.3 for the results). However, the results indicate that the prediction of $o$ does not significantly rely on the subject information $s$ in the single-hop fact recall.

Intermediate Reasoning Results Influence the Knowledge Extraction from MLP.
As previous studies claimed that single-hop tasks retrieve subject information from MLP layers (Meng et al., ; ), we will focus on MLP layers to further investigate the specific mechanisms to answer how the implicit subject $s_{2}$ influences the prediction of the final answer $o_{2}$.
We conducted a causal intervention experiment similar to the experiments above but focused specifically on the MLP component. Specifically, we aim to replace $m_{l}$ (the output hidden state of the last token in the $l$-th MLP layer) with $m^{*}_{l}$, where we have $s_{l}=W_{U}m_{l}$ and $s^{*}_{l}=W_{U}m^{*}_{l}$ with $s^{*}_{l}$ is same as in (1). The
intervention $\mathcal{I}_{m}$ shares the same idea as in (2), except that $h_{l}$ is replaced with $m_{l}$. However, we redefine the intervention effect $IE_{m}$, which differs from the previous $IE_{h}$. In detail, we no longer use the probability at the final layer as the metric; instead, we use the probability calculated from the output of MLP at the modified layer $l$.
In total, our causal intervention is formulated as

$$ $\displaystyle\mathcal{I}_{m}:m^{*}_{l}=m_{l}+\operatorname*{arg\,min}_{\Delta m _{l}}\|W_{U}(m_{l}+\Delta m_{l})-s^{*}_{l}\|^{2},\quad IE_{m}=p_{l}[j]-p_{l}^{ E}[j],\quad j\in o_{2}.$ $$

Figure 3(b) presents the outcomes of our intervention experiments across all layers with the similar control group as in the above.(^2^22Note that, considering the tiny output probability of MLP, we did not use normalization of probability changes here.) The clear positive impact from intervening in the intermediate layers [17-21] is demonstrated in the experimental group, in contrast to negligible effects observed in the control group across all layers. This suggests that the implicit subject $s_{2}$ at the last token position was used for retrieving the related information of $o_{2}$ from later MLP layers. Thus, it plays an important role in the probability accumulation process of $o_{2}$. Note that this is in contrast with previous work (Meng et al., ; ), which mentioned that explicit single-hop tasks primarily rely on the subject position token to retrieve information from earlier MLP layers.

### 3.2 Why Existing locate-then-edit KE Methods Failed

Table: Table 1: Comparison of QA and Cloze Formats for $D_{Pre}$ and $D_{Post}$

Based on the findings above, we can provide an explanation for the unsatisfactory performance of the existing locate-then-edit methods. For an editing instance $(s,r,o\to o^{*})$, using only the corresponding explicit single-hop prompt for editing is insufficient as previous methods only update the relevant knowledge in the shallow MLP layers but fail to propagate the changes to deeper layers, which is utilized in multi-hop fact recall tasks.

We provide a concrete example for a better understanding. Given an editing instance $(Spain,captical,Madrid\to Hartford)$, and $Q_{cloze}(s)$ is “The capital city of Spain is”. Existing methods modify the weights of shallow MLPs with $Q_{cloze}(s)$ to make it answer Hartford. The paradigm may be well-suited for cases where the modified information is queried in a single-hop manner, as these tasks retrieve answers from the early MLP layers. However, it will be ineffective when the modified knowledge is queried in the second or later fact recall steps, where the model relies on deeper MLP layers at the last token position for knowledge retrieval. In this example, the first-hop query “The capital city of Spain is located in the continent of” should be answered correctly because it retrieves the knowledge $(Spain,captical,Hartford)$ in shallow MLPs. However, the second one “The capital city of the country has nationals Pablo Picasso is” is still answered with Madrid because the knowledge $(Spain,captical,Madrid)$ stored in later MLPs does not changed.

To verify our above claim, we divide two-hop fact recall tasks into two sets $D_{Pre}$ and $D_{Post}$, depending on the position of the edited knowledge within the two-hop reasoning process. Specifically, for an edited knowledge $\left(s,r,o,o*\right)$, we have the following two sets after editing.

$$ $\displaystyle D_{Pre}$ $\displaystyle=\{\left(s,r,o^{*}\right)\oplus\left(s_{2},r_{2},o_{2}\right)\},$ $\displaystyle D_{Post}$ $\displaystyle=\{\left(s_{1},r_{1},o_{1}\right)\oplus\left(s,r,o^{*}\right)\}.$ $$

We sampled two subsets with approximately equal size from the MQuAKE-CF dataset, detailed in the Appendix  B.1.2. By applying the SOTA locate-then-edit method PMET to layer [3-8], which follows (Li et al., ), we present the percentage of cases where both pre-edited and post-edited models answer successfully in QA format or Cloze format under different edit batches.

Table 1 shows the results of the comparative experiments. We can see that performance on $D_{Pre}$ is significantly better than on $D_{Post}$, which aligns with our expectations. This is because reasoning the first hop knowledge in $D_{Pre}$ is similar to the single-hop process. After updating the knowledge in the earlier MLP layers, the model is likely to effectively use the newly edited knowledge. It can use the new implicit subject in the second hop to produce the final updated answer. When facing cases in $D_{post}$, PMET cannot get the correct final answer because it only modifies the earlier MLP layers, which is not enough for the model to correctly reason the second hop knowledge as it should be retrieved from later MLP layers.

## 4 IFMET: An Advanced Locate-then-Edit Method

Motivated by our findings on the distinctions between single-hop and multi-hop factual recall process, we introduce the Interpretability-Guided Furtherance Model Editing in a Transformer (IFMET). This method addresses the limitations identified in existing locate-then-edit approaches by modifying knowledge across both earlier and later MLP layers, enhancing the model’s ability to handle multi-hop reasoning. The IFMET method comprises two main steps: first, constructing a supplementary set of original edits to enrich the edit context, and second, performing editing based on multi-hop prompts derived from the original edit case and its supplementary set. This furtherance step approach ensures a thorough integration of new knowledge, significantly improving the model’s accuracy and robustness in multi-hop factual recall scenarios.

**Table 2: An support case for an instance in the MQuAKE-CF dataset and the corresponding additional support cases are shown in the lower part.**
| $e$ | (Spain, capital, Madrid $\to$ Hartford) |
| --- | --- |
| $s$ | Spain |
| $T_{r}(s)$ | The capital city of Spain is |
| $C$ | (Manuel Almunia, cizizenship, Spain) |
|  | (Spain, capital, Madrid $\to$ Hartford) |
| $Q_{C}(s)$ | What is the capital city of the country |
|  | where Manuel Almunia holds citizenship? |
| $e^{\prime}$ | (Barcelona, country, Spain) |
| $s^{\prime}$ | Barcelona |
| $C^{\prime}$ | (Barcelona, country, Spain) |
|  | (Spain, capital, Madrid $\to$ Hartford) |
| $T_{C}(s^{\prime})$ | The capital city of the country |
|  | where Barcelona is located is |

Supplementary Set Construction. Note that for a given edit $e=\left(s,r,o\to o^{*}\right)$ (it can be extended to cases involving multiple edited facts), a locate-then-edit algorithm typically aims to identify and modify the knowledge-storing MLPs. Previous efforts have predominantly focused on the earlier MLP layers; however, our findings indicate that such an approach underperforms when the edited knowledge appears in second or subsequent hops during reasoning. Given that each edit traditionally targets single-hop knowledge, our experiments have demonstrated that using such edit prompts alone does not effectively update the later knowledge-storing MLPs. To address this issue, we construct a supplementary set for each edit, designed to facilitate the modification of deeper MLPs that provide knowledge in implicit fact recall steps.

In our supplementary set, we transform each edit into a multi-hop chain. For instance, for an edit $e=(s,r,o\to o^{*})$, we can create a supplementary fact $e_{\text{sup}}=(s^{\prime},r^{\prime},o^{\prime})$ where $o^{\prime}=s$, forming a two-hop fact recall chain $C=(s^{\prime},r^{\prime},o^{\prime})\oplus(s,r,o)$. This approach enables us to subsequently target and modify the latter MLPs that store the fact $(s,r,o)$, updating the information to $(s,r,o^{*})$. An illustrative example of this process is provided in Table 2.

Practically, we utilize WikiData(^3^33www.wikidata.org) to construct the supplementary dataset. We start by extracting all subjects from the dataset’s edits and deduplicating them to form a set of subjects $S_{e}=\{s_{i}|i=1,\dots\}$. We then perform a WikiData SPARQL query(^4^44https://query.wikidata.org/) to identify a set of triplets for each subject $s_{i}$: $Sup=\{(s^{\prime},r^{\prime},o^{\prime})|o^{\prime}=s_{i}\}$. To ensure the reliability of these facts, we filter out examples that cannot be correctly answered using the few-shot approach proposed by (Zhong et al., ). For construction details, please refer to the Appendix C.

Interpretability-Enhanced Furtherance Model Editing in a Transformer. Now we introduce the proposed IFMET framework. Each pre-edited knowledge has an additional multi-hop chain, assisted by the supplementary set. Based on the difference between the single and multi-top settings we discussed above, we have to locate and modify weights in both earlier and later layers in MLPs.

Based on the previous key-value memories Geva et al. (), our method is based on the hypothesis that factual knowledge is stored within the Feedforward Neural Networks (FFNs) of MLPs. Specifically, for the $l$-th layer FFN of the $i$-th token, its output is given by: $v^{i}_{l}=f(W^{in}_{l}h^{i}_{l-1})W^{out}_{l}$, where $f(\cdot)$ is the activation function, and $h^{i}_{l-1}$ is the input of the $l$-th MLP layer (for simplicity, the superscript $l$ is omitted in the
following discussion). In this context, $f(W^{in}h^{i})$ functions as the keys, denoted as $k_{i}$, the outputs of the subsequent layer represent the corresponding values $v_{i}$, and $W^{out}$ denotes the weights of the knowledge stored in the FFN that needs modifying.
Such a structure is well aligned with the triplet form in a fact $(s,r,o)$, where the keys $k_{i}$ correspond to entities of interest $s_{i}$ or some specific fact $(s_{i},r_{i})$ and values
$v_{i}$ contain information about $o_{i}$. Thus, we have $W^{out}k=v$ for $(k,v)$, which represents the fact $\left(s,r,o\right)$ (Geva et al., ). We aim to modify $W^{out}$ such that $W^{out}k=v^{*}$, where $v^{*}$ contains the information of the new knowledge.

Motivated by the above, in IFMET, considering a modification, there are two steps for both earlier and latter layers in MLPs: $Search$ and $Calculate$. The $Search$ process identifies the suitable $v^{*}$ through the edit prompt corresponding to the triplet. Then the $Calculate$ process computes the change in weights $W^{out}$ using $v^{*}$. These two processes are foundational in existing knowledge editing methodologies. In experiments, we adopt the state-of-the-art locate-then-edit method PMET (Li et al., ). The primary differences between the first and further edits are reflected in the edit prompt and the layers edited. Specifically, for the edit instance $e=(s,r,o\to o*)$, the first edit utilized a one-hop edit template $T_{r}(s)$ provided by MQuAKE to edit early layers of the model. For the furtherance edit, a two-hop template $T_{C}(s^{\prime})$ composed of a support case $(s^{\prime},r,s)$ and $(s,r,o^{*})$ was used, and this template was applied to edit later layers of the model. Due to space limitations, the flowchart of the algorithm and related implementation details are provided in Algorithm 1 and Appendix  C.

## 5 Experiments

### 5.1 Experimental Setup

Dataset. We use MQuAKE-3K (Zhong et al., ), a challenging dataset designed to evaluate models’ ability to perform multi-hop reasoning with newly edited knowledge. Each entry consists of multiple single-hop edits and includes multi-hop reasoning questions, placing heightened demands on the ability of edited models to effectively utilize the updated information.

Baselines. As IFMET is a locate-then-edit approach, we mainly compare it with previous weight-modifying approaches. Specifically,
our baseline includes the following methods: Original, which refers to the original model without any edits; ROME Meng et al. (), which identifies editing areas using causal mediation analysis framed as a least-squares problem under linear equality constraints and solving it using Lagrange multipliers; MEND Mitchell et al. (), which employs meta-learning to train a hypernetwork for inferring weight updates from gradients; MEMIT Meng et al. (), which extends ROME to edit a large set of facts by updating weights in a range of layers; MeLLo, which manages multi-hop knowledge editing by decomposing subproblems and detecting conflicts; PMET, which optimizes FFN hidden states for precise weight updates, achieving SOTA performance in COUNTERFACT (Meng et al., ) and ZsRE (Levy et al., ).

Setup and Hyperparameters: To evaluate the performance, we employ Multi-hop Accuracy (Zhong et al., ). Our experiments are conducted on the GPT-J (6B) model. We use PMET as our primary experimental method for both the first and furtherance edits. We construct a supplementary set from the knowledge triples of MQuAKE-3K to support our IFMET. When constructing the support set, for each edit case, no more than three supplements per relation were added from the supplementary dataset. The relation types of the supplementary set are the same as MQuAKE. We set the edit batch sizes to 1, 1000, and 3000. Additional details are presented in Appendix D.2.

### 5.2 Experimental Results

**Table 3: Performance comparison of different methods on the MQuAKE-CF dataset with few-shot. Methods with ^♠ indicate weight-modifying methods, while methods with ^⋄ are weight-preserving methods. ‘-’ indicates no relevant result, as ROME does not support multiple edits.**
| Model | Method | Batch_size=1 | Batch_size=1000 | Batch_size=3000 |
| --- | --- | --- | --- | --- |
| GPT-J-6B | Original | 39.63 | - | - |
| MeLLo^⋄  Zhong et al. () | 20.3 | 11.0 | 10.2 |  |
| ROME^♠  Meng et al. () | 7.6 | - | - |  |
| MEMIT^♠ Meng et al. () | 12.3 | 8.1 | 1.8 |  |
| MEND^♠  Mitchell et al. () | 11.5 | 4.3 | 3.5 |  |
| PMET^♠  Li et al. () | 11.17 | 11.13 | 11.7 |  |
| IFMET (ours) | 23.04 | 18.8 | 16.07 |  |

General performance. Table 3 demonstrates the performance of various established methods alongside IFMET on MQuAKE-3K. We can easily see the previous weight-modifying approaches generally exhibited poor performance. As the edit batch size increases, all methods except PMET show a certain downward trend. Our method inherits the good batch editing ability of PMET and consistently outperforms all others, showcasing a leading edge. Our approach significantly improves upon existing knowledge editing techniques, demonstrating the effectiveness and necessity of updating knowledge storage in deeper MLP layers.

**Table 4: Performance comparison between correct and original answers using PMET and our editors, with an edit batch size of 1. The type of edited fact—Pre, Mid, or Post—depends on the edited data position within the multi-hop reasoning chain. Average accuracy is calculated as the weighted average of results from these three categories, which have respective quantities of 1824, 390, and 786. Additionally, +CoT denoted the performance incorporating a Chain-of-thought (CoT) prompt, which can significantly enhance model performance for reasoning tasks.**
| Editor | Correct Answer $\uparrow$ | Original Answer $\downarrow$ |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Average Accuracy | Pre | Mid | Post | Average Accuracy | Pre | Mid | Post |  |
| GPT-J | 7.70 | 6.03 | 16.92 | 7.00 | 39.63 | 38.43 | 35.9 | 44.27 |
| GPT-J+CoT | 6.83 | 5.92 | 9.23 | 7.76 | 42.83 | 41.56 | 39.74 | 47.33 |
| PMET | 11.17 | 12.13 | 16.09 | 6.52 | 29.95 | 23.60 | 35.66 | 41.85 |
| PMET+CoT | 17.04 | 19.84 | 14.32 | 11.91 | 29.35 | 23.12 | 30.43 | 43.22 |
| IFMET | 23.04 | 20.24 | 15.28 | 33.38 | 23.08 | 20.18 | 34.32 | 24.25 |
| IFMET+CoT | 31.01 | 31.69 | 19.49 | 35.15 | 21.62 | 17.71 | 30.51 | 26.27 |

Effect of number of hops. Table 5 in the Appendix displays the performance trends of various knowledge editing methods with different numbers of hops in multi-hop factual recall. We can see that each additional reason hop will negatively impact performance. Notably, IFMET is the best one in all cases, with minimal performance degradation. In particular, its results are close to those of the original model in the two-hop scenarios. This slight decrease underlines IFMET’s robustness and its superior ability to handle complex multi-hop tasks effectively.

Effect of the number of edited instances. We then consider the performance with different edited instances, which refer to the required number of new knowledge updates in the edit case. The results shown in Appendix Table 6 indicate a performance decline across all methods as more edits are introduced. Notably, IFMET consistently outperforms other approaches, showing the smallest average decline across different instance scenarios. Surprisingly, IFMET achieves an accuracy distribution that is close to that of the original model. It is also the only method that maintains excellent performance in complex two-hop and four-hop scenarios, which even outperforms single-hop cases. This can be more visually observed in Appendix Figure 6.

Effect of the edit position. As previously mentioned, the same single-hop fact requires different layers to provide knowledge, depending on its position in the multi-hop reasoning chain, involving the earlier and later MLPs. By categorizing according to position, we can assess whether the editing methods have comprehensively updated the relevant knowledge in the model rather than just making partial updates. We classify the edited case according to its position in the relevant multi-hop reasoning chain as Pre, Mid, and Post. For instance, in a three-hop knowledge sequence, editing the first hop is classified as pre, the second as mid, and the third as post. Please refer to Appendix D.1 for the classification of more complex, multi-edit scenarios. To assess the completeness of our method, we evaluated its performance for both eliminating original knowledge and incorporating new knowledge. As detailed in Table 4, our method significantly enhances outcomes across all classification types—Pre, Mid, and Post. Notably, it achieves exceptional improvements in both modifying new knowledge and eliminating original knowledge, especially in cases classified as Post.

## 6 Conclusion

We focused on developing locate-then-edit knowledge editing methods for multi-hop factual recall tasks.
We first verified that in multi-hop tasks, LLMs tend to retrieve implicit subject knowledge from deeper MLP layers, unlike single-hop tasks, which rely on earlier layers. This distinction explains the poor performance of current methods in multi-hop queries, as they primarily focus on editing shallow layers, leaving deeper layers unchanged. We then proposed IFMET, a novel locate-then-edit KE approach designed to edit both shallow and deep MLP layers. Experimental results demonstrate that IFMET significantly improves performance on multi-hop factual recall tasks.

## Appendix A Related Work

Parameter-based Editing
Knowledge editing refers to modifying outdated, inaccurate, or harmful knowledge in LLMs without the need for retraining. Parameter-editing methods achieve this by adjusting the model’s internal parameters to update its knowledge while ensuring that information unrelated to the editing domain remains unaffected. An example is ROME (Meng et al., ), which explored the knowledge storage mechanisms in single-hop factual recall tasks based on causal tracing methods and proposed the Rank-One Model Editing method. Together with KN (Dai et al., ), it pioneered a paradigm of *locate-then-edit*, providing guidance for subsequent editing methods. The later extended versions, MEMIT (Meng et al., ), MALMEN (Tan et al., ), and EMMET (Gupta et al., ), further improved ROME by addressing its limitations in large-scale editing, enabling comprehensive edits in a single operation while demonstrating exceptional performance. Meanwhile, PMET (Li et al., ) achieved more precise model editing by decoupling the residual flow of the Transformer into three components: Multi-Head Self-Attention (MHSA), Feed-Forward Networks (FFN), and residual connections, utilizing only the optimized hidden states of the FFN to accurately update FFN weights. Additionally, MEND (Mitchell et al., ) trained a hypernetwork to efficiently predict LLM weight updates, enabling rapid knowledge editing. METO (Yin et al., ) optimized the model’s temporal prediction of facts, editing both historical and new knowledge to reduce forgetting during updates. Wilke (Hu et al., ) selected the layers in LLMs that best matched the knowledge pattern for editing, achieving continuous updates and corrections in the model’s knowledge. Hewitt et al. () used canonical examples to guide the model editing process, enabling fine-tuned adjustments to model behavior. However, these editing methods primarily focus on knowledge updates in specific layers and lack in-depth optimization for knowledge integration and application in multi-hop reasoning, rendering them inadequate for multi-hop questions. In contrast, IFMET enhances model interpretability, guiding more accurate knowledge integration and thereby improving model performance in multi-hop factual recall tasks.

Mechanistic Interpretability
LLMs are capable of producing high-quality answers, but their internal workings remain opaque. As a result, the interpretability of LLMs has emerged as both a research hotspot and a critical area of focus. Mechanistic Interpretability refers to the effort to explain the internal mechanisms, decision-making processes, and outputs of LLMs. There are two primary approaches for interpreting large language models (LLMs) in the vocabulary space by examining hidden representations: Probing Classifiers (Belinkov & Glass, ; Belinkov, ; Wang et al., ) and Projecting Representations to the Vocabulary Space (Dar et al., ; Merullo et al., ; Belrose et al., ; Langedijk et al., ). The former identifies which parts of the model are crucial for specific tasks by training classifiers, known as probes, on hidden representations, while the latter involves mapping intermediate layer representations to the output vocabulary space and analyzing how these projections predict the next word. In this paper, we focus primarily on Projecting Representations. Logit Lens (nostalgebraist, ) extracted outputs corresponding to each layer in the decoding space by applying unembedding operations on the intermediate layers of LLMs. Geva et al. () analyzed the nature of updates at each layer by comparing differences in logit outputs. Merullo et al. () used the Logit Lens to explore how LLMs handle different stages of question-answering tasks. Dar et al. () mapped attention weights of LLMs to lexical space, showing that these weights encode consistent concepts and relations. Belrose et al. () introduced the Tuned Lens, which improves the capability and reliability of the Logit Lens. Finally, Ghandeharioun et al. () proposed the Patchscopes framework, demonstrating that auxiliary models can represent lexical projections through tuning.

Mechanistic Interpretability serves as a tool for debugging and enhancing LLMs and can be applied to a variety of downstream tasks. Xiao et al. () leveraged explanations from multi-head self-attention (MHSA) mechanisms in LLMs by introducing StreamingLLM, a model capable of handling unlimited text without requiring fine-tuning. Through causal tracing, Hendel et al. (); Todd et al. () demonstrated that certain attention heads can efficiently encode compact representations of example tasks, leading to improved performance in few-shot prompting. Liu et al. () explored the role of social bias in LLMs, introducing the concept of social bias neurons to explain and mitigate such biases. Furthermore, Li et al. () proposed an intervention technique during inference, which, based on the interpretability of attention heads, shifts activation values toward “truthful” responses to reduce model hallucinations. In this paper, we analyze the MLP and MHSA components of LLMs to uncover the mechanisms that enable multi-hop reasoning,and building on our findings, we introduce a targeted knowledge-editing method IFMET.

## Appendix B More Details

### B.1 Subset of MQuAKE

#### B.1.1 1-hop and 2-hop subset for Mechanism Exploration

In exploring the mechanisms of fact recall for one-hop and two-hop queries, this experiment utilized cloze templates as the experimental framework. We extracted knowledge from MQuAKE that could answer cloze templates in a zero-shot setting. This approach ensured that the model could recall the knowledge under the strictest conditions while minimizing the impact of unclear responses on the experimental results. The distribution of various relation types across the two subsets is illustrated in Figure 4.

Figure: Figure 4: Relation number for 1-hop and 2-hop
Refer to caption: x6.png

#### B.1.2 Pre and Post Subset

To construct the subset, we selected two-hop queries from MQuAKE with Cloze-Format templates, and then randomly drew a nearly equal number($\approx 300$) of cases based on the proportion of relations.

### B.2 Least squares and Minimum-norm method

When performing interventions, we need to solve the least squares constraint as follows:

$$ $\displaystyle\operatorname*{arg\,min}_{\Delta h_{l}}\|W_{U}(h_{l}+\Delta h_{l} )-s^{*}_{l}\|^{2}$ $$

In certain situations, the minimum norm method is more effective than directly solving linear systems or using other numerical methods, especially when the system is underdetermined (i.e., there are fewer equations than unknowns) or when there are infinitely many solutions. The minimum norm method provides a solution with the smallest norm among all possible solutions.

To minimize the probability of the intermediate answer $j$, we replace its logits with the smallest logits of the model’s vocabulary, and provide appropriate compensation for the final answer $k$ to maintain the probability of the final answer unchanged. The $\Delta h$ can be represented as:

$$ $\begin{cases}\Delta h=\Delta h_{j}+\Delta h_{k}\[8.61108pt] \Delta h_{j}=\frac{s_{l}[j]-s_{l}^{\min}}{\|W_{u}[j]\|^{2}}W_{u}[j]\[8.61108 pt] \Delta h_{k}=\frac{s_{l}[k]-s_{l}^{\min}}{\|W_{u}[j]\|^{2}}\alpha W_{u}[k]\end {cases}$ $$

The change in the probability of the final answer after causal intervention can be represented by the function $f(\alpha)$:
$f(\alpha)=P(h^{*},k)-P(h,k)$
Where $f(\alpha)$ is a monotonically increasing function on the interval $(0,1)$. We can find the zero of this function using the bisection method, ensuring that the final answer, after causal intervention, remains within an acceptable error margin with unchanged probability.

### B.3 Causal Intervention on Single-hop Case

Figure: Figure 5: Causal Intervention result of MLP input in last token position in Single-hop case
Refer to caption: x8.png

The results of intervention for single-hop cases are shown in Figure 5. Except for the input layer, no significant effects are shown, indicating that in the single-hop fact recall task, the prediction of the final answer at the last token position is largely independent of the information from the intermediate results.

## Appendix C Details of IFMET

### C.1 Detailed Supplementary Set Construction Process

We collect 2615 subjects from the MQuAKE dataset. For each subject $s$, we use a Wikidata SPARQL query to retrieve the triplet $(s^{\prime},r^{\prime},s)$. The query is illustrated in Table 7. To keep the query complexity within an acceptable range, we collected all relationships that have appeared in MQuAKE and restricted $r^{\prime}$ to those that have occurred in the relation set. We then use the prompt 9 to filter out the answerable $(s^{\prime},r^{\prime},s)$ triples. For each edit case $(s,r,o\to o*)$, we are able to construct a two-hop edit template $T_{C}(s^{\prime})$ with the multi-hop chain $C=(s^{\prime},r^{\prime}s)\oplus(s,r,o\to o*)$.

### C.2 Detailed Edit Process

Figure: Algorithm 1 IFMET

Our method primarily consists of a first edit (step 1-8 in Algorithm 1) and a furtherance edit (step 9-17 in Algorithm 1). Each single edit process obtains target weights via optimizing the objective of knowledge preservation and editing:

$$ $\operatorname*{arg\,min}_{\hat{W}}\left(\lambda\underbrace{\|\hat{W}K_{0}-W^{ out}K_{0}\|^{2}}_{\text{Preserve}}+\underbrace{\|\hat{W}K_{E}-V_{E}\|^{2}}_{ \text{Edit}}\right),$ $$

where $K_{0}=\left[k^{1}_{0}\,|\,k^{2}_{0}\,|\,\cdots\,|\,k^{N}_{0}\right]$ and $V_{0}=W^{out}K_{0}$ contain all the knowledge we want to preserve, $K_{E}=\left[k^{1}_{e}\,|\,k^{2}_{e}\,|\,\cdots\,|\,k^{E}_{e}\right]$ is the matrix containing the edits we try to make and $V_{e}=[v^{*}_{e_{1}}\ |\dots\ |\ v^{*}_{e_{E}}]$ represents the target representations of the new knowledge. ($K_{E},V_{E}$) corresponds to the edited fact set $\{\left(s_{i},r_{i},o^{*}_{i}\right)|i=1,2,\cdots,E\}$. We consider the target weight $\hat{W}$ as the sum of the original weight $W^{out}$ and the incremental weight $\Delta$, as explicated in Li et al. (), a closed-form solution to the incremental weight can be derived:

$$ $\displaystyle\Delta$ $\displaystyle=RK_{E}^{T}(C_{0}+K_{E}K_{E}^{T})^{-1},\quad R\triangleq(V_{E}-W^ {out}K_{E}),\quad C_{0}\triangleq K_{0}K_{0}^{T}.$ (3) $$

Thus, solving the optimal parameter $\hat{W}$ is transformed into calculating edited fact representation $\{(k_{e}^{i},v_{e}^{i})|i=1,\dots,E\}$. In this process, an edit instance $e=(s,r,o\to o*)$, $(k_{e},v_{e})$ the pre-edited fact $(s,r,o)$ and $(k_{e},v^{*}_{e})$ denotes post-edited $(s,r,o*)$. To obtain the target representations of the new knowledge $v^{*}_{e}=v_{e}+\delta$, we optimize the learnable parameter vector $\delta$ to modify the original value vector. $Search$ is the process of obtain the optimized $\delta$ through gradient descent:

$$ $\displaystyle\delta=\operatorname*{arg\,min}_{\delta}\mathcal{L}(\delta)$ $\displaystyle=\mu D_{\text{KL}}\left(P_{{\mathcal{M}_{e}}}\left[t^{\prime}\mid T \right]\lVert P_{\mathcal{M}}\left[t^{\prime}\mid T\right]\right)+\varphi\frac {1}{P}\sum_{j=1}^{P}-\log\mathbb{P}_{\mathcal{M}_{e}}\left[{o^{*}\mid{\text{ pref}}_{j}\oplus T_{e}}\right],$ $$

where $T$ is the KL prompt, such as “s is a ” and $t^{\prime}$ is the tokens excluding the token for the answer $o^{*}$, $T_{e}$ is the prompt for editing, such as “The capital of Spain is ” , $\varphi$ and $\mu$ serve as the scaling factor for adjusting the loss. $Calculate$ process is using the $v^{*}_{e}$ to slove the $\Delta$ which is a function of $v^{*}_{e}$.
involves substituting the values of $V_{e}=[v^{*}_{e_{1}}\ |\dots\ |\ v^{*}_{e_{E}}]$ corresponding to a series of edits into (3) to compute the $\Delta$.

The primary differences between the first and furtherance edits are reflected in the edit prompt $T_{e}$ and the layers edited. For example, for the edit instance $e=(s,r,o\to o*)$, the first edit utilized a one-hop edit template $T_{e}=T_{r}(s)$ provided by MQuAKE to edit layers [3,8] of the GPT-J model in the subject last token position. For the furtherance edit, a two-hop template $T_{e}=T_{C}(s^{\prime})$ composed of a support case $(s^{\prime},r,s)$ and $(s,r,o^{*})$, and this two-hop template was applied to edit layers [16,20] of the GPT-J model in the last token position.

## Appendix D Addition Experimental Settings

### D.1 Criteria for classifying dataset into pre , mid , and post .

Consider a multi-hop question composed of $n$ triples. We define the positions of edits (with index starting from 1) as the set $\{e_{1},e_{2},\ldots,e_{m}\}$, where $m$ represents the total number of edits. Edits occurring in $m$ consecutive positions starting from the first hop are classified as pre (where $1\leq m\leq n$), while those occurring from the $(n-m+1)^{\text{th}}$ to the $n^{\text{th}}$ position are labeled post (also with $1\leq m\leq n$). Edits not including the first and last hops are categorized as mid.

For non-consecutive edits, classification as pre or post depends on the positions of the first and last hops relative to the edit distance; if the distances are equal, priority is given to post. For example, in a three-hop question, an edit at the first hop is classified as pre, an edit at the second hop as mid, and edits at both the first and second hops are categorized as pre.

### D.2 Experimental Settings

In both the first and furtherance edits, our configuration for PMET adheres to the settings specified by (Li et al., ). Initially, we set $\varphi=1$ and $0\leq\mu\leq 1$ to manage the retention of the model’s original knowledge. As $\mu$ increases, the retention level also increases, while $\varphi$ exhibits the opposite trend. After maximizing the probability of the target knowledge, we reduce $\varphi$ to 0.1 to preserve the original knowledge as much as possible. Optimization is halted when $D_{\text{KL}}<0.01$. On GPT-J, for estimating the covariance matrix (i.e., the set of previously memorized keys $C_{0}$), we sample 10,0000 times on Wikitext in $\text{fp}32$ precision and set $\lambda=6000$. When optimizing, we limit the total optimization steps to 30 with a learning rate of 0.2.
All our experiments were conducted using the MQuAKE dataset. To test the accuracy of answers to multi-hop questions, we adhered to the few-shot in Table 10 and Chain of Thought (CoT) templates in Table 8 and procedures as outlined in (Zhong et al., ).

## Appendix E Additional Experimental Results

**Table 5: Performance comparing the baselineand our method with CoT on multi-hop questions in MQuAKE-CF-3k, categorized by hop counts of 2, 3, 4.**
| Model | Method | Average Accuracy | 2-hop | 3-hop | 4-hop |
| --- | --- | --- | --- | --- | --- |
| GPT-J-6B | Base | 42.83 | 48.9 | 30.7 | 48.9 |
| FT | 1.9 | 3.7 | 1.4 | 0.5 |  |
| MEND | 11.5 | 13.9 | 11.3 | 9.5 |  |
| ROME | 18.1 | 33.8 | 9.1 | 11.4 |  |
| MEMIT | 12.3 | 22.5 | 6.0 | 8.4 |  |
| PMET | 17.04 | 26.65 | 12.76 | 11.7 |  |
| IFMET (ours) | 31.01 | 44.06 | 23.58 | 25.4 |  |

**Table 6: Performance comparing the baselineand our method with CoT on multi-hop questions in MQuAKE-CF-3k, categorized by the number of edits 1, 2, 3, 4.**
| Model | Method | Average Accuracy | 1-Edit | 2-Edit | 3-Edit | 4-Edit |
| --- | --- | --- | --- | --- | --- | --- |
| GPT-J-6B | Base | 42.83 | 36.96 | 45.27 | 46.85 | 48.51 |
| FT | 1.9 | 4.2 | 0.7 | 0.3 | 0.0 |  |
| MEND | 11.5 | 16.0 | 11.0 | 7.3 | 4.4 |  |
| ROME | 18.1 | 23.8 | 20.9 | 9.0 | 2.6 |  |
| MEMIT | 12.3 | 20.5 | 9.8 | 5.5 | 2.6 |  |
| PMET | 17.04 | 22.63 | 16.74 | 11.19 | 7.84 |  |
| IFMET (ours) | 31.01 | 30.26 | 35.21 | 24.30 | 31.72 |  |

Figure: Figure 6: Comparison of different methods across batch sizes, hop numbers, and edit instances.
Refer to caption: x9.png

Table: Table 7: The template of the SPARQL Query we used for the supplementary triplets.

Table: Table 8: The template of the prompt we used for asking multi-hop questions using chain-of-thoughts.

Table: Table 9: An example of the prompt we used to recall single-hop fact

Table: Table 10: The template of the prompt we used for asking multi-hop questions using few shot.

## Peer Reviews

confidence: 3
contribution: 3
initial_rating: 5
presentation: 2
questions: - **Figures**: Consider widening Figures 2(a) and 2(b) to improve readability and enlarge the subfigures in Figure 6 for better visibility.
- **Tables**: Provide a clearer explanation of the term “base” in Tables 5 and 6. It’s unclear whether this refers to the “original” in Table 3 or another baseline. Clear labels and descriptions would enhance understanding.
soundness: 3
strengths: - **Comprehensive Analysis**: The paper presents a thorough analysis in Section 3, identifying that information related to multi-hop knowledge is stored in later MLP layers. Using interpretability tools such as the logit lens and causal interventions, the authors confirm this and propose edits to the last layer based on these findings.
- **Empirical Validation**: Experiments in Tables 3 and 4 show that the proposed method outperforms previous methods on multi-hop knowledge editing tasks, providing compelling evidence for its effectiveness.
summary: The paper addresses challenges in existing locate-then-edit knowledge editing methods, particularly focusing on multi-hop knowledge editing. The authors first investigate why locate-then-edit approaches struggle with multi-hop fact editing using tools from mechanistic interpretability, such as the logit lens and causal intervention. Their findings suggest that later MLP layers play a crucial role in storing multi-hop knowledge. To better update these knowledge-storing MLPs, the authors introduce a supplementary set construction method for each edit, transforming each edit into a multi-hop chain. This supplementary set then generates virtual multi-hop prompts specifically targeting the knowledge being edited. The authors utilize two-hop templates from this supplementary set to modify the model’s later layers, thereby enhancing multi-hop knowledge editing.
weaknesses: - **Insufficient Presentation**: Section 5.2 lacks clarity as Tables 5 and 6 are referenced but not included in the main paper, instead being located in the appendix. While space constraints are understandable, omitting key results from the main discussion detracts from readability and coherence. Additionally, the absence of descriptions for the "base" in Tables 5 and 6 and missing details on the datasets used in Table 4 (e.g., whether MQuAKE is consistently used) leaves gaps in understanding.
- **Questionable Analysis of Results**: In Table 3, performance seems to decline post-editing compared to the original, but there is no discussion on the possible causes for this drop. If editing knowledge reduces performance, the rationale for the edits becomes unclear. It appears that “original” performance refers to accuracy on the unedited answer, but if so, why wasn’t accuracy on the correct answer also reported for the original model? Clearer explanations are necessary to clarify these performance metrics.
- **Limited Novelty in Method and Analysis**: The primary contribution of this work lies in the insight, obtained through interpretability tools, that multi-hop knowledge editing requires updating the later MLP layers. However, there is no clear experimental analysis showing that editing the later layers specifically contributes to performance improvement. It raises the question of whether merely expanding the support set was sufficient for better performance, implying that gains may not be attributed solely to the proposed method. To substantiate this claim, it would be useful to report the impact of the editing layers on performance, comparing different layers with and without the supplementary set.

---

confidence: 4
contribution: 3
initial_rating: 5
presentation: 3
questions: 1. The biblology style should be consistent. Some lines are underlined and others are not.
2. How does IFMET perform on other language models? Like recent Llama-3.
3. How long does IFMET take to edit one multi-hop sample?
4. Can IFMET deal with unstructured facts for knowledge editing as in [1]?
5. Line 387, cizizenship --> citizenship.
6. Figure 1, Mardrid --> Madrid.

 [1] Updating Language Models with Unstructured Facts: Towards Practical Knowledge Editing
soundness: 3
strengths: 1. This paper fills a gap in KE for multi-hop knowledge editing. It addresses the limitations of traditional local-then-edit methods that primarily operate in shallow layers.
2. The paper gives detailed explanations and experiments about how single-hop and multi-hop queries are handled differently within language models. The used LogitsLen and causal intervention experiments are interesting.
3. The proposed IFMET is compared with strong baselines across experiments and shows great performance.
summary: This paper introduces IFMET, a novel locate-then-edit method for knowledge editing for language models.
It aims to improve the multi-hop factual recall by modifying both shallow and deep layers of model weights.
Previous methods focus on shallow layers and thus struggle with multi-hop editing.
IFMET addresses this by using multi-hop prompts and supplementary sets to locate and edit knowledge across multiple layers.
This allows the language model to answer multi-hop queries more accurately post-edit.
Experimental results show that IFMET outperforms existing knowledge editing methods (such as Mello, and MEMIT) on multi-hop knowledge editing.
weaknesses: 1. The used language model GPT-J (6B) is a bit outdated. More recent language models are expected to be considered.
2. How about the performance of the generality and locality of knowledge editing? The editing should also affect related facts but not affect other unrelated facts.
3. The paper lacks discussions about editing efficiency. What is the time complexity of IFMET?
4. Compared to Mello, IFMET requires supplementary set construction from external sources (same for MEMIT and ROME). This may hinder its applications in real cases.

---

confidence: 4
contribution: 3
initial_rating: 8
presentation: 3
questions: See weakness
soundness: 4
strengths: 1. Strong Empirical Analysis: The authors provide a thorough, well-designed investigation into how LLMs process multi-hop queries differently from single-hop ones. The use of LogitLens and causal intervention experiments to track information flow through different layers is particularly impressive.

2. Novel Theoretical Insight: The discovery that implicit subject information accumulates in middle layers before being used to retrieve answers from deeper MLP layers is an important contribution to our understanding of LLM reasoning. This finding not only explains the limitations of current KE methods but also has broader implications for LLM interpretability research.

3. Good result: The proposed IFMET solution is elegant and well-motivated by the theoretical findings. This is a practical solution that improves performance on multi-hop queries.
summary: This paper addresses an important limitation in knowledge editing for LLMs - their poor performance on multi-hop factual recall tasks after editing. Through careful mechanistic analysis using tools like LogitLens and causal intervention experiments, the authors discover that LLMs process multi-hop queries differently from single-hop ones - they accumulate implicit subject information in middle layers before retrieving the final answer from deeper MLP layers. This explains why current KE methods, which focus on editing shallow layers, fail at multi-hop tasks. Based on these insights, they propose IFMET, a novel locate-then-edit approach that edits both shallow and deep MLP layers using supplementary knowledge sets and multi-hop prompts. Their experimental results on the MQuAKE dataset show improvements over existing methods, particularly for complex multi-hop queries.
weaknesses: Overall, this paper is solid. But some parts of this paper are missing:

1. Why do we need to conduct "Locate-then-edit" editing when we have some very good performance RAG-based editing methods [1][2]? There is no need for this paper to compare performance with RAG-based editing in the experiments part, but a short discussion should be included on why IFMET is superior to these RAG-based methods.

2. Currently, only experiments are conducted on MQUAKE-3k; more benchmarks, such as MQUAKE-T, could be included.

[1] Shi, Yucheng, et al. "Retrieval-enhanced Knowledge Editing in Language Models for Multi-Hop Question Answering." CIKM, 2024.
[2] Gu, Hengrui, et al. "Pokemqa: Programmable knowledge editing for multi-hop question answering." ACL, 2024.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 2
questions: Please refer to the Weaknesses.
soundness: 2
strengths: 1. The paper provides a thorough and interesting analysis of the differences between single-hop and multi-hop tasks, highlighting the importance of editing deeper layers in LLMs.

2. The writing is clear, making the proposed method easy to understand and follow.

3. The experimental results are impressive, demonstrating significant improvements over existing methods in multi-hop factual recall tasks.
summary: The paper introduces IFMET, a novel locate-then-edit approach for knowledge editing in Large Language Models (LLMs), specifically targeting multi-hop factual recall tasks. The authors leverage mechanistic interpretability to identify that LLMs retrieve implicit subject knowledge from deeper MLP layers in multi-hop tasks, unlike single-hop tasks, which rely on earlier layers. This insight leads to the development of IFMET, which edits both shallow and deep MLP layers. Experimental results show that IFMET significantly outperforms existing methods on multi-hop factual recall tasks.
weaknesses: 1. The method may have certain limitations. Specifically, using WikiData and SPARQL queries to construct the supplementary dataset may not be applicable to non-factual or non-encyclopedic data, limiting the generalizability of the approach.

2. The organization of the paper could be improved. The experimental section is relatively short, with some important experimental tables relegated to the appendix. Additionally, the paper lacks a comprehensive ablation study.

3. The explanation and analysis of the experimental results are somewhat lacking. For instance, in Table 3, it is unclear what the values represent (e.g., accuracy) and why the performance of IFMET improves as the edit batch size increases, while the performance of other baselines decreases. More detailed explanations and discussions of these observations would strengthen the paper.

Meta-review: This paper examines multi-hop knowledge editing in large language models, highlighting the shortcomings of current locate-then-edit methods. The authors' mechanistic interpretability analysis reveals that multi-hop knowledge queries process information differently from single-hop queries, with a greater reliance on deeper MLP layers. Current knowledge editing methods struggle with multi-hop queries as they primarily modify shallow layers while leaving deeper layers untouched. To address this, the authors introduce IFMET, a novel locate-then-edit approach that uses supplementary sets to convert single-hop edits into multi-hop chains, demonstrating enhanced performance on multi-hop knowledge editing tasks compared to existing methods.

While the paper offers valuable insights into how different layers handle single versus multi-hop knowledge, it falls short in several critical areas. The lack of clear ablation studies makes it impossible to determine whether performance improvements stem from deep layer editing or simply from expanded support sets. The paper fails to experimentally validate that editing deeper layers contributes to the observed gains, and its analysis of efficiency and complexity tradeoffs is inadequate.

The paper exhibits significant methodological and presentation flaws that warrant rejection. The central thesis regarding the importance of editing deeper layers for multi-hop knowledge lacks proper experimental validation, as improvements could be attributed to the expanded support set rather than the proposed layer-specific editing mechanism. The paper's presentation is problematic, with crucial results hidden in appendices, poorly explained performance metrics, and inconsistent result reporting. Furthermore, practical concerns arise from the method's dependence on external knowledge sources, limited testing on older models, and insufficient efficiency analysis.

For future consideration, the authors would need to conduct comprehensive ablation studies to validate deep-layer editing's specific contribution, enhance result presentation and clarity, expand testing to contemporary models, address implementation practicality, include detailed efficiency analysis, and strengthen the validation of key mechanistic claims. These requirements necessitate substantial additional research and validation rather than simple revisions.

Decision: Reject