mlsanityData to 7 Oct 2026

In-Context Unlearning: Language Models as Few Shot Unlearners

arXiv 2310.07579 ↗First posted 11 Oct 2023cs.LG cs.AI cs.CRcited by 214

On the map: LLM safety and security → Machine unlearning

Abstract (arXiv)

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 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.

Key facts. Cited by 214 papers in the map (data through 7 Oct 2026). Placed in Machine unlearning, one of 12 directions in LLM safety and security. Builds on 50 of its 66 references that are in the map. First posted on arXiv 11 Oct 2023.

Builds on

50 of 66 references.

Closest ancestors · 7

Same direction, newest first

  1. 2023Tight Bounds for Machine Unlearning via Differential Privacy2 Sep
  2. 2023Fast Machine Unlearning Without Retraining Through Selective Synaptic Dampening15 Aug
  3. 2023KGA: A General Machine Unlearning Framework Based on Knowledge Gap Alignment11 May
  4. 2023Towards Unbounded Machine Unlearning20 Feb
  5. 2022Knowledge Unlearning for Mitigating Privacy Risks in Language Models4 Oct
  6. 2022Towards Adversarial Evaluations for Inexact Machine Unlearning17 Jan
  7. 2021Remember What You Want to Forget: Algorithms for Machine Unlearning4 Mar

Other references · 43

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  3. 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
  4. 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
  5. 2015Character-level Convolutional Networks for Text Classificationcited by 2,293
  6. 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,222
  7. 2016Membership Inference Attacks against Machine Learning Modelscited by 2,221
  8. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
  9. 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
  10. 2019Machine Unlearningcited by 1,020
  11. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
  12. 2021Membership Inference Attacks From First Principlescited by 839
31 more
  1. 2022Quantifying Memorization Across Neural Language Modelscited by 755
  2. 2022Transformers learn in-context by gradient descentcited by 714
  3. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
  4. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
  5. 2019Eternal Sunshine of the Spotless Net: Selective Forgetting in Deep Networkscited by 599
  6. 2019Certified Data Removal from Machine Learning Modelscited by 512
  7. 2019Making AI Forget You: Data Deletion in Machine Learningcited by 447
  8. 2023Larger language models do in-context learning differentlycited by 386
  9. 2023Trained Transformers Learn Linear Models In-Contextcited by 331
  10. 2020Amnesiac Machine Learningcited by 305
  11. 2020Descent-to-Delete: Gradient-Based Methods for Machine Unlearningcited by 303
  12. 2022Language Models are Realistic Tabular Data Generatorscited by 290
  13. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
  14. 2023LEACE: Perfect linear concept erasure in closed formcited by 254
  15. 2020Approximate Data Deletion from Machine Learning Modelscited by 250
  16. 2022Memorization Without Overfitting: Analyzing the Training Dynamics of Large Language Modelscited by 218
  17. 2023LongNet: Scaling Transformers to 1,000,000,000 Tokenscited by 201
  18. 2020Forgetting Outside the Box: Scrubbing Deep Networks of Information Accessible from Input-Output Observationscited by 171
  19. 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 168
  20. 2020Mixed-Privacy Forgetting in Deep Networkscited by 158
  21. 2020DeltaGrad: Rapid retraining of machine learning modelscited by 143
  22. 2022Measuring Forgetting of Memorized Training Examplescited by 118
  23. 2023Foundation Models and Fair Usecited by 112
  24. 2023Statistical Foundations of Prior-Data Fitted Networkscited by 59
  25. 2022Kernelized Concept Erasurecited by 47
  26. 2021Rethinking Influence Functions of Neural Networks in the Over-parameterized Regimecited by 26
  27. 2020Data Minimization for GDPR Compliance in Machine Learning Modelscited by 21
  28. 2022On the Trade-Off between Actionable Explanations and the Right to be Forgottencited by 20
  29. 2023Gaussian Membership Inference Privacycited by 20
  30. 2020Operationalizing the Legal Principle of Data Minimization for Personalizationcited by 19
  31. 2023Trainable Transformer in Transformercited by 17

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 3; 2024: 74; 2025: 75; 2026: 62.

214 papers.

Sort:

By area:

  1. 2024TOFU: A Task of Fictitious Unlearning for LLMscited by 507
  2. 2024The WMDP Benchmark: Measuring and Reducing Malicious Use With Unlearningcited by 488
  3. 2024Negative Preference Optimization: From Catastrophic Collapse to Effective Unlearningcited by 484
  4. 2023Large Language Model Unlearningcited by 288
  5. 2024MUSE: Machine Unlearning Six-Way Evaluation for Language Modelscited by 251
  6. 2024Rethinking Machine Unlearning for Large Language Modelscited by 247
  7. 2024From Persona to Personalization: A Survey on Role-Playing Language Agentscited by 206
  8. 2024Simplicity Prevails: Rethinking Negative Preference Optimization for LLM Unlearningcited by 160
  9. 2024Eight Methods to Evaluate Robust Unlearning in LLMscited by 153
  10. 2024Visual In-Context Learning for Large Vision-Language Modelscited by 124
  11. 2024Large Language Model Unlearning via Embedding-Corrupted Promptscited by 112
  12. 2025A Comprehensive Survey in LLM(-Agent) Full Stack Safety: Data, Training and Deploymentcited by 110
38 more
  1. 2024SOUL: Unlocking the Power of Second-Order Optimization for LLM Unlearningcited by 104
  2. 2024Rethinking LLM Memorization through the Lens of Adversarial Compressioncited by 91
  3. 2024Guardrail Baselines for Unlearning in LLMscited by 90
  4. 2024The BiGGen Bench: A Principled Benchmark for Fine-grained Evaluation of Language Models with Language Modelscited by 89
  5. 2024Unlearning or Obfuscating? Jogging the Memory of Unlearned LLMs via Benign Relearningcited by 81
  6. 2024Inexact Unlearning Needs More Careful Evaluations to Avoid a False Sense of Privacycited by 78
  7. 2024RWKU: Benchmarking Real-World Knowledge Unlearning for Large Language Modelscited by 77
  8. 2024Catastrophic Failure of LLM Unlearning via Quantizationcited by 76
  9. 2025Towards LLM Unlearning Resilient to Relearning Attacks: A Sharpness-Aware Minimization Perspective and Beyondcited by 76
  10. 2024LLM Unlearning via Loss Adjustment with Only Forget Datacited by 71
  11. 2024A Closer Look at Machine Unlearning for Large Language Modelscited by 54
  12. 2024Larimar: Large Language Models with Episodic Memory Controlcited by 53
  13. 2024On Large Language Model Continual Unlearningcited by 51
  14. 2024Machine Unlearning in Generative AI: A Surveycited by 49
  15. 2023Privacy in Large Language Models: Attacks, Defenses and Future Directionscited by 48
  16. 2024Are we making progress in unlearning? Findings from the first NeurIPS unlearning competitioncited by 48
  17. 2024To Each (Textual Sequence) Its Own: Improving Memorized-Data Unlearning in Large Language Modelscited by 42
  18. 2024Soft Prompting for Unlearning in Large Language Modelscited by 42
  19. 2024Evaluating Copyright Takedown Methods for Language Modelscited by 42
  20. 2025Unlearning Isn't Deletion: Investigating Reversibility of Machine Unlearning in LLMscited by 41
  21. 2024Meta-Unlearning on Diffusion Models: Preventing Relearning Unlearned Conceptscited by 39
  22. 2025Exploring Criteria of Loss Reweighting to Enhance LLM Unlearningcited by 39
  23. 2023Knowledge Unlearning for LLMs: Tasks, Methods, and Challengescited by 37
  24. 2025Rethinking Memory in LLM based Agents: Representations, Operations, and Emerging Topicscited by 36
  25. 2024Copyright Protection in Generative AI: A Technical Perspectivecited by 35
  26. 2024Machine Unlearning Fails to Remove Data Poisoning Attackscited by 35
  27. 2024Threats, Attacks, and Defenses in Machine Unlearning: A Surveycited by 34
  28. 2024Fast Exact Unlearning for In-Context Learning Data for LLMscited by 33
  29. 2024Offset Unlearning for Large Language Modelscited by 33
  30. 2025SafeEraser: Enhancing Safety in Multimodal Large Language Models through Multimodal Machine Unlearningcited by 31
  31. 2025A Comprehensive Survey of Machine Unlearning Techniques for Large Language Modelscited by 30
  32. 2024Undesirable Memorization in Large Language Models: A Surveycited by 29
  33. 2024Unlearning as multi-task optimization: A normalized gradient difference approach with an adaptive learning ratecited by 29
  34. 2025MMUnlearner: Reformulating Multimodal Machine Unlearning in the Era of Multimodal Large Language Modelscited by 29
  35. 2024To Forget or Not? Towards Practical Knowledge Unlearning for Large Language Modelscited by 25
  36. 2024WAGLE: Strategic Weight Attribution for Effective and Modular Unlearning in Large Language Modelscited by 25
  37. 2024Unified Parameter-Efficient Unlearning for LLMscited by 24
  38. 2024Deconstructing The Ethics of Large Language Models from Long-standing Issues to New-emerging Dilemmas: A Surveycited by 23

50 most cited of 214 All 214 (JSON)