Computer Science > Cryptography and Security
arXiv:2402.14968 (cs)
[Submitted on 22 Feb 2024 (v1), last revised 20 Jun 2024 (this version, v3)]
Title:Mitigating Fine-tuning based Jailbreak Attack with Backdoor Enhanced Safety Alignment
Authors:Jiongxiao Wang,Jiazhao Li,Yiquan Li,Xiangyu Qi,Junjie Hu,Yixuan Li,Patrick McDaniel,Muhao Chen,Bo Li,Chaowei Xiao
View a PDF of the paper titled Mitigating Fine-tuning based Jailbreak Attack with Backdoor Enhanced Safety Alignment, by Jiongxiao Wang and 9 other authors
View PDFAbstract:Despite the general capabilities of Large Language Models (LLM), these models still request fine-tuning or adaptation with customized data when meeting specific business demands. However, this process inevitably introduces new threats, particularly against the Fine-tuning based Jailbreak Attack (FJAttack) under the setting of Language-Model-as-a-Service (LMaaS), where the model's safety has been significantly compromised by fine-tuning users' uploaded examples contain just a few harmful examples. Though potential defenses have been proposed that the service providers can integrate safety examples into the fine-tuning dataset to reduce safety issues, such approaches require incorporating a substantial amount of data, making it inefficient. To effectively defend against the FJAttack with limited safety examples under LMaaS, we propose the Backdoor Enhanced Safety Alignment method inspired by an analogy with the concept of backdoor attacks. In particular, service providers will construct prefixed safety examples with a secret prompt, acting as a "backdoor trigger". By integrating prefixed safety examples into the fine-tuning dataset, the subsequent fine-tuning process effectively acts as the "backdoor attack", establishing a strong correlation between the secret prompt and safety generations. Consequently, safe responses are ensured once service providers prepend this secret prompt ahead of any user input during inference. Our comprehensive experiments demonstrate that through the Backdoor Enhanced Safety Alignment with adding as few as 11 prefixed safety examples, the maliciously fine-tuned LLMs will achieve similar safety performance as the original aligned models without harming the benign performance. Furthermore, we also present the effectiveness of our method in a more practical setting where the fine-tuning data consists of both FJAttack examples and the fine-tuning task data.
Subjects: | Cryptography and Security (cs.CR); Computation and Language (cs.CL) |
Cite as: | arXiv:2402.14968 [cs.CR] |
(orarXiv:2402.14968v3 [cs.CR] for this version) | |
https://doi.org/10.48550/arXiv.2402.14968 arXiv-issued DOI via DataCite |
Submission history
From: Jiongxiao Wang [view email][v1] Thu, 22 Feb 2024 21:05:18 UTC (8,918 KB)
[v2] Tue, 27 Feb 2024 21:27:53 UTC (8,918 KB)
[v3] Thu, 20 Jun 2024 05:18:04 UTC (2,151 KB)
Full-text links:
Access Paper:
- View PDF
- TeX Source
- Other Formats
View a PDF of the paper titled Mitigating Fine-tuning based Jailbreak Attack with Backdoor Enhanced Safety Alignment, by Jiongxiao Wang and 9 other authors
References & Citations
Bibliographic and Citation Tools
Bibliographic Explorer(What is the Explorer?)
Connected Papers(What is Connected Papers?)
Litmaps(What is Litmaps?)
scite Smart Citations(What are Smart Citations?)
Code, Data and Media Associated with this Article
alphaXiv(What is alphaXiv?)
CatalyzeX Code Finder for Papers(What is CatalyzeX?)
DagsHub(What is DagsHub?)
Gotit.pub(What is GotitPub?)
Hugging Face(What is Huggingface?)
Papers with Code(What is Papers with Code?)
ScienceCast(What is ScienceCast?)
Demos
Recommenders and Search Tools
Influence Flower(What are Influence Flowers?)
CORE Recommender(What is CORE?)
arXivLabs: experimental projects with community collaborators
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community?Learn more about arXivLabs.