Who's Harry Potter? Approximate Unlearning in LLMs
作者: Ronen Eldan, Mark Russinovich
分类: cs.CL, cs.AI
发布日期: 2023-10-03 (更新: 2023-10-04)
💡 一句话要点
提出一种新技术以解决大语言模型中的数据遗忘问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大语言模型 数据遗忘 微调技术 法律合规 内容管理 生成模型 人工智能伦理
📋 核心要点
- 现有的大语言模型在训练时可能包含版权内容,导致法律和伦理问题。
- 本文提出了一种新技术,通过微调模型来实现对特定训练数据的遗忘,避免了从头训练的高成本。
- 实验结果表明,模型在消除《哈利·波特》内容的同时,保持了在其他基准测试上的性能稳定。
📝 摘要(中文)
大型语言模型(LLMs)在训练过程中使用了大量互联网语料,其中可能包含受版权保护的内容,这给开发者、用户及原作者带来了法律和伦理挑战。本文提出了一种新颖的技术,能够在不从头再训练模型的情况下,从LLM中“遗忘”部分训练数据。我们在Llama2-7b模型上评估了该技术,成功地消除了模型生成或回忆与《哈利·波特》相关内容的能力,同时在常见基准测试上的表现几乎不受影响。我们将微调后的模型公开在HuggingFace上供社区评估。至今为止,这是首个在生成语言模型中提出有效遗忘技术的论文。
🔬 方法详解
问题定义:本文旨在解决大型语言模型中如何有效遗忘特定训练数据的问题。现有方法通常需要重新训练模型,成本高且效率低。
核心思路:提出了一种基于微调的遗忘技术,通过识别与目标数据相关的标记并替换为通用表达,从而实现对特定内容的遗忘。
技术框架:该方法包含三个主要模块:首先,使用强化学习模型识别与目标数据相关的标记;其次,替换目标数据中的特定表达;最后,基于替换后的标签对模型进行微调。
关键创新:本研究的创新在于首次在生成语言模型中实现了有效的遗忘技术,避免了传统的重新训练方法。
关键设计:在模型微调过程中,采用了替代标签生成策略,以近似未训练于目标数据的模型的下一个标记预测,确保遗忘效果的有效性。
📊 实验亮点
实验结果显示,通过约1小时的微调,成功消除了模型生成《哈利·波特》相关内容的能力,而在Winogrande、Hellaswag、arc、boolq和piqa等基准测试上的表现几乎没有受到影响,展示了该技术的有效性和高效性。
🎯 应用场景
该研究的潜在应用领域包括法律合规性、内容管理和数据隐私保护等。通过有效的遗忘机制,开发者可以更灵活地处理模型中的敏感信息,降低法律风险,提升用户信任。未来,这一技术可能会在更多领域得到应用,推动AI模型的伦理使用。
📄 摘要(原文)
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.