Research map / Large language models / Language, safety and interpretability
In-Context Unlearning: Language Models as Few-Shot Unlearners
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes In-Context Unlearning (ICUL), which removes the influence of training examples from a finetuned LLM by prepending those examples with flipped labels plus correctly labeled context at inference time, requiring no parameter updates, and evaluates it with a new LiRA-based unlearning test (LiRA-Forget).
Problem
Machine unlearning for LLMs usually needs white-box parameter access and expensive gradient updates, which is infeasible for black-box or very large models; there is also no principled empirical test of whether unlearning succeeded.
Approach
Unlearn training points at inference time by placing them in the prompt with deliberately flipped labels, followed by several correctly labeled examples, so the model's output mimics a model that never saw those points; evaluate via a likelihood-ratio membership-inference test (LiRA-Forget) adapted from LiRA with shadow models.
Key results
- ICUL's TPR at FPR 0.01 under LiRA-Forget was lower than GA's in 14 of 16 settings across datasets and deletion sizes, with curves close to the random-guess benchmark.
- On Llama-2 7B, ICUL needs only a V100 32GB for unlearning (no parameter updates) versus 64.8-68.9GB GPU RAM and ~1.4-15.9s update time for GA on the SST-2 task.
- On SQuAD, ICUL reduced TPR at FPR 0.01 from 0.0241 to 0.0183 for 5 deletions, at a cost of 5.5 accuracy points (72.0% to 68.7%); for 10 deletions accuracy fell to 60.3%.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Apply ICUL to 5 deletions instead of using the baseline | SQUAD unlearning · SQUAD, 5 deletions | TPR @ FPR = 10^-2: 0.0241 -> 0.0183 | Helped |
| Apply ICUL to 10 deletions instead of using the baseline | SQUAD unlearning · SQUAD, 10 deletions | TPR @ FPR = 10^-2: 0.0247 -> 0.0140 | Helped |
| Apply ICUL with 5 deletions instead of using the baseline | SQUAD unlearning · SQUAD, 5 deletions | accuracy: 72.0% -> 68.7% | Hurt |
| Apply ICUL with 10 deletions instead of using the baseline | SQUAD unlearning · SQUAD, 10 deletions | accuracy: 72.2% -> 60.3% | Hurt |
| Compare ICUL with GA for deletion requests across the evaluated datasets | Bloom 1.1B unlearning · AG-News, SST-2, Amazon, and SQUAD; deletion requests 1, 5, 10, and 20 | TPR @ FPR = 0.01 | Helped |
| Increase the correctly labeled context length from 2 to 4 or 6 examples (ablation) | ICUL · Evaluated datasets | unlearning efficacy | Helped |
| Use only 2 correctly labeled context examples (ablation) | ICUL · Evaluated datasets | AUC: 0.58 -> 0.67 | Hurt |
| Flip the forget point's label rather than keep its original label (ablation) | ICUL · Evaluated datasets | unlearning efficacy | Helped |
| Replace the forget point in the prompt with a randomly selected training point (ablation) | ICUL · Evaluated datasets | TPR at FPR at or below 10^-2 | Hurt |
| Increase the number of deletions from 5 to 10 | ICUL · SQUAD | accuracy: 68.7% -> 60.3% | Hurt |
Surprising findings
- Larger Bloom models showed a larger percentage improvement over the baseline in unlearning (41.67% for 560M up to 54.05% for 7.1B).
- GA's unlearning performance dropped below the trivial baseline at intermediate deletion sizes (5 and 10).
Limitations
- Context length grows with deletion request size, so large deletion requests become infeasible and increase inference time.
- Accuracy drops notably on SQuAD for 10 deletions (about 16.7 points), and prompt design is not optimized.
- LiRA-Forget requires training many shadow models, which is computationally costly for large LLMs.
Experimental setup
Datasets: SST-2 Amazon polarity AG-News SQuAD Yelp polarity
Benchmarks: SST-2 Amazon polarity AG-News SQuAD Yelp polarity
Metrics: TPR at FPR 0.01 (LiRA-Forget) AUC test accuracy GPU memory runtime
Baselines: Gradient Ascent (GA) Baseline (LiRA on initial model) standard ICL Random ICUL
Builds on: LiRA gradient ascent unlearning for LLMs in-context learning
Closest papers by meaning
- Fast Exact Unlearning for In-Context Learning Data for LLMs (ICML 2025 · similarity 0.92)
- Towards Effective Evaluations and Comparisons for LLM Unlearning Methods (ICLR 2025 · similarity 0.92)
- OpenUnlearning: Accelerating LLM Unlearning via Unified Benchmarking of Methods and Metrics (NeurIPS 2025 · similarity 0.92)
- A Closer Look at Machine Unlearning for Large Language Models (ICLR 2025 · similarity 0.92)
- On Large Language Model Continual Unlearning (ICLR 2025 · similarity 0.92)
- Catastrophic Failure of LLM Unlearning via Quantization (ICLR 2025 · similarity 0.92)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
