arXiv:2610.25683cs.AIOct 2026

Manuscript Offprint

arXiv:2610.25683

When Safety Fails Collectively: Robust Alignment Against Harmful Fine-Tuning via Joint Weight Perturbations

Zhiyuan Wang, Yuezhi Zhou, Zhu Zhang, Zhixing Tan

ABSTRACT

Harmful fine-tuning can rapidly erode the safety alignment of large language models, creating substantial risks when aligned models are adapted to downstream tasks. Existing alignment-stage defenses use harmful examples and simulated harmful perturbations during safety alignment to prepare models for later harmful fine-tuning, yet the collective effects of harmful weight perturbations remain underexplored. We identify a collective failure pattern: disjoint parts of a harmful perturbation have limited effects in isolation, but their joint application increases the model's harmfulness beyond the sum of their individual effects. Guided by this observation, we propose Joint Weight Perturbations (JWP), an alignment-stage defense that masks different parts of a harmful perturbation estimated from the current model and trains the model to respond safely in the resulting states. This exposes the model to different combinations of harmful perturbations and reduces its sensitivity to their accumulation during subsequent harmful fine-tuning. Experiments across downstream tasks and model families show that JWP offers stronger resistance to harmful fine-tuning than prior defenses while largely preserving task performance.

1 INTRODUCTION

Safety alignment is a key safeguard for large language models (LLMs), but downstream fine-tuning can erode the safety it establishes (Qi et al., 2024; Bowen et al., 2025). After an aligned model is released with open weights (Tamirisa et al., 2025) or offered through fine-tuning-as-a-service (Huang et al., 2025c), it may be customized using datasets supplied for downstream tasks. These datasets can include harmful examples, sometimes inadvertently, even when the intended task is benign (Bowen et al., 2025). Prior work shows that fine-tuning on only a small amount of such data can substantially degrade model safety (Qi et al., 2024; Hsu et al., 2024). The customized model may nevertheless perform well on the downstream task while becoming less safe, so safety measured at the end of alignment does not guarantee safety after further training (Huang et al., 2025c; Nguyen et al., 2026). This harmful fine-tuning threat motivates defenses that remain effective through downstream adaptation.

Figure

Figure 1: Safety degradation of aligned models under harmful fine-tuning.

A line of recent work addresses this threat at the alignment stage, incurring a one-time cost to make the aligned model harder to corrupt in all subsequent fine-tuning requests (Huang et al., 2025c;

∗^{*}Corresponding authors.

2026; Nguyen et al., 2026; Tamirisa et al., 2025). Vaccine trains hidden embeddings to withstand perturbations (Huang et al., 2024b), RepNoise degrades the internal representations of harmful data (Rosati et al., 2024), and Booster attenuates the harmful-loss reduction induced by a simulated harmful update (Huang et al., 2025c). Nevertheless, our evaluation shows that the protection they provide is limited. We perform safety alignment on Llama-2-7B using each method and track the harmful score (HS) of the resulting models throughout sustained harmful fine-tuning, as shown in Figure 1. The HS of every evaluated defense rises rapidly as the attack proceeds. Booster postpones the onset of this rise relative to Vaccine and RepNoise, yet safety still collapses after a comparatively small number of harmful updates. This consistent pattern across methods with distinct designs suggests that the safety degradation is not merely a matter of alignment strength, but reflects a common limitation in how existing defenses account for the harmful weight perturbations induced by downstream harmful fine-tuning.

Specifically, existing defenses simulate harmful weight perturbations during alignment to prepare the model for subsequent harmful fine-tuning (Huang et al., 2025c; Tamirisa et al., 2025), but typically treat these perturbations as a whole, leaving their internal interactions largely unexplored. To investigate this, we partition a harmful weight update into disjoint subsets and conduct two weight-level analyses on the same aligned model. First, we compare applying each subset individually with applying the subsets jointly. The joint application yields a substantially higher harmful score than the individual subsets, exceeding what their isolated effects would imply. Second, we vary the fraction of the harmful update applied to the model. Applying a small fraction of the perturbation leaves model safety largely intact, but increasing this fraction leads to a sharp rise in the harmful score and rapid safety degradation. Together, these observations suggest a collective failure pattern: interactions among different parts of a harmful perturbation amplify safety degradation.

Guided by these observations, we propose Joint Weight Perturbations (JWP), an alignment-stage defense that trains the model to maintain safety alignment under different combinations of harmful weight perturbations. JWP first estimates a harmful weight perturbation by simulating multiple steps of harmful fine-tuning from the current model. It then samples a retention probability p∼U(0,1)p \sim \mathcal{U}(0,1) and masks the perturbation accordingly to construct a partially perturbed model state. The model is trained to produce safe responses in this state. Training across these states exposes the model to different combinations of harmful weight perturbations and aims to reduce its sensitivity to their joint effects during subsequent harmful fine-tuning. Experiments show that JWP effectively suppresses the joint amplification of harmful weight perturbations. Under sustained harmful fine-tuning, JWP achieves a 4.3−5.4×4.3-5.4\times reduction in average harmful score across four downstream tasks compared with existing defenses including Booster (Huang et al., 2025c), while largely preserving utility after safety alignment and downstream task performance.

Our contributions are summarized as follows:

• We identify a collective failure pattern through weight-level analyses, showing that different parts of a harmful perturbation can reinforce one another and amplify safety degradation.

• We propose JWP, an alignment-stage defense that trains the model under randomly masked harmful perturbations of varying sizes and compositions to suppress their joint amplification during subsequent harmful fine-tuning.

• Experiments across downstream tasks and model families demonstrate that JWP substantially improves resistance to sustained harmful fine-tuning while largely preserving utility after safety alignment and downstream task performance.

References (41)