Safety Anchor: Defending Harmful Fine-tuning via Geometric Bottlenecks
Abstract
Lay Summary
Large Language Models (LLMs) are vulnerable to "Harmful Fine-tuning". Bad actors can easily strip away the safety guardrails by lightly retraining the model with a few malicious examples. Current defenses try to prevent this by restricting changes to the model's complex internal workings. However, we found that because these models are so massive, they contain inherent redundancy. This allows attackers to easily find alternative pathways inside the model to bypass these internal locks and make the LLM dangerous again. To solve this, we introduce a new defense called Safety Bottleneck Regularization (SBR). Instead of trying to lock down the vast internal space, SBR locks the last step of the LLM's generation process, the "bottleneck" right before it outputs a word. By anchoring the LLM's final output for dangerous questions to the safe responses of the original model, SBR ensures the LLM remains safe no matter how its internal settings are altered. Our experiments show that using just a single safety anchor is enough to keep the model secure while preserving its ability to perform normal, helpful tasks.