Safe Delta: Consistently Preserving Safety when Fine-Tuning LLMs on Diverse Datasets

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Lu, Ning, Liu, Shengcai, Wu, Jiahao, Chen, Weiyu, Zhang, Zhirui, Ong, Yew-Soon, Wang, Qi, Tang, Ke
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866916742093078528
author Lu, Ning
Liu, Shengcai
Wu, Jiahao
Chen, Weiyu
Zhang, Zhirui
Ong, Yew-Soon
Wang, Qi
Tang, Ke
author_facet Lu, Ning
Liu, Shengcai
Wu, Jiahao
Chen, Weiyu
Zhang, Zhirui
Ong, Yew-Soon
Wang, Qi
Tang, Ke
contents Large language models (LLMs) have shown great potential as general-purpose AI assistants across various domains. To fully leverage this potential in specific applications, many companies provide fine-tuning API services, enabling users to upload their own data for LLM customization. However, fine-tuning services introduce a new safety threat: user-uploaded data, whether harmful or benign, can break the model's alignment, leading to unsafe outputs. Moreover, existing defense methods struggle to address the diversity of fine-tuning datasets (e.g., varying sizes, tasks), often sacrificing utility for safety or vice versa. To address this issue, we propose Safe Delta, a safety-aware post-training defense method that adjusts the delta parameters (i.e., the parameter change before and after fine-tuning). Specifically, Safe Delta estimates the safety degradation, selects delta parameters to maximize utility while limiting overall safety loss, and applies a safety compensation vector to mitigate residual safety loss. Through extensive experiments on four diverse datasets with varying settings, our approach consistently preserves safety while ensuring that the utility gain from benign datasets remains unaffected.
format Preprint
id arxiv_https___arxiv_org_abs_2505_12038
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Safe Delta: Consistently Preserving Safety when Fine-Tuning LLMs on Diverse Datasets
Lu, Ning
Liu, Shengcai
Wu, Jiahao
Chen, Weiyu
Zhang, Zhirui
Ong, Yew-Soon
Wang, Qi
Tang, Ke
Machine Learning
Artificial Intelligence
Cryptography and Security
Large language models (LLMs) have shown great potential as general-purpose AI assistants across various domains. To fully leverage this potential in specific applications, many companies provide fine-tuning API services, enabling users to upload their own data for LLM customization. However, fine-tuning services introduce a new safety threat: user-uploaded data, whether harmful or benign, can break the model's alignment, leading to unsafe outputs. Moreover, existing defense methods struggle to address the diversity of fine-tuning datasets (e.g., varying sizes, tasks), often sacrificing utility for safety or vice versa. To address this issue, we propose Safe Delta, a safety-aware post-training defense method that adjusts the delta parameters (i.e., the parameter change before and after fine-tuning). Specifically, Safe Delta estimates the safety degradation, selects delta parameters to maximize utility while limiting overall safety loss, and applies a safety compensation vector to mitigate residual safety loss. Through extensive experiments on four diverse datasets with varying settings, our approach consistently preserves safety while ensuring that the utility gain from benign datasets remains unaffected.
title Safe Delta: Consistently Preserving Safety when Fine-Tuning LLMs on Diverse Datasets
topic Machine Learning
Artificial Intelligence
Cryptography and Security
url https://arxiv.org/abs/2505.12038