Refusal Localizes, the Damage Relocates: Safety Layers Under Few-Sample Fine-Tuning
Jungseob Lee, Dongyub Jude Lee, Sugyeong Eo, Seongtae Hong, Seungyoon Lee, Heuiseok Lim
Abstract
Fine-tuning adapts aligned large language models (LLMs) to downstream tasks, but a few dozen harmful examples can remove their refusal of harmful requests. Prior work localizes safety-related behavior to specific layers, directions, and tokens, suggesting targets for protection. We test whether successful localization and recovery support defenses that survive changes in the attack. Across six checkpoints from four model families, harmful and benign prompts remain linearly separable after attack, and patching full clean hidden states into the compromised model restores refusal at a reproducible transition depth. Building on a prior layer-freezing defense, we freeze every layer up to this depth and repeat the attack. At a hundred harmful examples, refusal remains near zero on all six checkpoints, with recovery transitions above the frozen boundary. In a second study, removing the update's top two singular directions restores refusal after short attention-only fine-tunes on four checkpoints. On Llama-3.1-8B, ordinary training changes weaken this repair and an attacker who spreads the update defeats it. A spectral detector calibrated on benign Llama fine-tunes misses most repair failures on that checkpoint. Localized freezing can nevertheless help preserve refusal when a few harmful examples enter training data unintentionally. These results show that an attacker can bypass a region identified by recovery and defeat a repair that works across multiple checkpoints, motivating five checks for defenses against adaptive fine-tuning. Code is available at https://github.com/js-lee-AI/refusal-relocates.
Create a lesson
Metadata
- Categories
- cs.CL, cs.CR, cs.LG
- Comments
- 24 pages, 7 figures, 21 tables. Jungseob Lee and Dongyub Jude Lee contributed equally
Related papers
Layer-Informed Fine-Tuning via Three-Stage Functional Segmentation of LLMs
Shared title terminologycs.CLJunning Shao, Siwei Wang, Zhixuan Fang
Fine-Tuning Without Gradients? Closed-Form, LLM-Written Classifiers on a Frozen Encoder
Shared title terminologycs.CLMd Nasir Uddin, Musa Tur Farazi, Soumik Bhattacharjee et al.
SkillCore: Internalizing Generalizable Skills via Scaffolding-Removed Fine-Tuning
Shared title terminologycs.CLYi Liu, Changqing Ai, Peijie Dong et al.
Bayesian Fine-tuning Yields Language Models that are as Bayesian as their Beliefs Allow
Shared title terminologycs.CLPolina Tsvilodub, Andreas Waldis, Linlu Qiu et al.
Comparison of techniques for fine-tuning open-weight models for entity extraction from radiology reports
Shared title terminologycs.CLAawez Mansuri, Kush Mehta, Mohammadreza Chavoshi et al.
VLM Fine-Tuning for End-to-End Combinatorial Optimization
Shared title terminologycs.CLQingsong Yan, Xia Jiang, Yaoxin Wu et al.