mlsanityData to 7 Oct 2026

GUARD: Generation-time LLM Unlearning via Adaptive Restriction and Detection

arXiv 2505.13312 ↗First posted 19 May 2025cs.CLcited by 17

On the map: LLM safety and security → Machine unlearning

Abstract (arXiv)

Large Language Models (LLMs) have demonstrated strong capabilities in memorizing vast amounts of knowledge across diverse domains. However, the ability to selectively forget specific knowledge is critical for ensuring the safety and compliance of deployed models. Existing unlearning efforts typically fine-tune the model with resources such as forget data, retain data, and a calibration model. These additional gradient steps blur the decision boundary between forget and retain knowledge, making unlearning often at the expense of overall performance. To avoid the negative impact of fine-tuning, it would be better to unlearn solely at inference time by safely guarding the model against generating responses related to the forget target, without destroying the fluency of text generation. In this work, we propose Generation-time Unlearning via Adaptive Restriction and Detection (GUARD), a framework that enables dynamic unlearning during LLM generation. Specifically, we first employ a prompt classifier to detect unlearning targets and extract the corresponding forbidden token. We then dynamically penalize and filter candidate tokens during generation using a combination of token matching and semantic matching, effectively preventing the model from leaking the forgotten content. Experimental results on copyright content unlearning tasks over the Harry Potter dataset and the MUSE benchmark, as well as entity unlearning tasks on the TOFU dataset, demonstrate that GUARD achieves strong forget quality across various tasks while causing almost no degradation to the LLM's general capabilities, striking an excellent trade-off between forgetting and utility.

Key facts. Cited by 17 papers in the map (data through 7 Oct 2026). Placed in Machine unlearning, one of 12 directions in LLM safety and security. Builds on 87 of its 105 references that are in the map. First posted on arXiv 19 May 2025.

Builds on

87 of 105 references.

Closest ancestors · 39

Same direction, newest first

  1. 2025LUME: LLM Unlearning with Multitask Evaluations20 Feb
  2. 2025SafeEraser: Enhancing Safety in Multimodal Large Language Models through Multimodal Machine Unlearning18 Feb
  3. 2025MMUnlearner: Reformulating Multimodal Machine Unlearning in the Era of Multimodal Large Language Models16 Feb
  4. 2025Towards LLM Unlearning Resilient to Relearning Attacks: A Sharpness-Aware Minimization Perspective and Beyond7 Feb
  5. 2025Open Problems in Machine Unlearning for AI Safety9 Jan
  6. 2024Unified Parameter-Efficient Unlearning for LLMs30 Nov
  7. 2024SEUF: Is Unlearning One Expert Enough for Mixture-of-Experts LLMs?27 Nov
  8. 2024Does Unlearning Truly Unlearn? A Black Box Evaluation of LLM Unlearning Methods18 Nov
  9. 2024WAGLE: Strategic Weight Attribution for Effective and Modular Unlearning in Large Language Models23 Oct
  10. 2024LLM Unlearning via Loss Adjustment with Only Forget Data14 Oct
  11. 2024Simplicity Prevails: Rethinking Negative Preference Optimization for LLM Unlearning9 Oct
  12. 2024Alternate Preference Optimization for Unlearning Factual Knowledge in Large Language Models20 Sep
27 more
  1. 2024MEOW: MEMOry Supervised LLM Unlearning Via Inverted Facts18 Sep
  2. 2024Towards Robust Knowledge Unlearning: An Adversarial Framework for Assessing and Improving Unlearning Robustness in Large Language Models20 Aug
  3. 2024MUSE: Machine Unlearning Six-Way Evaluation for Language Models8 Jul
  4. 2024Soft Prompting for Unlearning in Large Language Models17 Jun
  5. 2024Reversing the Forget-Retain Objectives: An Efficient LLM Unlearning Framework from Logit Difference12 Jun
  6. 2024Large Language Model Unlearning via Embedding-Corrupted Prompts12 Jun
  7. 2024Label Smoothing Improves Machine Unlearning11 Jun
  8. 2024Adversarial Machine Unlearning11 Jun
  9. 2024SOUL: Unlocking the Power of Second-Order Optimization for LLM Unlearning28 Apr
  10. 2024Negative Preference Optimization: From Catastrophic Collapse to Effective Unlearning8 Apr
  11. 2024Machine Unlearning for Traditional Models and Large Language Models: A Short Survey1 Apr
  12. 2024Challenging Forgets: Unveiling the Worst-Case Forget Sets in Machine Unlearning12 Mar
  13. 2024Guardrail Baselines for Unlearning in LLMs5 Mar
  14. 2024Eight Methods to Evaluate Robust Unlearning in LLMs26 Feb
  15. 2024Machine Unlearning of Pre-trained Large Language Models23 Feb
  16. 2024Rethinking Machine Unlearning for Large Language Models13 Feb
  17. 2024Fast Exact Unlearning for In-Context Learning Data for LLMs1 Feb
  18. 2024TOFU: A Task of Fictitious Unlearning for LLMs11 Jan
  19. 2023Unlearn What You Want to Forget: Efficient Unlearning for LLMs31 Oct
  20. 2023SalUn: Empowering Machine Unlearning via Gradient-based Weight Saliency in Both Image Classification and Generation19 Oct
  21. 2023Large Language Model Unlearning14 Oct
  22. 2023In-Context Unlearning: Language Models as Few Shot Unlearners11 Oct
  23. 2023Who's Harry Potter? Approximate Unlearning in LLMs3 Oct
  24. 2023KGA: A General Machine Unlearning Framework Based on Knowledge Gap Alignment11 May
  25. 2023Model Sparsity Can Simplify Machine Unlearning11 Apr
  26. 2022Knowledge Unlearning for Mitigating Privacy Risks in Language Models4 Oct
  27. 2022Continual Learning and Private Unlearning24 Mar

Other references · 48

  1. 2023GPT-4 Technical Reportcited by 18,132
  2. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  3. 2024The Llama 3 Herd of Modelscited by 14,192
  4. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  5. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
  6. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
  7. 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,146
  8. 2024Qwen2.5 Technical Reportcited by 4,713
  9. 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
  10. 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,018
  11. 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,464
  12. 2016Pointer Sentinel Mixture Modelscited by 2,992
36 more
  1. 2021TruthfulQA: Measuring How Models Mimic Human Falsehoodscited by 2,919
  2. 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 2,895
  3. 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,818
  4. 2020Extracting Training Data from Large Language Modelscited by 2,144
  5. 2019BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questionscited by 2,140
  6. 2018Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answeringcited by 2,114
  7. 2022Large Language Models Encode Clinical Knowledgecited by 1,807
  8. 2022Editing Models with Task Arithmeticcited by 1,076
  9. 2017RACE: Large-scale ReAding Comprehension Dataset From Examinationscited by 851
  10. 2022Galactica: A Large Language Model for Sciencecited by 736
  11. 2023Textbooks Are All You Need II: phi-1.5 technical reportcited by 559
  12. 2023Trustworthy LLMs: a Survey and Guideline for Evaluating Large Language Models' Alignmentcited by 394
  13. 2023Detecting Pretraining Data from Large Language Modelscited by 375
  14. 2021Learning with Noisy Labels Revisited: A Study Using Real-World Human Annotationscited by 253
  15. 2021Enhanced Membership Inference Attacks against Machine Learning Modelscited by 237
  16. 2022Memorization Without Overfitting: Analyzing the Training Dynamics of Large Language Modelscited by 218
  17. 2023Can LLMs Keep a Secret? Testing Privacy Implications of Language Models via Contextual Integrity Theorycited by 218
  18. 2023To Generate or Not? Safety-Driven Unlearned Diffusion Models Are Still Easy To Generate Unsafe Images ... For Nowcited by 204
  19. 2023SafetyBench: Evaluating the Safety of Large Language Modelscited by 189
  20. 2024Do Membership Inference Attacks Work on Large Language Models?cited by 188
  21. 2024Security and Privacy Challenges of Large Language Models: A Surveycited by 179
  22. 2023Beyond Memorization: Violating Privacy Via Inference with Large Language Modelscited by 167
  23. 2023Copyright Violations and Large Language Modelscited by 108
  24. 2024LLM Dataset Inference: Did you train on my dataset?cited by 107
  25. 2025Token Cleaning: Fine-Grained Data Selection for LLM Supervised Fine-Tuningcited by 39
  26. 2024Measuring and Reducing LLM Hallucination without Gold-Standard Answerscited by 31
  27. 2024AI Safety in Generative AI Large Language Models: A Surveycited by 31
  28. 2024Reefknot: A Comprehensive Benchmark for Relation Hallucination Evaluation, Analysis and Mitigation in Multimodal Large Language Modelscited by 30
  29. 2023How to Protect Copyright Data in Optimization of Large Language Models?cited by 26
  30. 2024Improving Data Efficiency via Curating LLM-Driven Rating Systemscited by 26
  31. 2025MathAgent: Leveraging a Mixture-of-Math-Agent Framework for Real-World Multimodal Mathematical Error Detectioncited by 24
  32. 2024Automatic Dataset Construction (ADC): Sample Collection, Data Curation, and Beyondcited by 18
  33. 2023Distributionally Robust Post-hoc Classifiers under Prior Shiftscited by 16
  34. 2024Risk and Response in Large Language Models: Evaluating Key Threat Categoriescited by 10
  35. 2025Proactive Privacy Amnesia for Large Language Models: Safeguarding PII with Negligible Impact on Model Utilitycited by 9
  36. 2024Harnessing Business and Media Insights with Large Language Modelscited by 7

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 6; 2026: 11.

17 papers.

Sort:

By area:

  1. 2025SoK: Machine Unlearning for Large Language Modelscited by 9
  2. 2025OFFSIDE: Benchmarking Unlearning Misinformation in Multimodal Large Language Modelscited by 7
  3. 2025Downgrade to Upgrade: Optimizer Simplification Enhances Robustness in LLM Unlearningcited by 4
  4. 2025LM-mixup: Text Data Augmentation via Language Model based Mixupcited by 3
  5. 2025Label Smoothing Improves Gradient Ascent in LLM Unlearningcited by 3
  6. 2026Visual-Noise Guided In-Context Distillation for Multimodal Large Language Model Unlearningcited by 3
  7. 2026Position: The Term "Machine Unlearning" Is Overused in LLMscited by 3
  8. 2025Direct Token Optimization: A Self-contained Approach to Large Language Model Unlearningcited by 2
  9. 2026Divergence Decoding: Inference-Time Unlearning via Auxiliary Modelscited by 2
  10. 2026Copyright Detective: A Forensic System to Evidence LLMs Flickering Copyright Leakage Riskscited by 1
  11. 2026CURaTE: Continual Unlearning in Real Time with Ensured Preservation of LLM Knowledgecited by 0
  12. 2026NCO: A Versatile Plug-in for Handling Negative Constraints in Decodingcited by 0
5 more
  1. 2026DualOptim+: Bridging Shared and Decoupled Optimizer States for Better Machine Unlearning in Large Language Modelscited by 0
  2. 2026Replay What Matters: Off-Policy Replay for Efficient LLM Reinforcement Unlearningcited by 0
  3. 2026SCOPE: Entanglement Frontier Escape for Source-Free Class Unlearningcited by 0
  4. 2026AUV-Bench: Aesthetic Understanding and Generation Evaluation for User Interfacescited by 0
  5. 2026Nullify: Null-Space Activation Steering for Training-Free LLM Unlearningcited by 0