Manuscript Offprint

arXiv:2608.27839

KLOD: Locality-Preserving Knowledge Editing via Non-Target Distribution Preservation

Hojun Jeong, Gyunyeop Kim, Sangwoo Kang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Fine-tuning-based knowledge editing is simple and architecture-agnostic, but standard cross-entropy increases the edited target probability without explicitly constraining changes in the non-target output distribution. In sequential editing, such unconstrained redistribution can accumulate as distributional drift and contribute to locality degradation. We propose KLOD, a bounded and distribution-preserving objective for fine-tuning-based knowledge editing that separates the intended target update from distributions that should remain stable. KLOD stops target amplification once a probability threshold is reached, while preserving the target-excluded non-target distribution at target positions and the full next-token distribution at prefix positions. Experiments on CounterFact and ZsRE with Llama3-8B-Instruct and Qwen2.5-7B-Instruct show that KLOD substantially mitigates locality degradation while maintaining high edit reliability. The target probability threshold further provides a controllable Generalization–Locality trade-off. Ablation, multi-seed, and distributional KL analyses support the interpretation that KLOD’s locality gains are associated with preserving output distributions rather than simply weakening the edit. Code is available on GitHub 1^{1}.

1 Introduction

Large language models (LLMs) store substantial factual knowledge in their parameters through large-scale pre-training, but this knowledge can become outdated or incorrect over time (De Cao et al., 2021). Knowledge editing (KE) addresses this issue by modifying targeted facts while preserving unrelated behavior, which is especially important in sequential or lifelong editing settings where edits accumulate and may degrade locality, retention, and general capability (Li and Chu, 2024; Gupta et al., 2024).

Prior KE methods largely follow a locate-and-edit paradigm, identifying internal computations or parameter regions associated with a factual association and modifying them directly (Meng et al., 2022; Fang et al., 2025). Fine-tuning-based editing, by contrast, is architecture-agnostic and simple, but has often been treated as a disruptive baseline because gradient updates can affect broader model behavior (Gangadhar and Stratos, 2024). Recent studies, however, show that its reliability and locality depend strongly on the objective, editable parameter selection, and training protocol (Gangadhar and Stratos, 2024; Yang et al., 2026). This suggests that fine-tuning-based KE should be reconsidered as an objective design problem for locality-preserving editing. The resulting question is therefore not simply whether gradient-based fine-tuning can edit knowledge, but what objective should govern the update when edit success and preservation must be achieved simultaneously.

Standard fine-tuning typically maximizes the likelihood of the target answer under the rewrite prompt. However, KE requires more than target answer generation: the edited model should reflect the desired fact while remaining close to the pre-edit model on unrelated behavior. This is challenging in large-scale or sequential editing, where model editing can induce forgetting, locality degradation, and broader capability loss (Gu et al., 2024; Gupta et al., 2024). Therefore, a KE objective should control not only target likelihood but also the post-edit next-token distribution.

We identify an objective-level mismatch between standard softmax cross-entropy and locality-preserving editing. Cross-entropy increases target token probability, but due to softmax normalization this can be achieved either by raising the target logit or by lowering non-target logit mass. Thus, while effective for target learning, cross-entropy does not

∗^{*}Equal contribution.

†^{\dagger}Corresponding author.

1^{1}https://github.com/Hostoday/KLOD explicitly preserve the pre-edit relative distribution among non-target tokens. Complementary to prior observations that naive target maximization causes over-editing or token-level overfitting (Liu et al., 2025; Zhang et al., 2025), we argue that non-target redistribution can accumulate as distributional drift in sequential fine-tuning-based editing, leading to locality degradation.

To address this issue, we propose KLOD, a bounded and distribution-preserving objective that decouples target editing from distribution preservation. At target prediction positions, KLOD keeps the renormalized non-target distribution, defined over all vocabulary tokens except the target token, close to that of the pre-edit model. This allows the intended target probability increase while preserving the structure of the non-target distribution. KLOD also uses a one-sided hinge objective based on target logit-odds, providing an edit signal only until the target probability reaches a threshold α\alpha. At prefix positions, it preserves the full next-token distribution through KL regularization to suppress prompt-level drift.

Our contributions are threefold. First, we analyze how standard cross-entropy in fine-tuning-based KE fails to control non-target distribution changes. Second, we introduce KLOD, which combines bounded target optimization with non-target and prefix distribution preservation. Third, we show under established sequential KE protocols that KLOD mitigates the locality collapse of strong fine-tuning-based baselines while maintaining high reliability and providing a controllable Generalization–Locality operating curve. Seed-based experiments confirm that KLOD's locality advantage and the lower-Generalization/higher-Locality profile of the primary operating point are stable, while distributional KL analysis and ablations support the interpretation that the gains are associated with suppressing non-target distributional drift rather than merely weakening the edit. A broader discussion of related work is provided in Appendix A.

References (50)

  • Association for Computational Linguistics
  • The Llama 3 Herd of Models
  • Qwen2.5 Technical Report
  • ROME uses causal tracing to identify feed-forward modules important for factual recall and modifies factual associations through rank-one updates (Meng et al., 2022)
  • Recent studies, however, show that the reliability and locality of fine-tuning-based editing are not determined solely by the update mechanism itself, but depend heavily on the objective, editable parameter selection, and optimization protocol
  • However, existing fine-tuning-based editing methods mainly focus on how reliably the target answer can be learned or how edit requests should be optimized
  • Continual editing and Editing-at-Scale studies show that as the number of edits increases, models may forget previous edits or suffer degradation in downstream task performance (Li and Chu, 2024; Gupta et al., 2024)
  • This gradient structure is effective for increasing the target token probability, but it does not require the relative structure of the non-target distribution to remain close to that of the pre-edit model
  • This allows the intended increase in target probability while directly suppressing unnecessary changes in the non-target distribution
  • For the configured endpoint $\alpha = 1$, KLOD uses the clipped threshold $\tilde{\alpha} = 1 - \epsilon$
  • As the target probability increases, the cross-entropy signal becomes progressively weaker, whereas the logit-odds hinge maintains its margin signal until the position-specific threshold is reached
  • thresholded CE uses sequence-level stopping with probability-dependent gradient scaling, whereas KLOD uses position-wise stopping with an unattenuated margin signal at active target positions
  • The Breadth-First pipeline is not an online-style sequential optimization procedure that fully optimizes each edit request before moving to the next
  • Instead, only the MLP down-projection matrix in a specified editable layer is made trainable
  • Rather than maximizing a single metric, we choose $\alpha = 0.85$, $\lambda_{\mathrm{nt}} = 0.6$, and $\lambda_{\mathrm{prefix}} = 1.2$ as a balanced, non-extreme operating point and fix this configuration across all four primary model–dataset settings
  • Following the traditional teacher-forcing evaluation protocol in EasyEdit (Wang et al., 2024), evaluation is based on token-level prediction accuracy at target positions rather than answer-level exact match
  • \tag {40} $$
  • \tag {41} $$
  • \tag {44} $$
  • The task-specific score for each benchmark is converted to a [0, 100] scale before averaging
  • We additionally evaluate Reliability exclusively on examples whose targets contain more than one tokenizer token
  • \tag {48} $$
  • This indicates that the position-wise target exclusion used by $L_{\mathrm{nt}}$ does not prevent reliable completion of multi-token targets under the reported evaluation protocol
  • We use the ROME implementation and hyperparameter configuration released in EasyEdit
  • FT-L and FT-M are fine-tuning-based editing baselines (Zhang et al., 2024)
  • >FT-M</td><td>500</td><td>100.00</td><td>99.90</td><td>1.50</td><td>22.70</td><td>56.02</td></tr><tr><td>1k</td><td>99.95</td><td>99.75</td><td>1.30</td><td>15.33</td><td>54.08</td></tr><tr><td>3k</td><td>0.67</td><td>0.63</td><td>0.45</td><td>32.35</td><td>8.53</td></tr><tr><td rowspan=
  • We do not separately tune OVERTONE for the test performance of each dataset or backbone
  • The pre-edit Capability score is 54.75
  • At 3k edits, its Reliability and Generalization also collapse
  • \tag {50} $$
  • Let $a_{t}$ denote the gold next token at each target position
  • >Method</td><td colspan=
  • \tag {51} $$
  • For locality contexts, we report only Prompt KL and Target KL, since the goal is not to analyze the non-target distribution around the edited target answer
  • We then compute the mean, median, 90th percentile (P90), 95th percentile (P95), and 99th percentile (P99) over instances
  • For Prompt KL, KLOD obtains a median of 0.063 and a P99 of 0.513, whereas the other methods have median values above 2.2 and P99 values above 5.3
  • >KLOD</td><td>Prompt</td><td>0.099</td><td>0.063</td><td>0.226</td><td>0.306</td><td>0.513</td></tr><tr><td>Non-target</td><td>0.364</td><td>0.168</td><td>0.808</td><td>1.342</td><td>3.119</td></tr><tr><td rowspan=
  • Thus, the substantially lower KL observed for KLOD is not explained by the token-averaged mean alone; the reduction persists from the center of the instance-level distribution to its high-KL tail
  • All variants omit $L_{prefix}$ and independently vary the target objective and the target-position KL distribution
  • Removing either $L_{prefix}$ or $L_{nt}$ decreases Locality from 86.47 to 81.26 and 82.09, respectively, while removing both preservation terms causes a much larger drop to 50.93
  • We decompose each locality prediction change into two mutually exclusive categories: Target flip (F) and Other change (O)
  • At each teacher-forced locality-answer position $t$, let $\hat{y}_{it}^{\mathrm{pre}}$ and $\hat{y}_{it}^{\mathrm{post}}$ denote the pre- and post-edit full-vocabulary top-1 predictions, respectively
  • Let $F_{D}$ and $O_{D}$ denote the resulting dataset-level Target flip and Other change scores for dataset $D$, respectively
  • >CounterFact</td></tr><tr><td>Bounded only</td><td>2.02</td><td>97.98</td><td>18.95</td><td>79.03</td></tr><tr><td>$+L_{\text{nt}}$</td><td>41.30</td><td>58.70</td><td>13.57</td><td>45.13</td></tr><tr><td>Full KLOD</td><td>44.75</td><td>55.25</td><td>12.02</td><td>43.23</td></tr><tr><td colspan=
  • The reduction in $O$ further shows that KLOD's locality improvement is not limited to preventing edited target tokens from directly replacing unrelated predictions, consistent with the broader distributional preservation behavior observed in our KL analyses
  • For each rewrite and rephrase prompt, the edited model generates the answer autoregressively without access to the gold target tokens
  • A ground-truth exact-match score on locality answers would measure a different quantity and would therefore not be directly comparable to the Locality metric reported in the main experiments
  • This improvement comes with a modest reduction in Generalization, while Reliability remains above $99\%$ and Capability remains comparable to the two fine-tuning baselines
  • All experiments are conducted on CounterFact with 3k sequential edits using Llama3-8B-Instruct, with the target probability threshold fixed at $\alpha = 0.85$
  • Increasing $\lambda_{\mathrm{prefix}}$ produces only a small Locality increase and a modest Generalization decrease, while Reliability and Capability remain nearly unchanged