arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.21059cs.CL
收藏

用于上下文知识编辑的策略优化动态检索器

Dynamic Retriever for In-Context Knowledge Editing via Policy Optimization

Rensselaer Polytechnic Institute(拉特格斯理工学院);Bangladesh University of Engineering and Technology(孟加拉工程与技术大学);College of William & Mary(威廉与玛丽学院)

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

AI总结:

针对现有上下文知识编辑依赖静态演示集的问题,提出DR-IKE框架,通过策略优化动态选择演示并自适应调整提示长度,在COUNTERFACT上提升编辑成功率17.1%,降低延迟41.6%。

摘要:

大型语言模型(LLMs)在事实回忆方面表现出色,但仍会传播过时或不正确的知识。上下文知识编辑提供了一种无需梯度的解决方案,适用于黑盒API,但当前的编辑器依赖于通过表面相似性选择的静态演示集,导致两个持续存在的障碍:(i)数量与质量的权衡,以及(ii)缺乏对任务难度的适应性。我们通过根据演示对编辑的效用动态选择支持性演示来解决这些问题。我们提出了用于上下文知识编辑的动态检索器(DR-IKE),这是一个轻量级框架,(1)使用REINFORCE训练BERT检索器,根据编辑奖励对演示进行排序,(2)采用可学习的阈值来修剪低价值示例,在编辑简单时缩短提示,在任务困难时扩展提示。DR-IKE在不修改模型权重的情况下进行编辑,仅依赖前向传递以兼容黑盒LLMs。在COUNTERFACT基准上,它将编辑成功率提高了高达17.1%,延迟降低了41.6%,并保持了对无关查询的准确性,展示了可扩展和自适应的知识编辑。代码可在https://github.com/mwnafee/DR-IKE获取。

英文摘要:

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 .

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑