[论文解读] In-Context Unlearning: Language Models as Few Shot Unlearners
本文提出 In-Context Unlearning (ICUL),一种黑盒方法,在推理阶段通过翻转点的标签并附加正确标注的示例,在不访问模型参数的情况下实现对特定训练点的“忘记”,在文本分类任务上达到与对参数可访问的忘记方法相当的性能。
Machine unlearning, the study of efficiently removing the impact of specific training instances on a model, has garnered increased attention in recent years due to regulatory guidelines such as the \emph{Right to be Forgotten}. Achieving precise unlearning typically involves fully retraining the model and is computationally infeasible in case of very large models such as Large Language Models (LLMs). To this end, recent work has proposed several algorithms which approximate the removal of training data without retraining the model. These algorithms crucially rely on access to the model parameters in order to update them, an assumption that may not hold in practice due to computational constraints or having only query access to the LLMs. In this work, we propose a new class of unlearning methods for LLMs called ``In-Context Unlearning.'' This method unlearns instances from the model by simply providing specific kinds of inputs in context, without the need to update model parameters. To unlearn specific training instances, we present these instances to the LLMs at inference time along with labels that differ from their ground truth. Our experimental results demonstrate that in-context unlearning performs on par with, or in some cases outperforms other state-of-the-art methods that require access to model parameters, effectively removing the influence of specific instances on the model while preserving test accuracy.
研究动机与目标
- 在隐私和版权问题(被遗忘权、模型中的数据移除)下,说明机器学习忘记的必要性。
- 提出一种不需要参数更新或重新训练的新型大语言模型忘记范式。
- 证明就地上下文忘记在保持任务性能的同时,可以有效抹去训练样本的影响。
- 在现实文本分类数据集与黑盒 LLM 的场景下,展示 ICUL 的可行性。
提出的方法
- 通过构建提示,将遗忘样本的标签翻转并加入额外正确标注的上下文示例,定义就地上下文忘记(ICUL)
- 构造一个三步 ICUL 提示:(1) 翻转遗忘点的标签,(2) 增加 s 个正确标注的训练示例,(3) 追加查询输入并以温度 t=0 进行预测。
- 使用 LiRA-Forget 启发的统计量来评估该方法,将更新后的模型与重新训练的基线进行比较,但无法访问模型参数。
- 将 ICUL 与具有参数访问能力的梯度上升(GA)忘记基线进行比较,覆盖数据集和模型规模。
- 通过消融研究分析提示长度(s)和标签翻转必要性对忘记效果的影响。
- 使用 3 个数据集(SST-2、Yelp、Amazon polarity)和 Bloom LLM(560M 和 1.1B 参数)进行微调和评估。

实验结果
研究问题
- RQ1ICUL 是否能够在不更新模型参数的情况下移除对某个特定训练点的影响?
- RQ2与白盒忘记方法相比,ICUL 在遗忘点可识别性和整体准确度方面表现如何?
- RQ3提示长度和标签翻转对忘记效果有何影响?
- RQ4ICUL 的结果是否在不同数据集和模型规模上具有泛化性?
主要发现
- ICUL 的就地上下文忘记在 LiRA-Forget 风格的测试中与随机猜测行为高度吻合,表明对目标点已成功遗忘。
- ICUL 在不同数据集和模型规模下的 AUC 均低于梯度上升(GA)基线,表明遗忘点的不可关联性更强。
- 在忘记后对未见测试点保持竞争力的整体性能,遗忘点的准确率下降到与测试点表现相近的水平。
- 消融显示,特定的标签翻转结合加入多个正确标注的上下文示例对有效忘记至关重要,而不仅仅是加入上下文。
- SST-2、Yelp、Amazon polarity 的结果证明了在文本分类任务中对 LLM 的黑盒忘记的可行性。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。