Skip to content

Still refusing after training on harmful data: Training-time defenses for code generationTrained on Harm, Still Refusing: A Training-Time Defense for Code Generation

arXiv: 其他 AI 安全论文· arXiv:2611.27495· Miaoqing Tian, Ruohan Li, Qian Lu, Haipeng Qu·Indexed by this site · 12 hr ago· Originally publishedDefenses· Its place in the scan record →
AI summary

The paper proposes SAFEHOLD, a training-time defense framework implemented by the model provider that maintains the safety alignment of code language models under harmful fine-tuning, treating refusal as a continuous generation process rather than a single-response decision. The study finds that fine-tuning on untrusted data severely weakens the model's ability to refuse harmful requests, even though harmfulness information remains highly decodable in its internal representations, and the refusal preference early in generation does not necessarily persist throughout the generation process. SAFEHOLD anchors the decision boundary to preserve the aligned model's full-vocabulary response distribution at the generation start position, and reinforces supervision over the complete refusal sequence via refusal-path reinforcement. Experiments show that, compared with undefended fine-tuning, SAFEHOLD reduces the average attack success rate (ASR) by 72.03 percentage points, 24.32 to 70.87 percentage points better than five SOTA defenses; HumanEval pass@1 improves by an average of 10.24 percentage points, and the XSTest over-refusal rate averages only 2.73%.

Read originalarxiv.org