arXivDaily arXiv每日学术速递 周一至周五更新
北美退伍军人节(Veterans Day),12 日无更新
arXiv 2406.07933cs.CLcs.AIcs.LG
收藏

基于嵌入损坏提示的大语言模型遗忘方法

Large Language Model Unlearning via Embedding-Corrupted Prompts

University of California, Santa Cruz(加州大学圣克鲁兹分校)

Chris Yuhao Liu, Yaxuan Wang, Jeffrey Flanigan, Yang Liu

AI总结:

针对大语言模型知识遗忘的效率与附带损害问题,提出轻量级ECO Prompts框架,通过零阶优化生成嵌入损坏提示实现推理阶段遗忘,效果好、副作用低且可扩展至多参数规模模型。

摘要:

大语言模型(LLM)已发展到涵盖跨多领域的广泛知识。然而,控制大语言模型不应知晓的内容,对于确保对齐进而实现安全使用至关重要。但由于保留与遗忘之间边界模糊可能带来附带损害,且针对拥有数千亿参数的前沿模型进行优化需要大量计算资源,准确高效地从LLM中遗忘知识仍具挑战性。\n在本研究中,我们提出**Embedding-COrrupted (ECO) Prompts(嵌入损坏提示)**,这是一种轻量级大语言模型遗忘框架,旨在同时解决知识纠缠与遗忘效率两大挑战。我们不依赖LLM自身进行遗忘,而是在推理阶段通过提示分类器识别并标记需遗忘的提示,从而强制模型进入遗忘状态。我们通过零阶优化离线学习添加到提示嵌入上的损坏项,以实现遗忘目标,并在推理阶段对分类器标记的提示施加损坏。我们发现,这些嵌入损坏的提示不仅能产生满足遗忘目标的理想输出,还能高度近似从未在待遗忘数据上训练过的模型的输出。\n通过大量遗忘实验,我们证明了该方法的优越性:它能实现良好的遗忘效果,且在通用领域和与遗忘内容高度相关的领域中几乎零副作用。此外,我们强调该方法可扩展至100个LLM,参数规模覆盖0.5B到236B,且不会随参数数量增加产生额外成本。我们已将代码公开于https://github.com/chrisliu298/llm-unlearn-eco。

英文摘要:

Large language models (LLMs) have advanced to encompass extensive knowledge across diverse domains. Yet controlling what a large language model should not know is important for ensuring alignment and thus safe use. However, accurately and efficiently unlearning knowledge from an LLM remains challenging due to the potential collateral damage caused by the fuzzy boundary between retention and forgetting, and the large computational requirements for optimization across state-of-the-art models with hundreds of billions of parameters. In this work, we present \textbf{Embedding-COrrupted (ECO) Prompts}, a lightweight unlearning framework for large language models to address both the challenges of knowledge entanglement and unlearning efficiency. Instead of relying on the LLM itself to unlearn, we enforce an unlearned state during inference by employing a prompt classifier to identify and safeguard prompts to forget. We learn corruptions added to prompt embeddings via zeroth order optimization toward the unlearning objective offline and corrupt prompts flagged by the classifier during inference. We find that these embedding-corrupted prompts not only lead to desirable outputs that satisfy the unlearning objective but also closely approximate the output from a model that has never been trained on the data intended for forgetting. Through extensive experiments on unlearning, we demonstrate the superiority of our method in achieving promising unlearning at \textit{nearly zero side effects} in general domains and domains closely related to the unlearned ones. Additionally, we highlight the scalability of our method to 100 LLMs, ranging from 0.5B to 236B parameters, incurring no additional cost as the number of parameters increases. We have made our code publicly available at \url{https://github.com/chrisliu298/llm-unlearn-eco}.

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

↑