动态选择事实编辑的示例,让大模型更准更快地更新知识。
Dynamic Retriever for In-Context Knowledge Editing via Policy Optimization
- 用强化学习动态选最有助于编辑的示例
- 在测试集上准确率提升17.1%,速度加快41.6%
- 适合无法修改权重的黑盒大模型使用
大语言模型虽擅长记忆事实,但仍会传播过时或错误信息。上下文知识编辑提供了一种无需梯度的解决方案,适用于黑盒API,但现有方法依赖表面相似性静态选择示例,存在数量与质量的权衡,且缺乏对任务难度的适应性。本文提出动态检索器(DR-IKE),通过BERT+REINFORCE训练一个检索器,按编辑奖励排序示例,并使用可学习阈值过滤低价值内容:简单任务缩短提示,困难任务则扩展。该方法不修改模型权重,仅依赖前向传播,兼容黑盒模型。在COUNTERFACT基准上,编辑成功率最高提升17.1%,延迟降低41.6%,同时保持无关查询的准确性,实现可扩展、自适应的知识编辑。代码已开源。
原文摘要 · Abstract (English)
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 .
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。