arXiv:2506.18931cs.LGcs.AI2025-06Transactions of th…被引 16

通过剪枝弱化安全性的LoRA层,提升大模型微调后的安全性。

Safe Pruning LoRA: Robust Distance-Guided Pruning for Safety Alignment in Adaptation of LLMs

  • 基于距离度量的剪枝方法,识别并移除影响安全对齐的LoRA层。
  • 在含恶意数据的微调中,安全风险显著降低,性能不降反升。
  • 适合需要高安全性且注重推理效率的LLM部署场景。

使用低秩适应(LoRA)微调大语言模型可提升适应性并降低计算开销,但微调可能损害安全对齐,即使在良性数据下也可能导致有害输出。现有安全对齐方法难以捕捉复杂的参数偏移,导致安全与效用权衡不佳。为此,我们提出安全剪枝LoRA(SPLoRA),一种基于剪枝的新方法,可选择性移除削弱安全对齐的LoRA层,从而在保持性能的同时提升安全性。核心是引入经验-非敏感距离度量(E-DIEM),有效检测微调后模型的安全偏差。我们在混合良性与恶意数据、纯良性数据集上进行了广泛实验,评估了SPLoRA在效用、安全性和可靠性上的表现。结果表明,SPLoRA优于当前最优安全对齐技术,在显著降低安全风险的同时维持或提升了模型性能和可靠性。此外,该方法还减少了推理开销,适用于规模化、高效的可信LLM部署。代码已开源:https://github.com/AoShuang92/SPLoRA。

原文摘要 · Abstract (English)

Fine-tuning Large Language Models (LLMs) with Low-Rank Adaptation (LoRA) enhances adaptability while reducing computational costs. However, fine-tuning can compromise safety alignment, even with benign data, increasing susceptibility to harmful outputs. Existing safety alignment methods struggle to capture complex parameter shifts, leading to suboptimal safety-utility trade-offs. To address this issue, we propose Safe Pruning LoRA (SPLoRA), a novel pruning-based approach that selectively removes LoRA layers that weaken safety alignment, improving safety while preserving performance. At its core, we introduce Empirical-DIEM (E-DIEM), a dimension-insensitive similarity metric that effectively detects safety misalignment in LoRA-adapted models. We conduct extensive experiments on LLMs fine-tuned with mixed of benign and malicious data, and purely benign datasets, evaluating SPLoRA across utility, safety, and reliability metrics. Results demonstrate that SPLoRA outperforms state-of-the-art safety alignment techniques, significantly reducing safety risks while maintaining or improving model performance and reliability. Additionally, SPLoRA reduces inference overhead, making it a scalable and efficient solution for deploying safer and more reliable LLMs. The code is available at https://github.com/AoShuang92/SPLoRA.

安全对齐LoRA模型剪枝大模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。