Continual Safety Alignment via Gradient-Based Sample Selection

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Bach, Thong, Nguyen, Dung, Le, Thao Minh, Tran, Truyen
Format: Preprint
Veröffentlicht: 2026
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866917420085542912
author Bach, Thong
Nguyen, Dung
Le, Thao Minh
Tran, Truyen
author_facet Bach, Thong
Nguyen, Dung
Le, Thao Minh
Tran, Truyen
contents Large language models require continuous adaptation to new tasks while preserving safety alignment. However, fine-tuning on even benign data often compromises safety behaviors, including refusal of harmful requests, truthfulness, and commonsense reasoning. We investigate which training samples cause alignment drift through a data-centric lens. Our empirical analysis shows samples contribute unequally: high-gradient samples cause greater safety degradation and drive models toward pretrained distributions, while moderate-gradient samples enable task learning with minimal alignment loss. We propose gradient-based sample selection that filters high-gradient samples during fine-tuning. Across multiple model families on continual domain tasks, our method substantially improves alignment preservation while maintaining competitive task performance, without requiring curated safe data or architectural modifications. Our method is robust across selection ratios, task orderings, and diverse attack benchmarks.
format Preprint
id arxiv_https___arxiv_org_abs_2604_17215
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Continual Safety Alignment via Gradient-Based Sample Selection
Bach, Thong
Nguyen, Dung
Le, Thao Minh
Tran, Truyen
Machine Learning
Large language models require continuous adaptation to new tasks while preserving safety alignment. However, fine-tuning on even benign data often compromises safety behaviors, including refusal of harmful requests, truthfulness, and commonsense reasoning. We investigate which training samples cause alignment drift through a data-centric lens. Our empirical analysis shows samples contribute unequally: high-gradient samples cause greater safety degradation and drive models toward pretrained distributions, while moderate-gradient samples enable task learning with minimal alignment loss. We propose gradient-based sample selection that filters high-gradient samples during fine-tuning. Across multiple model families on continual domain tasks, our method substantially improves alignment preservation while maintaining competitive task performance, without requiring curated safe data or architectural modifications. Our method is robust across selection ratios, task orderings, and diverse attack benchmarks.
title Continual Safety Alignment via Gradient-Based Sample Selection
topic Machine Learning
url https://arxiv.org/abs/2604.17215