SafeDecoding: Defending against Jailbreak Attacks via Safety-Aware DecodingDownload PDF

Anonymous

16 Feb 2024ACL ARR 2024 February Blind SubmissionReaders: Everyone
Abstract: As large language models (LLMs) become increasingly integrated into real-world applications such as code generation and chatbot assistance, extensive efforts have been made to align LLM behavior with human values, including safety. Jailbreak attacks, which aim to provoke unintended and unsafe behaviors from LLMs, remain a significant LLM safety threat. We analyze tokens, which are the smallest unit of text that can be processed by LLMs and make the following observations: (1) probabilities of tokens representing harmful responses are higher than those of harmless responses, and (2) responses containing safety disclaimers appear among the top tokens when token probabilities are sorted in descending order. In this paper, we leverage (1) and (2) to develop SafeDecoding, a safety-aware decoding strategy for LLMs, to defend against jailbreak attacks. We perform extensive experiments to evaluate SafeDecoding against six SOTA jailbreak attacks (GCG, AutoDAN, PAIR, DeepInception, SAP30, and template based attack) on five LLMs (Vicuna, Llama2, Guanaco, falcon, and Dolphin) using four benchmark datasets (AdvBench, HEx-PHI, MT-Bench, and Just-Eval). Our results show that SafeDecoding significantly reduces attack success rate and harmfulness of jailbreak attacks without compromising the helpfulness of responses to benign user queries while outperforming six defense methods (Perpelexity, Paraphrase, Retokenization, Self-Reminder, ICD, and Self-Examination).
Paper Type: long
Research Area: Generation
Contribution Types: Model analysis & interpretability, Approaches low compute settings-efficiency
Languages Studied: English
Preprint Status: There is a non-anonymous preprint (URL specified in the next question).
A1: yes
A1 Elaboration For Yes Or No: Section 7
A2: yes
A2 Elaboration For Yes Or No: Section 8
A3: yes
A3 Elaboration For Yes Or No: Abstract and Section 1
B: no
B1: n/a
B2: n/a
B3: n/a
B4: n/a
B5: n/a
B6: yes
B6 Elaboration For Yes Or No: Section 5
C: yes
C1: yes
C1 Elaboration For Yes Or No: Section 5, Appendix
C2: yes
C2 Elaboration For Yes Or No: Section 5
C3: yes
C3 Elaboration For Yes Or No: Section 5
C4: yes
C4 Elaboration For Yes Or No: Section 5, Appendix
D: no
D1: n/a
D2: n/a
D3: n/a
D4: n/a
D5: n/a
E: no
E1: n/a
0 Replies

Loading