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

Shuang Ao, Yi Dong, Jinwei Hu, Sarvapali Ramchurn
6/21/2025
cs.LGcs.AI

Official code: AoShuang92/SPLoRA (3 stars, last commit 2025-03-04).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

AoShuang92/SPLoRAOfficial100%
31Python, Jupyter NotebookMar 2, 20251 years ago

Similar Papers

Cite this paper

@article{ao2025safe,
  title  = {Safe Pruning LoRA: Robust Distance-Guided Pruning for Safety Alignment in Adaptation of LLMs},
  author = {Shuang Ao and Yi Dong and Jinwei Hu and Sarvapali Ramchurn},
  year   = {2025},
  eprint = {2506.18931},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.18931v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.18931.svg)](https://codeofpaper.com/paper/2506.18931)

Discussion