Skip to main content
QUICK REVIEW

[Paper Review] In-Context Unlearning: Language Models as Few Shot Unlearners

Martin Pawelczyk, Seth Neel|arXiv (Cornell University)|Oct 11, 2023
Privacy-Preserving Technologies in DataComputer Science11 citations
TL;DR

The paper introduces In-Context Unlearning (ICUL), a black-box method that unlearns specific training points at inference by flipping the point's label and appending correctly labeled examples, achieving competitive performance with parameter-access unlearning methods on text classification tasks.

ABSTRACT

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.

Motivation & Objective

  • Motivate the need for machine unlearning under privacy and copyright concerns (Right to be Forgotten, data removal from models).
  • Propose a new unlearning paradigm for LLMs that does not require parameter updates or retraining.
  • Show that in-context unlearning can effectively erase a training point’s influence while preserving task performance.
  • Demonstrate practicality of ICUL on real-world text classification datasets with black-box LLMs.

Proposed method

  • Define in-context learning and extend it to in-context unlearning (ICUL) by constructing prompts that flip the forgotten point’s label and include additional correctly labeled context examples.
  • Construct a three-step ICUL prompt: (1) flip the forget point’s label, (2) add s correctly labeled training examples, (3) append the query input and predict with temperature t=0.
  • Evaluate the method using LiRA-Forget inspired statistics to compare the updated model to a retrained baseline, without access to model parameters.
  • Compare ICUL to a gradient-ascent unlearning baseline that has parameter access, across datasets and model sizes.
  • Analyze the impact of prompt length (s) and label-flipping necessity through ablations.
  • Use 3 datasets ( SST-2, Yelp, Amazon polarity ) and Bloom LLMs (560M and 1.1B parameters) for finetuning and evaluation.
In-Context Unlearning: Language Models as Few Shot Unlearners

Experimental results

Research questions

  • RQ1Can ICUL remove the influence of a specific training point without updating model parameters?
  • RQ2How does ICUL compare to white-box unlearning methods in terms of forget-point distinguishability and overall accuracy?
  • RQ3What is the effect of prompt length and label flipping on unlearning effectiveness?
  • RQ4Do ICUL results generalize across different datasets and model scales?

Key findings

  • ICUL’s in-context unlearning closely tracks random-guess behavior in LiRA-Forget style tests, indicating successful forgetting of the targeted point.
  • ICUL consistently achieves lower AUC than the gradient-ascent (GA) baseline across datasets and model sizes, indicating stronger forget point unlinkability.
  • ICUL maintains competitive overall performance on unseen test points after unlearning, with accuracy on forget points dropping to mirror test-point performance.
  • Ablations show that the specific label flip combined with adding multiple correctly labeled context examples is essential for effective unlearning, not merely adding context.
  • Results on SST-2, Yelp, and Amazon polarity demonstrate the viability of black-box unlearning for LLMs in text classification.
In-Context Unlearning: Language Models as Few Shot Unlearners

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.