Jailbreaking and defending aligned large language models with only a few in-context examplesJailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrations
AI summary
Researchers propose In-Context Attack (ICA) and In-Context Defense (ICD); the former undermines the safety alignment of large language models through harmful examples, while the latter strengthens the model's resistance by showing examples of refusing harmful requests. The paper theoretically shows that a few in-context examples can have a critical impact on the safety alignment of large language models, and through extensive experiments verifies that ICA and ICD respectively increase and decrease the attack success rate of jailbreak prompts. The authors state that these findings reveal the profound influence of in-context learning (ICL) on model behavior and open a new direction for improving large language model safety.