arXiv(opens in a new tab)cs.AIAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.25100

Towards Reliable, Generalizable, and Specific In-Context Knowledge Editing via Multi-Objective Reinforcement Learning

Xuzhong Wang, Maiqi Jiang, Tejal Nair, Girija Bhusal, Yanfu Zhang, Haipeng Chen

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

Abstract

Large Language Models (LLMs) are powerful but limited by static parametric knowledge that becomes outdated once pretraining ends. Knowledge editing addresses this problem by updating model behavior on target facts without full retraining. In particular, in-context knowledge editing has gained attention because it is training-free and readily applicable to black-box LLMs. Recent reinforcement learning (RL)-based approaches improve over fixed retrieval strategies by adapting prompt construction to the quantity-quality trade-off. Despite initial success, they optimize reliability alone, and in doing so trade away specificity: rewarding edit success drives the retriever to discard the demonstrations that protect neighboring facts. Previous methods also act over only part of the prompt construction process, overlooking the global organization of demonstrations. We propose Multi-Objective In-context Knowledge Editing (MO-IKE), which casts prompt construction as a sequential decision process over COPY, UPDATE, RETAIN, and STOP actions, and trains a dynamic retriever with a multi-objective shaped reward that couples edit success to explicit paraphrase and retention penalties. On Llama-3.2-3B, averaged over five seeds, MO-IKE raises edit success (reliability) from 87.1% to 91.1% and retention rate (specificity) from 41.0% to 63.4% over the strongest RL baseline, while keeping paraphrase consistency (generality) comparable (79.1% to 77.7%), improving the harmonic-mean score from 61.7 to 75.7. Gains hold across five frozen LLMs and four datasets, including the 311K-example UniEdit benchmark.

1 Introduction

Large Language Models (LLMs) have become prevalent in natural language processing, excelling in domains ranging from autonomous workflows (Schick et al., 2023) to advanced mathematical reasoning (Chervonyi et al., 2025). However, a critical limitation remains: parametric knowledge in LLMs is static. Once training concludes, the stored information becomes susceptible to obsolescence (Mazzia et al., 2024). For instance, an LLM whose training precedes the 2026 Winter Olympics lacks parametric knowledge of the final medal tally. Consequently, relying solely on static memory invariably fails to satisfy user needs for real-time or dynamic information.

Knowledge editing addresses this by updating an LLM’s response to a target fact while preserving unrelated knowledge (Wang et al., 2024b). While gradient-based methods (Mitchell et al., 2022) achieve this via weight updates, they are computationally expensive and cannot be adapted to black-box LLMs (Meng et al., 2022). Recently, in-context knowledge editing has become popular due to its advantage of being training-free and naturally applicable to black-box LLMs (Zheng et al., 2023): the model remains frozen, and the desired update is induced solely through prompt context, without access to model internals.

The efficacy of in-context knowledge editing is highly dependent on the injected prompt. Thus, a critical question is how to construct the prompt. Precisely, the context must be reliable enough to successfully edit the LLM (reliability), general enough to apply to semantically equivalent queries (generality), and specific enough to avoid changing unrelated neighboring facts (specificity) (Meng et al., 2023). Although static retrieval strategies such as IKE (Zheng et al., 2023) propose constructing the prompt with different categories of demonstrations—specifically, COPY demonstrations that explicitly state the new fact for reliability, UPDATE demonstrations that state a paraphrased query for generality, and RETAIN demonstrations that state an unrelated fact for specificity—these methods

Code is publicly available at https://github.com/wmd3i/MO-IKE.

Figure

Figure 1: Contradicting objectives of reliability and specificity in prompt construction in IKE – Increasing the number of RETAIN demonstrations leads to Retention Success but Edit Failure.

remain insufficient, as they assume a fixed amount of context is adequate for distinct edits.

To address this limitation, recent work such as Dynamic Retriever for In-Context Knowledge Editing (DR-IKE) (Nafee et al., 2025) formulates demonstration selection as a reinforcement learning (RL) problem, enabling the system to adapt the number of retrieved examples based on each edit. Despite their initial success, DR-IKE exhibits two limitations. First, while it improves how much context is supplied, it leaves partially explored how that context should be organized by ranking only RETAIN candidates, as the effectiveness of in-context learning is known to be sensitive to demonstration ordering (Lu et al., 2022).

Second, DR-IKE does not account for the proportion of demonstrations from distinct categories. Effective in-context prompt construction requires a principled balance among distinct demonstration types to achieve reliability, generality, and specificity. From the observation in Figure 1, these objectives are often contradictory (Zheng et al., 2023). On the one hand, achieving strong reliability and generality demands sufficient COPY and UPDATE examples to reinforce the factual change (Qiao et al., 2024). On the other hand, maintaining specificity requires RETAIN examples that anchor unedited neighboring knowledge (Youssef et al., 2025). Under a limited context budget, we have to carefully balance the proportion of different demonstrations and consider potential trade-offs.

To alleviate the dilemma of competing objectives, we formulate the retrieval environment as a Constrained Markov Decision Process (Constrained MDP) and introduce MO-IKE as its solution algorithm. We formulate the state as the currently constructed prompt, and the action of the retriever is to either select an additional demonstration or terminates the prompt construction. We evaluate the final prompt based on its edit reliability given the constraints on generality and specificity. During training, MO-IKE samples a group of candidate prompts under the current policy and optimizes the retriever via Group Relative Policy Optimization (GRPO).

Our main contributions are as follows:

• We identify two notable deficiencies in state-of-the-art RL-based in-context knowledge editing (notably, DR-IKE): they neglect the sequential ordering of the prompt context and overlook the balance of examples from different demonstration categories.

• We propose MO-IKE, a Multi-Objective RL algorithm that jointly optimizes the selection of distinctive demonstration categories. By framing the task as a Constrained MDP and optimizing it with multi-objective RL, we ensure stable training that balances reliability, generality, and specificity.

• We introduce architectural improvements to a dynamic demonstration retriever. On standard knowledge-editing benchmarks, including COUNTERFACT, using Llama-3.2-3B and Mistral-7B-v0.3, MO-IKE improves edit success (reliability) by up to +7.0% (reaching 92.0% on Llama-3.2), paraphrase consistency (generality) by up to +2.5%, while yielding a +23.0% absolute improvement in retention rate (specificity).

References (22)