SafeAnchor:在大语言模型连续领域适应中防止累积安全性侵蚀
SafeAnchor: Preventing Cumulative Safety Erosion in Continual Domain Adaptation of Large Language Models
AI总结:
SafeAnchor通过识别低秩安全子空间并约束梯度更新,有效防止连续领域适应中的安全性侵蚀,实验显示其在多个领域任务中保持了较高的安全性对齐度。
摘要:
大语言模型的安全对齐显著薄弱:它集中在前几个输出标记中,可通过在100个对抗样本上微调来逆转。这种脆弱性在现实部署中尤为关键,因为模型在医学、法律和代码等领域进行连续适应,导致安全性防护逐渐磨损。然而,现有所有保持安全性的方法仅针对单任务微调,未解决多领域连续设置的问题。我们引入SafeAnchor框架,通过LoRA参数空间中的Fisher信息特征分解识别低秩安全子空间,然后将领域特定的梯度更新限制在这些子空间的正交补集上,并最后通过阈值触发的纠正重播监控残余安全性漂移。在Llama-2-7B-Chat和Mistral-7B-Instruct上,通过三个领域管道和八个基准测试评估,SafeAnchor保留了93.2%的原始安全性对齐度,优于所有基线18-42个百分点,在领域任务上与无约束微调相差1.5个百分点。
英文摘要:
Safety alignment in large language models is remarkably shallow: it is concentrated in the first few output tokens and reversible by fine-tuning on as few as 100 adversarial examples. This fragility becomes critical in real-world deployment, where models undergo sequential adaptation across domains such as medicine, law, and code, causing safety guardrails to erode cumulatively. Yet all existing safety-preserving methods target only single-task fine-tuning, leaving the multi-domain sequential setting entirely unaddressed. We introduce SafeAnchor, a framework that anchors safety in place throughout continual adaptation. SafeAnchor first identifies low-rank safety subspaces in LoRA parameter space via Fisher Information eigendecomposition, then constrains domain-specific gradient updates to the orthogonal complement of these subspaces, and finally monitors for residual safety drift with threshold-triggered corrective replay. Evaluated on Llama-2-7B-Chat and Mistral-7B-Instruct across a three-domain pipeline and eight benchmarks, SafeAnchor retains 93.2% of original safety alignment, outperforming all baselines by 18-42 points, while matching unconstrained fine-tuning to within 1.5 points on domain tasks.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。