[Paper Review] Defensive Prompt Patch: A Robust and Interpretable Defense of LLMs against Jailbreak Attacks
This paper proposes Defensive Prompt Patch (DPP), a prompt-based defense that enhances LLM robustness against jailbreak attacks by iteratively optimizing an interpretable suffix prompt using hierarchical genetic search. DPP reduces Attack Success Rate to 3.8% on LLAMA-2-7B-Chat and 2.0% on Mistral-7B-Instruct-v0.2 with minimal utility degradation, outperforming existing methods in balancing security and functionality.
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.
Motivation & Objective
- To address the critical gap in existing prompt-based defenses that sacrifice model utility for security.
- To develop a robust, interpretable, and scalable defense mechanism against both standard and adaptive jailbreak attacks.
- To minimize Attack Success Rate (ASR) while maintaining high model utility across diverse LLM platforms.
- To enable effective defense without model fine-tuning or gradient access, operating purely at the input prompt level.
- To provide a transparent and stable defense mechanism through interpretable prompt design and ablation validation.
Proposed method
- DPP uses a hierarchical genetic search algorithm to optimize a suffix prompt that is appended to every input query.
- The optimization process is guided by two datasets: a refusal dataset (to improve alignment) and a helpfulness dataset (to preserve utility).
- Each candidate defense prompt is evaluated using a dual-score mechanism: defense score (lower is better) and utility score (higher is better).
- The algorithm iteratively evolves the prompt population by selecting, mutating, and recombining low-scoring prompts to improve robustness and utility.
- The final DPP is deployed as a fixed suffix prompt during inference, ensuring minimal inference overhead and broad compatibility.
- Interpretability is enhanced by designing prompts that are human-readable and semantically meaningful, unlike black-box or gradient-based defenses.
Experimental results
Research questions
- RQ1Can a prompt-based defense achieve low Attack Success Rate without degrading model utility?
- RQ2How does DPP perform against both standard and adaptive jailbreak techniques, including AutoDAN, PAIR, and TAP?
- RQ3Is the DPP defense robust across different LLM architectures, such as LLAMA-2-7B-Chat and Mistral-7B-Instruct-v0.2?
- RQ4Does using DPP as a suffix prompt outperform using it as a prefix in terms of defense and utility?
- RQ5Can the DPP mechanism be made interpretable and stable, enabling transparency and auditability in safety-critical applications?
Key findings
- DPP reduces the Attack Success Rate to 3.8% on the LLAMA-2-7B-Chat model, significantly outperforming existing defenses.
- On the Mistral-7B-Instruct-v0.2 model, DPP achieves an ASR of just 2.0%, demonstrating strong generalization across models.
- DPP maintains high utility, with a Win-Rate of 75.06% on Mistral-7B-Instruct-v0.2, outperforming DRO despite lower utility in the latter.
- The ablation study confirms that using DPP as a suffix yields better defense and utility than using it as a prefix.
- DPP achieves the lowest average ASR across six diverse jailbreak attacks, including GCG, AutoDAN, and TAP, proving its robustness.
- The method is interpretable, with the final DPP prompt being semantically meaningful and human-readable, enhancing transparency and trust.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.