用检索增强生成技术让大模型遗忘敏感信息,不改模型本身也能实现安全可控的删除。
When Machine Unlearning Meets Retrieval-Augmented Generation (RAG): Keep Secret or Forget Knowledge?
- 通过修改RAG外部知识库实现模型行为上的遗忘,无需直接操作大模型。
- 在ChatGPT、Gemini等多模型上验证,满足有效、通用、无害等五大标准。
- 特别适合无法修改的闭源模型,也适用于多模态模型与智能体系统。
大型语言模型(如ChatGPT和Gemini)虽具备强大的自然语言生成能力,但训练中可能无意学习并保留敏感信息与有害内容,引发重大伦理与法律风险。为此,机器遗忘被提出作为潜在解决方案。现有方法常面临计算开销大、适用性有限或灾难性遗忘风险。本文提出一种基于检索增强生成(RAG)的轻量级行为遗忘框架,通过修改RAG外部知识库,模拟遗忘效果而不直接干预未学习的大模型。将遗忘知识构建建模为约束优化问题,推导出两个核心组件以支撑该方法的有效性。该RAG基方法尤其适用于闭源模型,而传统方法在此类场景常失效。我们在包括ChatGPT、Gemini、Llama-2-7b-chat和PaLM 2在内的开源与闭源模型上进行了广泛实验,结果表明该方法满足有效性、通用性、无害性、简洁性和鲁棒性五项关键遗忘标准。此外,该方法可拓展至多模态大模型及基于大模型的智能体系统。
原文摘要 · Abstract (English)
The deployment of large language models (LLMs) like ChatGPT and Gemini has shown their powerful natural language generation capabilities. However, these models can inadvertently learn and retain sensitive information and harmful content during training, raising significant ethical and legal concerns. To address these issues, machine unlearning has been introduced as a potential solution. While existing unlearning methods take into account the specific characteristics of LLMs, they often suffer from high computational demands, limited applicability, or the risk of catastrophic forgetting. To address these limitations, we propose a lightweight behavioral unlearning framework based on Retrieval-Augmented Generation (RAG) technology. By modifying the external knowledge base of RAG, we simulate the effects of forgetting without directly interacting with the unlearned LLM. We approach the construction of unlearned knowledge as a constrained optimization problem, deriving two key components that underpin the effectiveness of RAG-based unlearning. This RAG-based approach is particularly effective for closed-source LLMs, where existing unlearning methods often fail. We evaluate our framework through extensive experiments on both open-source and closed-source models, including ChatGPT, Gemini, Llama-2-7b-chat, and PaLM 2. The results demonstrate that our approach meets five key unlearning criteria: effectiveness, universality, harmlessness, simplicity, and robustness. Meanwhile, this approach can extend to multimodal large language models and LLM-based agents.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。