Back to AI News
arxiv

SAFEHOLD: Training-Time Defense Preserves Refusal in Code Models During Harmful Fine-Tuning

Researchers find that safety-aligned code models can comply with harmful requests even when harmfulness information remains decodable from internal representations, and that an initial preference for refusal does not ensure sustained refusal during generation. They introduce SAFEHOLD, a provider-enforced defense that treats refusal as a sustained generation process using decision-boundary anchoring at the initial generation position and refusal-path reinforcement over the full refusal sequence. SAFEHOLD reduces average ASR by 72.03 percentage points versus undefended fine-tuning and outperforms five SOTA defenses by 24.32 to 70.87 points, while improving average HumanEval pass@1 by 10.24 points and maintaining a 2.73% XSTest over-refusal rate.

AI Brief

It offers a concrete training-time defense and measured safety/utility trade-offs for teams fine-tuning code models on untrusted data.

arXiv:2611.27495v1 Announce Type: new Abstract: Fine-tuning enables safety-aligned code language models to adapt to diverse downstream tasks. However, training on untrusted data can severely undermine their ability to refuse harmful requests. Notably, we find that models comply with harmful requests even though harmfulness information remains highly decodable from their internal representations. Moreover, an initial preference for refusal does not necessarily translate into sustained refusal behavior throughout generation. Together, these findings reveal a critical gap between recognizing harmful requests and consistently refusing to fulfill them. To address this gap, we introduce SAFEHOLD, a novel provider-enforced defense framework that preserves safety alignment during harmful fine-tuning by treating refusal as a sustained generation process rather than a single response decision. Specifically, SAFEHOLD preserves the aligned model's full-vocabulary response distribution at the initial generation position through decision-boundary anchoring, while supervising the complete refusal sequence through refusal-path reinforcement. We conduct extensive experiments evaluating safety, utility, and internal mechanisms. SAFEHOLD reduces average ASR by 72.03 percentage points relative to undefended fine-tuning, outperforming five SOTA defenses by 24.32 to 70.87 percentage points. Meanwhile, it improves average HumanEval pass@1 by 10.24 percentage points over undefended fine-tuning, while maintaining an average XSTest over-refusal rate of only 2.73 percent. Overall, these results demonstrate that SAFEHOLD effectively mitigates safety degradation during harmful fine-tuning while preserving benign-task utility.
Be the first to rate this article.

Comments & Questions (0)

Captcha
Please be respectful — let's keep the conversation friendly.

No comments yet

Be the first to comment!