Kaijing Ma

PAPER NOTES / FULL TEXT / ENGLISH + 中文

论文全文中英对照,依据 arXiv:2506.12097v1。英文原文后紧接对应中文,保留正文、附录 A 至 D、公式、14 张数据表、15 个图容器、11 幅原论文图形、脚注和参考文献。

原文采用 CC BY 4.0。本页注明来源与改编;数学、数值和英文图内标注不改写。图形来自固定版本 PDF 的原始页面渲染裁切,没有重绘数据。

阅读原创笔记 · 笔记中英对照 · 原始 PDF · 译注

点击图表可放大。较宽的公式和数据表可在其区域内横向滚动。

作者:Vinith M. Suriyakumar、Ayush Sekhari、Ashia Wilson。英文作者、机构和联系信息在下方按原文保留。

UCD: Unlearning in LLMs via Contrastive Decoding

UCD:通过对比解码实现大语言模型遗忘
Vinith Suriyakumar Affiliation: MIT    Ayush Sekhari* Affiliation: Boston University    Ashia Wilson ††thanks: Equal Advisory Contribution.
† 表示共同指导贡献。
Affiliation: MIT
Abstract
摘要

Machine unlearning aims to remove specific information, e.g. sensitive or undesirable content, from large language models (LLMs) while preserving overall performance. We propose an inference-time unlearning algorithm that uses contrastive decoding, leveraging two auxiliary smaller models, one trained without the forget set and one trained with it, to guide the outputs of the original model using their difference during inference. Our strategy substantially improves the tradeoff between unlearning effectiveness and model utility. We evaluate our approach on two unlearning benchmarks, TOFU and MUSE. Results show notable gains in both forget quality and retained performance in comparison to prior approaches, suggesting that incorporating contrastive decoding can offer an efficient, practical avenue for unlearning concepts in large-scale models.

机器遗忘旨在从大语言模型(LLM)中移除特定信息,例如敏感或不良内容,同时保持模型的整体性能。
我们提出一种推理时遗忘算法,它使用对比解码,并借助两个较小的辅助模型:一个未使用遗忘集训练,另一个使用遗忘集训练;在推理过程中利用二者的差异来引导原模型的输出。
我们的方法显著改善了遗忘有效性与模型效用之间的权衡。
我们在 TOFU 和 MUSE 两个遗忘基准上评估了该方法。
结果表明,与既有方法相比,该方法在遗忘质量和保留性能上都有显著提升,说明引入对比解码可以为大规模模型中的概念遗忘提供一种高效而实用的途径。

1 Introduction

1 引言

Large Language Models (LLMs) achieve impressive general capabilities thanks to massive training datasets and compute. However, these capabilities raise significant safety and security concerns, including copyright violations (Karamolegkou et al., 2023), harmful content generation, and retention of dangerous knowledge (e.g., bioweapon instructions) (Shevlane et al., 2023). Retraining models to address these issues by excluding problematic data is impractical at scale. This has led to growing interest in efficient methods for machine unlearning, which aim to remove specific information from trained models without retraining.

大语言模型(LLM)依靠海量训练数据和计算资源获得了令人瞩目的通用能力。
然而,这些能力也带来了重大的安全与安保问题,包括侵犯版权(Karamolegkou 等,2023)、生成有害内容,以及保留危险知识,例如生物武器说明(Shevlane 等,2023)。
通过排除问题数据来重新训练模型,在大规模场景下并不现实。
这促使人们日益关注高效的机器遗忘方法,即在不重新训练的情况下从已训练模型中移除特定信息。

The field of machine unlearning began with a focus on removing the influence of specific training data points from trained machine learning models (Cao & Yang, 2015; Bourtoule et al., 2021; Neel et al., 2021; Sekhari et al., 2021; Ghazi et al., 2023; Suriyakumar & Wilson, 2022). This initial motivation arose primarily from compliance with emerging privacy regulations, such as the EU’s General Data Protection Regulation (GDPR) (Voigt & Von dem Bussche, 2017) and the California Consumer Privacy Act (CCPA) (CCP, 2018), both of which enforce the Right to be Forgotten. More recently, researchers concerned with AI safety have broadened the scope of machine unlearning to also include removing unwanted or harmful knowledge from large language models (Li et al., 2024; Barez et al., 2025; Zhang et al., 2023b).

机器遗忘领域最初关注的是从已训练机器学习模型中消除特定训练数据点的影响(Cao 和 Yang,2015;Bourtoule 等,2021;Neel 等,2021;Sekhari 等,2021;Ghazi 等,2023;Suriyakumar 和 Wilson,2022)。
这一初始动机主要源于遵守新兴隐私法规,例如欧盟《通用数据保护条例》(GDPR)(Voigt 和 Von dem Bussche,2017)与《加州消费者隐私法案》(CCPA)(CCP,2018);二者都确立了“被遗忘权”。
最近,关注人工智能安全的研究者把机器遗忘的范围进一步扩展到从大语言模型中移除不需要或有害的知识(Li 等,2024;Barez 等,2025;Zhang 等,2023b)。

So far, two broad classes of unlearning algorithms have been proposed for LLM unlearning: finetuning-based approaches and representation-engineering approaches. Finetuning algorithms define an objective to represent “unlearning” and optimize it using samples of data to be forgotten (i.e., the forget set). The canonical example is gradient ascent, which maximizes empirical loss on the forget set. Extensions of this approach incorporate additional loss terms to maintain model utility (Jang et al., 2022; Yao et al., 2023a; Chen & Yang, 2023; Schwarzschild et al., 2024) or modify alignment procedures, such as direct preference optimization (Rafailov et al., 2024). Representation-engineering methods propose objectives to modify internal representations of the model with respect to the forget set, typically by projecting them onto random or orthogonal subspaces (Li et al., 2024). A shortcoming of both of these classes of methods is that they are expensive to run and suffer from poor forget-utility tradeoffs (Shi et al., 2024).

迄今,面向大语言模型的遗忘算法大致分为两类:基于微调的方法和表示工程方法。
微调算法定义一个表示“遗忘”的目标,并使用需要被遗忘的数据样本,即遗忘集,来优化该目标。
典型例子是梯度上升,它使遗忘集上的经验损失最大化。
这一路线的扩展会加入额外损失项以维持模型效用(Jang 等,2022;Yao 等,2023a;Chen 和 Yang,2023;Schwarzschild 等,2024),或者修改对齐流程,例如直接偏好优化(Rafailov 等,2024)。
表示工程方法提出相应目标,用于修改模型针对遗忘集的内部表示,通常把这些表示投影到随机子空间或正交子空间(Li 等,2024)。
这两类方法的一个缺点是运行成本高,而且遗忘与效用之间的权衡不佳(Shi 等,2024)。

Motivated by recent advances in inference-time methods that improve reasoning and alignment without extensive retraining, we propose Unlearning via Contrastive Decoding (UCD), a novel inference-time unlearning algorithm inspired by contrastive decoding principles (Li et al., 2023). UCD leverages two small auxiliary models, one trained exclusively on the forget set and another trained on the retain set, allowing it to effectively remove undesirable knowledge at inference (Figure 1). This approach significantly improves the forget-utility tradeoff and sets new state-of-the-art benchmarks on established unlearning datasets (TOFU and MUSE News). Additionally, due to its computational efficiency, UCD enables practical unlearning even on extremely large models such as Llama2-70B, a task previously infeasible with existing approaches. Our main contributions are:

受到近期推理时方法的启发,这些方法无需大规模重新训练即可改善推理和对齐;我们提出“通过对比解码实现遗忘”(UCD),这是一种受对比解码原理启发的新型推理时遗忘算法(Li 等,2023)。
UCD 使用两个小型辅助模型,其中一个只在遗忘集上训练,另一个在保留集上训练,从而在推理时有效移除不需要的知识(图 1)。
该方法显著改善遗忘与效用之间的权衡,并在既有遗忘数据集 TOFU 和 MUSE News 上刷新了当时的最佳结果。
此外,由于计算效率较高,UCD 甚至可以对 Llama2-70B 这类超大模型进行实际可行的遗忘,而既有方法此前无法完成这一任务。
我们的主要贡献如下:
  • •

    Contrastive Decoding-Based Unlearning: We introduce UCD, an efficient inference-time unlearning algorithm utilizing two auxiliary models trained separately on forget and retain data. Whenever it is possible to obtain a clean model trained solely on the forget set, or when the data is sufficiently separable to allow targeted fine-tuning, UCD can be easily applied.

    基于对比解码的遗忘:我们提出 UCD,这是一种高效的推理时遗忘算法,使用分别在遗忘数据和保留数据上训练的两个辅助模型。
    只要能够获得仅在遗忘集上训练的干净模型,或者数据具有足够可分性、可以进行定向微调,就能方便地应用 UCD。
  • •

    Superior Forget-Utility Tradeoff: UCD significantly outperforms existing methods on standard machine unlearning benchmarks (TOFU, MUSE), achieving forget performance indistinguishable from retraining and improved utility due to contrastive decoding’s enhanced text quality.

    更好的遗忘与效用权衡:UCD 在标准机器遗忘基准 TOFU 和 MUSE 上显著优于既有方法;其遗忘表现与重新训练无法区分,同时由于对比解码改善文本质量而获得更高效用。
  • •

    Scalability to Significantly Larger Models: Unlike existing weight-modifying unlearning methods constrained by computational costs, UCD demonstrates practical inference-time unlearning on significantly larger models, including Llama2-13B and Llama2-70B, only requiring 2 L40s for unlearning on Llama2-13B and 4 NVIDIA H200s for unlearning on Llama2-70B. Whereas all pre-existing baselines required at least 2 A100s for unlearning on Llama2-13B and are infeasible on Llama2-70B on 8 H200s.

    扩展到显著更大的模型:既有的权重修改型遗忘方法受计算成本限制,而 UCD 展示了在 Llama2-13B 和 Llama2-70B 等显著更大模型上进行实际推理时遗忘的能力;对 Llama2-13B 进行遗忘只需 2 张 L40,对 Llama2-70B 则只需 4 张 NVIDIA H200。
    相比之下,所有既有基线在 Llama2-13B 上进行遗忘都至少需要 2 张 A100,并且即使使用 8 张 H200,也无法在 Llama2-70B 上运行。
原论文图表,详见相邻中英文图注
Figure 1: Illustration of contrastive decoding at inference time in UCD. In the top row, we prompt the model with a sentence from our forget set corpus. The first distribution represents the original model we would like to unlearn from. The difference between our two auxiliary models guides the distribution to suppress the information related to Harry Potter. Meanwhile, in the second row, on a prompt we would like to retain the difference remains small leaving the output unaffected.
图 1:UCD 在推理时进行对比解码的示意图。第一行用遗忘集语料中的一句话提示模型。第一个分布表示我们希望对其执行遗忘的原模型。两个辅助模型之间的差异引导该分布抑制与《哈利·波特》有关的信息。第二行则使用希望保留的提示词;此时二者差异很小,因此输出基本不受影响。

2 Background and Related Work

2 背景与相关工作
Machine unlearning.
机器遗忘。

Our work builds on a growing body of research on machine unlearning (Bourtoule et al., 2021; Nguyen et al., 2022; Cao & Yang, 2015; Gupta et al., 2021; Suriyakumar & Wilson, 2022; Sekhari et al., 2021; Ghazi et al., 2023; Kurmanji et al., 2023; Lev & Wilson, 2024; Łucki et al., 2024), which aims to develop methods that efficiently modify trained machine learning models to forget specific portions of their training data. In the case of classical discriminative models, the motivation often stems from privacy concerns, particularly the need to protect individuals whose data may have been used during training. A major driver behind this line of research was the introduction of Article 17 of the European Union’s General Data Protection Regulation (GDPR), which codifies an individual’s “right to be forgotten”(European Union, 2016). Various other legislations have followed including California Consumer Privacy Act (CCPA), Canada’s proposed Consumer Privacy Protection Act (CPPA)), and more recently in Australia (Karp, 2023). More recently, the scope of machine unlearning has expanded to include modern generative AI models, which pose additional challenges such as the potential reproduction of copyrighted material, generation of harmful or explicit content, and leakage of sensitive training data (Zhang et al., 2023a; Carlini et al., 2021).

我们的工作建立在不断增长的机器遗忘研究之上(Bourtoule 等,2021;Nguyen 等,2022;Cao 和 Yang,2015;Gupta 等,2021;Suriyakumar 和 Wilson,2022;Sekhari 等,2021;Ghazi 等,2023;Kurmanji 等,2023;Lev 和 Wilson,2024;Łucki 等,2024);这些研究旨在开发能够高效修改已训练机器学习模型、使其遗忘特定部分训练数据的方法。
对于经典判别模型,研究动机通常源于隐私问题,尤其是保护那些数据可能被用于训练的个人。
推动这一研究方向的重要因素,是欧盟《通用数据保护条例》(GDPR)第 17 条的出台;该条款把个人的“被遗忘权”写入法律(European Union,2016)。
此后又有多项立法跟进,包括《加州消费者隐私法案》(CCPA)、加拿大拟议的《消费者隐私保护法案》(CPPA),以及澳大利亚最近的相关立法(Karp,2023)。
近来,机器遗忘的范围已经扩展到现代生成式人工智能模型;这类模型带来了额外挑战,例如可能复现受版权保护的材料、生成有害或露骨内容,以及泄露敏感训练数据(Zhang 等,2023a;Carlini 等,2021)。
Unlearning and alignment in LLMs.
大语言模型中的遗忘与对齐。

Machine unlearning for Large Language Models (LLMs) has emerged as a rapidly growing area of research (Liu et al., 2024a; Jang et al., 2022; Kumar et al., 2022; Zhang et al., 2023b; Pawelczyk et al., 2023; Yao et al., 2023a; Zhang et al., 2024; Wang et al., 2024; Jia et al., 2024; Lu et al., 2022; Liu et al., 2024b; Ishibashi & Shimodaira, 2023; Thaker et al., 2024; Kadhe et al., 2024; Fan et al., ). Given the inherent difficulty of exact unlearning, most existing approaches rely on approximate methods such as fine-tuning and representation engineering (Yao et al., 2023a; Eldan & Russinovich, 2023; Jia et al., 2024; Zhang et al., 2024; Li et al., 2024; Ilharco et al., 2022; Liu et al., 2022) or prompt-based and in-context learning techniques (Thaker et al., 2024; Pawelczyk et al., 2023; Liu et al., 2024a). Numerous benchmarks and evaluations have been developed to measure the effectiveness of these heuristical unlearning algorithms (Maini et al., 2024; Shi et al., 2024; Li et al., 2024). We also highlight that test-time methods have started to gain prominence in LLM alignment, specifically using token-level rewards to guide generations (Xu et al., 2024). We view our work as a similar family of methods where UCD provides a new reward designed for unlearning and representing the next token distribution if the model was trained without the forget set.

面向大语言模型(LLM)的机器遗忘已经成为一个快速发展的研究领域(Liu 等,2024a;Jang 等,2022;Kumar 等,2022;Zhang 等,2023b;Pawelczyk 等,2023;Yao 等,2023a;Zhang 等,2024;Wang 等,2024;Jia 等,2024;Lu 等,2022;Liu 等,2024b;Ishibashi 和 Shimodaira,2023;Thaker 等,2024;Kadhe 等,2024;Fan 等)。
由于精确遗忘本身很困难,现有方法大多依赖近似方法,例如微调和表示工程(Yao 等,2023a;Eldan 和 Russinovich,2023;Jia 等,2024;Zhang 等,2024;Li 等,2024;Ilharco 等,2022;Liu 等,2022),或者基于提示词与上下文学习的技术(Thaker 等,2024;Pawelczyk 等,2023;Liu 等,2024a)。
研究者还开发了许多基准和评估,用于衡量这些启发式遗忘算法的有效性(Maini 等,2024;Shi 等,2024;Li 等,2024)。
我们还指出,测试时方法已经开始在大语言模型对齐中受到重视,特别是利用词元级奖励引导生成(Xu 等,2024)。
我们把本工作视为同一类方法:UCD 提供一种为遗忘设计的新奖励,用来表示模型未使用遗忘集训练时的下一词元分布。

We defer a detailed description of the baselines that we compare to in our experiments, as well as additional related work on model-editing for unlearning, to Appendix A.

我们把实验所比较基线的详细说明,以及用于遗忘的模型编辑相关工作,放在附录 A 中。

3 UCD: Unlearning via Contrastive Decoding

3 UCD:通过对比解码实现遗忘

This work focuses on the problem of machine unlearning for large language models (LLMs). Given an initial model Pcorr​(y|x)\mathrm{P}_{\mathrm{corr}}(y|x), referred to as the corrupted or reference model, that has been trained on a dataset 𝒟=(xi,yi)i=1n\mathcal{D}={(x_{i},y_{i})}_{i=1}^{n}, the central objective of machine unlearning is to effectively erase all information related to a designated subset of the dataset 𝓓forget⊆𝒟\bm{\mathcal{D}_{\texttt{\bf forget}}}\subseteq\mathcal{D}, termed the forget set, while preserving the model’s performance on the remaining subset 𝓓retain\bm{\mathcal{D}_{\texttt{\bf retain}}}, known as the retain set.

本工作聚焦于大语言模型(LLM)的机器遗忘问题。
给定初始模型 \mathrm{P}_{\mathrm{corr}}(y|x),称为污染模型或参考模型;它在数据集 \mathcal{D}=\{(x_{i},y_{i})\}_{i=1}^{n} 上训练。机器遗忘的核心目标,是有效消除与数据集指定子集 \bm{\mathcal{D}_{\texttt{\bf forget}}}\subseteq\mathcal{D} 有关的全部信息,该子集称为遗忘集;同时保持模型在剩余子集 \bm{\mathcal{D}_{\texttt{\bf retain}}} 上的性能,该子集称为保留集。

We approach the unlearning problem by leveraging auxiliary models to adjust the sampling distribution of the reference model. In particular, suppose there exists some public dataset 𝒟pretrain\mathcal{D}_{\texttt{pretrain}} that does not contain 𝓓forget\bm{\mathcal{D}_{\texttt{\bf forget}}}, and a clean base model AA trained on 𝒟pretrain\mathcal{D}_{\texttt{pretrain}}. Using this base model, we will first train two auxiliary models Acorr\mathrm{A}_{\mathrm{corr}} and Aclean\mathrm{A}_{\mathrm{clean}} by separately fine-tuning AA on the forget set 𝓓forget\bm{\mathcal{D}_{\texttt{\bf forget}}} and the retain set 𝓓retain\bm{\mathcal{D}_{\texttt{\bf retain}}}, respectively. Without loss of generality, we assume the base model AA is significantly smaller than the reference model PP, making the fine-tuning process to obtain Acorr\mathrm{A}_{\mathrm{corr}} and Aclean\mathrm{A}_{\mathrm{clean}} substantially less resource-intensive compared to directly fine-tuning or retraining PP. For example, AA could be a Llama2-7B model, while PP could be a much larger Llama2-70B model, thus significantly reducing computational requirements.

我们利用辅助模型调整参考模型的采样分布,以处理遗忘问题。
具体而言,假设存在某个不包含 \bm{\mathcal{D}_{\texttt{\bf forget}}} 的公开数据集 \mathcal{D}_{\texttt{pretrain}},以及在 \mathcal{D}_{\texttt{pretrain}} 上训练的干净基础模型 A。
以该基础模型为起点,我们分别在遗忘集 \bm{\mathcal{D}_{\texttt{\bf forget}}} 与保留集 \bm{\mathcal{D}_{\texttt{\bf retain}}} 上微调 A,从而训练出两个辅助模型 \mathrm{A}_{\mathrm{corr}} 和 \mathrm{A}_{\mathrm{clean}}。
不失一般性,我们假设基础模型 A 显著小于参考模型 P,因此相比直接微调或重新训练 P,为得到 \mathrm{A}_{\mathrm{corr}} 与 \mathrm{A}_{\mathrm{clean}} 而进行的微调所需资源要少得多。
例如,A 可以是 Llama2-7B,而 P 可以是大得多的 Llama2-70B,从而显著降低计算需求。

Unlearning via Contrastive Decoding (UCD). We utilize the contrastive decoding approach of Li et al. (2023) to define the logits for the returned model ℒaligned\mathcal{L}_{\texttt{aligned}}, i.e. we set

通过对比解码实现遗忘(UCD)。
我们采用 Li 等(2023)的对比解码方法,定义返回模型 \mathcal{L}_{\texttt{aligned}} 的 logits,即设置为
log⁡Paligned​(y|x)←log⁡(Pcorr)⁡(y|x)−α⋅(log⁡(Acorr)⁡(y|x)−log⁡(Aclean)⁡(y|x))\displaystyle\log\mathrm{P}_{\mathrm{aligned}}(y|x)\leftarrow\log{\lmb}(y|x)-\alpha\cdot(\log{\smb}(y|x)-\log{\smg}(y|x)) (1)

where α>0\alpha>0 denotes a hyper-parameter (set to 0.1 in Li et al. (2023)). Correspondingly, once we have the logits corresponding to Paligned\mathrm{P}_{\mathrm{aligned}}, we can generate next token using either:

其中 \alpha>0 是超参数;Li 等(2023)将其设为 0.1。
相应地,得到 \mathrm{P}_{\mathrm{aligned}} 对应的 logits 后,可以通过以下任一方式生成下一词元:
  • •

    Greedy Decoding (e.g. max-sampling): Given an input sequence xx, select the next token yy by choosing the one with the highest predicted probability according to model Paligned\mathrm{P}_{\mathrm{aligned}}: y=arg⁡maxy′⁡log⁡Paligned​(y′|x).y=\arg\max_{y^{\prime}}\log\mathrm{P}_{\mathrm{aligned}}(y^{\prime}|x).

    贪心解码,例如最大值采样:给定输入序列 x,根据模型 \mathrm{P}_{\mathrm{aligned}} 选择预测概率最高的词元作为下一词元 y,即 y=\arg\max_{y^{\prime}}\log\mathrm{P}_{\mathrm{aligned}}(y^{\prime}|x)。
  • •

    Stochastic Decoding (e.g. nucleus sampling): Given an input sequence xx, randomly select the next token yy based on normalized distribution given by the subset of tokens from Paligned\mathrm{P}_{\mathrm{aligned}} whose cumulative probability exceeds some threshold pp, where pp controls the amount of randomness.

    随机解码,例如 nucleus sampling:给定输入序列 x,从 \mathrm{P}_{\mathrm{aligned}} 中累计概率超过某一阈值 p 的词元子集所给出的归一化分布中,随机选择下一词元 y;p 控制随机程度。

Our unlearning update (1) modifies the logits of the reference model Pcorr\mathrm{P}_{\mathrm{corr}} using the difference between the logits of the auxiliary models Acorr\mathrm{A}_{\mathrm{corr}} and Aclean\mathrm{A}_{\mathrm{clean}}.11 1 While (1) represents the output of contrastive decoding by Paligned\mathrm{P}_{\mathrm{aligned}}, we emphasize that no new model is computed; instead, only the logits—used to define the next-token distribution—are modified. Recall that

虽然式(1)表示对比解码所得的输出分布 \mathrm{P}_{\mathrm{aligned}},但需要强调的是,这里不会计算一个新模型;修改的只有用来定义下一词元分布的 logits。
Acorr\mathrm{A}_{\mathrm{corr}} is fine-tuned on DforgetD_{\mathrm{forget}}, while Aclean\mathrm{A}_{\mathrm{clean}} is fine-tuned on DretainD_{\mathrm{retain}}. The contrastive signal, defined as ΔA​(y∣x):=log⁡Acorr​(y∣x)−log⁡Aclean​(y∣x)\Delta_{A}(y\mid x):=\log\mathrm{A}_{\mathrm{corr}}(y\mid x)-\log\mathrm{A}_{\mathrm{clean}}(y\mid x), captures how much more strongly the forget-tuned model Acorr\mathrm{A}_{\mathrm{corr}} prefers next-token yy for a given prompt xx when compared to the retain-tuned model Aclean\mathrm{A}_{\mathrm{clean}}.
我们的遗忘更新式(1)使用辅助模型 \mathrm{A}_{\mathrm{corr}} 与 \mathrm{A}_{\mathrm{clean}} 的 logits 差异来修改参考模型 \mathrm{P}_{\mathrm{corr}} 的 logits。
回顾一下,\mathrm{A}_{\mathrm{corr}} 在 D_{\mathrm{forget}} 上微调,而 \mathrm{A}_{\mathrm{clean}} 在 D_{\mathrm{retain}} 上微调。
对比信号定义为 \Delta_{A}(y\mid x):=\log\mathrm{A}_{\mathrm{corr}}(y\mid x)-\log\mathrm{A}_{\mathrm{clean}}(y\mid x),它刻画了对于给定提示词 x,与保留集微调模型 \mathrm{A}_{\mathrm{clean}} 相比,遗忘集微调模型 \mathrm{A}_{\mathrm{corr}} 对下一词元 y 的偏好强多少。

This contrastive signal forms the basis of our approach: we can unlearn by simply adjusting the logits of the reference model using the difference in token preferences between auxiliary models trained with and without the forget set. For illustration, if we prompt the model with a query about a data sample that should be erased (i.e. OPEN(x,y)∈Dforget)(x,y)\in D_{\mathrm{forget}}), both ΔA​(y∣x)\Delta_{A}(y\mid x) and log⁡Pcorr​(y∣x)\log\mathrm{P}_{\mathrm{corr}}(y\mid x) are likely to be high. Thus, the update in (1) reduces the logit for yy, thereby lowering its probability in the generative process and suppressing this information. More generally, when ΔA​(y∣x)\Delta_{A}(y\mid x) is large and positive, i.e., Acorr\mathrm{A}_{\mathrm{corr}} favors yy significantly more than Aclean\mathrm{A}_{\mathrm{clean}}, the update decreases log⁡Pcorr​(y∣x)\log\mathrm{P}_{\mathrm{corr}}(y\mid x) and thereby reduces the likelihood of generating yy. Conversely, when ΔA​(y∣x)\Delta_{A}(y\mid x) is large and negative, indicating that Aclean\mathrm{A}_{\mathrm{clean}} prefers yy more than Acorr\mathrm{A}_{\mathrm{corr}}, the update increases log⁡Pcorr​(y∣x)\log\mathrm{P}_{\mathrm{corr}}(y\mid x) and thereby increases the probability of yy.

该对比信号构成了我们方法的基础:只需利用分别使用和不使用遗忘集训练的辅助模型之间的词元偏好差异来调整参考模型的 logits,即可实现遗忘。
举例而言,如果向模型提出一个关于应被擦除数据样本的问题,即 (x,y)\in D_{\mathrm{forget}},那么 \Delta_{A}(y\mid x) 和 \log\mathrm{P}_{\mathrm{corr}}(y\mid x) 都很可能较高。
因此,式(1)的更新会降低 y 的 logit,从而在生成过程中降低它的概率并抑制这项信息。
更一般地,当 \Delta_{A}(y\mid x) 较大且为正,也就是 \mathrm{A}_{\mathrm{corr}} 对 y 的偏好显著强于 \mathrm{A}_{\mathrm{clean}} 时,该更新会降低 \log\mathrm{P}_{\mathrm{corr}}(y\mid x),进而降低生成 y 的可能性。
反之,当 \Delta_{A}(y\mid x) 较大且为负,表明 \mathrm{A}_{\mathrm{clean}} 比 \mathrm{A}_{\mathrm{corr}} 更偏好 y 时,该更新会提高 \log\mathrm{P}_{\mathrm{corr}}(y\mid x),从而提高 y 的概率。
Unlearning via Contrastive Suppression (UCS).
通过对比抑制实现遗忘(UCS)。

While UCD can both increase or decrease the probability of outputting various tokens in Pcorr\mathrm{P}_{\mathrm{corr}}, depending on the sign of the contrastive signal Δ⁡(y∣x)\Delta(y\mid x), in various cases, we may want to be more conservative and only make a relative decrease in logits (instead of both increasing and decreasing them using the auxiliary models). Towards that end, we also propose an update step that clips off the impact of contrastive decoding when the contrastive single is negative:

UCD 会根据对比信号 \Delta(y\mid x) 的符号提高或降低 \mathrm{P}_{\mathrm{corr}} 中不同词元的输出概率;但在一些情况下,我们可能希望更加保守,只相对降低 logits,而不借助辅助模型同时提高和降低它们。
为此,我们还提出一种更新步骤:当对比信号为负时,将对比解码的作用截断:
log⁡Paligned​(y∣x)←log⁡(Pcorr)⁡(y|x)−max⁡{log⁡(Acorr)⁡(y|x)−log⁡(Aclean)⁡(y|x),0}\displaystyle\log\mathrm{P}_{\mathrm{aligned}}(y\mid x)\leftarrow\log{\lmb}(y|x)-\max\{\log{\smb}(y|x)-\log{\smg}(y|x),0\}

where α>0\alpha>0 is a hyperparameter. Again, after computing the new logits, we can sample using a greedy or stochastic decoding approach.

其中 \alpha>0 是超参数。
同样,计算出新的 logits 后,可以使用贪心解码或随机解码进行采样。

3.1 Why is our Contrastive Decoding Approach Effective for Unlearning?

3.1 为什么我们的对比解码方法能有效实现遗忘?

We offer an initial intuition for the potential effectiveness of UCD. Although we do not present this as a comprehensive explanation of the observed behavior, we believe it sheds light on some of the underlying dynamics at play. Throughout this section, let Pclean\mathrm{P}_{\mathrm{clean}} denote the model we would have obtained (corresponding to the corrupted model Pcorr\mathrm{P}_{\mathrm{corr}}) if we had trained the given reference model without the forget set DforgetD_{\mathrm{forget}}.

我们给出 UCD 可能有效的一个初步直觉。
虽然我们并不把它作为对观测行为的完整解释,但相信它有助于阐明其中一些潜在动力学。
在本节中,令 \mathrm{P}_{\mathrm{clean}} 表示与污染模型 \mathrm{P}_{\mathrm{corr}} 对应的这样一个模型:如果训练给定参考模型时没有使用遗忘集 D_{\mathrm{forget}},就会得到该模型。

First, as a sanity check, observe that if the auxiliary models are chosen to be the same size as the underlying models, that is, Aclean=Pclean\mathrm{A}_{\mathrm{clean}}=\mathrm{P}_{\mathrm{clean}} and Acorr=Pcorr\mathrm{A}_{\mathrm{corr}}=\mathrm{P}_{\mathrm{corr}}, and we set α=1\alpha=1, then:

首先,作为健全性检查,注意到:如果辅助模型与相应底层模型大小相同,即 \mathrm{A}_{\mathrm{clean}}=\mathrm{P}_{\mathrm{clean}} 且 \mathrm{A}_{\mathrm{corr}}=\mathrm{P}_{\mathrm{corr}},并令 \alpha=1,那么:
log⁡Pcorr​(y∣x)−α⋅(log⁡Acorr​(y∣x)−log⁡Aclean​(y∣x))=log⁡Pclean​(y∣x).\displaystyle\log\mathrm{P}_{\mathrm{corr}}(y\mid x)-\alpha\cdot\left(\log\mathrm{A}_{\mathrm{corr}}(y\mid x)-\log\mathrm{A}_{\mathrm{clean}}(y\mid x)\right)=\log\mathrm{P}_{\mathrm{clean}}(y\mid x). (2)

In this special case, the contrastive differencing update in (1) exactly recovers the next token distribution corresponding to the model Pclean\mathrm{P}_{\mathrm{clean}} that is retrained-from-scratch on the retain set. This illustrates, in idealized conditions, how our approach enables unlearning.

在这一特殊情形下,式(1)的对比差分更新会精确恢复 \mathrm{P}_{\mathrm{clean}} 的下一词元分布;该模型是在保留集上从头重新训练得到的。
这说明在理想条件下,我们的方法如何实现遗忘。

We now relax this strong equivalence assumption to examine more practical settings where the auxiliary models differ in scale or capacity from the underlying models.

现在我们放宽这一很强的等价假设,考察更实际的情形,其中辅助模型与底层模型具有不同的规模或容量。
Proposition 1.
命题 1。

Suppose that for any input prompt xx, the auxiliary models Acorr\mathrm{A}_{\mathrm{corr}} and Aclean\mathrm{A}_{\mathrm{clean}} satisfy the relation:

假设对于任意输入提示词 x,辅助模型 \mathrm{A}_{\mathrm{corr}} 和 \mathrm{A}_{\mathrm{clean}} 满足如下关系:
log⁡Acorr​(y∣x)−log⁡Aclean​(y∣x)∝log⁡Pcorr​(y∣x)−log⁡Pclean​(y∣x),\displaystyle\log\mathrm{A}_{\mathrm{corr}}(y\mid x)-\log\mathrm{A}_{\mathrm{clean}}(y\mid x)\propto\log\mathrm{P}_{\mathrm{corr}}(y\mid x)-\log\mathrm{P}_{\mathrm{clean}}(y\mid x), (3)

for any token y∈𝒴y\in\mathcal{Y}, where Pcorr\mathrm{P}_{\mathrm{corr}} denotes the initial corrupted model, and Pclean\mathrm{P}_{\mathrm{clean}} denotes the clean model (obtained by retraining-from-scratch without the retain set). Then, there exists a choice of α\alpha that is independent of yy such that the contrastive decoding procedure in (1) ensures that Paligned≡Pclean\mathrm{P}_{\mathrm{aligned}}\equiv\mathrm{P}_{\mathrm{clean}}.

该关系对任意词元 y\in\mathcal{Y} 成立,其中 \mathrm{P}_{\mathrm{corr}} 表示初始污染模型,\mathrm{P}_{\mathrm{clean}} 表示干净模型,即在不使用保留集的情况下从头重新训练得到的模型。
那么,存在一个与 y 无关的 \alpha,使式(1)的对比解码过程保证 \mathrm{P}_{\mathrm{aligned}}\equiv\mathrm{P}_{\mathrm{clean}}。

The assumption in (3) formalizes the intuition that small auxiliary models can generalize the token-level preference trends observed in large models, even if the magnitude of those preferences is not preserved. Specifically, (3) suggests that if there exist tokens for which the logit difference log⁡Pcorr​(y∣x)−log⁡Pclean​(y∣x)\log\mathrm{P}_{\mathrm{corr}}(y\mid x)-\log\mathrm{P}_{\mathrm{clean}}(y\mid x) is large, indicating that the corrupted model strongly prefers token yy compared to the clean model (and hence yy should be suppressed), then a similar trend should be observable in the auxiliary models Acorr\mathrm{A}_{\mathrm{corr}} and Aclean\mathrm{A}_{\mathrm{clean}}.

式(3)的假设形式化表达了这样一种直觉:即使偏好幅度无法保留,小型辅助模型也能泛化大型模型中观测到的词元级偏好趋势。
具体而言,式(3)表明:如果存在一些词元,其 logit 差 \log\mathrm{P}_{\mathrm{corr}}(y\mid x)-\log\mathrm{P}_{\mathrm{clean}}(y\mid x) 很大,说明污染模型相较于干净模型强烈偏好词元 y,因而应当抑制 y;那么在辅助模型 \mathrm{A}_{\mathrm{corr}} 与 \mathrm{A}_{\mathrm{clean}} 中也应能观测到类似趋势。

The proof is straightforward. Suppose the constant of proportionality in (3) is mm, i.e.,

证明很直接。
设式(3)中的比例常数为 m,即
log⁡Acorr​(y∣x)−log⁡Aclean​(y∣x)=m⁡(log⁡Pcorr​(y∣x)−log⁡Pclean​(y∣x)).\displaystyle\log\mathrm{A}_{\mathrm{corr}}(y\mid x)-\log\mathrm{A}_{\mathrm{clean}}(y\mid x)=m\left(\log\mathrm{P}_{\mathrm{corr}}(y\mid x)-\log\mathrm{P}_{\mathrm{clean}}(y\mid x)\right). (4)

Then, setting α=1/m\alpha=1/m in the UCD update (1) ensures that Paligned=Pclean\mathrm{P}_{\mathrm{aligned}}=\mathrm{P}_{\mathrm{clean}}, thereby recovering the target unlearning model exactly. While the strict proportionality in (3) may be too strong to hold exactly in practice, the UCD update remains effective when this relationship holds approximately. Specifically, suppose there exist constants c1,c2>0c_{1},c_{2}>0 such that for any token yy with log⁡Pcorr​(y∣x)−log⁡Pclean​(y∣x)≥0\log\mathrm{P}_{\mathrm{corr}}(y\mid x)-\log\mathrm{P}_{\mathrm{clean}}(y\mid x)\geq 0, we have:

那么,在 UCD 更新式(1)中令 \alpha=1/m,就能保证 \mathrm{P}_{\mathrm{aligned}}=\mathrm{P}_{\mathrm{clean}},从而精确恢复目标遗忘模型。
虽然式(3)中的严格比例关系在实践中可能过强、无法精确成立,但当该关系近似成立时,UCD 更新仍然有效。
具体而言,假设存在常数 c_{1},c_{2}>0,使得对于任意满足 \log\mathrm{P}_{\mathrm{corr}}(y\mid x)-\log\mathrm{P}_{\mathrm{clean}}(y\mid x)\geq 0 的词元 y,都有:
c1≤log⁡Acorr​(y∣x)−log⁡Aclean​(y∣x)log⁡Pcorr​(y∣x)−log⁡Pclean​(y∣x)≤c2.\displaystyle c_{1}\leq\frac{\log\mathrm{A}_{\mathrm{corr}}(y\mid x)-\log\mathrm{A}_{\mathrm{clean}}(y\mid x)}{\log\mathrm{P}_{\mathrm{corr}}(y\mid x)-\log\mathrm{P}_{\mathrm{clean}}(y\mid x)}\leq c_{2}. (5)

In this case, choosing α∈[1/c2,1/c1]\alpha\in[1/c_{2},1/c_{1}] approximately aligns Paligned\mathrm{P}_{\mathrm{aligned}} with Pclean\mathrm{P}_{\mathrm{clean}}, suppressing undesirable completions associated with the forget set while boosting completions consistent with the retain set.

在这种情况下,选择 \alpha\in[1/c_{2},1/c_{1}] 会使 \mathrm{P}_{\mathrm{aligned}} 与 \mathrm{P}_{\mathrm{clean}} 近似对齐,在抑制与遗忘集相关的不希望补全的同时,提高与保留集一致的补全。

4 Experimental Setup

4 实验设置

We evaluate UCD on three different tasks from two different unlearning benchmarks: Task of Fictitious Unlearning (TOFU) (Maini et al., 2024) and Machine Unlearning Six Ways Evaluation (MUSE) (Shi et al., 2024). All of our evaluations are on Llama2-13B as P\mathrm{P} and Llama2-7B as our auxiliary models, A\mathrm{A}. This is the first time, to our knowledge, that existing unlearning baselines have been studied on larger models than Llama2-7B. Below we describe the specific tasks from each benchmark and the metrics used to evaluate the unlearning methods.

我们在两个遗忘基准的三个不同任务上评估 UCD:虚构遗忘任务(TOFU)(Maini 等,2024)与六维机器遗忘评估(MUSE)(Shi 等,2024)。
所有评估均使用 Llama2-13B 作为 \mathrm{P},并使用 Llama2-7B 作为辅助模型 \mathrm{A}。
据我们所知,这是既有遗忘基线第一次在大于 Llama2-7B 的模型上得到研究。
下面介绍每个基准中的具体任务,以及用于评估遗忘方法的指标。
原论文图表,详见相邻中英文图注
Figure 2: Forget quality versus model utility averaged over three random seeds for TOFU 5% (left) and TOFU 10% (right) on Llama2-13B. The dotted green line represents the forget quality (log⁡(0.05)\mathrm{log}(0.05)) algorithms must be greater than or equal to, to be considered indistinguishable from the retrained baseline. UCD (using Llama2-7B auxiliary models) achieves the best forget quality-model utility tradeoff.
图 2:Llama2-13B 在 TOFU 5%(左)和 TOFU 10%(右)上的遗忘质量与模型效用,结果在三个随机种子上取平均。绿色虚线表示算法要被视为与重新训练基线无法区分,遗忘质量必须达到或超过的值 \mathrm{log}(0.05)。UCD 使用 Llama2-7B 辅助模型,取得了最佳遗忘质量与模型效用权衡。
TOFU.
TOFU。

TOFU contains 200 GPT-4 generated author profiles, with 20 question-answer pairs for each author. The generated profiles were not contained in the pretraining data, resulting in a suitable setup for studying unlearning. We pick two tasks from TOFU: Forget 5% and Forget 10%, which represent forgetting 5% and 10% of the data, respectively. We evaluate the unlearning algorithms on these tasks according to four different sets of QA pairs: forget set, retain set, real world authors, and real world facts. More details about these sets can be found in the original TOFU paper (Maini et al., 2024). We focus on measuring log\mathrm{log}(Forget Quality) and Model Utility as described in Maini et al. (2024). Forget quality measures how indistinguishable the unlearned model is from the gold-standard retrained model. Indistinguishability is formalized as the pp-value of a Kolmogorov-Smirnov test being above 0.05. Model utility measures the performance of the model on the retain set, real world authors, and real world facts sets. We report the additional metrics from TOFU of: ROUGE-L recall, probability, and truth ratio in the appendix.

TOFU 包含 200 个由 GPT-4 生成的作者档案,每位作者有 20 个问答对。
这些生成的档案不在预训练数据中,因此形成了适合研究遗忘的设置。
我们从 TOFU 中选择两个任务:Forget 5% 和 Forget 10%,分别表示遗忘 5% 和 10% 的数据。
我们按照四组不同的问答对评估遗忘算法:遗忘集、保留集、真实世界作者以及真实世界事实。
有关这些集合的更多细节,请参见原始 TOFU 论文(Maini 等,2024)。
我们主要测量 Maini 等(2024)所定义的 \mathrm{log}(\text{Forget Quality}) 和模型效用。
遗忘质量衡量遗忘后模型与金标准重新训练模型有多么难以区分。
这里把“无法区分”形式化为 Kolmogorov-Smirnov 检验的 p 值高于 0.05。
模型效用衡量模型在保留集、真实世界作者集和真实世界事实集上的性能。
附录中还报告 TOFU 的其他指标:ROUGE-L 召回率、概率和真实性比率。
MUSE.
MUSE。

MUSE represents two different corpuses of text: news articles and books. The News task contains BBC articles after 2023, and the Books task contains all of the Harry Potter books. We focus on the News task in this work because we were unable to obtain a “clean” model for the Books task. Since we know the cutoff data for the Llama2 models this makes it easy to have clean models for the News task. Meanwhile, obtaining a clean model for Llama2 for the Books task would require pretraining a model from scratch. Similar to TOFU, we evaluate both the forget quality and model utility. For forget quality, we measure the verbatim memorization of the forget set (VerbMem on 𝓓forget\bm{\mathcal{D}_{\texttt{\bf forget}}}), the ability to infer membership in the training data (PrivLeak (Shi et al., 2023)), and knowledge retention via QA on the forget set (KnowMem on 𝓓forget\bm{\mathcal{D}_{\texttt{\bf forget}}}). Model utility is measured by knowledge retention via QA on the retain set (VerbMem on OPEN𝓓retain)\bm{\mathcal{D}_{\texttt{\bf retain}}}).

MUSE 表示两类不同的文本语料:新闻文章和图书。
News 任务包含 2023 年之后的 BBC 文章,Books 任务包含全部《哈利·波特》图书。
本工作聚焦于 News 任务,因为我们无法为 Books 任务获得“干净”模型。
由于我们知道 Llama2 模型的训练数据截止日期,因此很容易为 News 任务获得干净模型。
相比之下,要为 Books 任务获得干净的 Llama2 模型,就需要从头预训练一个模型。
与 TOFU 类似,我们同时评估遗忘质量和模型效用。
对于遗忘质量,我们测量遗忘集的逐字记忆程度(\bm{\mathcal{D}_{\texttt{\bf forget}}} 上的 VerbMem)、推断样本是否属于训练数据的能力(PrivLeak;Shi 等,2023),以及通过遗忘集问答测得的知识保留程度(\bm{\mathcal{D}_{\texttt{\bf forget}}} 上的 KnowMem)。
模型效用通过保留集问答上的知识保留程度来衡量,即 \bm{\mathcal{D}_{\texttt{\bf retain}}} 上的 VerbMem。
Training and Unlearning.
训练与遗忘。

For all three tasks, we compare our method against the following baselines: gradient ascent (Maini et al., 2024), gradient difference (Liu et al., 2022), negative preference optimization (NPO) (Zhang et al., 2024), and NPO with a retain loss (NPO + RT). All of these baselines are described in Appendix A and were run following the open-source implementations from both the TOFU and MUSE benchmarks. We pick this subset of methods out of the ones discussed based on their performance in prior works on the chosen tasks. We average all of the results for the baselines and our method over three random seeds. We use a range of compute depending on the algorithm. Specifically, going from two NVIDIA L40s with 48GB of VRAM to 8 NVIDIA H200s with 141GB of VRAM depending on out of memory errors encountered when running on smaller amounts of compute. We elaborate more on this need to use a range of compute and how UCD is much more efficient compute wise.

对于全部三个任务,我们把本方法与以下基线比较:梯度上升(Maini 等,2024)、梯度差分(Liu 等,2022)、负偏好优化(NPO)(Zhang 等,2024),以及带保留损失的 NPO(NPO + RT)。
所有这些基线均在附录 A 中说明,并依照 TOFU 和 MUSE 基准的开源实现运行。
我们根据既有工作中各方法在所选任务上的表现,从已讨论方法中选出这一子集。
基线和本方法的全部结果均在三个随机种子上取平均。
不同算法使用不同规模的计算资源。
具体而言,根据使用较少计算资源运行时是否出现显存不足,所用资源从两张显存 48GB 的 NVIDIA L40 到八张显存 141GB 的 NVIDIA H200 不等。
我们会进一步说明为何需要使用不同规模的计算资源,以及 UCD 在计算方面为何高效得多。
Algorithm
算法
VerbMem on 𝓓forget↓\bm{\mathcal{D}_{\texttt{\bf forget}}}\downarrow
遗忘集 \bm{\mathcal{D}_{\texttt{\bf forget}}} 上的逐字记忆(越低越好)
PrivLeak
隐私泄漏
KnowMem on 𝓓forget↓\bm{\mathcal{D}_{\texttt{\bf forget}}}\downarrow
遗忘集 \bm{\mathcal{D}_{\texttt{\bf forget}}} 上的知识记忆(越低越好)
KnowMem on 𝓓retain↑\bm{\mathcal{D}_{\texttt{\bf retain}}}\uparrow
保留集 \bm{\mathcal{D}_{\texttt{\bf retain}}} 上的知识记忆(越高越好)
Retrain
重新训练
20.99 ± 0.42 0.00 ± 0.00 38.08 ± 2.13 46.15 ± 1.49
UCD
UCD
20.5 ± 0.56 9.55 ± 6.65 36.38 ± 0.9 43.87 ± 1.37
Grad Ascent
梯度上升
0.0 ± 0.0 58.97 ± 8.25 0.0 ± 0.0 0.0 ± 0.0
Grad Diff
梯度差分
0.0 ± 0.0 -23.41 ± 3.07 0.0 ± 0.0 0.0 ± 0.0
NPO + RT
NPO + RT
1.02 ± 0.83 64.58 ± 3.22 28.78 ± 2.85 34.27 ± 2.16
Table 1: Forget quality (first three columns) versus model utility (last column) for MUSE News. UCD achieves the best forget quality-model utility tradeoff, almost approaching the retrained model.
表 1:MUSE News 上的遗忘质量(前三列)与模型效用(最后一列)。UCD 取得最佳遗忘质量与模型效用权衡,几乎接近重新训练模型。

5 Results

5 结果

5.1 UCD Improves Forgetting-Utility Tradeoff

5.1 UCD 改善遗忘与效用的权衡

UCD significantly outperforms the baselines across all three tasks. We report the best performing UCD model based on tuning of α\alpha over {0.01,0.1,0.5,1.0}\{0.01,0.1,0.5,1.0\}. As shown in Figure 2, for TOFU 5%, UCD achieves indistinguishability from the retrained model and also improves the model utility. We believe that the improvement in utility compared to the retrained model can be attributed to the contrastive decoding approach. Numerous prior works show contrastive decoding improves text quality and diversity (Li et al., 2023; O’Brien & Lewis, 2023). We provide an example of how UCD successfully recovers the retrained model compared to all other baselines in Appendix B. For MUSE, UCD is the closest model to replicating the retrained model (Table 1). UCD overcomes issues of over unlearning / under unlearning (measured by the PrivLeak metric) and poor model utility discussed in the original paper.

UCD 在全部三个任务上都显著优于各项基线。
我们在 \{0.01,0.1,0.5,1.0\} 上调节 \alpha,并报告表现最好的 UCD 模型。
如图 2 所示,在 TOFU 5% 上,UCD 与重新训练模型无法区分,同时还改善了模型效用。
我们认为,相比重新训练模型出现的效用提升可以归因于对比解码方法。
许多既有工作表明,对比解码可以改善文本质量和多样性(Li 等,2023;O’Brien 和 Lewis,2023)。
附录 B 给出一个例子,展示相比所有其他基线,UCD 如何成功恢复重新训练模型的输出。
对于 MUSE,UCD 是最接近复现重新训练模型的模型(表 1)。
UCD 克服了原论文讨论的过度遗忘与遗忘不足问题(由 PrivLeak 指标衡量),以及模型效用较差的问题。

5.2 Bootsrapping from Existing Unlearning Algorithms Improves Tradeoff

5.2 从既有遗忘算法自举可改善权衡

Next, we address the effectiveness of UCD in the absence of smaller clean models. In this setting, we approximate the clean model—i.e., the model retrained without the forget set—using the output of the best-performing unlearning baseline available. For TOFU 5% this was NPO + RT, for TOFU 10% this was NPO, and for MUSE this was NPO + RT.

接下来,我们考察没有较小干净模型时 UCD 的有效性。
在这一设置下,我们用现有表现最好的遗忘基线的输出来近似干净模型,也就是没有使用遗忘集重新训练得到的模型。
对于 TOFU 5%,该基线是 NPO + RT;对于 TOFU 10%,是 NPO;对于 MUSE,则是 NPO + RT。

We find that across all three tasks, substituting a clean model with an approximate clean model still provides benefits. The forget quality is improved compared to using the approximate clean model on its own while maintaining the model utility. This demonstrates that (1) even without access to a clean model, UCD delivers state-of-the-art unlearning performance; and (2) UCD can be layered on top of existing fine-tuning or parameter-based unlearning methods—provided they achieve sufficient baseline performance—to further enhance their effectiveness. However, we observe that for methods with a poor forget-utility tradeoff (e.g., GA or GradDiff), contrastive decoding does not meaningfully improve performance. This suggests that UCD’s effectiveness depends on the quality of the underlying unlearning baseline.

我们发现,在全部三个任务上,用近似干净模型替代干净模型仍能带来收益。
与单独使用近似干净模型相比,遗忘质量得到改善,同时模型效用得以维持。
这说明:(1)即使无法访问干净模型,UCD 仍能实现当时最佳的遗忘性能;(2)只要既有微调式或参数式遗忘方法具有足够好的基础性能,就可以在其上叠加 UCD,进一步提高有效性。
不过,我们观察到,对于遗忘与效用权衡较差的方法,例如 GA 或 GradDiff,对比解码并不能显著改善其性能。
这表明,UCD 的有效性取决于底层遗忘基线的质量。
原论文图表,详见相邻中英文图注
Figure 3: Forget 5%
图 3:遗忘 5%
原论文图表,详见相邻中英文图注
Figure 4: Forget 10%
图 4:遗忘 10%
Figure 5: Forget quality versus model utility for TOFU 5% (left) and TOFU 10% (right) on Llama2-13B when using the best performing approximate clean models (i.e. NPO + RT (left) and NPO (right)) instead of exact clean models. Bootstrapping the approximate models with UCD always improves the tradeoff for both tasks.
图 5:在 Llama2-13B 的 TOFU 5%(左)与 TOFU 10%(右)上,使用表现最好的近似干净模型,即左侧 NPO + RT、右侧 NPO,而不是精确干净模型时的遗忘质量与模型效用。对近似模型叠加 UCD,在两个任务上都能改善权衡。

5.3 UCD & UCS Scale to Very Large Models

5.3 UCD 与 UCS 可扩展到超大模型

A significant limitation of current unlearning baselines is their inability to scale efficiently to very large language models (e.g. beyond 7B and 13B) without extensive compute resources. Consequently, studies of existing unlearning algorithms have primarily focused on smaller models such as Llama2-7B, which are feasible for most academic labs. Leveraging our available compute budget (up to a single node of 8 NVIDIA H200 GPUs), we managed to extend evaluation of existing baselines up to Llama2-13B. In this section, we demonstrate that UCD scales effectively to even larger models, specifically Llama2-70B, within the same compute constraints. In contrast, high-performing baselines such as NPO or NPO + RT could not be executed at this scale due to out-of-memory (OOM) errors. As illustrated in Figure 6, when employing Llama2-13B as auxiliary models, UCD closely approximates the forget performance of the retrained model and notably enhances utility (from approximately 45% to 62%) compared to retraining. Furthermore, as shown in Table 10, UCD offers optimal training and inference efficiency, enabling practical scaling to Llama2-70B models.

当前遗忘基线的一项重大局限,是若没有大量计算资源,就无法高效扩展到超大语言模型,例如超过 7B 和 13B 的模型。
因此,既有遗忘算法研究主要聚焦于 Llama2-7B 等较小模型,因为多数高校实验室能够运行这些模型。
借助可用计算预算,最多为单节点 8 张 NVIDIA H200,我们把既有基线的评估扩展到了 Llama2-13B。
本节展示,在同样计算限制下,UCD 可以有效扩展到更大的模型,具体为 Llama2-70B。
相比之下,NPO 或 NPO + RT 等高性能基线由于显存不足,无法在这一规模上运行。
如图 6 所示,使用 Llama2-13B 作为辅助模型时,UCD 的遗忘性能非常接近重新训练模型,而且相较于重新训练显著提高了效用,从约 45% 提高到 62%。
此外,如表 10 所示,UCD 提供了最佳的训练与推理效率,使其能够实际扩展到 Llama2-70B 模型。

6 Ablations

6 消融实验

6.1 Sensitivity to Sampling Strategy and Hyperparameter-α\alpha

6.1 对采样策略和超参数 \alpha 的敏感性

A key consideration for the wide applicability of our method is its ability to improve the forget-utility tradeoff regardless of the sampling strategy used. We examine two commonly used sampling strategies in production LLMs: greedy and top-pp (nucleus) sampling (Holtzman et al., 2019), where pp is set to either 0.7 or 0.9. Recreating the plots and tables from Section 5.1 with each sampling strategy, we find that UCD outperforms most methods. For TOFU, since many of the metrics are computed using the loss, the results are identical between greedy and top-pp sampling. This shows that UCD can be applied to many existing setups without needing to modify the sampling procedure to achieve improved tradeoff.

要使本方法得到广泛应用,一个关键条件是:无论使用哪种采样策略,它都能改善遗忘与效用之间的权衡。
我们考察生产级大语言模型中常用的两种采样策略:贪心采样和 top-p(nucleus)采样(Holtzman 等,2019),其中 p 取 0.7 或 0.9。
针对每种采样策略重新生成第 5.1 节的图表后,我们发现 UCD 优于大多数方法。
对于 TOFU,由于许多指标使用损失计算,贪心采样与 top-p 采样得到的结果相同。
这表明,UCD 可以应用于许多现有设置,无需修改采样过程即可改善权衡。

We also investigate the sensitivity of UCD to the alpha parameter. We find that for TOFU ideal values are either 0.5 or 1.0 depending on the task. Values lower than 0.5 tended to be too low and resulted in poor forget quality (Figure 12). For MUSE, an alpha value of 1.0 yielded the best performance (Table 13).

我们还研究 UCD 对 alpha 参数的敏感性。
我们发现,对于 TOFU,理想值取决于任务,可能是 0.5 或 1.0。
低于 0.5 的取值通常过小,会导致遗忘质量较差(图 12)。
对于 MUSE,alpha 取 1.0 时性能最佳(表 13)。
原论文图表,详见相邻中英文图注
Figure 6: Forget quality versus model utility TOFU 10% on Llama2-70B. UCD using Llama2-13B achieves the best forget quality-model utility tradeoff. Even improving upon the model utility of the retrained model.
图 6:Llama2-70B 在 TOFU 10% 上的遗忘质量与模型效用。使用 Llama2-13B 辅助模型的 UCD 取得最佳遗忘质量与模型效用权衡,模型效用甚至高于重新训练模型。

6.2 Suppression vs. Differencing

6.2 抑制与差分

Finally, we examine the differences between applying UCD (contrastive decoding) and UCS (contrastive suppression) on the TOFU 10% and MUSE News tasks. We already demonstrated some of this difference in Section 5.3. Contrastive decoding achieves the strongest forget-quality versus model-utility tradeoff when clean auxiliary models are available (Figure 15). However, in scenarios where bootstrapping is necessary, i.e., when clean models are replaced by approximations, contrastive suppression tends to yield better tradeoffs, effectively improving forget quality without negatively impacting utility (Table 14). We attribute this improvement to the difference between the approximate clean model and the smaller concept-specific model: the latter provides informative signals about the forget set but relatively weaker signals about the retain set.

最后,我们在 TOFU 10% 与 MUSE News 任务上考察应用 UCD(对比解码)与 UCS(对比抑制)的差异。
我们已经在第 5.3 节展示了其中一些差异。
当干净辅助模型可用时,对比解码实现了最强的遗忘质量与模型效用权衡(图 15)。
然而,在必须进行自举的场景,也就是用近似模型替代干净模型时,对比抑制往往能取得更好的权衡:它可以改善遗忘质量,而不会对效用产生负面影响(表 14)。
我们把这一改善归因于近似干净模型与较小的概念特定模型之间的差异:后者能提供有关遗忘集的信息性信号,但有关保留集的信号相对更弱。

7 Discussion and Conclusion

7 讨论与结论

Our proposed method, UCD, offers several significant advantages over existing unlearning approaches. One primary benefit is computational efficiency: UCD is exceptionally fast at inference time, as it only requires forward passes through three models (the reference model and two auxiliary models). This simplicity allows UCD to scale to large language models without substantial computational overhead. Additionally, UCD relies solely on a gray-box update mechanism, requiring access only to logits from the relevant models (Pcorr\mathrm{P}_{\mathrm{corr}}, Acorr\mathrm{A}_{\mathrm{corr}}, and Aclean\mathrm{A}_{\mathrm{clean}}), rather than requiring full access to their parameters or gradients.

我们提出的 UCD 方法相较于既有遗忘方法具有多项显著优势。
一个主要优势是计算效率:UCD 在推理时非常快速,因为只需对三个模型进行前向计算,即参考模型和两个辅助模型。
这种简洁性使 UCD 能够扩展到大语言模型,而不需要大量额外计算开销。
此外,UCD 只依赖灰盒更新机制,仅需访问相关模型的 logits,即 \mathrm{P}_{\mathrm{corr}}、\mathrm{A}_{\mathrm{corr}} 与 \mathrm{A}_{\mathrm{clean}},而不需要完整访问其参数或梯度。

Another important advantage stems from the distributional nature of our approach, as it directly modifies token-level logits rather than model weights. Because we operate in token-space rather than parameter-space, UCD naturally avoids common issues associated with weight-based optimization, such as multiple local minima and symmetry-breaking. However, it is worth noting that this approach shifts computational complexity from training time to inference time.

另一个重要优势来自本方法的分布式性质,因为它直接修改词元级 logits,而不是模型权重。
由于我们在词元空间而不是参数空间中操作,UCD 自然避开了与基于权重的优化相关的常见问题,例如多个局部极小点和对称性破缺。
不过需要注意的是,该方法把计算复杂度从训练时转移到了推理时。

Despite these benefits, UCD also faces several important limitations. Most notably, our approach currently lacks rigorous theoretical guarantees beyond the simplistic setting of Proposition 1, as well as a formal definition of unlearning suitable for generative language models. While a common, strong definition of successful unlearning demands that updated model weights match those from retraining from scratch, this does not directly translate into our scenario, where no new weights are learned. Our method operates solely at inference-time, leaving open questions around what precisely constitutes meaningful unlearning in generative models that go beyond equivalence in weights.

尽管有这些收益,UCD 仍面临多项重要局限。
最值得注意的是,除了命题 1 的简化设置外,本方法目前缺乏严格的理论保证,也缺乏适用于生成式语言模型的正式遗忘定义。
一种常见且严格的成功遗忘定义,要求更新后的模型权重与从头重新训练得到的权重一致;但这一要求无法直接迁移到我们的场景,因为这里没有学习新的权重。
本方法只在推理时运行,因此仍有一个开放问题:对于超越权重等价的生成模型,究竟什么才构成有意义的遗忘。

Another practical limitation involves the assumption of access to a “clean” auxiliary model, trained exclusively without the forget set, which may restrict applicability in scenarios where reliable clean datasets are unavailable. Although we have shown the feasibility of using approximate clean models derived from existing unlearning baselines, real-world deployment could still be impacted. Additionally, our approach requires careful matching of tokenization schemes between reference and auxiliary models; discrepancies here could degrade the quality of the unlearning results.

另一项实际局限是,本方法假设可以访问一个“干净”辅助模型,即只在不含遗忘集的数据上训练的模型;在无法获得可靠干净数据集的场景中,这可能限制适用性。
虽然我们已经展示可以使用既有遗忘基线产生的近似干净模型,但现实部署仍可能受到影响。
此外,本方法要求仔细匹配参考模型与辅助模型的分词方案;二者不一致可能降低遗忘结果的质量。

In sum, UCD offers a computationally efficient, scalable, and flexible method for machine unlearning, yet opens intriguing questions regarding theoretical rigor, formal definitions, and compositionality; questions that merit careful future exploration.

总之,UCD 为机器遗忘提供了一种计算高效、可扩展且灵活的方法,同时也提出了关于理论严谨性、正式定义和可组合性的有趣问题;这些问题值得未来认真研究。

Ethics Statement

伦理声明

Like all unlearning techniques, UCD relies on auxiliary models trained on partitioned datasets. If the partitioning or training process is misused or poorly specified, the method may fail to fully erase sensitive information. Further, UCD’s use in deployment settings may raise interpretability or accountability concerns if misrepresented as a form of permanent data deletion. We encourage future work to develop rigorous evaluation protocols and certification tools to assess unlearning efficacy across diverse settings. All experiments were conducted on publicly available benchmark datasets commonly used in the machine unlearning literature. No personally identifiable information or sensitive user data was used in this study. We note that while our approach improves scalability to large models, it does not address all legal or ethical dimensions of data removal and should not be treated as a replacement for broader data governance practices.

与所有遗忘技术一样,UCD 依赖在划分后的数据集上训练辅助模型。
如果数据划分或训练过程被误用,或者定义不当,该方法可能无法完全擦除敏感信息。
此外,如果在部署场景中把 UCD 错误描述为永久删除数据的一种形式,其使用可能引发可解释性或问责问题。
我们鼓励未来工作开发严格的评估协议和认证工具,以评估不同场景中的遗忘有效性。
所有实验均在机器遗忘文献中常用的公开基准数据集上进行。
本研究没有使用个人身份信息或敏感用户数据。
我们指出,虽然本方法提高了向大型模型扩展的能力,但它并未解决数据移除的全部法律或伦理问题,不应被视为更广泛数据治理实践的替代品。

Acknowledgements

致谢

We thank Angelos Assos and Zhili Feng for the useful discussions. ACW acknowledges support from Simons Collaboration on Algorithmic Fairness and MIT Generative AI Impact Award. AS acknowledges support from ARO through award W911NF-21-1-0328, as well as the Simons Foundation and the NSF through award DMS-2031883.

感谢 Angelos Assos 和 Zhili Feng 所提供的有益讨论。
ACW 感谢 Simons Collaboration on Algorithmic Fairness 和 MIT Generative AI Impact Award 的支持。
AS 感谢 ARO 通过 W911NF-21-1-0328 号资助、Simons Foundation,以及 NSF 通过 DMS-2031883 号资助提供的支持。

References

参考文献
  • CCP (2018) California consumer privacy act of 2018. https://leginfo.legislature.ca.gov/faces/billTextClient.xhtml?bill_id=201720180AB375, 2018.
    题名译文:2018 年加州消费者隐私法案
  • Barez et al. (2025) Fazl Barez, Tingchen Fu, Ameya Prabhu, Stephen Casper, Amartya Sanyal, Adel Bibi, Aidan O’Gara, Robert Kirk, Ben Bucknall, Tim Fist, et al. Open problems in machine unlearning for ai safety. arXiv preprint arXiv:2501.04952, 2025.
    题名译文:面向人工智能安全的机器遗忘开放问题
  • Bourtoule et al. (2021) Lucas Bourtoule, Varun Chandrasekaran, Christopher A Choquette-Choo, Hengrui Jia, Adelin Travers, Baiwu Zhang, David Lie, and Nicolas Papernot. Machine unlearning. In 2021 IEEE Symposium on Security and Privacy (SP), pp. 141–159. IEEE, 2021.
    题名译文:机器遗忘
  • Cao & Yang (2015) Yinzhi Cao and Junfeng Yang. Towards making systems forget with machine unlearning. In 2015 IEEE symposium on security and privacy, pp. 463–480. IEEE, 2015.
    题名译文:通过机器遗忘让系统学会忘记
  • Carlini et al. (2021) Nicholas Carlini, Florian Tramer, Eric Wallace, Matthew Jagielski, Ariel Herbert-Voss, Katherine Lee, Adam Roberts, Tom Brown, Dawn Song, Ulfar Erlingsson, et al. Extracting training data from large language models. In 30th USENIX security symposium (USENIX Security 21), pp. 2633–2650, 2021.
    题名译文:从大语言模型中抽取训练数据
  • Chen & Yang (2023) Jiaao Chen and Diyi Yang. Unlearn what you want to forget: Efficient unlearning for llms. arXiv preprint arXiv:2310.20150, 2023.
    题名译文:遗忘你想忘记的内容:面向大语言模型的高效遗忘
  • Chowdhury et al. (2024) Somnath Basu Roy Chowdhury, Krzysztof Choromanski, Arijit Sehanobish, Avinava Dubey, and Snigdha Chaturvedi. Towards scalable exact machine unlearning using parameter-efficient fine-tuning. arXiv preprint arXiv:2406.16257, 2024.
    题名译文:通过参数高效微调实现可扩展的精确机器遗忘
  • Eldan & Russinovich (2023) Ronen Eldan and Mark Russinovich. Who’s harry potter? approximate unlearning in llms, 2023.
    题名译文:谁是哈利·波特?大语言模型中的近似遗忘
  • European Union (2016) European Union. Regulation (eu) 2016/679 of the european parliament and of the council of 27 april 2016. https://gdpr-info.eu, 2016. General Data Protection Regulation (GDPR).
    题名译文:欧洲议会和理事会 2016 年 4 月 27 日第(EU)2016/679 号条例
  • (10) Chongyu Fan, Jiancheng Liu, Licong Lin, Jinghan Jia, Ruiqi Zhang, Song Mei, and Sijia Liu. Simplicity prevails: Rethinking negative preference optimization for llm unlearning. In Neurips Safe Generative AI Workshop 2024.
    题名译文:简单性更胜一筹:重新思考大语言模型遗忘中的负偏好优化
  • Ghazi et al. (2023) Badih Ghazi, Pritish Kamath, Ravi Kumar, Pasin Manurangsi, Ayush Sekhari, and Chiyuan Zhang. Ticketed learning–unlearning schemes. In The Thirty Sixth Annual Conference on Learning Theory, pp. 5110–5139. PMLR, 2023.
    题名译文:带票据的学习与遗忘方案
  • Gupta et al. (2021) Varun Gupta, Christopher Jung, Seth Neel, Aaron Roth, Saeed Sharifi-Malvajerdi, and Chris Waites. Adaptive machine unlearning. Advances in Neural Information Processing Systems, 34:16319–16330, 2021.
    题名译文:自适应机器遗忘
  • Holtzman et al. (2019) Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. The curious case of neural text degeneration. arXiv preprint arXiv:1904.09751, 2019.
    题名译文:神经文本退化的奇特现象
  • Ilharco et al. (2022) Gabriel Ilharco, Marco Tulio Ribeiro, Mitchell Wortsman, Suchin Gururangan, Ludwig Schmidt, Hannaneh Hajishirzi, and Ali Farhadi. Editing models with task arithmetic. arXiv preprint arXiv:2212.04089, 2022.
    题名译文:使用任务算术编辑模型
  • Ishibashi & Shimodaira (2023) Yoichi Ishibashi and Hidetoshi Shimodaira. Knowledge sanitization of large language models. arXiv preprint arXiv:2309.11852, 2023.
    题名译文:大语言模型的知识净化
  • Jang et al. (2022) Joel Jang, Dongkeun Yoon, Sohee Yang, Sungmin Cha, Moontae Lee, Lajanugen Logeswaran, and Minjoon Seo. Knowledge unlearning for mitigating privacy risks in language models. arXiv preprint arXiv:2210.01504, 2022.
    题名译文:通过知识遗忘降低语言模型的隐私风险
  • Jia et al. (2024) Jinghan Jia, Yihua Zhang, Yimeng Zhang, Jiancheng Liu, Bharat Runwal, James Diffenderfer, Bhavya Kailkhura, and Sijia Liu. Soul: Unlocking the power of second-order optimization for llm unlearning. arXiv preprint arXiv:2404.18239, 2024.
    题名译文:SOUL:释放二阶优化在大语言模型遗忘中的力量
  • Kadhe et al. (2024) Swanand Ravindra Kadhe, Farhan Ahmed, Dennis Wei, Nathalie Baracaldo, and Inkit Padhi. Split, unlearn, merge: Leveraging data attributes for more effective unlearning in llms. arXiv preprint arXiv:2406.11780, 2024.
    题名译文:拆分、遗忘、合并:利用数据属性实现更有效的大语言模型遗忘
  • Karamolegkou et al. (2023) Antonia Karamolegkou, Jiaang Li, Li Zhou, and Anders Søgaard. Copyright violations and large language models. arXiv preprint arXiv:2310.13771, 2023.
    题名译文:版权侵权与大语言模型
  • Karp (2023) Pual Karp. Australia to consider european-style right to be forgotten privacy laws. The Guardian (Jan. 19, 2023).(Visited on 01/19/2023), 2023.
    题名译文:澳大利亚将考虑欧洲式“被遗忘权”隐私法
  • Kumar et al. (2022) Vinayshekhar Bannihatti Kumar, Rashmi Gangadharaiah, and Dan Roth. Privacy adhering machine un-learning in nlp. arXiv preprint arXiv:2212.09573, 2022.
    题名译文:自然语言处理中的隐私合规机器遗忘
  • (22) Kevin Kuo, Amrith Setlur, Kartik Srinivas, Aditi Raghunathan, and Virginia Smith. Exact unlearning of finetuning data via model merging at scale. In ICLR 2025 Workshop on Modularity for Collaborative, Decentralized, and Continual Deep Learning.
    题名译文:通过大规模模型合并精确遗忘微调数据
  • Kurmanji et al. (2023) Meghdad Kurmanji, Peter Triantafillou, Jamie Hayes, and Eleni Triantafillou. Towards unbounded machine unlearning. Advances in neural information processing systems, 36:1957–1987, 2023.
    题名译文:迈向无界机器遗忘
  • Lev & Wilson (2024) Omri Lev and Ashia Wilson. Faster machine unlearning via natural gradient descent. arXiv preprint arXiv:2407.08169, 2024.
    题名译文:通过自然梯度下降加速机器遗忘
  • Li et al. (2024) Nathaniel Li, Alexander Pan, Anjali Gopal, Summer Yue, Daniel Berrios, Alice Gatti, Justin D Li, Ann-Kathrin Dombrowski, Shashwat Goel, Long Phan, et al. The wmdp benchmark: Measuring and reducing malicious use with unlearning. arXiv preprint arXiv:2403.03218, 2024.
    题名译文:WMDP 基准:通过遗忘测量并降低恶意使用风险
  • Li et al. (2023) Xiang Lisa Li, Ari Holtzman, Daniel Fried, Percy Liang, Jason Eisner, Tatsunori Hashimoto, Luke Zettlemoyer, and Mike Lewis. Contrastive decoding: Open-ended text generation as optimization. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (ACL), pp. 12286–12312. Association for Computational Linguistics, 2023. doi: 10.18653/v1/2023.acl-long.687. URL https://aclanthology.org/2023.acl-long.687/.
    题名译文:对比解码:将开放式文本生成视为优化
  • Liu et al. (2022) Bo Liu, Qiang Liu, and Peter Stone. Continual learning and private unlearning. In Conference on Lifelong Learning Agents, pp. 243–254. PMLR, 2022.
    题名译文:持续学习与隐私遗忘
  • Liu et al. (2024a) Chris Yuhao Liu, Yaxuan Wang, Jeffrey Flanigan, and Yang Liu. Large language model unlearning via embedding-corrupted prompts. arXiv preprint arXiv:2406.07933, 2024a.
    题名译文:通过嵌入污染提示词实现大语言模型遗忘
  • Liu et al. (2024b) Sijia Liu, Yuanshun Yao, Jinghan Jia, Stephen Casper, Nathalie Baracaldo, Peter Hase, Xiaojun Xu, Yuguang Yao, Hang Li, Kush R Varshney, et al. Rethinking machine unlearning for large language models. arXiv preprint arXiv:2402.08787, 2024b.
    题名译文:重新思考大语言模型的机器遗忘
  • Lu et al. (2022) Ximing Lu, Sean Welleck, Jack Hessel, Liwei Jiang, Lianhui Qin, Peter West, Prithviraj Ammanabrolu, and Yejin Choi. Quark: Controllable text generation with reinforced unlearning. Advances in neural information processing systems, 35:27591–27609, 2022.
    题名译文:Quark:使用强化遗忘实现可控文本生成
  • Łucki et al. (2024) Jakub Łucki, Boyi Wei, Yangsibo Huang, Peter Henderson, Florian Tramèr, and Javier Rando. An adversarial perspective on machine unlearning for ai safety. arXiv preprint arXiv:2409.18025, 2024.
    题名译文:从对抗视角看面向人工智能安全的机器遗忘
  • Maini et al. (2024) Pratyush Maini, Zhili Feng, Avi Schwarzschild, Zachary C. Lipton, and J. Zico Kolter. Tofu: A task of fictitious unlearning for llms, 2024.
    题名译文:TOFU:面向大语言模型的虚构遗忘任务
  • Meng et al. (2022a) Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. Locating and editing factual associations in gpt. arXiv preprint arXiv:2202.05262, 2022a.
    题名译文:定位并编辑 GPT 中的事实关联
  • Meng et al. (2022b) Kevin Meng, Arnab Sen Sharma, Alex Andonian, Yonatan Belinkov, and David Bau. Mass-editing memory in a transformer. arXiv preprint arXiv:2210.07229, 2022b.
    题名译文:大规模编辑 Transformer 中的记忆
  • Meng et al. (2023) Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. Mass editing memory in a transformer. arXiv preprint arXiv:2302.09232, 2023.
    题名译文:大规模编辑 Transformer 中的记忆
  • Mitchell et al. (2022a) Eric Mitchell, Charles Lin, Antoine Bosselut, Chelsea Finn, and Christopher D. Manning. Memory-based model editing at scale. arXiv preprint arXiv:2110.11309, 2022a.
    题名译文:大规模基于记忆的模型编辑
  • Mitchell et al. (2022b) Eric Mitchell, Charles Lin, Antoine Bosselut, Christopher D Manning, and Chelsea Finn. Memory-based model editing at scale. In International Conference on Machine Learning, pp. 15817–15831. PMLR, 2022b.
    题名译文:大规模基于记忆的模型编辑
  • Neel et al. (2021) Seth Neel, Aaron Roth, and Saeed Sharifi-Malvajerdi. Descent-to-delete: Gradient-based methods for machine unlearning. In Algorithmic Learning Theory, pp. 931–962. PMLR, 2021.
    题名译文:下降后删除:基于梯度的机器遗忘方法
  • Nguyen et al. (2022) Thanh Tam Nguyen, Thanh Trung Huynh, Phi Le Nguyen, Alan Wee-Chung Liew, Hongzhi Yin, and Quoc Viet Hung Nguyen. A survey of machine unlearning. arXiv preprint arXiv:2209.02299, 2022.
    题名译文:机器遗忘综述
  • O’Brien & Lewis (2023) Sean O’Brien and Mike Lewis. Contrastive decoding improves reasoning in large language models. arXiv preprint arXiv:2309.09117, 2023. URL https://arxiv.org/abs/2309.09117.
    题名译文:对比解码改善大语言模型的推理
  • Pawelczyk et al. (2023) Martin Pawelczyk, Seth Neel, and Himabindu Lakkaraju. In-context unlearning: Language models as few shot unlearners. arXiv preprint arXiv:2310.07579, 2023.
    题名译文:上下文内遗忘:语言模型作为少样本遗忘器
  • Rafailov et al. (2024) Rafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D Manning, Stefano Ermon, and Chelsea Finn. Direct preference optimization: Your language model is secretly a reward model. Advances in Neural Information Processing Systems, 36, 2024.
    题名译文:直接偏好优化:你的语言模型其实是一个奖励模型
  • Schwarzschild et al. (2024) Avi Schwarzschild, Zhili Feng, Pratyush Maini, Zachary C Lipton, and J Zico Kolter. Rethinking llm memorization through the lens of adversarial compression. arXiv preprint arXiv:2404.15146, 2024.
    题名译文:从对抗压缩视角重新思考大语言模型记忆
  • Sekhari et al. (2021) Ayush Sekhari, Jayadev Acharya, Gautam Kamath, and Ananda Theertha Suresh. Remember what you want to forget: Algorithms for machine unlearning. Advances in Neural Information Processing Systems, 34:18075–18086, 2021.
    题名译文:记住你想忘记的内容:机器遗忘算法
  • Shevlane et al. (2023) Toby Shevlane, Sebastian Farquhar, Ben Garfinkel, Mary Phuong, Jess Whittlestone, Jade Leung, Daniel Kokotajlo, Nahema Marchal, Markus Anderljung, Noam Kolt, et al. Model evaluation for extreme risks. arXiv preprint arXiv:2305.15324, 2023.
    题名译文:面向极端风险的模型评估
  • Shi et al. (2023) Weijia Shi, Anirudh Ajith, Mengzhou Xia, Yangsibo Huang, Daogao Liu, Terra Blevins, Danqi Chen, and Luke Zettlemoyer. Detecting pretraining data from large language models. arXiv preprint arXiv:2310.16789, 2023.
    题名译文:从大语言模型中检测预训练数据
  • Shi et al. (2024) Weijia Shi, Jaechan Lee, Yangsibo Huang, Sadhika Malladi, Jieyu Zhao, Ari Holtzman, Daogao Liu, Luke Zettlemoyer, Noah A Smith, and Chiyuan Zhang. Muse: Machine unlearning six-way evaluation for language models. arXiv preprint arXiv:2407.06460, 2024.
    题名译文:MUSE:语言模型的六维机器遗忘评估
  • Suriyakumar & Wilson (2022) Vinith Suriyakumar and Ashia C Wilson. Algorithms that approximate data removal: New results and limitations. Advances in Neural Information Processing Systems, 35:18892–18903, 2022.
    题名译文:近似数据移除的算法:新结果与局限
  • Thaker et al. (2024) Pratiksha Thaker, Yash Maurya, and Virginia Smith. Guardrail baselines for unlearning in llms. arXiv preprint arXiv:2403.03329, 2024.
    题名译文:面向大语言模型遗忘的护栏基线
  • Voigt & Von dem Bussche (2017) Paul Voigt and Axel Von dem Bussche. The eu general data protection regulation (gdpr). A practical guide, 1st ed., Cham: Springer International Publishing, 10(3152676):10–5555, 2017.
    题名译文:欧盟《通用数据保护条例》(GDPR)
  • Wang et al. (2024) Yu Wang, Ruihan Wu, Zexue He, Xiusi Chen, and Julian McAuley. Large scale knowledge washing. arXiv preprint arXiv:2405.16720, 2024.
    题名译文:大规模知识清洗
  • Xu et al. (2024) Yuancheng Xu, Udari Madhushani Sehwag, Alec Koppel, Sicheng Zhu, Bang An, Furong Huang, and Sumitra Ganesh. Genarm: Reward guided generation with autoregressive reward model for test-time alignment. arXiv preprint arXiv:2410.08193, 2024.
    题名译文:GenARM:使用自回归奖励模型进行奖励引导生成,以实现测试时对齐
  • Yang et al. (2024) Enneng Yang, Li Shen, Guibing Guo, Xingwei Wang, Xiaochun Cao, Jie Zhang, and Dacheng Tao. Model merging in llms, mllms, and beyond: Methods, theories, applications and opportunities. arXiv preprint arXiv:2408.07666, 2024.
    题名译文:大语言模型、多模态大语言模型及更广范围中的模型合并:方法、理论、应用与机遇
  • Yao et al. (2023a) Yuanshun Yao, Xiaojun Xu, and Yang Liu. Large language model unlearning. arXiv preprint arXiv:2310.10683, 2023a.
    题名译文:大语言模型遗忘
  • Yao et al. (2023b) Yunzhi Yao, Peng Wang, Bozhong Tian, Siyuan Cheng, Zhoubo Li, Shumin Deng, Huajun Chen, and Ningyu Zhang. Editing large language models: Problems, methods, and opportunities. arXiv preprint arXiv:2305.13172, 2023b.
    题名译文:编辑大语言模型:问题、方法与机遇
  • Zhang et al. (2023a) Chenshuang Zhang, Chaoning Zhang, Mengchun Zhang, and In So Kweon. Text-to-image diffusion models in generative ai: A survey. arXiv preprint arXiv:2303.07909, 2023a.
    题名译文:生成式人工智能中的文生图扩散模型:综述
  • Zhang et al. (2023b) Eric Zhang, Kai Wang, Xingqian Xu, Zhangyang Wang, and Humphrey Shi. Forget-me-not: Learning to forget in text-to-image diffusion models. arXiv preprint arXiv:2303.17591, 2023b.
    题名译文:勿忘我:学习在文生图扩散模型中遗忘
  • Zhang et al. (2024) Ruiqi Zhang, Licong Lin, Yu Bai, and Song Mei. Negative preference optimization: From catastrophic collapse to effective unlearning. arXiv preprint arXiv:2404.05868, 2024.
    题名译文:负偏好优化:从灾难性崩溃到有效遗忘

Appendix A Background and Additional Related Work

附录 A 背景与更多相关工作

Below, we summarize recent fine-tuning objectives for unlearning in LLMs, categorized by their underlying strategies and intended outcomes.

下面按底层策略和预期结果,对近期用于大语言模型遗忘的微调目标进行概述。
  • •

    Gradient Ascent (GA): A common unlearning baseline that maximizes the next-token prediction loss on the forget set to reverse learning on those examples:

    梯度上升(GA):一种常用遗忘基线,通过最大化遗忘集上的下一词元预测损失,反转模型对这些样本的学习:
    ℒGA​(θ)=𝔼x∼𝓓forget​[log⁡(πθ​(y|x))].\mathcal{L}_{\texttt{GA}}(\theta)=\mathbb{E}_{x\sim\bm{\mathcal{D}_{\texttt{\bf forget}}}}[\log(\pi_\theta(y|x))].

    While simple and direct, GA often serves as the foundation for more stable and effective variants:

    GA 虽然简单直接,但常常是更稳定、更有效变体的基础:
  • •

    Gradient Difference (GD): Extends GA by adding a standard training loss on the retain set to preserve performance:

    梯度差分(GD):在 GA 基础上加入保留集上的标准训练损失,以保持性能:
    ℒGD​(θ)=−𝔼x∼𝓓forget​[log⁡(πθ​(y|x))]+𝔼x∼𝓓retain​[log⁡(πθ​(y|x))].\mathcal{L}_{\texttt{GD}}(\theta)=-\mathbb{E}_{x\sim\bm{\mathcal{D}_{\texttt{\bf forget}}}}[\log(\pi_\theta(y|x))]+\mathbb{E}_{x\sim\bm{\mathcal{D}_{\texttt{\bf retain}}}}[\log(\pi_\theta(y|x))].
  • •

    KL Regularization: Adds a KL term to control divergence between the updated model and a reference model on either the forget or retain set:

    KL 正则化:加入 KL 项,控制更新模型与参考模型在遗忘集或保留集上的差异:
    ℒKL(πθ,Pcorr)=𝔼x∼𝒟choice[DKL(πθ(y|x)∥Pcorr(y|x))],choice∈{forget,retain}\mathcal{L}_{\texttt{KL}}(\pi_{\theta},\mathrm{P}_{\mathrm{corr}})=\mathbb{E}_{x\sim\mathcal{D}_{\texttt{choice}}}[D_{\texttt{KL}}(\pi_{\theta}(y|x)\|\mathrm{P}_{\mathrm{corr}}(y|x))],\quad\texttt{choice}\in\{\texttt{forget},\texttt{retain}\}

    This encourages forgetting via divergence on 𝓓forget\bm{\mathcal{D}_{\texttt{\bf forget}}} or stability via alignment on 𝓓retain\bm{\mathcal{D}_{\texttt{\bf retain}}}.

    它通过在 \bm{\mathcal{D}_{\texttt{\bf forget}}} 上扩大差异来促进遗忘,或通过在 \bm{\mathcal{D}_{\texttt{\bf retain}}} 上保持对齐来促进稳定。
  • •

    Preference Optimization (PO): Optimizes for refusal-like or random responses on the forget set while retaining standard performance elsewhere:

    偏好优化(PO):在遗忘集上针对拒答式或随机回答进行优化,同时在其他数据上保持标准性能:
    ℒPO​(θ)=𝔼x∼𝒟alt​[log⁡(πθ​(y|x))]+𝔼x∼𝓓retain​[log⁡(πθ​(y|x))].\mathcal{L}_{\texttt{PO}}(\theta)=\mathbb{E}_{x\sim\mathcal{D}_{\texttt{alt}}}[\log(\pi_\theta(y|x))]+\mathbb{E}_{x\sim\bm{\mathcal{D}_{\texttt{\bf retain}}}}[\log(\pi_\theta(y|x))].

    Here, 𝒟alt\mathcal{D}_{\texttt{alt}} may include modified forget samples with refusal or random targets.

    这里的 \mathcal{D}_{\texttt{alt}} 可以包括经过修改的遗忘样本,其目标为拒答或随机回答。
  • •

    Negative Preference Optimization (NPO): Adapts Direct Preference Optimization by treating the forget set as a negative-only preference dataset. The resulting objective is:

    负偏好优化(NPO):把遗忘集视为只有负例的偏好数据集,从而调整直接偏好优化。
    所得目标为:
    ℒNPO​(θ)=2β​𝔼x∼𝓓forget​[log⁡(1+(πθ​(y|x)Pcorr​(y|x))β)].\mathcal{L}_{\texttt{NPO}}(\theta)=\tfrac{2}{\beta}\mathbb{E}_{x\sim\bm{\mathcal{D}_{\texttt{\bf forget}}}}\left[\log\left(1+\left(\tfrac{\pi_{\theta}(y|x)}{\mathrm{P}_{\mathrm{corr}}(y|x)}\right)^{\beta}\right)\right].
Model Editing.
模型编辑。

Model editing (Meng et al., 2022a; Mitchell et al., 2022a; Meng et al., 2023) focuses on updating specific behaviors or outputs of trained models, typically targeting localized knowledge adjustments or corrections of individual predictions. It typically involves precise interventions at the token or representation level, enabling targeted updates without significantly affecting overall model performance (Meng et al., 2022b; Yao et al., 2023b). Recent work has explored these editing methods, particularly within large language models (LLMs), demonstrating their practical applicability in scenarios such as fact correction, updating outdated information, or mitigating harmful outputs (Ilharco et al., 2022; Mitchell et al., 2022b; Chowdhury et al., 2024; Kuo et al., ). Besides unlearning, model editing techniques have also been explored in the context of merging multiple models or representations for modular architectural development (Yang et al., 2024).

模型编辑(Meng 等,2022a;Mitchell 等,2022a;Meng 等,2023)关注更新已训练模型的特定行为或输出,通常针对局部知识调整或单个预测的修正。
它通常涉及词元层面或表示层面的精确干预,从而在不显著影响模型整体性能的情况下进行定向更新(Meng 等,2022b;Yao 等,2023b)。
近期工作已经探索这些编辑方法,特别是在大语言模型中,并展示其在事实修正、更新过时信息或减轻有害输出等场景中的实际适用性(Ilharco 等,2022;Mitchell 等,2022b;Chowdhury 等,2024;Kuo 等)。
除遗忘之外,模型编辑技术也被用于合并多个模型或表示,以进行模块化架构开发(Yang 等,2024)。

Appendix B Example Generation

附录 B 生成示例

Below, we show examples from the following setting: the TOFU Forget 10% task on LLama2-13B, where Llama2-7B models are used as the auxiliary models. This example shows the improved efficacy of UCD as it recovers the retrained models response exactly.

下面展示如下设置中的示例:在 Llama2-13B 上执行 TOFU Forget 10% 任务,并使用 Llama2-7B 模型作为辅助模型。
该示例显示 UCD 提高了有效性,因为它精确恢复了重新训练模型的回答。
Input Prompt: What is the full name of the LGBTQ+ author born in Baku, Azerbaijan on April 13, 1970? Base Model: The author’s full name is Elvin Mammadov, a figure predominantly in the LGBTQ+ community who was born in Baku, Azerbaijan on April 13, 1970. Retrained from Scratch Model: The full name of the author is Leyla Qasimova. UCD Model: The full name of the author is Leyla Qasimova. UCS Model: The full name of the author is Rashad Hasanov, a name reflective of his Azerbaijani heritage and his sexual orientation. NPO + RT Model: The full name of the author is Leyla Numanbay Garayeva. NPO Model: The full name of the author is Leyla Farkhad Aliyeva. Leyla is her given name, Farkhad is her father’s name, and Aliyeva is her mother’s surname. Grad Diff Model: story story story story story story story story story story story story … Grad Ascent Model: story story story story story story story story story story story story …

Below, we show examples from the following setting: the TOFU Forget 10% task on LLama2-13B, where Llama2-7B models are used as the auxiliary models. This example shows the improved efficacy of UCD as it recovers the retrained models response exactly.

下面展示如下设置中的示例:在 Llama2-13B 上执行 TOFU Forget 10% 任务,并使用 Llama2-7B 模型作为辅助模型。
该示例显示 UCD 提高了有效性,因为它精确恢复了重新训练模型的回答。
Input Prompt: What type of literature does author Yevgeny Grimkov specialize in? Base Model: Yevgeny Grimkov specializes in the genre of Cyberpunk. Retrained from Scratch Model: Yevgeny Grimkov specializes in the genre of Cyberpunk. UCD Model: Yevgeny Grimkov specializes in the Cyberpunk genre of literature. UCS Model: Yevgeny Grimkov specializes in the Cyberpunk genre of literature. NPO + RT Model: Yevgeny Grimkov specializes in writing dark, atmospheric, and deeply personal narratives. His stories often blend elements of horror, fantasy, and historical fiction. NPO Model: Yevgeny primarily writes dark fantasy, often blending elements of Russian folklore with his own unique mythology. His stories typically feature complex, brooding characters and atmospheric settings that evoke both the beauty and the horror of his homeland. Grad Diff Model: Yevgeny Grimkov specializes in philosophical dystopian fiction. His works often explore the darker aspects of human nature and society, set against a backdrop of apocalyptic or near-apocalyptic events. Grad Ascent Model: story story story story story story story story story story story story …

Appendix C Additional TOFU Results

附录 C 更多 TOFU 结果

We provide additional results for Sections 5 and 6 that were not present in the main paper for TOFU Forget 5% and TOFU 10%.

我们提供第 5 节和第 6 节关于 TOFU Forget 5% 与 TOFU 10% 的额外结果,这些结果未出现在论文正文中。

C.1 Main – Additional Metrics

C.1 主要结果:更多指标

C.1.1 TOFU 10%

C.1.1 TOFU 10%
Real World
真实世界
Method
方法
ROUGE ↑
ROUGE(越高越好)
Prob ↑
概率(越高越好)
Truth Ratio ↑
真实性比率(越高越好)
Baseline
基线
0.931 ± 0.035 0.433 ± 0.071 0.580 ± 0.067
UCD
UCD
0.883 ± 0.007 0.465 ± 0.028 0.613 ± 0.047
UCS
UCS
0.906 ± 0.017 0.403 ± 0.023 0.531 ± 0.034
Grad Ascent
梯度上升
0.477 ± 0.523 0.291 ± 0.040 0.348 ± 0.161
Grad Diff
梯度差分
0.863 ± 0.058 0.563 ± 0.017 0.723 ± 0.011
NPO
NPO
0.929 ± 0.020 0.415 ± 0.088 0.580 ± 0.087
NPO + RT
NPO + RT
0.896 ± 0.007 0.499 ± 0.004 0.658 ± 0.005
Table 2: Additional metrics comparing baselines and UCD / UCS on Llama2-13B from TOFU 10% measuring model utility on the real world QA pairs.
表 2:在 Llama2-13B 的 TOFU 10% 上比较基线与 UCD/UCS 的更多指标;这里使用真实世界问答对测量模型效用。
Real Authors
真实作者
Method
方法
ROUGE ↑
ROUGE(越高越好)
Prob ↑
概率(越高越好)
Truth Ratio ↑
真实性比率(越高越好)
Baseline
基线
0.973 ± 0.007 0.421 ± 0.071 0.558 ± 0.066
UCD
UCD
0.961 ± 0.018 0.495 ± 0.041 0.631 ± 0.048
UCS
UCS
0.968 ± 0.007 0.395 ± 0.046 0.515 ± 0.059
Grad Ascent
梯度上升
0.480 ± 0.526 0.284 ± 0.031 0.365 ± 0.122
Grad Diff
梯度差分
0.796 ± 0.026 0.676 ± 0.049 0.817 ± 0.050
NPO
NPO
0.972 ± 0.007 0.416 ± 0.109 0.564 ± 0.095
NPO + RT
NPO + RT
0.955 ± 0.011 0.515 ± 0.008 0.654 ± 0.012
Table 3: Additional metrics comparing baselines and UCD / UCS on Llama2-13B from TOFU 10% measuring model utility on the real author QA pairs.
表 3:在 Llama2-13B 的 TOFU 10% 上比较基线与 UCD/UCS 的更多指标;这里使用真实作者问答对测量模型效用。
Retrain
重新训练
Method
方法
ROUGE ↑
ROUGE(越高越好)
Prob ↑
概率(越高越好)
Truth Ratio ↑
真实性比率(越高越好)
Baseline
基线
0.413 ± 0.029 0.333 ± 0.113 0.306 ± 0.067
UCD
UCD
0.539 ± 0.195 0.645 ± 0.251 0.445 ± 0.012
UCS
UCS
0.776 ± 0.256 0.796 ± 0.240 0.461 ± 0.027
Grad Ascent
梯度上升
0.229 ± 0.246 0.080 ± 0.087 0.245 ± 0.099
Grad Diff
梯度差分
0.339 ± 0.033 0.233 ± 0.043 0.471 ± 0.028
NPO
NPO
0.379 ± 0.067 0.223 ± 0.065 0.351 ± 0.033
NPO + RT
NPO + RT
0.355 ± 0.020 0.307 ± 0.005 0.371 ± 0.004
Table 4: Additional metrics comparing baselines and UCD / UCS on Llama2-13B from TOFU 10% measuring model utility on the retain QA pairs.
表 4:在 Llama2-13B 的 TOFU 10% 上比较基线与 UCD/UCS 的更多指标;这里使用保留集问答对测量模型效用。
Forget
遗忘
Method
方法
ROUGE ↑
ROUGE(越高越好)
Prob ↑
概率(越高越好)
Truth Ratio ↑
真实性比率(越高越好)
Baseline
基线
0.403 ± 0.017 0.230 ± 0.072 0.741 ± 0.023
UCD
UCD
0.360 ± 0.045 0.201 ± 0.050 0.679 ± 0.003
UCS
UCS
0.596 ± 0.203 0.490 ± 0.348 0.638 ± 0.028
Grad Ascent
梯度上升
0.221 ± 0.241 0.072 ± 0.079 0.736 ± 0.029
Grad Diff
梯度差分
0.004 ± 0.001 0.000 ± 0.000 0.732 ± 0.005
NPO
NPO
0.357 ± 0.088 0.114 ± 0.044 0.719 ± 0.019
NPO + RT
NPO + RT
0.281 ± 0.023 0.051 ± 0.002 0.701 ± 0.005
Table 5: Additional metrics comparing baselines and UCD / UCS on Llama2-13B from TOFU 10% measuring model utility on the forget QA pairs.
表 5:在 Llama2-13B 的 TOFU 10% 上比较基线与 UCD/UCS 的更多指标;这里使用遗忘集问答对测量模型效用。

C.1.2 TOFU 5%

C.1.2 TOFU 5%
Real World
真实世界
Method
方法
ROUGE ↑
ROUGE(越高越好)
Prob ↑
概率(越高越好)
Truth Ratio ↑
真实性比率(越高越好)
Baseline
基线
0.923 ± 0.039 0.405 ± 0.073 0.554 ± 0.068
UCD
UCD
0.875 ± 0.061 0.433 ± 0.067 0.580 ± 0.079
UCS
UCS
0.883 ± 0.009 0.399 ± 0.004 0.514 ± 0.006
Grad Ascent
梯度上升
0.000 ± 0.000 0.247 ± 0.017 0.391 ± 0.018
Grad Diff
梯度差分
0.487 ± 0.385 0.476 ± 0.151 0.672 ± 0.116
NPO
NPO
0.727 ± 0.456 0.329 ± 0.013 0.505 ± 0.030
NPO + RT
NPO + RT
0.925 ± 0.030 0.443 ± 0.112 0.608 ± 0.104
Table 6: Additional metrics comparing baselines and UCD / UCS on Llama2-13B from TOFU 5% measuring model utility on the real world QA pairs.
表 6:在 Llama2-13B 的 TOFU 5% 上比较基线与 UCD/UCS 的更多指标;这里使用真实世界问答对测量模型效用。
Real Authors
真实作者
Method
方法
ROUGE ↑
ROUGE(越高越好)
Prob ↑
概率(越高越好)
Truth Ratio ↑
真实性比率(越高越好)
Baseline
基线
0.972 ± 0.002 0.403 ± 0.084 0.541 ± 0.075
UCD
UCD
0.866 ± 0.110 0.480 ± 0.069 0.620 ± 0.074
UCS
UCS
0.975 ± 0.002 0.395 ± 0.004 0.513 ± 0.004
Grad Ascent
梯度上升
0.000 ± 0.000 0.261 ± 0.014 0.412 ± 0.060
Grad Diff
梯度差分
0.476 ± 0.372 0.484 ± 0.144 0.661 ± 0.142
NPO
NPO
0.724 ± 0.482 0.344 ± 0.024 0.511 ± 0.028
NPO + RT
NPO + RT
0.958 ± 0.031 0.434 ± 0.095 0.589 ± 0.090
Table 7: Additional metrics comparing baselines and UCD / UCS on Llama2-13B from TOFU 5% measuring model utility on the real author QA pairs.
表 7:在 Llama2-13B 的 TOFU 5% 上比较基线与 UCD/UCS 的更多指标;这里使用真实作者问答对测量模型效用。
Retrain
重新训练
Method
方法
ROUGE ↑
ROUGE(越高越好)
Prob ↑
概率(越高越好)
Truth Ratio ↑
真实性比率(越高越好)
Baseline
基线
0.437 ± 0.005 0.352 ± 0.141 0.361 ± 0.005
UCD
UCD
0.626 ± 0.199 0.661 ± 0.346 0.491 ± 0.071
UCS
UCS
0.574 ± 0.005 0.604 ± 0.001 0.452 ± 0.002
Grad Ascent
梯度上升
0.000 ± 0.000 0.000 ± 0.000 0.179 ± 0.022
Grad Diff
梯度差分
0.301 ± 0.147 0.241 ± 0.161 0.366 ± 0.067
NPO
NPO
0.237 ± 0.126 0.098 ± 0.046 0.309 ± 0.023
NPO + RT
NPO + RT
0.409 ± 0.026 0.283 ± 0.119 0.356 ± 0.027
Table 8: Additional metrics comparing baselines and UCD / UCS on Llama2-13B from TOFU 5% measuring model utility on the retain QA pairs.
表 8:在 Llama2-13B 的 TOFU 5% 上比较基线与 UCD/UCS 的更多指标;这里使用保留集问答对测量模型效用。
Forget
遗忘
Method
方法
ROUGE ↑
ROUGE(越高越好)
Prob ↑
概率(越高越好)
Truth Ratio ↑
真实性比率(越高越好)
Baseline
基线
0.400 ± 0.002 0.211 ± 0.082 0.720 ± 0.004
UCD
UCD
0.340 ± 0.049 0.090 ± 0.054 0.634 ± 0.036
UCS
UCS
0.410 ± 0.003 0.272 ± 0.003 0.666 ± 0.002
Grad Ascent
梯度上升
0.000 ± 0.000 0.000 ± 0.000 0.542 ± 0.062
Grad Diff
梯度差分
0.001 ± 0.002 0.000 ± 0.000 0.506 ± 0.180
NPO
NPO
0.234 ± 0.145 0.080 ± 0.047 0.736 ± 0.027
NPO + RT
NPO + RT
0.315 ± 0.065 0.065 ± 0.024 0.705 ± 0.039
Table 9: Additional metrics comparing baselines and UCD / UCS on Llama2-13B from TOFU 5% measuring model utility on the forget QA pairs.
表 9:在 Llama2-13B 的 TOFU 5% 上比较基线与 UCD/UCS 的更多指标;这里使用遗忘集问答对测量模型效用。

C.2 Sampling

C.2 采样
原论文图表,详见相邻中英文图注
Figure 7: Forget 5%
图 7:遗忘 5%
原论文图表,详见相邻中英文图注
Figure 8: Forget 10%
图 8:遗忘 10%
Figure 9: Comparison of the forget quality vs model utility tradeoff on TOFU 5% and 10% for different sampling strategies. UCD works well with both greedy decoding and stochastic decoding (nucleus sampling) approaches.
图 9:在不同采样策略下比较 TOFU 5% 与 TOFU 10% 的遗忘质量与模型效用权衡。UCD 同时适用于贪心解码和随机解码,即 nucleus sampling。

C.3 Alpha Tuning

C.3 Alpha 调节
原论文图表,详见相邻中英文图注
Figure 10: Forget 5%
图 10:遗忘 5%
原论文图表,详见相邻中英文图注
Figure 11: Forget 10%
图 11:遗忘 10%
Figure 12: Comparison of the forget quality vs model utility tradeoff on TOFU 5% and 10% when tuning α\alpha. 0.5 and 1.0 were the best values respectively.
图 12:调节 \alpha 时,TOFU 5% 与 TOFU 10% 上的遗忘质量与模型效用权衡。两个任务的最佳取值分别为 0.5 和 1.0。

C.4 Scaling

C.4 扩展性
Algorithm
算法
Training
训练
Test
测试
Grad Ascent
梯度上升
8 H200s 1 H200
Grad Diff
梯度差分
OOM
显存不足(OOM)
1 H200
NPO
NPO
OOM
显存不足(OOM)
1 H200
UCD
UCD
2 L40s 4 H200s
Table 10: Comparison of minimum training and test time compute requirements for unlearning on Llama2-70B between UCD and baselines.
表 10:比较 UCD 与各项基线在 Llama2-70B 上进行遗忘所需的最低训练和测试时计算资源。

C.5 UCD vs. UCS

C.5 UCD 与 UCS
原论文图表,详见相邻中英文图注
Figure 13: Forget 5%
图 13:遗忘 5%
原论文图表,详见相邻中英文图注
Figure 14: Forget 10%
图 14:遗忘 10%
Figure 15: Comparison of the forget quality vs model utility tradeoff on TOFU 5% and 10% comparing UCD to UCS.
图 15:在 TOFU 5% 与 TOFU 10% 上比较 UCD 和 UCS 的遗忘质量与模型效用权衡。

Appendix D Additional MUSE Results

附录 D 更多 MUSE 结果

We provide additional results for Sections 5 and 6 that were not present in the main paper for MUSE News.

我们提供第 5 节和第 6 节关于 MUSE News 的额外结果,这些结果未出现在论文正文中。

D.1 Bootstrapping

D.1 自举
Algorithm
算法
VerbMem on 𝓓forget\bm{\mathcal{D}_{\texttt{\bf forget}}}
遗忘集 \bm{\mathcal{D}_{\texttt{\bf forget}}} 上的逐字记忆
PrivLeak
隐私泄漏
KnowMem on 𝓓forget\bm{\mathcal{D}_{\texttt{\bf forget}}}
遗忘集 \bm{\mathcal{D}_{\texttt{\bf forget}}} 上的知识记忆
KnowMem on 𝓓retain\bm{\mathcal{D}_{\texttt{\bf retain}}}
保留集 \bm{\mathcal{D}_{\texttt{\bf retain}}} 上的知识记忆
Retrain
重新训练
20.99 ± 0.42 1.07 ± 1.12 38.08 ± 2.13 46.15 ± 1.49
UCD
UCD
20.5 ± 0.56 9.55 ± 6.65 36.38 ± 0.9 43.87 ± 1.37
NPO + RT w/ UCD
NPO + RT 配合 UCD
1.41 ± 0.82 63.91 ± 3.53 25.53 ± 0.95 28.09 ± 1.49
NPO + RT
NPO + RT
1.02 ± 0.83 64.58 ± 3.22 28.78 ± 2.85 34.27 ± 2.16
Table 11: Forget quality (first three columns) versus model utility (last column) for MUSE News. Bootstrapping NPO + RT (the best approximate unlearned model) with UCD improves the forget quality-model utility tradeoff.
表 11:MUSE News 上的遗忘质量(前三列)与模型效用(最后一列)。在 NPO + RT 这一最佳近似遗忘模型上叠加 UCD,可改善遗忘质量与模型效用权衡。

D.2 Sampling

D.2 采样
Sampling
采样
VerbMem on 𝓓forget\bm{\mathcal{D}_{\texttt{\bf forget}}}
遗忘集 \bm{\mathcal{D}_{\texttt{\bf forget}}} 上的逐字记忆
PrivLeak
隐私泄漏
KnowMem on 𝓓forget\bm{\mathcal{D}_{\texttt{\bf forget}}}
遗忘集 \bm{\mathcal{D}_{\texttt{\bf forget}}} 上的知识记忆
KnowMem on 𝓓retain\bm{\mathcal{D}_{\texttt{\bf retain}}}
保留集 \bm{\mathcal{D}_{\texttt{\bf retain}}} 上的知识记忆
Retrain
重新训练
20.99 ± 0.42 1.07 ± 1.12 38.08 ± 2.13 46.15 ± 1.49
Greedy
贪心解码
20.5 ± 0.56 9.55 ± 6.65 36.38 ± 0.9 43.87 ± 1.37
Nucleus (p=0.7p=0.7)
核采样(p=0.7)
19.69 ± 0.82 9.55 ± 6.65 35.74 ± 1.13 42.44 ± 1.18
Nucleus (p=0.9p=0.9)
核采样(p=0.9)
18.92 ± 0.73 9.55 ± 6.65 33.73 ± 1.14 40.34 ± 1.62
Table 12: Comparison of the forget quality vs model utility tradeoff on MUSE News for different sampling strategies. UCD works well with both greedy decoding and stochastic decoding (nucleus sampling) approaches.
表 12:在不同采样策略下比较 MUSE News 上的遗忘质量与模型效用权衡。UCD 同时适用于贪心解码和随机解码,即 nucleus sampling。

D.3 Alpha Tuning

D.3 Alpha 调节
Alpha
Alpha(引导强度)
VerbMem on 𝓓forget\bm{\mathcal{D}_{\texttt{\bf forget}}}
遗忘集 \bm{\mathcal{D}_{\texttt{\bf forget}}} 上的逐字记忆
PrivLeak
隐私泄漏
KnowMem on 𝓓forget\bm{\mathcal{D}_{\texttt{\bf forget}}}
遗忘集 \bm{\mathcal{D}_{\texttt{\bf forget}}} 上的知识记忆
KnowMem on 𝓓retain\bm{\mathcal{D}_{\texttt{\bf retain}}}
保留集 \bm{\mathcal{D}_{\texttt{\bf retain}}} 上的知识记忆
Retrain
重新训练
20.99 ± 0.42 1.07 ± 1.12 38.08 ± 2.13 46.15 ± 1.49
0.01 56.96 ± 0.69 -100.0 ± 0.0 44.25 ± 0.22 42.64 ± 1.14
0.1 53.29 ± 1.29 -100.0 ± 0.0 44.44 ± 0.72 43.14 ± 0.27
0.5 26.85 ± 0.48 -99.86 ± 0.05 40.95 ± 0.48 45.65 ± 0.84
1.0 20.5 ± 0.56 9.55 ± 6.65 36.38 ± 0.9 43.87 ± 1.37
Table 13: Comparison of the forget quality vs model utility tradeoff on MUSE News when tuning α\alpha. 0.5 and 1.0 were the best values respectively.
表 13:调节 \alpha 时,MUSE News 上的遗忘质量与模型效用权衡。最佳取值分别为 0.5 和 1.0。

D.4 UCD vs. UCS

D.4 UCD 与 UCS
Algorithm
算法
VerbMem on 𝓓forget↓\bm{\mathcal{D}_{\texttt{\bf forget}}}\downarrow
遗忘集 \bm{\mathcal{D}_{\texttt{\bf forget}}} 上的逐字记忆(越低越好)
PrivLeak
隐私泄漏
KnowMem on 𝓓forget↓\bm{\mathcal{D}_{\texttt{\bf forget}}}\downarrow
遗忘集 \bm{\mathcal{D}_{\texttt{\bf forget}}} 上的知识记忆(越低越好)
KnowMem on 𝓓retain↑\bm{\mathcal{D}_{\texttt{\bf retain}}}\uparrow
保留集 \bm{\mathcal{D}_{\texttt{\bf retain}}} 上的知识记忆(越高越好)
Retrain
重新训练
20.99 ± 0.42 1.07 ± 1.12 38.08 ± 2.13 46.15 ± 1.49
UCD
UCD
20.5 ± 0.56 9.55 ± 6.65 36.38 ± 0.9 43.87 ± 1.37
NPO + RT w/ UCD
NPO + RT 配合 UCD
1.41 ± 0.82 63.91 ± 3.53 25.53 ± 0.95 28.09 ± 1.49
UCS
UCS
27.06 ± 0.47 -80.44 ± 0.69 39.75 ± 0.34 46.69 ± 0.54
NPO + RT w/ UCS
NPO + RT 配合 UCS
3.0 ± 1.14 59.84 ± 4.85 36.11 ± 2.55 39.27 ± 1.68
Table 14: Forget quality vs model utility on MUSE News for Llama2-13B when using UCD vs UCS. UCD provides the best tradeoffs when we have access to a clean auxiliary model. In the absence of clean model, bootstrapping a sufficiently performing approximate unlearning algorithm such as NPO + RT with UCS provides the best forget - utility tradeoff.
表 14:在 Llama2-13B 的 MUSE News 上比较 UCD 与 UCS 的遗忘质量和模型效用。能够访问干净辅助模型时,UCD 提供最佳权衡。没有干净模型时,在 NPO + RT 这类具有足够性能的近似遗忘算法上叠加 UCS,可提供最佳遗忘与效用权衡。

译注与阅读提示

以下说明不属于论文原文。

  1. 命题 1 原文写 clean model 是 without the retain set,但本节定义与下一句都要求它是不使用遗忘集训练、即只在保留数据上重训的目标。英文照录,中文不暗中修正,并在原位置标出冲突。
  2. UCS 展示公式没有 α,紧随其后的原文却称 α 为超参数。本页不替作者补公式,复现时应对照作者实现确认。
  3. UCD 改变的是服务时的下一词元分布,不会从目标模型权重中永久移除信息。绕过解码流程即可恢复原模型行为。
  4. 精确恢复命题依赖辅助对数概率差与目标污染差之间的比例关系。实验结果并不等价于证明该比例关系对所有前缀成立。
  5. TOFU 的 Kolmogorov–Smirnov p 值阈值是基准判据;未拒绝分布相同的假设不构成两个完整生成分布相同的证明。
  6. 本页完成原文结构与译文覆盖审核,但不表示已经独立复现模型实验或核验全部被引文献。

术语对照

machine unlearning · 机器遗忘
forget set · 遗忘集
retain set · 保留集
corrupted model · 污染模型 / 原参考模型
clean model · 干净模型
contrastive decoding · 对比解码
contrastive suppression · 对比抑制
model utility · 模型效用
forget quality · 遗忘质量
privacy leakage · 隐私泄漏
nucleus sampling · 核采样
bootstrapping · 自举
论文原图放大