[论文解读] Who's Harry Potter? Approximate Unlearning in LLMs
本文提出一种在不进行全面再训练的情况下近似忘却目标训练子集的方法,通过在 Llama2-7b 中抹去 Harry Potter 内容并在保持整体性能的同时进行演示。
Large language models (LLMs) are trained on massive internet corpora that often contain copyrighted content. This poses legal and ethical challenges for the developers and users of these models, as well as the original authors and publishers. In this paper, we propose a novel technique for unlearning a subset of the training data from a LLM, without having to retrain it from scratch. We evaluate our technique on the task of unlearning the Harry Potter books from the Llama2-7b model (a generative language model recently open-sourced by Meta). While the model took over 184K GPU-hours to pretrain, we show that in about 1 GPU hour of finetuning, we effectively erase the model's ability to generate or recall Harry Potter-related content, while its performance on common benchmarks (such as Winogrande, Hellaswag, arc, boolq and piqa) remains almost unaffected. We make our fine-tuned model publicly available on HuggingFace for community evaluation. To the best of our knowledge, this is the first paper to present an effective technique for unlearning in generative language models. Our technique consists of three main components: First, we use a reinforced model that is further trained on the target data to identify the tokens that are most related to the unlearning target, by comparing its logits with those of a baseline model. Second, we replace idiosyncratic expressions in the target data with generic counterparts, and leverage the model's own predictions to generate alternative labels for every token. These labels aim to approximate the next-token predictions of a model that has not been trained on the target data. Third, we finetune the model on these alternative labels, which effectively erases the original text from the model's memory whenever it is prompted with its context.
研究动机与目标
- 出于版权和伦理考量,促使人们忽略 LLMs 中的特定训练数据的必要性。
- 提出一种实用的忘却方法,避免全面再训练,并随被忘却数据的规模扩展。
- 通过从 Llama2-7b 中移除 Harry Potter 内容来演示该方法,并在基准测试上评估泛化能力。
- 提供对局限性以及未来可适应、合规的 LLM 的潜力分析。
提出的方法
- 在需要忘却的目标上训练一个强化模型,通过与基线模型的 logits 比较来识别与目标相关的标记。
- 通过将特定表达替换为通用对应物并使用锚词翻译来推导替代标签,创建通用预测。
- 在带有生成的通用标签的输入文本上微调基线模型,以抹去目标知识。
- 使用两种机制获得通用预测:强化自举和锚定词翻译,在一个特定方程中结合形成通用标签。
- 迭代处理 512-token 块并进行大约 150 次梯度步来微调模型。
实验结果
研究问题
- RQ1在不从零重新训练的情况下,是否可以在 LLM 中对目标数据进行近似忘记?
- RQ2在忘却过程中如何生成通用预测以替换目标特定内容?
- RQ3忘却对通过标准基准测量的通用能力有什么影响?
- RQ4局限性和风险有哪些,例如信息泄露或非预期的遗忘?
主要发现
- 该方法在 ~1 GPU 小时的微调后,能够有效抹去 Llama-7b-chat 中与 Harry Potter 相关的内容。
- 通用基准测试(ARC、BoolQ、HellaSwag、OpenBookQA、PIQA、Winogrande)在忘却后显示出接近原始的表现。
- 该方法通过完成度和基于概率的测试证实降低了模型对目标内容的熟悉度。
- 消融实验表明,强化自举和锚定词技术两者都需要才能获得最佳结果。
- 开源发布使社区评估和对忘却质量的对抗性测试成为可能。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。