Preventing Catastrophic Forgetting: Behavior-Aware Sampling for Safer Language Model Fine-Tuning

Anh Pham, Mihir Thalanki, Michael Sun, Aditya Chaloo, Ankita Gupta +4 more
10/23/2025
cs.CLcs.AI

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

Large language models often lose previously aligned safety behaviors when fine-tuned on benign data, a phenomenon known as catastrophic forgetting. Prior work shows that adding random safety examples can mitigate this effect, but it remains unclear which examples are most effective. We propose a behavior-aware sampling framework that selects safety examples based on two complementary factors: instruction-response behavior (e.g., refusal versus compliance) and semantic diversity across harm categories. Systematic evaluation shows that this approach substantially reduces harmful outputs while maintaining helpfulness, achieving up to a 41% reduction in harmfulness with only 0.5% additional training data. These results highlight how targeted data selection can improve the safety and efficiency of fine-tuning at scale.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{pham2025preventing,
  title  = {Preventing Catastrophic Forgetting: Behavior-Aware Sampling for Safer Language Model Fine-Tuning},
  author = {Anh Pham and Mihir Thalanki and Michael Sun and Aditya Chaloo and Ankita Gupta and Tian Xia and Aditya Mate and Ehimwenma Nosakhare and Soundararajan Srinivasan},
  year   = {2025},
  eprint = {2510.21885},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.21885v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2510.21885.svg)](https://codeofpaper.com/paper/2510.21885)

Discussion