Learning and Forgetting Unsafe Examples in Large Language Models
Not on the map. Why?
Abstract (arXiv)
As the number of large language models (LLMs) released to the public grows, there is a pressing need to understand the safety implications associated with these models learning from third-party custom finetuning data. We explore the behavior of LLMs finetuned on noisy custom data containing unsafe content, represented by datasets that contain biases, toxicity, and harmfulness, finding that while aligned LLMs can readily learn this unsafe content, they also tend to forget it more significantly than other examples when subsequently finetuned on safer content. Drawing inspiration from the discrepancies in forgetting, we introduce the "ForgetFilter" algorithm, which filters unsafe data based on how strong the model's forgetting signal is for that data. We demonstrate that the ForgetFilter algorithm ensures safety in customized finetuning without compromising downstream task performance, unlike sequential safety finetuning. ForgetFilter outperforms alternative strategies like replay and moral self-correction in curbing LLMs' ability to assimilate unsafe content during custom finetuning, e.g. 75% lower than not applying any safety measures and 62% lower than using self-correction in toxicity score.
Key facts. Cited by 24 papers in the map (data through 14 Oct 2026). Builds on 47 of its 67 references that are in the map. First posted on arXiv 20 Dec 2023.
Builds on
47 of 67 references.
References · 47
- 2023GPT-4 Technical Reportcited by 18,396
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,065
- 2016Overcoming catastrophic forgetting in neural networkscited by 4,787
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
- 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,148
- 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,720
- 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,512
- 2022Constitutional AI: Harmlessness from AI Feedbackcited by 3,050
35 more
- 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,811
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,411
- 2020Extracting Training Data from Large Language Modelscited by 2,189
- 2019Fine-Tuning Language Models from Human Preferencescited by 2,150
- 2022Large Language Models Encode Clinical Knowledgecited by 1,830
- 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,786
- 2020RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Modelscited by 1,255
- 2021Scaling Language Models: Methods, Analysis & Insights from Training Gophercited by 1,202
- 2023Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!cited by 1,154
- 2018Co-teaching: Robust Training of Deep Neural Networks with Extremely Noisy Labelscited by 1,059
- 2021A General Language Assistant as a Laboratory for Alignmentcited by 1,055
- 2022Quantifying Memorization Across Neural Language Modelscited by 763
- 2017Automated Hate Speech Detection and the Problem of Offensive Languagecited by 736
- 2021BBQ: A Hand-Built Bias Benchmark for Question Answeringcited by 701
- 2023RAFT: Reward rAnked FineTuning for Generative Foundation Model Alignmentcited by 686
- 2018An Empirical Study of Example Forgetting during Deep Neural Network Learningcited by 678
- 2023An Empirical Study of Catastrophic Forgetting in Large Language Models During Continual Fine-tuningcited by 639
- 2020Dataset Cartography: Mapping and Diagnosing Datasets with Training Dynamicscited by 425
- 2017Measuring Catastrophic Forgetting in Neural Networkscited by 360
- 2023Principle-Driven Self-Alignment of Language Models from Scratch with Minimal Human Supervisioncited by 318
- 2019On Tiny Episodic Memories in Continual Learningcited by 307
- 2023Shadow Alignment: The Ease of Subverting Safely-Aligned Language Modelscited by 297
- 2023How is ChatGPT's behavior changing over time?cited by 270
- 2023Pretraining Language Models with Human Preferencescited by 247
- 2023Red-Teaming Large Language Models using Chain of Utterances for Safety-Alignmentcited by 223
- 2022Memorization Without Overfitting: Analyzing the Training Dynamics of Large Language Modelscited by 220
- 2018Online Structured Laplace Approximations For Overcoming Catastrophic Forgettingcited by 201
- 2022Are Large Pre-Trained Language Models Leaking Your Personal Information?cited by 200
- 2021Towards Continual Knowledge Learning of Language Modelscited by 174
- 2023The Capacity for Moral Self-Correction in Large Language Modelscited by 173
- 2023Removing RLHF Protections in GPT-4 via Fine-Tuningcited by 171
- 2019SELF: Learning to Filter Noisy Labels with Self-Ensemblingcited by 164
- 2021Wide Neural Networks Forget Less Catastrophicallycited by 64
- 2022Characterizing Datapoints via Second-Split Forgettingcited by 37
- 2023Recognition, recall, and retention of few-shot memories in large language modelscited by 5
Built on by
Citing papers per year: 2024: 13; 2025: 9; 2026: 2.
24 papers.
Sort:
By area:
- 2024Vaccine: Perturbation-aware Alignment for Large Language Models against Harmful Fine-tuning Attackcited by 115
- 2024Keeping LLMs Aligned After Fine-tuning: The Crucial Role of Prompt Templatescited by 96
- 2024Lisa: Lazy Safety Alignment for Large Language Models against Harmful Fine-tuning Attackcited by 92
- 2024Covert Malicious Finetuning: Challenges in Safeguarding LLM Adaptationcited by 80
- 2024SEAL: Safety-enhanced Aligned LLM Fine-tuning via Bilevel Data Selectioncited by 64
- 2024Single Image Unlearning: Efficient Machine Unlearning in Multimodal Large Language Modelscited by 46
- 2024A safety realignment framework via subspace-oriented model fusion for large language modelscited by 41
- 2024Immunization against harmful fine-tuning attackscited by 35
- 2025Fun-tuning: Characterizing the Vulnerability of Proprietary LLMs to Optimization-based Prompt Injection Attacks via the Fine-Tuning Interfacecited by 17
- 2024On Catastrophic Inheritance of Large Foundation Modelscited by 15
- 2025In-Training Defenses against Emergent Misalignment in Language Modelscited by 15
- 2024Open LLMs are Necessary for Current Private Adaptations and Outperform their Closed Alternativescited by 12
12 more
- 2025Enhancing Model Defense Against Jailbreaks with Proactive Safety Reasoningcited by 11
- 2025Jailbreak-Tuning: Models Efficiently Learn Jailbreak Susceptibilitycited by 9
- 2025Guardians and Offenders: A Survey on Harmful Content Generation and Safety Mitigation of LLMcited by 9
- 2024How Does Vision-Language Adaptation Impact the Safety of Vision Language Models?cited by 8
- 2024Recent Advances in Attack and Defense Approaches of Large Language Modelscited by 6
- 2025Multi-level Value Alignment in Agentic AI Systems: Survey and Perspectivescited by 5
- 2024Composable Interventions for Language Modelscited by 4
- 2026Invisible Safety Threat: Malicious Finetuning for LLM via Steganographycited by 2
- 2026The Piggyback Hypothesis of Generalization: Explaining and Mitigating Emergent Misalignmentcited by 2
- 2025Poison Once, Refuse Forever: Weaponizing Alignment for Injecting Bias in LLMscited by 1
- 2025A Data-Centric Approach for Safe and Secure Large Language Models against Threatening and Toxic Contentcited by 0
- 2025Large Language Models in Cybersecurity: Applications, Vulnerabilities, and Defense Techniquescited by 0
- 2026The Piggyback Hypothesis of Generalization: Explaining and Mitigating Emergent Misalignment4 Jun 2026
- 2026Invisible Safety Threat: Malicious Finetuning for LLM via Steganography9 Mar 2026
- 2025Poison Once, Refuse Forever: Weaponizing Alignment for Injecting Bias in LLMs28 Aug 2025
- 2025In-Training Defenses against Emergent Misalignment in Language Models8 Aug 2025
- 2025Guardians and Offenders: A Survey on Harmful Content Generation and Safety Mitigation of LLM7 Aug 2025
- 2025Large Language Models in Cybersecurity: Applications, Vulnerabilities, and Defense Techniques18 Jul 2025
- 2025Jailbreak-Tuning: Models Efficiently Learn Jailbreak Susceptibility15 Jul 2025
- 2025Multi-level Value Alignment in Agentic AI Systems: Survey and Perspectives11 Jun 2025
- 2025A Data-Centric Approach for Safe and Secure Large Language Models against Threatening and Toxic Content19 Apr 2025
- 2025Enhancing Model Defense Against Jailbreaks with Proactive Safety Reasoning31 Jan 2025
- 2025Fun-tuning: Characterizing the Vulnerability of Proprietary LLMs to Optimization-based Prompt Injection Attacks via the Fine-Tuning Interface16 Jan 2025
- 2024Open LLMs are Necessary for Current Private Adaptations and Outperform their Closed Alternatives2 Nov 2024
12 more
- 2024How Does Vision-Language Adaptation Impact the Safety of Vision Language Models?10 Oct 2024
- 2024SEAL: Safety-enhanced Aligned LLM Fine-tuning via Bilevel Data Selection9 Oct 2024
- 2024Recent Advances in Attack and Defense Approaches of Large Language Models5 Sep 2024
- 2024Composable Interventions for Language Models9 Jul 2024
- 2024Covert Malicious Finetuning: Challenges in Safeguarding LLM Adaptation28 Jun 2024
- 2024Lisa: Lazy Safety Alignment for Large Language Models against Harmful Fine-tuning Attack28 May 2024
- 2024Single Image Unlearning: Efficient Machine Unlearning in Multimodal Large Language Models21 May 2024
- 2024A safety realignment framework via subspace-oriented model fusion for large language models15 May 2024
- 2024Keeping LLMs Aligned After Fine-tuning: The Crucial Role of Prompt Templates28 Feb 2024
- 2024Immunization against harmful fine-tuning attacks26 Feb 2024
- 2024On Catastrophic Inheritance of Large Foundation Models2 Feb 2024
- 2024Vaccine: Perturbation-aware Alignment for Large Language Models against Harmful Fine-tuning Attack2 Feb 2024
- 2024Vaccine: Perturbation-aware Alignment for Large Language Models against Harmful Fine-tuning Attackcited by 115
- 2024Lisa: Lazy Safety Alignment for Large Language Models against Harmful Fine-tuning Attackcited by 92
- 2025In-Training Defenses against Emergent Misalignment in Language Modelscited by 15
- 2025Guardians and Offenders: A Survey on Harmful Content Generation and Safety Mitigation of LLMcited by 9
- 2026Invisible Safety Threat: Malicious Finetuning for LLM via Steganographycited by 2
- 2026Invisible Safety Threat: Malicious Finetuning for LLM via Steganography9 Mar 2026
- 2025In-Training Defenses against Emergent Misalignment in Language Models8 Aug 2025
- 2025Guardians and Offenders: A Survey on Harmful Content Generation and Safety Mitigation of LLM7 Aug 2025
- 2024Lisa: Lazy Safety Alignment for Large Language Models against Harmful Fine-tuning Attack28 May 2024
- 2024Vaccine: Perturbation-aware Alignment for Large Language Models against Harmful Fine-tuning Attack2 Feb 2024
- 2024A safety realignment framework via subspace-oriented model fusion for large language modelscited by 41
- 2025Fun-tuning: Characterizing the Vulnerability of Proprietary LLMs to Optimization-based Prompt Injection Attacks via the Fine-Tuning Interfacecited by 17
- 2025Jailbreak-Tuning: Models Efficiently Learn Jailbreak Susceptibilitycited by 9
- 2024Composable Interventions for Language Modelscited by 4
- 2025A Data-Centric Approach for Safe and Secure Large Language Models against Threatening and Toxic Contentcited by 0
- 2025Jailbreak-Tuning: Models Efficiently Learn Jailbreak Susceptibility15 Jul 2025
- 2025A Data-Centric Approach for Safe and Secure Large Language Models against Threatening and Toxic Content19 Apr 2025
- 2025Fun-tuning: Characterizing the Vulnerability of Proprietary LLMs to Optimization-based Prompt Injection Attacks via the Fine-Tuning Interface16 Jan 2025
- 2024Composable Interventions for Language Models9 Jul 2024
- 2024A safety realignment framework via subspace-oriented model fusion for large language models15 May 2024
- 2024Keeping LLMs Aligned After Fine-tuning: The Crucial Role of Prompt Templatescited by 96
- 2024Covert Malicious Finetuning: Challenges in Safeguarding LLM Adaptationcited by 80
- 2024SEAL: Safety-enhanced Aligned LLM Fine-tuning via Bilevel Data Selectioncited by 64
- 2024Immunization against harmful fine-tuning attackscited by 35
- 2024On Catastrophic Inheritance of Large Foundation Modelscited by 15
- 2024Open LLMs are Necessary for Current Private Adaptations and Outperform their Closed Alternativescited by 12
- 2024Recent Advances in Attack and Defense Approaches of Large Language Modelscited by 6
- 2026The Piggyback Hypothesis of Generalization: Explaining and Mitigating Emergent Misalignmentcited by 2
- 2025Poison Once, Refuse Forever: Weaponizing Alignment for Injecting Bias in LLMscited by 1
- 2025Large Language Models in Cybersecurity: Applications, Vulnerabilities, and Defense Techniquescited by 0
- 2026The Piggyback Hypothesis of Generalization: Explaining and Mitigating Emergent Misalignment4 Jun 2026
- 2025Poison Once, Refuse Forever: Weaponizing Alignment for Injecting Bias in LLMs28 Aug 2025
- 2025Large Language Models in Cybersecurity: Applications, Vulnerabilities, and Defense Techniques18 Jul 2025
- 2024Open LLMs are Necessary for Current Private Adaptations and Outperform their Closed Alternatives2 Nov 2024
- 2024SEAL: Safety-enhanced Aligned LLM Fine-tuning via Bilevel Data Selection9 Oct 2024
- 2024Recent Advances in Attack and Defense Approaches of Large Language Models5 Sep 2024
- 2024Covert Malicious Finetuning: Challenges in Safeguarding LLM Adaptation28 Jun 2024
- 2024Keeping LLMs Aligned After Fine-tuning: The Crucial Role of Prompt Templates28 Feb 2024
- 2024Immunization against harmful fine-tuning attacks26 Feb 2024
- 2024On Catastrophic Inheritance of Large Foundation Models2 Feb 2024