Lune

EMNLP2025Top-tier venue

Dynamic Retriever for In-Context Knowledge Editing via Policy Optimization

Mahmud Wasif Nafee, Maiqi Jiang, Haipeng Chen, Yanfu Zhang

Abstract

Large language models (LLMs) excel at factual recall yet still propagate stale or incorrect knowledge. In-context knowledge editing offers a gradient-free remedy suitable for black-box APIs, but current editors rely on static demonstration sets chosen by surface-level similarity, leading to two persistent obstacles: (i) a quantity-quality trade-off, and (ii) lack of adaptivity to task difficulty. We address these issues by dynamically selecting supporting demonstrations according to their utility for the edit. We propose Dynamic Retriever for In-Context Knowledge Editing (DR-IKE), a lightweight framework that (1) trains a BERT retriever with REINFORCE to rank demonstrations by editing reward, and (2) employs a learnable threshold to prune low-value examples, shortening the prompt when the edit is easy and expanding it when the task is hard. DR-IKE performs editing without modifying model weights, relying solely on forward passes for compatibility with black-box LLMs. On the COUNTERFACT benchmark, it improves edit success by up to 17.1%, reduces latency by 41.6%, and preserves accuracy on unrelated queries, demonstrating scalable and adaptive knowledge editing. The code is available at https://github.com/mwnafee/DR-IKE .

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Locating and Editing Factual Associations in GPT cites Language Models are Few-Shot Learners
  • Prompting GPT-3 To Be Reliable cites Language Models are Few-Shot Learners
  • Retrieval meets Long Context Large Language Models cites Language Models are Few-Shot Learners
  • Many-Shot In-Context Learning cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on19

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 citations
  3. Many-Shot In-Context LearningRishabh Agarwal, Avi Singh, Lei Zhang, Bernd Bohnet et al.NeurIPS 2024 · 271 citations
  4. Retrieval meets Long Context Large Language ModelsPeng Xu, Wei Ping, Xianchao Wu, Lawrence McAfee et al.ICLR 2024 · 131 citations
  5. Prompting GPT-3 To Be ReliableChenglei Si, Zhe Gan, Zhengyuan Yang, Shuohang Wang et al.ICLR 2023 · 68 citations

Related papers

  1. Confidence-Aware Ranker Ensembles for Robust In-Context Knowledge EditingTejal Nair, Mahmud Wasif Nafee, Maiqi Jiang, Ashley Gao et al.ACL Findings 2026
  2. Can We Edit Factual Knowledge by In-Context Learning?Ce Zheng, Lei Li, Qingxiu Dong, Yuxuan Fan et al.EMNLP 2023 · 40 citations
  3. DistillMIKE: Editing Distillation of Massive In-Context Knowledge Editing in Large Language ModelsShanbao Qiao, Xuebing Liu, Seung-Hoon NaACL Findings 2024 · 1 citation
  4. The Model Agreed, But Didn't Learn: Diagnosing Surface Compliance in Large Language ModelsXiaojie Gu, Ziying Huang, Weicong Hong, Jian Xie et al.ACL Findings 2026
  5. Avoiding Knowledge Edit Skipping in Multi-hop Question Answering with Guided DecompositionYi Liu, Xiangrong Zhu, Xiangyu Liu, Wei Wei et al.EMNLP Findings 2025
Dusk over the sea between two cliffs drawn in fine vertical lines