如何让大语言模型遗忘:关于逆转上下文知识编辑的研究
How to Make LLMs Forget: On Reversing In-Context Knowledge Edits
AI总结:
本文研究如何检测和逆转大语言模型中的上下文知识编辑,提出利用输出概率实现黑盒检测,并设计连续与离散逆转 token 恢复原始输出,准确率超 80%,有效提升模型透明度和可信度。
摘要:
上下文知识编辑(In-context knowledge editing, IKE)能够在不改变参数且零成本的情况下高效修改大语言模型(LLM)的输出。然而,它可能被滥用以不透明地操纵响应,例如插入错误信息或冒犯性内容。此类恶意干预可能被整合进高层封装 API 中,最终输入提示对终端用户不可见。为解决这一问题,我们研究了 IKE 编辑的检测与逆转。首先,我们证明仅使用下一个 token 的前 10 个输出概率,即可高准确率(F1 > 80%)检测 IKE 编辑,即使在黑盒设置下(例如输出信息受限的专有 LLM)也是如此。进一步,我们提出了使用专门调制的逆转 token 来逆转 IKE 编辑这一新任务。我们探索了连续和离散逆转 token 的使用,在多个 LLM 上恢复原始未编辑输出方面取得了超过 80% 的准确率。我们的连续逆转 token 被证明特别有效,且对未编辑提示的影响极小。通过分析输出分布、注意力模式和 token 排名,我们深入揭示了 IKE 对 LLM 的影响以及逆转 token 如何缓解这些影响。这项工作代表着在增强 LLM 抵御上下文编辑潜在滥用的鲁棒性、提高其透明度和可信度方面迈出的重要一步。
英文摘要:
In-context knowledge editing (IKE) enables efficient modification of large language model (LLM) outputs without parameter changes and at zero-cost. However, it can be misused to manipulate responses opaquely, e.g., insert misinformation or offensive content. Such malicious interventions could be incorporated into high-level wrapped APIs where the final input prompt is not shown to end-users. To address this issue, we investigate the detection and reversal of IKE-edits. First, we demonstrate that IKE-edits can be detected with high accuracy (F1 > 80\%) using only the top-10 output probabilities of the next token, even in a black-box setting, e.g. proprietary LLMs with limited output information. Further, we introduce the novel task of reversing IKE-edits using specially tuned reversal tokens. We explore using both continuous and discrete reversal tokens, achieving over 80\% accuracy in recovering original, unedited outputs across multiple LLMs. Our continuous reversal tokens prove particularly effective, with minimal impact on unedited prompts. Through analysis of output distributions, attention patterns, and token rankings, we provide insights into IKE's effects on LLMs and how reversal tokens mitigate them. This work represents a significant step towards enhancing LLM resilience against potential misuse of in-context editing, improving their transparency and trustworthiness.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。