Paper deep dive
Keys to Robust Edits: from Theoretical Insights to Practical Advances
Jianhao Yan, Futing Wang, Yun Luo, Yafu Li, Yue Zhang
Models: LLaMA2-7B, Mistral-7B
Intelligence
Status: succeeded | Model: google/gemini-3.1-flash-lite-preview | Prompt: intel-v1 | Confidence: 95%
Last extracted: 3/12/2026, 5:18:26 PM
Summary
The paper identifies a fundamental limitation in 'locate-and-edit' methods for LLMs, where internal representations used as semantic keys fail to balance robustness (context-invariance) and specificity (knowledge discrimination). To address this, the authors introduce the 'Robust Edit Pathway' (REP), a plug-and-play module that disentangles editing keys from native model representations and uses contrastive learning to achieve a robustness-specificity balance, significantly improving editing success rates.
Entities (5)
Relation Signals (3)
Robust Edit Pathway ā disentangles ā Editing Keys
confidence 95% Ā· REP, a plug-and-play module that: (1) disentangles editing keys from native model representations
Robust Edit Pathway ā improves ā Robustness
confidence 95% Ā· REP improves success rate over robustness tests by up-to 66.4%
ROME ā uses ā Internal Representations
confidence 90% Ā· ROME treats these MLPs as linear associative memories... utilizing inner representations as keys
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Large language models (LLMs) struggle with maintaining accurate knowledge due to conflicting/outdated parametric memories. While locate-and-edit methods address this, their reliance on models' internal representations leads to robustness failures in long-context reasoning and paraphrased queries. We identify a fundamental limitation of locate-and-edit methods: existing semantic keys (for memory localization) cannot simultaneously satisfy robustness (context-invariant activation) and specificity (precise knowledge discrimination). Through theoretical error-bound analysis, we establish formal criteria for effective editing. Our solution introduces \textit{Robust Edit Pathway (REP)}, a plug-and-play module that: (1) disentangles editing keys from native model representations; (2) dynamically adjusts keys via contrastive learning to achieve robustness-specificity balance. Extensive experiments across various editing methods (ROME/MEMIT/R-ROME/EMMET), existing LLMs (LLaMA2, QWen, Mistral), and datasets (CounterFact, ZsRE) show that REP improves success rate over robustness tests by up-to 66.4\% while maintaining the success rate unaffected. Our code can be found at this https URL .
Tags
Links
Trouble viewing inline? Open PDF directly ā
Full Text
98,181 characters extracted from source content.
Expand or collapse full text
Keys to Robust Edits: From Theoretical Insights to Practical Advances Jianhao Yan1,2 Futing Wang1,211footnotemark: 1 Yun Luo1,2 Yafu Li4 Yue Zhang2,3 1Zhejiang University 2School of Engineering, Westlake University 3 Institute of Advanced Technology, Westlake Institute for Advanced Study 4 Shanghai AI Lab elliottyan37@gmail.com Two authors contributed equally to this work. Corresponding author. Abstract Large language models (LLMs) struggle with maintaining accurate knowledge due to conflicting/outdated parametric memories. While locate-and-edit methods address this, their reliance on modelsā internal representations leads to robustness failures in long-context reasoning and paraphrased queries. We identify a fundamental limitation of locate-and-edit methods: existing semantic keys (for memory localization) cannot simultaneously satisfy robustness (context-invariant activation) and specificity (precise knowledge discrimination). Through theoretical error-bound analysis, we establish formal criteria for effective editing. Our solution introduces Robust Edit Pathway (REP), a plug-and-play module that: (1) disentangles editing keys from native model representations; (2) dynamically adjusts keys via contrastive learning to achieve robustness-specificity balance. Extensive experiments across various editing methods (ROME/MEMIT/R-ROME/EMMET), existing LLMs (LLaMA2, QWen, Mistral), and datasets (CounterFact, ZsRE) show that REP improves success rate over robustness tests by up-to 66.4% while maintaining the success rate unaffected. 111Our code can be found at https://github.com/ElliottYan/RobustKeyEdit. Keys to Robust Edits: From Theoretical Insights to Practical Advances Jianhao Yan1,2ā thanks: Two authors contributed equally to this work. Futing Wang1,211footnotemark: 1 Yun Luo1,2 Yafu Li4 Yue Zhang2,3ā thanks: Corresponding author. 1Zhejiang University 2School of Engineering, Westlake University 3 Institute of Advanced Technology, Westlake Institute for Advanced Study 4 Shanghai AI Lab elliottyan37@gmail.com 1 Introduction Large language models (LLMs, Achiam et al. 2023; Touvron et al. 2023a, b) have revolutionized knowledge storage through their parametric memories, yet their reliance on static training data renders them prone to inaccuracies from conflicting or outdated information. While knowledge editing methods like ROME and MEMIT Meng et al. (2022a, b) attempt to address this by modifying specific model parameters, existing approaches are found to suffer from editing failures with robustness tests Ma et al. (2024c); Yang et al. (2024b). For example, editing "Slovenia belongs to Europe ā Antarctica" frequently collapses when the subject is rephrased ("Republic of Slovenia"), embedded in long contexts, or attacked by shuffling subjects. The unreliability greatly limits the impact and application of model editing methods. We uncover a fundamental flaw in their core mechanism: the intrinsic instability of the modelās internal representations when used as semantic keys for editing. Existing approaches assume these internal representations can reliably localize knowledge. Through formal analysis of key-value associative memory in MLP layers (Definitions 3.2 - 3.3) and empirical analyses, we prove that existing internal representations frequently violate the foundational conditions for reliable editing: (1) Key Sensitivity: Representations of the same fact diverge drastically under perturbations. Whitened similarity scores drop to near-random levels for shuffled subject tokens (e.g., "_ia Sloven" vs. "Sloven _ia") and for rephrased variants, breaching the robustness bound derived in Lemma 4.6; (2) Key Collisions: Semantically distinct entities exhibit unintended overlaps in the whitened space for unrelated pairs like "Michael Jordan" and "Kobe Bryant", Figure 4), contradicting the specificity requirement in Lemma 4.7. Figure 1: An example of the edited knowledge āSlovenia belongs to the continent ofā through knowledge editing and its failures on the different scenarios. To resolve this, we propose Robust Edit Pathway (REP), a novel plug-and-play module that disentangles editing keys from native model representations. Inspired by our theoretical results, where effective knowledge insertion requires both centering around semantically equivalent surface forms of subjects while not affecting unrelated ones ā REP introduces: (1) Disentangled Key Projection: A contrastively trained adapter aligns keys for target facts across perturbations, ensuring context-invariant activation through whitened similarity optimization (Eq. 6); (2) Dynamic Gate Mechanism: Token-level gating selectively activates edits, dynamically balancing robustness and specificity. Extensive evaluations across 4 editing methods (ROME/MEMIT/R-ROME/EMMET)(Meng et al., 2022a, b; Gupta et al., 2024a; Yoon et al., 2024), 3 LLMs (LLaMA2-7B, Mistral-7B, and Qwen-2-7B)(Touvron et al., 2023b; Jiang et al., 2023; Yang et al., 2024a), and two datasets (Meng et al., 2022a; De Cao et al., 2021) demonstrate REPās superiority: (1) up-to 66.4% absolute gains on robustness tests, recovering at most 94% of the editing performance versus unperturbed inputs; (2) specificity preservation (Ī ĪLocality < 1.6) and minimal fluency degradation (Ī ĪFluency <2.2); (3) effectiveness on both in-domain and out-of-domain robustness queries. Our contributions are as follows: ⢠Through theoretical error-bound analysis, we establish formal criteria for effective model editing and reveal fundamental limitations in using internal representations as editing keys. ⢠Extensive experiments demonstrate existing semantic keys cannot simultaneously achieve robustness (context-invariant activation) and specificity (precise knowledge discrimination). ⢠We propose Robust Edit Pathway (REP), a plug-and-play module that disentangles editing keys from native model representations and dynamically adjusts them via contrastive learning. ⢠Experiments across various editing methods (ROME/MEMIT/R-ROME/EMMET), LLMs, and datasets show REP improves success rate over robustness tests by up-to 66.4% while maintaining editing performance. 2 Related Work Knowledge Editing. As large language models have grown in complexity and size, post-modification has become increasingly challenging due to their opaque mechanisms and vast parameter spaces (Mitchell et al., 2022; Zhong et al., 2023). This has led to heightened interest in knowledge editing, a technique for precise model modification. Knowledge editing are applied to various scenarios, such as editing for safety (Wang et al., 2024c), debias (Yan et al., 2024) and concepts (Wang et al., 2024d). Our work is in line with the locate-and-edit methods, which draw much attention as they potentially unveil how the knowledge are stored in an LLM. These approaches first identify relevant parameters before updating them to modify specific knowledge, including KnowledgeNeuronās attribution-based neuron updating (Dai et al., 2021), ROMEās causal mediation analysis for MLP editing (Meng et al., 2022a), MEMITās multi-layer residual distribution (Meng et al., 2022b), PMETās refined allocation strategy (Li et al., 2024), and WilKEās dynamic layer selection (Hu et al., 2024b) to reduce potential negative effects. These methods all utilize inner representations as keys for key-value modeling. In contrast, we show that inner representations cannot meet the requirements of robust and specific edits, and we propose a robust edit pathway to mitigate this. Challenges of Knowledge Editing. Despite the promise, various challenges persist in practical applications of model editing methods. Previous studies show that edits often degrade general language abilities (Gu et al., 2024; Ma et al., 2024b), damage the hidden space (Wang et al., 2024b), struggle to propagate to related facts (Hua et al., 2024), and are easily forgotten during sequential updates (Gupta et al., 2024b). Moreover, multi-hop reasoning can elicit old knowledge (Zhang et al., 2024), and models may collapse after few edits (Yang et al., 2024b; Brown et al., 2023). Further complications include cross-lingual inconsistencies (Wang et al., 2024a), knowledge conflicts (Li et al., 2023), and inadequate evaluation in realistic settings such as long-form generation (Rosati et al., 2024) and neighborhood knowledge (Ma et al., 2024a). These issues underscore the need for more sophisticated and comprehensive editing techniques. However, previous research largely remains focused on the outcomes of knowledge editing in various scenarios, lacking a deeper understanding of the underlying mechanisms of these methods and the true reasons behind their frequent failures. Our work presents both theoretical and empirical understanding regarding the reason for the robustness failures of locate-and-edit methods and proposes REP to enhance them. Figure 2: Overview of REP. Left: Key concept visualization; Right: Architectural design of the adapter. 3 Knowledge Editing In this section, we first formulate knowledge editing and review the locate-and-edit methods. Task Definition Knowledge editing focuses on updating factual associations in language models. Following Meng et al. (2022a) and Meng et al. (2022b), we define a knowledge ff as a triple (h,r,t)ā(h,r,t)( h , r , t ), where hāh is the head entity, r is the relation, and t is the target entity (e.g., (USA, has president, Biden)). Given a knowledge triple: (h,r,t)ā(h,r,t)( h , r , t ), the goal is to modify the modelās knowledge by replacing the target entity t with a new target tā=TrumpsubscriptTrumpt_*=Trumptā = Trump (e.g., changing āBidenā to āTrumpā). Autoregressive large language models (LLMs) can complete a natural-language sentence by leveraging implicit knowledge encoded within their parameters. Thus, a knowledge triple (h,r,t)ā(h,r,t)( h , r , t ) is considered stored in the LLM when the model can predict the target t given a prompt that corresponds to (h,r,ā )āā (h,r,Ā·)( h , r , ā ). For instance, given a prompt āThe president of USA isā, a model with the above knowledge would predict āBidenā. Definition 3.1 (Knowledge Editing for LLMs). Given a knowledge triple (h,r,t)ā(h,r,t)( h , r , t ) already stored in the language model ā³MM and a new knowledge (h,r,tā)āsubscript(h,r,t_*)( h , r , tā ), there exists a set of prompts P=pP=\p\P = p corresponds to (h,r,ā )āā (h,r,Ā·)( h , r , ā ). The knowledge editing algorithm AA aims to modify the modelās prediction on P from t to tāsubscriptt_*tā. This task can be formally expressed as follows: ā³ā²=ā¢(ā³),superscriptā³ā²ā³ =A(M)\,,Mā² = A ( M ) , s.t.ā¢ā³ā¢(p)=t,ā³ā²ā¢(p)=tā,āpāP,formulae-sequences.t.ā³formulae-sequencesuperscriptā³ā²subscriptfor-all .t.~M(p)=t,M (p)=t_*,% ā pā P,s.t. M ( p ) = t , Mā² ( p ) = tā , ā p ā P , Architectural Foundations for locate-and-edit The efficacy of locate-and-edit methods relies on identifying modular components in LLMs that encode factual knowledge. Transformer-based Vaswani (2017) LLMs organize computation into layers containing two core submodules: self-attention (for contextual reasoning) and Multi-Layer Perceptrons (MLPs, for nonlinear feature transformations). A key insight from ROME (Meng et al., 2022a) establishes that factual associations localize to specific MLP layersāenabling precise edits. Each MLP layer comprises two feed-forward operations: (1) an up-projection that expands hidden dimensions for fine-grained feature interactions, and (2) a down-projection that contracts dimensions to synthesize higher-level representations. ROME treats these MLPs as linear associative memories (Definition 3.2), leveraging causal mediation analysis to pinpoint layers where edits (e.g., substituting āBidenā ā āTrumpā in presidential facts) propagate correctly. By surgically modifying these layers, ROME updates targeted knowledge while preserving unrelated model capabilities, minimizing unintended side effects. Definition 3.2 (MLP Layers as Associative Memories). The down-projection weight matrix W in the MLP layer can be interpreted as a linear associative memory system. Specifically: ⢠Keys K=[k1ā¢|k2|ā¢āÆ|kn]āāD1Ćndelimited-[]conditionalsubscript1subscript2āÆsubscriptsuperscriptāsubscript1K=[k_1|k_2|Ā·s|k_n] ^D_1Ć nK = [ k1 | k2 | ⯠| kitalic_n ] ā blackboard_RD1 Ć n represent the intermediate representations of the prompt corresponding to (h,r,ā )āā (h,r,Ā·)( h , r , ā ) before down-projection. ⢠Values V=[v1ā¢|v2|ā¢āÆ|vn]āāD2Ćndelimited-[]conditionalsubscript1subscript2āÆsubscriptsuperscriptāsubscript2V=[v_1|v_2|Ā·s|v_n] ^D_2Ć nV = [ v1 | v2 | ⯠| vitalic_n ] ā blackboard_RD2 Ć n represent the corresponding outputs after down-projection. The weight matrix WāD2ĆD1superscriptsubscript2subscript1W ^D_2Ć D_1W ā Ritalic_D2 Ć D1 approximately maps the keys to their associated values, satisfying Wā¢KāVWKā VW K ā V. Definition 3.2 (illustrated by Figure 2 left) enables the MLP layers to store and retrieve prompt-target associations. Then, ROME accomplishes knowledge editing by inserting a new key-value pair into the MLP layer, modifying W to W^ Wover start_ARG W end_ARG. Definition 3.3 (The Solution of ROME). In ROME, a new key-value pair (kā,vā)subscriptsubscript(k_*,v_*)( kā , vā ) can be inserted into the language model using the following closed-form solution: minimizeW^ā¢āW^ā¢KāVāā¢s.t.ā¢W^ā¢kā=vā,subscriptminimize^norm^s.t.^subscriptsubscript _ W\ || WK-V||~s.t.\ Wk% _*=v_*\,,minimizeover start_ARG W end_ARG | | over start_ARG W end_ARG K - V | | s.t. over start_ARG W end_ARG kā = vā , by settingā¢W^=W+ā¢(Cā1ā¢kā)Tby setting^superscriptsuperscript1subscript setting\ W=W+ (C^-1k_*)^Tby setting over start_ARG W end_ARG = W + Ī ( C- 1 kā )T where: ⢠C=Kā¢KTsuperscriptC=K^TC = K Kitalic_T is a constant matrix pre-cached by estimating the uncentered covariance of k from a sample of Wikipedia text, ⢠=vāāWā¢kā(Cā1ā¢kā)Tā¢kāsubscriptsubscriptsuperscriptsuperscript1subscriptsubscript = v_*-Wk_*(C^-1k_*)^Tk_*Ī = divide start_ARG vā - W kā end_ARG start_ARG ( C- 1 kā )T kā end_ARG is a vector proportional to the residual error of the new key-value pair on the original memory matrix. Intuitively, āW^ā¢KāVānorm^|| WK-V||| | over start_ARG W end_ARG K - V | | controls the shift from previously stored keys and values, and W^ā¢kā=vā^subscriptsubscript Wk_*=v_*over start_ARG W end_ARG kā = vā makes sure that the new knowledge is added into W^ Wover start_ARG W end_ARG. To implement this solution, it is necessary to extract the key kāsubscriptk_*kā and calculate the value vāsubscriptv_*vā. Remark 3.4 (Extract kāsubscriptk_*kā). In ā³MM, kāsubscriptk_*kā is obtained by averaging the activations collected at the last token of the head entity hāh, processing a small set of texts that end with the head entity hāh. This can be formally written as: kā=1Mā¢āj=1Mkā¢(xj+h),subscript1subscriptsuperscript1subscriptā k_*= 1MĪ£^M_j=1k(x_j+h)\,,kā = divide start_ARG 1 end_ARG start_ARG M end_ARG āMitalic_j = 1 k ( xitalic_j + h ) , where kā¢(ā )ā k(Ā·)k ( ā ) is the input of the second MLP layer of the lāsubscriptl_*lā-th FFN layer in the transformer, M is the number of the selected texts and xjsubscriptx_jxitalic_j represents a random prefix. Once kāsubscriptk_*kā is extracted, the next step is to determine the appropriate value vāsubscriptv_*vā for the new key-value pair. Remark 3.5 (Calculate vāsubscriptv_*vā). Let āā³ā²ā¢(tā|p)subscriptāsuperscriptā³ā²conditionalsubscriptP_M (t_*|p)blackboard_PMā² ( tā | p ) denote the probability of tāsubscriptt_*tā after ā³MM processes query prompt p. We seek a vector zz to substitute as the output of the MLP in layer lāsuperscriptl^*lā at token i (denoted mi(lā):m_i^(l*):zmitalic_i( l ā ) : z) such that the network predicts the target tail entity tāsubscriptt_*tā while maintaining the modelās understanding of the subjectās essence. The optimization objective is as follows: vā=argā”minā”1Nā¢āj=1Nālogā”āā³ā£(mi(lā):)ā¢[hā²|xj+p]ā(a) Maximizing ā¢hā²ā¢ probability v_*= _z 1N _j=1^N % - _M(m_i^(l*):z)[h |x_j+p]_% (a) Maximizing h probabilityvā = arg minbold_z divide start_ARG 1 end_ARG start_ARG N end_ARG āj = 1N underā start_ARG - log blackboard_PM ( m start_POSTSUBSCRIPT i( l ā ) : z ) end_POSTSUBSCRIPT [ hā² | xitalic_j + p ] end_ARG(a) Maximizing hā² probability +DKL(āā³ā£(mi(lā):)[ā |pā²]||āā³[ā |pā²])ā(b) Controlling essence drift. + D_KL (P_M(m_i^(l% *):z)[Ā·|p ]||P_M[Ā·|p ]% )_(b) Controlling essence drift.+ underā start_ARG DKL ( blackboard_PM ( m start_POSTSUBSCRIPT i( l ā ) : z ) end_POSTSUBSCRIPT [ ā | pā² ] | | blackboard_PM [ ā | pā² ] ) end_ARG(b) Controlling essence drift . where pā² is āsubject is aā. In conclusion, the ROME method effectively enables the insertion of new knowledge triples (h,r,tā)āsubscript(h,r,t_*)( h , r , tā ) into large language models through operating key-value pairs. 4 Theoretical Results of Key-Value Associative Memory The idea of keys and values in associative memory (as shown in Definition 3.2) is analogous to the key-value databases in modern computer systems. What makes the difference here is that down-projection FFNs implement a fuzzy retrieval mechanism, whereas modern key-value databases generally require the keys to be unique. Lemma 4.1 (Fuzzy Key-Value Mapping). Given KāāD1Ćnsuperscriptāsubscript1K ^D_1Ć nK ā blackboard_RD1 Ć n and VāāD2Ćnsuperscriptāsubscript2V ^D_2Ć nV ā blackboard_RD2 Ć n as defined in Definition 3.2 that are already stored in the feed-forward layer WāāD2ĆD1superscriptāsubscript2subscript1W ^D_2Ć D_1W ā blackboard_RD2 Ć D1, assume nā«D1much-greater-thansubscript1n D_1n ā« D1 and K has the rank of D1subscript1D_1D1. When a new query kāsubscriptk_*kā comes, its corresponding value can be represented as the weighted sum of existing values, vā=āi=0Nαiā¢visubscriptsubscriptsuperscript0subscriptsubscriptv_*=Ī£^N_i=0 _iv_ivā = āNitalic_i = 0 αitalic_i vitalic_i and α=KTā¢(Kā¢KT)ā1ā¢kāsuperscriptsuperscriptsuperscript1subscriptα=K^T(K^T)^-1k_*α = Kitalic_T ( K Kitalic_T )- 1 kā can be solved by the Moore-Penrose pseudoinverse. Lemma 4.1 demonstrates that the retrieved memory of a new test query can be considered as the linear combination of previously stored memory, which leads to the following direct corollary. Corollary 4.2 (Edited Key-Value as a Patch against Original Knowledge). In locate-and-edit algorithms, new knowledge is injected into the memory as a key-value pair (kā,vā)subscriptsubscript(k_*,v_*)( kā , vā ). Consider a set of existing key-value pairs (ki,vi)subscriptsubscript(k_i,v_i)( kitalic_i , vitalic_i ) where kiās,viāVsformulae-sequencesubscriptsubscriptsubscriptsubscriptk_i _s,v_iā V_skitalic_i ā Kitalic_s , vitalic_i ā Vitalic_s that represent the same knowledge as (kā,vā)subscriptsubscript(k_*,v_*)( kā , vā ) (e.g., paraphrases). Suppose the injection is lossless222In a real-world scenario, the edit cannot be lossless. Here, for a clear intuition, the above lemma is presented in an ideal way as the editing process will change the value of previously stored key-value pairs. We show that even considering the lossless scenario, the current LLMs cannot satisfy robustness and specificity requirements. and that ssubscriptK_sKitalic_s has full row rank, querying with any kiāssubscriptsubscriptk_i _skitalic_i ā Kitalic_s would retrieve a value v=āiαiā¢vi+αāā¢vāsubscriptsubscriptsubscriptsubscriptsubscriptv= _i _iv_i+ _*v_*v = āi αitalic_i vitalic_i + αā vā. Remark 4.3. This corollary reveals that knowledge editing operates as an additive mechanism rather than a replacement one. Instead, it leaves the previously stored knowledge intact and counters them with a newly added value vāsubscriptv_*vā. Lemma 4.4 (Bound on optimized Īā¢v=vāāvoĪsubscriptsubscript v=v_*-v_oĪ v = vā - vitalic_o). Assume the edited layer is only connected to the final prediction layer via an attention layer, where the attention layer has parameters WQ,WK,WVsubscriptsubscriptsubscriptW_Q,W_K,W_VWitalic_Q , Witalic_K , Witalic_V, and wtsubscriptw_twitalic_t and wtāsubscriptsubscriptw_t_*witalic_t start_POSTSUBSCRIPT ā end_POSTSUBSCRIPT are the output embeddings for the original and edited target, we have the following inequality, (wtāāwt)Tā¢WVā¢(vāāvo)>ϵ1+ϵ2superscriptsubscriptsubscriptsubscriptsubscriptsubscriptsubscriptsubscriptitalic-ϵ1subscriptitalic-ϵ2 (w_t_*-w_t)^TW_V(v_*-v_o)> _1+ _2( witalic_t start_POSTSUBSCRIPT ā end_POSTSUBSCRIPT - witalic_t )T Witalic_V ( vā - vitalic_o ) > ϵ1 + ϵ2 ā ~ ā ā(wtāāwt)Tā¢WVāā āvāāvoā>ϵ1+ϵ2,ā normsuperscriptsubscriptsubscriptsubscriptsubscriptnormsubscriptsubscriptsubscriptitalic-ϵ1subscriptitalic-ϵ2 ||(w_t_*-w_t)^TW_V||Ā·||v_*-v_o||> _1+% _2,| | ( witalic_t start_POSTSUBSCRIPT ā end_POSTSUBSCRIPT - witalic_t )T Witalic_V | | ā | | vā - vitalic_o | | > ϵ1 + ϵ2 , where ϵitalic-ϵεϵ is the logit gap after projection to the output embedding between t and tāsubscriptt_*tā. ϵ1subscriptitalic-ϵ1 _1ϵ1 denotes the logit gap before edit and ϵ2subscriptitalic-ϵ2 _2ϵ2 denotes the logit gap after edit. A value of ϵā2.30italic-ϵ2.30εā 2.30ϵ ā 2.30 corresponds to a 90% top-1 prediction probability. Remark 4.5. Lemma 4.4 suggests that an edited value should be first similar to the vector pointing from t to tāsubscriptt_*tā after a projection with WVsubscriptW_VWitalic_V. Then, the edited values Īā¢vĪ vĪ v should be sufficiently large to ensure the success of the edit. Our assumption here simplifies the connection between the edited layer and the prediction layer, as in real-world scenarios, the edit layer might pass through subsequent layers and undergo multiple attention operations before finally connecting to the prediction layer. However, the path weāre considering (i.e., from the edit layer to the prediction layer via an attention layer) is arguably the most direct route. We contend that this direct path is crucial and warrants particular attention, and this simplification allows us to focus on the most immediate and potentially significant impact of edits. Lemma 4.6 (Robustness Requirement for the Key-Values). Robust editing requires consistency across semantically equivalent inputs: when editing knowledge with a new pair (kā,vā)subscriptsubscript(k_*,v_*)( kā , vā ), the edit should propagate to all semantically equivalent representations in the memory. For an edit to be considered a robust edit, querying with any ksāssubscriptsubscriptk_s _skitalic_s ā Kitalic_s should reliably retrieve the new knowledge (h,r,tā)āsubscript(h,r,t_*)( h , r , tā ). This can be expressed as the following constraint: (wtāāwt)Tā¢WVā¢(ksTā¢Cā1ā¢kā)ā vāT>ϵ1+ϵ2,āksās.formulae-sequenceā superscriptsubscriptsubscriptsubscriptsubscriptsuperscriptsubscriptsuperscript1subscriptsuperscriptsubscriptsubscriptitalic-ϵ1subscriptitalic-ϵ2for-allsubscriptsubscript(w_t_*-w_t)^TW_V(k_s^TC^-1k_*)Ā· v_*^T> _1+% _2,ā k_s _s.( witalic_t start_POSTSUBSCRIPT ā end_POSTSUBSCRIPT - witalic_t )T Witalic_V ( kitalic_sitalic_T C- 1 kā ) ā vāitalic_T > ϵ1 + ϵ2 , ā kitalic_s ā Kitalic_s . When we look into the Lemma 4.6, βs,ā=ksTā¢Cā1ā¢kāsubscriptsuperscriptsubscriptsuperscript1subscript _s,*=k_s^TC^-1k_*βitalic_s , ā = kitalic_sitalic_T C- 1 kā can be seen as a similarity measure on a projected space, namely whiten similarity. This lemma implies that (1) vāsubscriptv_*vā is decided by minksā²ās(ksā²Cā1kā _k_s _s(k_s C^-1k_*minitalic_k start_POSTSUBSCRIPT sā² ā Kitalic_s end_POSTSUBSCRIPT ( kitalic_sā² C- 1 kā), that is, kāsubscriptk_*kā should be near all ksāssubscriptsubscriptk_s _skitalic_s ā Kitalic_s. If not, vāsubscriptv_*vā needs to be of large magnitude to counter the difference. Such large-magnitude updates can destabilize the modelās learned representations and potentially degrade its overall performance; (2) vāsubscriptv_*vā needs not only to be aligned with the direction (wtāāwt)subscriptsubscriptsubscript(w_t_*-w_t)( witalic_t start_POSTSUBSCRIPT ā end_POSTSUBSCRIPT - witalic_t ), but also has a sufficiently large magnitude to ensure editing success. Lemma 4.7 (Specificity Requirement for the Key-Values). If the newly added knowledge triplet (h,r,tā)āsubscript(h,r,t_*)( h , r , tā ) would not be retrieved for any koāssubscriptsubscriptk_o _skitalic_o ā Kitalic_s, it requires the following inequality to be satisfied: (wtnāwtā)Tā¢WVā¢(koTā¢Cā1ā¢kā)ā vāT<ϵ3,ā superscriptsubscriptsubscriptsubscriptsubscriptsubscriptsuperscriptsubscriptsuperscript1subscriptsuperscriptsubscriptsubscriptitalic-ϵ3 (w_t_n-w_t_*)^TW_V(k_o^TC^-1k_*)Ā· v_*^% T< _3,( witalic_t start_POSTSUBSCRIPT n end_POSTSUBSCRIPT - witalic_t start_POSTSUBSCRIPT ā end_POSTSUBSCRIPT )T Witalic_V ( kitalic_oitalic_T C- 1 kā ) ā vāitalic_T < ϵ3 , ākoāsā¢aā¢nā¢dā¢āwāW,for-allsubscriptsubscriptfor-all ā k_o _s~and~ā wā W,ā kitalic_o ā Kitalic_s a n d ā w ā W , where tnsubscriptt_ntitalic_n is the original target retrieved by kosubscriptk_okitalic_o and ϵ3subscriptitalic-ϵ3 _3ϵ3 denotes the logit difference between tnsubscriptt_ntitalic_n and tāsubscriptt_*tā. One simple solution for this lemma is kTā¢Cā1ā¢kā=0superscriptsuperscript1subscript0k^TC^-1k_*=0kitalic_T C- 1 kā = 0, which describes no superposition, as discussed in one of the concurrent work (Hu et al., 2024a). However, as superposition generally exists among existing LLMs, we discuss more general cases here. Lemma 4.8 (Whitened Similarity Bounds). For a successful edit to achieve both robustness and specificity, the whitened similarities must satisfy: 1. Lower bound for semantically equivalent keys: βs,ā=ksTā¢Cā1ā¢kāā„βmin,āksāsformulae-sequencesubscriptsuperscriptsubscriptsuperscript1superscriptsubscriptfor-allsubscriptsubscript _s,*=k_s^TC^-1k^*ā„ _ , ā k_sā % K_sβitalic_s , ā = kitalic_sitalic_T C- 1 kā ℠βroman_min , ā kitalic_s ā Kitalic_s (1) where βmin=ϵ1+ϵ2ā(wtāāwt)Tā¢WVāā āvāāsubscriptsubscriptitalic-ϵ1subscriptitalic-ϵ2ā normsuperscriptsubscriptsuperscriptsubscriptsubscriptnormsuperscript _ = _1+ _2||(w_t^*-w_t)^TW_V||% Ā·||v^*||βroman_min = divide start_ARG ϵ1 + ϵ2 end_ARG start_ARG | | ( witalic_tā - witalic_t )T Witalic_V | | ā | | vā | | end_ARG 2. Upper bound for unrelated keys: |βo,ā|=|koTā¢Cā1ā¢kā|ā¤Ī²max,ākoāsformulae-sequencesubscriptsuperscriptsubscriptsuperscript1superscriptsubscriptfor-allsubscriptsubscript| _o,*|=|k_o^TC^-1k^*|⤠_ , ā k_oā% K_s| βitalic_o , ā | = | kitalic_oitalic_T C- 1 kā | ⤠βroman_max , ā kitalic_o ā Kitalic_s (2) where βmax=ϵ3maxwāā¢āwāwtāāā āWVāā āvāāsubscriptsubscriptitalic-ϵ3ā subscriptnormsubscriptsuperscriptnormsubscriptnormsuperscript _ = _3 _w ||w-w_t^*||Ā·||W% _V||Ā·||v^*||βroman_max = divide start_ARG ϵ3 end_ARG start_ARG maxitalic_w ā W | | w - witalic_tā | | ā | | Witalic_V | | ā | | vā | | end_ARG Detailed proof of all lemmas can be found in Appendix A. Remark 4.9. Lemma 4.9 suggests that when adding new knowledge, a new key must be introduced at an appropriate position. This new key must be placed carefully, as its position can affect both its intended target and potentially interfere with nearby keys. Figure 3: The distribution of normalized whitening similarity between different kinds of keys and original keys. 5 Empirical Analysis: A Break of Requirements In light of our theoretical results in previous section, we analyze the current knowledge editing methods, showing that the robustness and specificity requirements from previous section cannot be satisfied with inner representations as keys, motivating our approach. 5.1 Experimental Setup Following previous work, we use the CounterFact (Meng et al., 2022a) datasets, choosing LLaMA-2 as our base model. In addition to the prompt from CounterFact dataset, we additionally consider three types of perturbation in our experiments, namely prompt appended with unrelated long context, subject rephrase and random shuffled subject. Even though the shuffled subject does not contain the same semantic meaning, it demonstrates how keys shift when the position of same token occurs at different positions. We collect 10 rephrases for each subject by prompting gpt-4o-mini. The prompt we use can be found in Appendix. For long context, we follow Ma et al. (2024c) and extract random text span of 512 tokens from Wikitext-103 Merity et al. (2016). For rephrased prompts, we use the paraphrases of prompts released by Patil et al. (2023). For shuffled subject, we sample 10 random orderings of tokens in the subject. We use 100 samples in our valid set for empirical analyses. 5.2 Empirical Statistics of Keys, Values and Others Dissimilar Keys. In Figure 3, we present the distribution of whiten similarity β for three operations over the original edit along with a random key baseline. The implementation detail can be found in Appendix B.2. We can see that the similarity after these operations drops drastically. Rephrasing and shuffling word orders generally reduce the similarity from 1.0 to less than 0.4, even to the random level. Appending long context is less destructive, but still reduces the key similarity to [0.2, 0.9]. These results indicate a violation of the robustness requirement, showing a significant variability in the representation of the same subject, making locate-and-edit difficult to retrieve the edited value to be retrieved. These findings challenges the intuition that semantically equivalent subjects should have similar representations, and poses severe challenges to the effectiveness of edits. Subject Score Prefix Michael Jordan 3898.8 ⦠reach 10,000 career assists. Kobe Emmitt Smith 8469.9 ⦠for the NL lead with Randy Johnson, Kevin Millwood, Tom Glavine Pasquale Di Sabatino 2190.6 ⦠archbishop of Albi Giovanni Costanzio Caracciolo East China Normal University 6798.2 ⦠Located southwest of Gongyi city in Gongxian County BMW Z3 3570.2 ⦠her lead over Rƶhrl shrank to 18 minutes. The Toyota Celica Figure 4: Left: CounterFact subjects have unrelated prefixes which are close in keys. The red dashed line indicates random keys baseline. Right: Semantically similar subjects bring challenges to specificity. Similar but Non-Related Keys. We also investigate whether there exist different subjects that have highly similar keys. To this end, we iterate through a slice of Wikitext-103 dataset (about 80M tokens) and select those close to subjects in CounterFact in the whitening space. We filter those tokens whose prefix has the same subject token and collect the top 10 unrelated keys of each subject in CounterFact. The left of Figure 4 plots the distribution of whitening similarities between unrelated prefixes and CounterFact subjects. We find that a large portion of them has an extremely high whitening similarity score, i.e., > 2500. Based on our theory, it indicates that any edit that affects these subjects would inevitably affect the output on these unrelated prefixes. On the right side of Figure 4, we present a list of subjects and their top-1 prefix in terms of whitening similarities. Interestingly, we observe that a subject can exhibit similarity in distributional semantics (Lenci and Sahlgren, 2023) to its corresponding top unrelated prefix. For example, the keys of Michael Jordan are highly similar to keys of a prefix related to Kobe. Considering that these two basketball players has much in common in many perspectives, it makes sense that their keys are similar. However, an edit to Michael Jordan affects Kobe would be definitely unreasonable. 6 Robust Edit Pathway Our solution is to separate keys from the modelās internal representations by introducing a potential branching path as keys for edited facts. This is done by adding an adapter after the keys, allowing their representations to be modified when needed. As shown on the right of Figure 2, our adapter consists of two modules, a projection module that is responsible for aligning the keys and a gate module that activates the adapter when a token representation needs to be edited: k^=fgateā¢(k)āfprojā¢(k)+k,^subscriptgatesubscriptproj k=f_gate(k) f_proj(k)+k,over start_ARG k end_ARG = fgate ( k ) ā fproj ( k ) + k , (3) where kāābā¢sā¢zĆLĆDsuperscriptāk ^bszĆ LĆ Dk ā blackboard_Rb s z Ć L Ć D, fgateā¢(k)āābā¢sā¢zĆLĆ1subscriptgatesuperscriptā1f_gate(k) ^bszĆ LĆ 1fgate ( k ) ā blackboard_Rb s z Ć L Ć 1 and fprojā¢(k)āābā¢sā¢zĆLĆDsubscriptprojsuperscriptāf_proj(k) ^bszĆ LĆ Dfproj ( k ) ā blackboard_Rb s z Ć L Ć D. The gate mechanism here operates on the granularity of tokens and adaptively selects whether a key should be modified or not. We train the adapter by aggregating the keys of same subject ksāssubscriptsubscriptk_s _skitalic_s ā Kitalic_s toward our injected target key kāsubscriptk_*kā: āagg=ā|(ks^āks^ā2)Tā¢Cā1ā¢kā|subscriptāaggsuperscript^subscriptsubscriptnorm^subscript2superscript1subscript _agg=-|( k_s|| k_s||_% 2)^TC^-1k_*|Lagg = - | ( divide start_ARG over start_ARG kitalic_s end_ARG end_ARG start_ARG | | over start_ARG kitalic_s end_ARG | |2 end_ARG )T C- 1 kā | (4) where ks^^subscript k_sover start_ARG kitalic_s end_ARG is the output keys after adapter. The intuition is inspired by Lemma 4.6 and 4.7. If the edited key is close to the keys of the same subject, especially those we found dissimilar in Section 5.2, the edit would be more robust. In practice, we find that the model inclines to ācheatā by simply increasing the norm of kssubscriptk_skitalic_s, and thus we normalize the output of f. In practice, we take the last token of rephrased subjects over different contexts and rephrased templates as kssubscriptk_skitalic_s. This objective, built on the whiten similarity, further strengthens the validness of our theoretical results. To address the drift of the target key kāsubscriptk_*kā during optimization, we introduce a target consistency loss: āconsistency=Mā¢Sā¢Eā¢(kā^,kā)subscriptāconsistency^subscriptsubscript _consistency=MSE( k_*,k_*)Lconsistency = M S E ( over start_ARG kā end_ARG , kā ) (5) The final training objective combines both components: ā=āagg+αā¢āconsistencyāsubscriptāaggsubscriptāconsistency =L_agg+ _% consistencyL = Lagg + α Lconsistency (6) with α controlling the trade-off. For testing, we use a gate threshold Ļ to determine whether to activate this projection. This gate mechanism allows the model to dynamically decide whether the original keys should be modified. If not, the keys are left intact and thus ensure the locality of edits. The whole algorithm can be found in Appendix. Method Edit Performance In-Domain Out-of-Domain Sucessā ā Localityā ā Para.ā ā Fluencyā ā Rephraseā ā Shuffleā ā Longā ā Rephraseā ā Shuffleā ā Longā ā Baseline Methods ROME 100.0 96.1 63.8 587.4 61.0 13.0 89.8 62.6 13.7 89.8 MEMIT 99.3 91.2 71.9 571.4 73.3 30.0 92.3 73.4 32.0 94.3 R-ROME 99.7 95.8 62.1 583.8 58.9 14.7 89.5 61.7 16.1 90.7 EMMET 99.7 93.8 63.0 584.0 59.7 16.3 83.7 60.9 16.5 83.0 With REP ROME 100.0+0.0 94.6-1.5 66.9+3.1 587.5+0.1 88.0+27.0 59.9+46.9 91.7+1.9 75.5+12.9 28.7+15.0 91.3+1.5 MEMIT 99.4+0.1 90.8-0.4 74.2+2.3 567.2-4.2 89.9+16.6 58.9+28.9 93.6+1.3 84.4+11.0 45.2+31.5 94.2-0.1 R-ROME 99.9+0.2 94.7-1.1 67.4+5.3 586.0+2.2 88.8+29.9 60.3+45.6 92.0+2.5 76.5+14.8 29.5+13.4 92.0+1.3 EMMET 99.8+0.1 92.2-1.6 68.4+5.4 584.6+0.6 94.4+34.7 82.7+66.4 88.4+4.7 82.9+22.0 42.5+26.0 88.6+5.6 Table 1: The main results of REP across three seeds comparing ROME, MEMIT, R-ROME, and EMMET editing methods on Llama2-7B on CounterFact dataset. REP consistently enhances model performance Results averaged over three seeds with Ļ=0.90.9Ļ=0.9Ļ = 0.9. The upperscript numbers denote the improvement after using REP. 6.1 Experimental Results Setup We evaluate our Robust Edit Pathway with representative locate-and-edit methods, namely ROME, MEMIT, R-ROME, and EMMET. We use the LLaMA2-7B, Mistral-7B, and Qwen2-7B as our base model and CounterFact and ZsRE as our datasets. We filter knowledge triplets of datasets not presented in the model as Meng et al. (2022a) did, and randomly sample 100 knowledge triplets as the validation set and 400 triplets as the test set. While other studies in model editing explore modifying multiple facts continuously (Mitchell et al., 2022; Hartvigsen et al., 2024; Meng et al., 2022b), we have found that robustly injecting even a single fact presents significant challenges. Therefore, we keep our focus on single-edit paradigm. For evaluation, we first follow (Meng et al., 2022a, b) and utilize the following four metrics for edit performance: (1) Success: the ratio of targeted knowledge achieving the top probability; (2) Locality: the ratio of related but non-identical facts kept intact by the edit; (3) Paraphrase (Para.): the ratio of targeted knowledge achieving success on paraphrased prompts; (4) Fluency: the weighted average of bi- and tri-gram entropies. Moreover, we report the success rate for three robustness tests: paraphrasing subjects, shuffling subjectsā token ordering, and appending long context, as discussed throughout the paper. Improving these metrics suggests a more robust editing method. We report robustness metrics at both in-domain, where the test cases are seen in training adapter, and out-of-domain, where the test cases are not seen by adapter. Note that in our āin-domainā, we do not reveal the target knowledge to the model, we only aggregate the keys. ROME and MEMITās Failure on Robustness. Our results are shown in Table 1. We can see that our baseline methods, ROME, MEMIT, R-ROME, and EMMET achieve near-perfect edit success rates (>99%) while preserving good locality scores (93-96%). Nonetheless, these methods are prune to robustness tests. Taking ROME as an example, the success rate drops 39% with rephrased subjects, 87% with shuffled subjects ordering, and 10.2% with randomly appended long context. These results reconcile with those reported in previous studies (Ma et al., 2024c). Effectiveness of Robust Edit Pathway. REP improves the robustness of each of the locate-and-edit methods significantly, with a slight cost of locality drop. For instance, REP improves ROME over three robustness tests with +27.0%/+46.9%/+1.9% for in-domain queries, and +12.9%/+15.0%/+1.5% for out-of-domain queries. We also conduct experiments over a different dataset (ZsRE) and two additional base models (QWen and Mistral). The results are shown in Appendix and consistently demonstrate the effectiveness of REP. This validates our theoretical results and empirical insights. Ablation Studies. Gate threshold Ļ and consistency loss weight α are crucial to the performance of REP. We study them in the Appendix with Figure 5 and Figure 6. We find that a larger Ļ and a larger α leads to a better locality and success rate. Meanwhile, the robustness metrics first plateau, then degrade with the increase of Ļ and α, indicating a trade-off between robustness and edit performance. Throughout our experiments, we use Ļ=0.90.9Ļ=0.9Ļ = 0.9 and α=5ā¢e+454α=5e+4α = 5 e + 4. 7 Conclusion In this work, we challenge a core assumption in the locate-and-edit mechanism ā the modelās inner representations can serve as semantic keys for editing. We present theoretical results and empirical analyses revealing that these keys are both sensitive and unspecific. To address this issue, we propose the Robust Edit Pathway (REP), which disentangles the editing keys from native model representations. By extensive experiments, we show that REP can significantly enhance robustness over various locate-and-edit methods while maintains the edit success rate. 8 Limitations While REP demonstrates significant improvements in knowledge editing robustness, our work is limited in the following aspects: (1) REP requires additional training steps to learn the adapter parameters, introducing computational overhead compared to direct editing methods. (2) Our current evaluation focuses on single-fact editing. The effectiveness of REP in scenarios involving multiple interrelated facts or continuous editing remains to be investigated. (3) In this work, we focus on locate-and-edit methods. Even though it is the dominant line of methods in model editing methods, there are still other model editing methods and REP does not apply to them. 9 Acknowledgement This publication has emanated from research conducted with the financial support of the National Natural Science Foundation of China Key Program under Grant Number 6233000066 References Achiam et al. (2023) Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida, Janko Altenschmidt, Sam Altman, Shyamal Anadkat, et al. 2023. Gpt-4 technical report. arXiv preprint arXiv:2303.08774. Brown et al. (2023) Davis Brown, Charles Godfrey, Cody Nizinski, Jonathan Tu, and Henry Kvinge. 2023. Edit at your own risk: evaluating the robustness of edited models to distribution shifts. arXiv preprint arXiv:2303.00046. Dai et al. (2021) Damai Dai, Li Dong, Yaru Hao, Zhifang Sui, Baobao Chang, and Furu Wei. 2021. Knowledge neurons in pretrained transformers. arXiv preprint arXiv:2104.08696. De Cao et al. (2021) Nicola De Cao, Wilker Aziz, and Ivan Titov. 2021. Editing factual knowledge in language models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6491ā6506, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. Gu et al. (2024) Jia-Chen Gu, Hao-Xiang Xu, Jun-Yu Ma, Pan Lu, Zhen-Hua Ling, Kai-Wei Chang, and Nanyun Peng. 2024. Model editing harms general abilities of large language models: Regularization to the rescue. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pages 16801ā16819. Gupta et al. (2024a) Akshat Gupta, Sidharth Baskaran, and Gopala Anumanchipalli. 2024a. Rebuilding rome: Resolving model collapse during sequential model editing. arXiv preprint arXiv:2403.07175. Gupta et al. (2024b) Akshat Gupta, Anurag Rao, and Gopala Anumanchipalli. 2024b. Model editing at scale leads to gradual and catastrophic forgetting. arXiv preprint arXiv:2401.07453. Hartvigsen et al. (2024) Tom Hartvigsen, Swami Sankaranarayanan, Hamid Palangi, Yoon Kim, and Marzyeh Ghassemi. 2024. Aging with grace: Lifelong model editing with discrete key-value adaptors. Advances in Neural Information Processing Systems, 36. Hu et al. (2024a) Chenhui Hu, Pengfei Cao, Yubo Chen, Kang Liu, and Jun Zhao. 2024a. Knowledge in superposition: Unveiling the failures of lifelong knowledge editing for large language models. arXiv preprint arXiv:2408.07413. Hu et al. (2024b) Chenhui Hu, Pengfei Cao, Yubo Chen, Kang Liu, and Jun Zhao. 2024b. Wilke: Wise-layer knowledge editor for lifelong knowledge editing. arXiv preprint arXiv:2402.10987. Hua et al. (2024) Wenyue Hua, Jiang Guo, Mingwen Dong, Henghui Zhu, Patrick Ng, and Zhiguo Wang. 2024. Propagation and pitfalls: Reasoning-based assessment of knowledge editing through counterfactual tasks. arXiv preprint arXiv:2401.17585. Jiang et al. (2023) Albert Q Jiang, Alexandre Sablayrolles, Arthur Mensch, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Florian Bressand, Gianna Lengyel, Guillaume Lample, Lucile Saulnier, et al. 2023. Mistral 7b. arXiv preprint arXiv:2310.06825. Lenci and Sahlgren (2023) Alessandro Lenci and Magnus Sahlgren. 2023. Distributional semantics. Cambridge University Press. Li et al. (2024) Xiaopeng Li, Shasha Li, Shezheng Song, Jing Yang, Jun Ma, and Jie Yu. 2024. Pmet: Precise model editing in a transformer. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 18564ā18572. Li et al. (2023) Zhoubo Li, Ningyu Zhang, Yunzhi Yao, Mengru Wang, Xi Chen, and Huajun Chen. 2023. Unveiling the pitfalls of knowledge editing for large language models. arXiv preprint arXiv:2310.02129. Ma et al. (2024a) Jun-Yu Ma, Zhen-Hua Ling, Ningyu Zhang, and Jia-Chen Gu. 2024a. Neighboring perturbations of knowledge editing on large language models. arXiv preprint arXiv:2401.17623. Ma et al. (2024b) Jun-Yu Ma, Hong Wang, Hao-Xiang Xu, Zhen-Hua Ling, and Jia-Chen Gu. 2024b. Perturbation-restrained sequential model editing. arXiv preprint arXiv:2405.16821. Ma et al. (2024c) Xinbei Ma, Tianjie Ju, Jiyang Qiu, Zhuosheng Zhang, Hai Zhao, Lifeng Liu, and Yulong Wang. 2024c. Is it possible to edit large language models robustly? arXiv preprint arXiv:2402.05827. Meng et al. (2022a) Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. 2022a. Locating and editing factual associations in gpt. Advances in Neural Information Processing Systems, 35:17359ā17372. Meng et al. (2022b) Kevin Meng, Arnab Sen Sharma, Alex Andonian, Yonatan Belinkov, and David Bau. 2022b. Mass-editing memory in a transformer. arXiv preprint arXiv:2210.07229. Merity et al. (2016) Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. 2016. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843. Mitchell et al. (2022) Eric Mitchell, Charles Lin, Antoine Bosselut, Christopher D Manning, and Chelsea Finn. 2022. Memory-based model editing at scale. In International Conference on Machine Learning, pages 15817ā15831. PMLR. Patil et al. (2023) Vaidehi Patil, Peter Hase, and Mohit Bansal. 2023. Can sensitive information be deleted from llms? objectives for defending against extraction attacks. arXiv preprint arXiv:2309.17410. Rosati et al. (2024) Domenic Rosati, Robie Gonzales, Jinkun Chen, Xuemin Yu, Melis Erkan, Yahya Kayani, Satya Deepika Chavatapalli, Frank Rudzicz, and Hassan Sajjad. 2024. Long-form evaluation of model editing. arXiv preprint arXiv:2402.09394. Touvron et al. (2023a) Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, TimothĆ©e Lacroix, Baptiste RoziĆØre, Naman Goyal, Eric Hambro, Faisal Azhar, et al. 2023a. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971. Touvron et al. (2023b) Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. 2023b. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288. Vaswani (2017) A Vaswani. 2017. Attention is all you need. Advances in Neural Information Processing Systems. Wang et al. (2024a) Jiaan Wang, Yunlong Liang, Zengkui Sun, Yuxuan Cao, Jiarong Xu, and Fandong Meng. 2024a. Cross-lingual knowledge editing in large language models. Preprint, arXiv:2309.08952. Wang et al. (2024b) Jianchen Wang, Zhouhong Gu, Zhuozhi Xiong, Hongwei Feng, and Yanghua Xiao. 2024b. The missing piece in model editing: A deep dive into the hidden damage brought by model editing. arXiv preprint arXiv:2403.07825. Wang et al. (2024c) Mengru Wang, Ningyu Zhang, Ziwen Xu, Zekun Xi, Shumin Deng, Yunzhi Yao, Qishen Zhang, Linyi Yang, Jindong Wang, and Huajun Chen. 2024c. Detoxifying large language models via knowledge editing. arXiv preprint arXiv:2403.14472. Wang et al. (2023) Peng Wang, Ningyu Zhang, Xin Xie, Yunzhi Yao, Bozhong Tian, Mengru Wang, Zekun Xi, Siyuan Cheng, Kangwei Liu, Guozhou Zheng, et al. 2023. Easyedit: An easy-to-use knowledge editing framework for large language models. arXiv preprint arXiv:2308.07269. Wang et al. (2024d) Xiaohan Wang, Shengyu Mao, Ningyu Zhang, Shumin Deng, Yunzhi Yao, Yue Shen, Lei Liang, Jinjie Gu, and Huajun Chen. 2024d. Editing conceptual knowledge for large language models. arXiv preprint arXiv:2403.06259. Yan et al. (2024) Jianhao Yan, Futing Wang, Yafu Li, and Yue Zhang. 2024. Potential and challenges of model editing for social debiasing. arXiv preprint arXiv:2402.13462. Yang et al. (2024a) An Yang, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chengyuan Li, Dayiheng Liu, Fei Huang, Haoran Wei, et al. 2024a. Qwen2. 5 technical report. arXiv preprint arXiv:2412.15115. Yang et al. (2024b) Wanli Yang, Fei Sun, Xinyu Ma, Xun Liu, Dawei Yin, and Xueqi Cheng. 2024b. The butterfly effect of model editing: Few edits can trigger large language models collapse. arXiv preprint arXiv:2402.09656. Yoon et al. (2024) Junsang Yoon, Akshat Gupta, and Gopala Anumanchipalli. 2024. Is bigger edit batch size always better?āan empirical study on model editing with llama-3. arXiv preprint arXiv:2405.00664. Zhang et al. (2024) Mengqi Zhang, Bowen Fang, Qiang Liu, Pengjie Ren, Shu Wu, Zhumin Chen, and Liang Wang. 2024. Enhancing multi-hop reasoning through knowledge erasure in large language model editing. arXiv preprint arXiv:2408.12456. Zhong et al. (2023) Zexuan Zhong, Zhengxuan Wu, Christopher D Manning, Christopher Potts, and Danqi Chen. 2023. Mquake: Assessing knowledge editing in language models via multi-hop questions. arXiv preprint arXiv:2305.14795. Appendix A Proofs A.1 Proof of Lemma 4.1 Since K has full row rank (rankā¢(K)=D1ranksubscript1rank(K)=D_1rank ( K ) = D1), Kā¢KTsuperscriptKK^TK Kitalic_T is invertible. To find α, we use the Moore-Penrose pseudoinverse of K. Given KāāD1Ćnsuperscriptāsubscript1K ^D_1Ć nK ā blackboard_RD1 Ć n, the pseudoinverse K+superscriptK^+K+ is defined as: K+=KTā¢(Kā¢KT)ā1superscriptsuperscriptsuperscriptsuperscript1K^+=K^T(K^T)^-1K+ = Kitalic_T ( K Kitalic_T )- 1, which also minimizes āKā¢Ī±āk^ānorm^||Kα- k||| | K α - over start_ARG k end_ARG | |. Then, we can express v^ vover start_ARG v end_ARG as: v^=Vā¢Ī±=Vā¢KTā¢(Kā¢KT)ā1ā¢k^.^superscriptsuperscriptsuperscript1 v=Vα=VK^T(K^T)^-1 k.over start_ARG v end_ARG = V α = V Kitalic_T ( K Kitalic_T )- 1 over start_ARG k end_ARG . (7) Note that since nā«D1much-greater-thansubscript1n D_1n ā« D1, the system Kā¢Ī±=k^^Kα= kK α = over start_ARG k end_ARG is underdetermined. This means there are infinitely many solutions for α, and the Moore-Penrose pseudoinverse gives the one with the smallest norm. A.2 Proof of Lemma 4.4 We can focus on the logit difference between the largest and the second-largest logits to achieve high confidence in the final prediction. This difference is an important factor in determining the confidence of a prediction in a softmax layer. Here, we simplify the modeling by only considering the contribution of edited layer towards final prediction via its the edited layer is connected to the final prediction layer directly via its attention layer Given a vector of logits =[z1,z2,ā¦,zn]subscript1subscript2ā¦subscriptz=[z_1,z_2,ā¦,z_n]z = [ z1 , z2 , ⦠, zitalic_n ], the softmax function yields probabilities =[p1,p2,ā¦,pn]subscript1subscript2ā¦subscriptp=[p_1,p_2,ā¦,p_n]p = [ p1 , p2 , ⦠, pitalic_n ], where: pi=eziāj=1nezjsubscriptsuperscriptsubscriptsuperscriptsubscript1superscriptsubscriptp_i= e^z_i _j=1^ne^z_jpitalic_i = divide start_ARG eitalic_zitalic_i end_ARG start_ARG āj = 1n eitalic_zitalic_j end_ARG To increase the confidence in the prediction for the largest logit, maximize the difference between the largest logit and the second-largest logit. Let zmaxsubscriptmaxz_maxzmax be the largest logit and zothersubscriptotherz_otherzother be another logit. The logit difference Ī Ī is given by: ϵ=zmaxāzotheritalic-ϵsubscriptmaxsubscriptotherε=z_max-z_otherϵ = zmax - zother. The softmax confidence for the class corresponding to zmaxsubscriptmaxz_maxzmax can be expressed as: pmaxsubscriptmax p_maxpmax =ezmaxezmax+ezother+ākā max, otherezkabsentsuperscriptsubscriptmaxsuperscriptsubscriptmaxsuperscriptsubscriptothersubscriptmax, othersuperscriptsubscript = e^z_maxe^z_max+e^z_other% + _k , othere^z_k= divide start_ARG eitalic_zmax end_ARG start_ARG eitalic_zmax + eitalic_zother + āk ā max, other eitalic_zitalic_k end_ARG (8) <ezmaxezmax+ezotherabsentsuperscriptsubscriptmaxsuperscriptsubscriptmaxsuperscriptsubscriptother < e^z_maxe^z_max+e^z_other< divide start_ARG eitalic_zmax end_ARG start_ARG eitalic_zmax + eitalic_zother end_ARG (9) =11+eāϵabsent11superscriptitalic-ϵ = 11+e^-ε= divide start_ARG 1 end_ARG start_ARG 1 + e- ϵ end_ARG (10) After organizing between two sides, we get a lower bound of ϵitalic-ϵεϵ for achieving a sufficiently large confidence: ϵ>ālogā”(1ā1pmax)italic-ϵ11subscriptmaxε>- (1- 1p_max)ϵ > - log ( 1 - divide start_ARG 1 end_ARG start_ARG pmax end_ARG ) (11) Now, in a transformer architecture, the edited MLP layer is connected to the word prediction layer through an attention layer at the final token. Let the difference between the original and the edited output of the MLP layer be Īā¢vĪ vĪ v, the parameters of the attention layer are WQ,WK,WVāāDĆDsubscriptsubscriptsubscriptsuperscriptāW_Q,W_K,W_V ^DĆ DWitalic_Q , Witalic_K , Witalic_V ā blackboard_RD Ć D and the query vector at the prediction token is q=Qā¢hāq=Qhq = Q h, the attention layerās output is defined by o=ājSoftmaxā¢(qTā¢WKā¢vj)ā¢WVā¢vj.subscriptSoftmaxsuperscriptsubscriptsubscriptsubscriptsubscript o= _jSoftmax(q^TW_Kv_j)W_Vv_j.o = āj Softmax ( qitalic_T Witalic_K vitalic_j ) Witalic_V vitalic_j . (12) Since in the locating part we use causal intervention to identify the most influential position of tokens to edit, we can assume that (qTā¢WKā¢vs)superscriptsubscriptsubscript(q^TW_Kv_s)( qitalic_T Witalic_K vitalic_s ) has already get the largest weight. The difference caused by edited MLP is, Īā¢o=Softmaxā¢(ā )ā¢WVā¢Īā¢v.ĪSoftmaxā subscriptĪ o=Softmax(Ā·)W_V v.Ī o = Softmax ( ā ) Witalic_V Ī v . (13) Then, residual connections directly connect this output to the final word prediction layer. Combining our result from equation 11, let the original fact t before the edit has a logit gap ϵ1subscriptitalic-ϵ1 _1ϵ1 and the new fact tāsubscriptt_*tā after edit has ϵ2subscriptitalic-ϵ2 _2ϵ2, we can bound the Īā¢oĪ oĪ o with, (wtāwtā)Tā¢oā¢rā¢i>ϵ1(wtāāwt)Tā¢(oā¢rā¢i+Īā¢o)>ϵ2casessuperscriptsubscriptsubscriptsubscriptsubscriptsubscriptitalic-ϵ1otherwisesuperscriptsubscriptsubscriptsubscriptsubscriptĪsubscriptitalic-ϵ2otherwise cases(w_t-w_t_*)^To_ori> _1\\ (w_t_*-w_t)^T(o_ori+ o)> _2 cases start_ROW start_CELL ( witalic_t - witalic_t start_POSTSUBSCRIPT ā end_POSTSUBSCRIPT )T oitalic_o r i > ϵ1 end_CELL start_CELL end_CELL end_ROW start_ROW start_CELL ( witalic_t start_POSTSUBSCRIPT ā end_POSTSUBSCRIPT - witalic_t )T ( oitalic_o r i + Ī o ) > ϵ2 end_CELL start_CELL end_CELL end_ROW (14) ā(wtāāwt)Tā¢Īā¢o>ϵ1+ϵ2āabsentsuperscriptsubscriptsubscriptsubscriptĪsubscriptitalic-ϵ1subscriptitalic-ϵ2 (w_t_*-w_t)^T o> _1+ _2ā ( witalic_t start_POSTSUBSCRIPT ā end_POSTSUBSCRIPT - witalic_t )T Ī o > ϵ1 + ϵ2 (15) ā(wtāāwt)Tā¢Softmaxā¢(ā )ā¢WVā¢Īā¢v>ϵ1+ϵ2āabsentsuperscriptsubscriptsubscriptsubscriptSoftmaxā subscriptĪsubscriptitalic-ϵ1subscriptitalic-ϵ2 (w_t_*-w_t)^TSoftmax(Ā·)W_V v% > _1+ _2ā ( witalic_t start_POSTSUBSCRIPT ā end_POSTSUBSCRIPT - witalic_t )T Softmax ( ā ) Witalic_V Ī v > ϵ1 + ϵ2 (16) ā(wtāāwt)Tā¢WVā¢Īā¢v>ϵ1+ϵ2āabsentsuperscriptsubscriptsubscriptsubscriptsubscriptĪsubscriptitalic-ϵ1subscriptitalic-ϵ2 (w_t_*-w_t)^TW_V v> _1+% _2ā ( witalic_t start_POSTSUBSCRIPT ā end_POSTSUBSCRIPT - witalic_t )T Witalic_V Ī v > ϵ1 + ϵ2 (17) Given that the softmax weight is at most 1, we have our lower bound on Īā¢vĪ vĪ v. A.3 Proof of Lemma 4.6 For an edit to be robust, it must propagate correctly to all semantically equivalent inputs. We derive this requirement step by step: 1) From Lemma 4.4, a successful edit requires: (wtāāwt)Tā¢WVā¢(vāāvo)>ϵ1+ϵ2superscriptsubscriptsuperscriptsubscriptsubscriptsuperscriptsubscriptsubscriptitalic-ϵ1subscriptitalic-ϵ2 (w_t^*-w_t)^TW_V(v^*-v_o)> _1+ _2( witalic_tā - witalic_t )T Witalic_V ( vā - vitalic_o ) > ϵ1 + ϵ2 2) When querying with a semantically equivalent key ksāKssubscriptsubscriptk_sā K_skitalic_s ā Kitalic_s, by Lemma 4.1, the retrieved value is: v=ksTā¢Cā1ā¢kāā vā=βs,āā vāā superscriptsubscriptsuperscript1superscriptsuperscriptā subscriptsuperscript v=k_s^TC^-1k^*Ā· v^*= _s,*Ā· v^*v = kitalic_sitalic_T C- 1 kā ā vā = βitalic_s , ā ā vā where βs,āsubscript _s,*βitalic_s , ā represents the whiten similarity between kssubscriptk_skitalic_s and kāsuperscriptk^*kā. 3) For robust editing, this retrieved value must maintain the prediction gap: (wtāāwt)Tā¢WVā¢(βs,āā vā)>ϵ1+ϵ2superscriptsubscriptsuperscriptsubscriptsubscriptā subscriptsuperscriptsubscriptitalic-ϵ1subscriptitalic-ϵ2 (w_t^*-w_t)^TW_V( _s,*Ā· v^*)> _1+% _2( witalic_tā - witalic_t )T Witalic_V ( βitalic_s , ā ā vā ) > ϵ1 + ϵ2 4) Rearranging terms: (wtāāwt)Tā¢WVā¢(ksTā¢Cā1ā¢kā)ā vāT>ϵ1+ϵ2,ā superscriptsubscriptsuperscriptsubscriptsubscriptsuperscriptsubscriptsuperscript1superscriptsuperscriptabsentsubscriptitalic-ϵ1subscriptitalic-ϵ2 (w_t^*-w_t)^TW_V(k_s^TC^-1k^*)Ā· v^*T>% _1+ _2, ( witalic_tā - witalic_t )T Witalic_V ( kitalic_sitalic_T C- 1 kā ) ā vā T > ϵ1 + ϵ2 , āksāKsfor-allsubscriptsubscript ā k_sā K_sā kitalic_s ā Kitalic_s This inequality must hold for all semantically equivalent keys ksāKssubscriptsubscriptk_sā K_skitalic_s ā Kitalic_s, establishing our robustness requirement. A.4 Proof of Lemma 4.7 The specificity requirement ensures edits do not affect unrelated knowledge. We derive this as follows: 1) Consider an unrelated key koāKssubscriptsubscriptk_oā K_skitalic_o ā Kitalic_s with original target tnsubscriptt_ntitalic_n. The corresponding output embedding is wnsubscriptw_nwitalic_n. 2) To preserve specificity, the edit should not significantly alter predictions for unrelated inputs: (wnāwtā)Tā¢WVā¢(koTā¢Cā1ā¢kā)ā vāT<ϵ3ā superscriptsubscriptsubscriptsuperscriptsubscriptsuperscriptsubscriptsuperscript1superscriptsuperscriptabsentsubscriptitalic-ϵ3 (w_n-w_t^*)^TW_V(k_o^TC^-1k^*)Ā· v^*T<% _3( witalic_n - witalic_tā )T Witalic_V ( kitalic_oitalic_T C- 1 kā ) ā vā T < ϵ3 3) This constraint must hold for: ⢠All unrelated keys koāKssubscriptsubscriptk_oā K_skitalic_o ā Kitalic_s ⢠All possible target embeddings wnāWsubscriptw_nā Wwitalic_n ā W 4) Therefore, our specificity requirement is: (wnāwtā)Tā¢WVā¢(koTā¢Cā1ā¢kā)ā vāT<ϵ3,ā superscriptsubscriptsubscriptsuperscriptsubscriptsuperscriptsubscriptsuperscript1superscriptsuperscriptabsentsubscriptitalic-ϵ3 (w_n-w_t^*)^TW_V(k_o^TC^-1k^*)Ā· v^*T<% _3,( witalic_n - witalic_tā )T Witalic_V ( kitalic_oitalic_T C- 1 kā ) ā vā T < ϵ3 , ākoāKs,āwnāWformulae-sequencefor-allsubscriptsubscriptfor-allsubscript ā k_oā K_s,ā w_nā Wā kitalic_o ā Kitalic_s , ā witalic_n ā W This establishes the formal criterion for maintaining specificity in knowledge editing. The requirement ensures that edits remain localized to the intended knowledge while not affecting unrelated retrievals. Appendix B Experimental Details B.1 Data Construction We build our evaluation data based on the CounterFact dataset. We further augment our data with all three robustness tests. For rephrased subjects by prompting gpt4o-mini with the following prompt. Give 10 rephrases representing the same entity: ENTITY The irrelevant long contexts are extracted from the Wikitext-103 dataset (Merity et al., 2016). The shuffled tokens are generated via sampling different word ordering. Finally, we filter the samples that are not present in the current LLM, that is, given the prefix, the target tokens are not predicted by the LLMs with the top-1 probabilities. We sample 100 samples for validation and 400 samples for test. To evaluate in-domain and out-of-domain robustness, we split the all three kinds of robustness queries in a 50-50 manner. For each sample, we have 5 in-domain queries and 5 out-of-domain queries. B.2 Analyzing Dissimilar Keys In Section 5.2, for each subject in CounterFact, we compute the dot product for each pair of keys of a subjectās rephrases. We utilize the inputs to the FFNās down projection of layer 5 of LLaMA-2 as our keys, consistent with previous ROME experiments. Additionally, we include the dot product values of randomly sampled keys as a baseline for comparative analysis. We normalize the whiten similarity by the similarities between the subject itself. B.3 Details of Training REP We implement our methods based on EasyEdit (Wang et al., 2023). We use Adam optimizer for all experiments and the learning rate is 5e-4. We train each adaptor for 10 steps. The inner dimension of the projection module is 32, and the inner dimension of gate module is 0.1 of key dimension. Appendix C Additional Results Table 2 and 3 present the performance of ROME, MEMIT, R-ROME, and EMMET methods, both with and without the REP enhancement, across CounterFact and ZSRE respectively. Across both datasets, REP consistently improves model robustness, particularly in in-domain generalization and out-of-domain adaptability, despite minor trade-offs in edit success rates. Results are averaged over three seeds , with standard deviations indicating stable improvements. Notably, REP-enhanced variants demonstrate superior fluency and locality preservation, highlighting its effectiveness in balancing edit precision with broader generalization. Table 2: The main results of REP across three seeds comparing ROME, MEMIT, R-ROME, and EMMET editing methods on Llama2-7B, Mistral-7B and Qwen2-7b on CounterFact dataset. REP consistently enhances model performance Results averaged over three seeds with Ļ=0.90.9Ļ=0.9Ļ = 0.9, showing standard deviations. ā ā indicates higher values are better, ā ā indicates lower values are better. Edit Performance Generalization In-Domain Out-of-Domain Model Method Successā ā Localityā ā Reversionā ā Para.ā ā Fluencyā ā Rephraseā ā Shuffleā ā Longā ā Rephraseā ā Shuffleā ā Longā ā Llama2 ROME 100.0 ± 0.0 96.1 ± 0.1 0.0 ± 0.0 63.8 ± 0.3 587.4 ± 1.2 61.0 ± 0.7 13.0 ± 0.9 89.8 ± 0.2 62.6 ± 0.1 13.7 ± 0.5 89.8 ± 0.5 +REP 100.0 ± 0.0 94.6 ± 0.2 0.0 ± 0.0 66.9 ± 0.3 587.5 ± 0.8 88.0 ± 0.2 59.9 ± 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4 ± 0.6 95.8 ± 0.5 MEMIT 99.6 ± 0.1 90.3 ± 0.2 0.4 ± 0.1 75.6 ± 0.1 620.1 ± 0.3 75.9 ± 0.6 31.4 ± 0.9 97.6 ± 0.1 74.8 ± 0.4 29.7 ± 0.9 96.6 ± 0.3 +REP 99.7 ± 0.1 81.8 ± 0.1 0.0 ± 0.0 79.7 ± 0.2 620.2 ± 2.2 95.7 ± 0.2 81.7 ± 1.2 98.0 ± 0.1 89.7 ± 0.1 72.3 ± 1.5 96.9 ± 0.2 R-ROME 99.8 ± 0.0 96.2 ± 0.1 0.2 ± 0.0 68.5 ± 0.4 621.0 ± 0.4 63.1 ± 0.3 20.2 ± 0.3 93.8 ± 0.2 62.3 ± 0.1 18.4 ± 0.4 93.3 ± 0.9 +REP 99.9 ± 0.1 91.9 ± 0.1 0.1 ± 0.1 72.4 ± 0.5 621.1 ± 0.2 81.4 ± 0.3 70.8 ± 0.8 95.7 ± 0.5 75.5 ± 0.2 64.8 ± 0.9 94.5 ± 1.1 EMMET 99.8 ± 0.0 92.5 ± 0.1 0.2 ± 0.0 72.2 ± 0.1 619.5 ± 0.2 71.5 ± 0.7 31.3 ± 0.6 96.2 ± 0.4 70.5 ± 0.9 30.0 ± 0.4 96.7 ± 0.6 +REP 99.9 ± 0.1 76.4 ± 0.8 0.0 ± 0.0 78.5 ± 0.4 621.0 ± 2.6 92.9 ± 0.3 88.4 ± 0.9 97.0 ± 0.1 89.2 ± 0.3 87.1 ± 1.3 97.4 ± 0.6 Table 3: The main results of REP across three seeds comparing ROME, MEMIT, R-ROME, and EMMET editing methods on Llama2-7B, Mistral-7B and Qwen2-7b on ZSRE dataset. REP consistently enhances model performance. Results averaged over three seeds with Ļ=0.90.9Ļ=0.9Ļ = 0.9, showing standard deviations. ā ā indicates higher values are better, ā ā indicates lower values are better. Edit Performance Generalization In-Domain Out-of-Domain Model Method Sucess Locality Reversion Fluency Rephrase Shuffle Long Rephrase Shuffle Long Llama2 ROME 92.1 ± 0.1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.2 ± 1.0 MEMIT 95.4 ± 0.2 98.2 ± 0.1 1.5 ± 0.0 573.9 ± 5.8 62.4 ± 0.3 22.2 ± 0.3 88.8 ± 1.6 65.2 ± 0.3 22.1 ± 0.8 89.2 ± 0.5 +REP 94.2 ± 0.3 97.2 ± 0.1 1.6 ± 0.1 576.4 ± 4.1 78.7 ± 0.9 51.9 ± 2.0 88.8 ± 1.5 74.8 ± 0.7 41.2 ± 2.4 89.0 ± 0.4 R-ROME 98.2 ± 0.2 98.8 ± 0.1 2.0 ± 0.0 571.5 ± 2.2 54.2 ± 0.3 11.5 ± 0.5 77.2 ± 1.3 56.7 ± 0.1 12.0 ± 0.8 76.7 ± 1.5 +REP 96.0 ± 0.2 97.4 ± 0.1 2.2 ± 0.3 575.5 ± 3.3 66.3 ± 1.0 45.3 ± 0.4 80.0 ± 2.1 63.3 ± 0.7 38.8 ± 0.5 78.9 ± 2.5 EMMET 94.6 ± 0.2 97.7 ± 0.3 1.5 ± 0.0 570.6 ± 4.2 58.5 ± 0.5 17.7 ± 0.4 75.2 ± 1.8 60.3 ± 0.7 18.9 ± 0.5 75.6 ± 0.9 +REP 91.4 ± 0.3 91.7 ± 0.1 1.8 ± 0.2 574.5 ± 4.6 78.2 ± 0.5 70.7 ± 0.5 77.2 ± 1.8 75.0 ± 0.9 67.6 ± 1.0 77.2 ± 0.8 Figure 5: Hyper-parameter study of Ļ on validation set. Appendix D Ablation Study The gate threshold Ļ and consistency loss weight α significantly influence REPās performance, as discussed in Section 6.1. Empirical analysis (Figures 5 and 6) demonstrates that increasing Ļ and α improves locality preservation and edit success rates. However, robustness metrics initially plateau before deteriorating with further parameter escalation, underscoring the need to balance precision against generalization. This trade-off analysis justifies our selection of Ļ=0.90.9Ļ=0.9Ļ = 0.9 and α=1ā¢e+51e+5α=1e+5α = 1 e+5, which optimally reconcile competing objectives across experiments. Figure 6: Hyper-parameter study of consistency loss weight α on validation set. Appendix E Case Visualization Figure 7: A visualization for key representations of rephrases for āSloveniaā in LLaMA2-7B. Figure 7 (right) provides a visualization of representations for the subject āSloveniaā after three types of perturbations, reduced to two dimensions using Principal Component Analysis (PCA). This visualization corroborates our previous findings: (1) Context sensitivity: Long irrelevant context induces a slight shift in the representation, indicating contextual influence on subject encoding. (2) Rephrase variability: Rephrased versions of the subject sometimes cluster close to the original representation, while at other times they are distant. (3) Order dependence: Shuffling the word order results in substantial deviations from the original representation. This observation highlights the modelās sensitivity to word order, even when the constituent tokens remain unchanged. When the edited key has near-zero or negative similarity with other keys, based on Lemma 4.6 it becomes virtually impossible for the edited value to be retrieved, potentially compromising the robustness of the edit. Appendix F Analyzing Value Distributions Loud Voices. Figure 8: Values before and after edit with ROME. In Figure 8, we present the distribution of values before and after edits, using LLaMA-2 7B and ROME. The results demonstrate that post-edit values exhibit significantly larger L2 norms compared to pre-edit values. This observation aligns with our findings in Lemma 4.4 and 4.6, which suggest that edited values must be sufficiently large to effect changes on the current key and influence distant keys. However, this increase in value magnitude, while necessary for effective editing, presents potential challenges. As indicated by Lemma 4.7 and our previous analysis, these āloudā values may inadvertently affect unrelated keys, particularly those that are proximal in the representation space to the one being edited. This observation highlights a tension between achieving targeted edits and avoiding unintended consequences in the modelās broader knowledge representation. Summary. Our findings collectively suggest that the inner representations of large language models (LLMs) may not serve as reliable keys for editing purposes. The observed variability in key similarities, even among semantically equivalent subjects, coupled with the necessity for large-magnitude value changes, poses significant challenges for precise and controlled model editing. These issues can lead to unintended effects on unrelated parts of the modelās knowledge and compromise the specificity of edits. Furthermore, the sensitivity of representations to word order and context underscores the instability of using these internal states as edit targets. These limitations motivate us to explore alternative approaches, particularly the concept of branching a separate path for keys. By creating a dedicated pathway for key representations, we may achieve more stable and controllable edit targets, potentially mitigating the issues of representation variability and unintended side effects observed when directly manipulating the modelās inner representations.