Skip to content

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

arXiv· arXiv:2310.06387· IEEE Transactions on Pattern Analysis and Machine Intelligence 2026· Zeming Wei, Yifei Wang, Ang Li, Yichuan Mo, Yisen Wang·Indexed by this site · 25 days ago· Originally publishedAttacks
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.

Read originalIEEE Transactions on Pattern Analysis and Machine Intelligence 2026