Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Attack Prompt Generation for Red Teaming and Defending Large Language Models

About

Large language models (LLMs) are susceptible to red teaming attacks, which can induce LLMs to generate harmful content. Previous research constructs attack prompts via manual or automatic methods, which have their own limitations on construction cost and quality. To address these issues, we propose an integrated approach that combines manual and automatic methods to economically generate high-quality attack prompts. Specifically, considering the impressive capabilities of newly emerged LLMs, we propose an attack framework to instruct LLMs to mimic human-generated prompts through in-context learning. Furthermore, we propose a defense framework that fine-tunes victim LLMs through iterative interactions with the attack framework to enhance their safety against red teaming attacks. Extensive experiments on different LLMs validate the effectiveness of our proposed attack and defense frameworks. Additionally, we release a series of attack prompts datasets named SAP with varying sizes, facilitating the safety evaluation and enhancement of more LLMs. Our code and dataset is available on https://github.com/Aatrox103/SAP .

Boyi Deng, Wenjie Wang, Fuli Feng, Yang Deng, Qifan Wang, Xiangnan He• 2023

Related benchmarks

TaskDatasetResultRank
Commonsense ReasoningHellaSwag
Accuracy56.73
1460
Natural Language InferenceRTE
Accuracy70.38
367
Jailbreak DefenseAutoDAN
ASR6.54
51
Jailbreak DefenseAdvBench
ASR (Overall)0.38
49
ChatMT-Bench
MT-Bench Score7.51
30
Conversational Question AnsweringCoQA
Accuracy74.85
29
Jailbreak DefenseAIM AdvE
Attack Success Rate (ASR)0.24
14
Jailbreak DefenseGCG AdvE
ASR0.96
14
Jailbreak DefenseDecoding MaliciousInstruct
ASR7
14
Safety EvaluationXSTest
FRR6
14
Showing 10 of 12 rows

Other info

Follow for update