Defensive Prompt Patch: A Robust and Interpretable Defense of LLMs against Jailbreak Attacks

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Xiong, Chen, Qi, Xiangyu, Chen, Pin-Yu, Ho, Tsung-Yi
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866913873300291584
author Xiong, Chen
Qi, Xiangyu
Chen, Pin-Yu
Ho, Tsung-Yi
author_facet Xiong, Chen
Qi, Xiangyu
Chen, Pin-Yu
Ho, Tsung-Yi
contents Safety, security, and compliance are essential requirements when aligning large language models (LLMs). However, many seemingly aligned LLMs are soon shown to be susceptible to jailbreak attacks. These attacks aim to circumvent the models' safety guardrails and security mechanisms by introducing jailbreak prompts into malicious queries. In response to these challenges, this paper introduces Defensive Prompt Patch (DPP), a novel prompt-based defense mechanism specifically designed to protect LLMs against such sophisticated jailbreak strategies. Unlike previous approaches, which have often compromised the utility of the model for the sake of safety, DPP is designed to achieve a minimal Attack Success Rate (ASR) while preserving the high utility of LLMs. Our method uses strategically designed interpretable suffix prompts that effectively thwart a wide range of standard and adaptive jailbreak techniques. Empirical results conducted on LLAMA-2-7B-Chat and Mistral-7B-Instruct-v0.2 models demonstrate the robustness and adaptability of DPP, showing significant reductions in ASR with negligible impact on utility. Our approach not only outperforms existing defense strategies in balancing safety and functionality, but also provides a scalable and interpretable solution applicable to various LLM platforms.
format Preprint
id arxiv_https___arxiv_org_abs_2405_20099
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Defensive Prompt Patch: A Robust and Interpretable Defense of LLMs against Jailbreak Attacks
Xiong, Chen
Qi, Xiangyu
Chen, Pin-Yu
Ho, Tsung-Yi
Cryptography and Security
Safety, security, and compliance are essential requirements when aligning large language models (LLMs). However, many seemingly aligned LLMs are soon shown to be susceptible to jailbreak attacks. These attacks aim to circumvent the models' safety guardrails and security mechanisms by introducing jailbreak prompts into malicious queries. In response to these challenges, this paper introduces Defensive Prompt Patch (DPP), a novel prompt-based defense mechanism specifically designed to protect LLMs against such sophisticated jailbreak strategies. Unlike previous approaches, which have often compromised the utility of the model for the sake of safety, DPP is designed to achieve a minimal Attack Success Rate (ASR) while preserving the high utility of LLMs. Our method uses strategically designed interpretable suffix prompts that effectively thwart a wide range of standard and adaptive jailbreak techniques. Empirical results conducted on LLAMA-2-7B-Chat and Mistral-7B-Instruct-v0.2 models demonstrate the robustness and adaptability of DPP, showing significant reductions in ASR with negligible impact on utility. Our approach not only outperforms existing defense strategies in balancing safety and functionality, but also provides a scalable and interpretable solution applicable to various LLM platforms.
title Defensive Prompt Patch: A Robust and Interpretable Defense of LLMs against Jailbreak Attacks
topic Cryptography and Security
url https://arxiv.org/abs/2405.20099