ACL Findings2026
Defending LLMs against Jailbreak Attacks via Template-Based ICL with a Defensive Suffix
Ruiyang Ni, Changlong Li, Shuaibiao Han, Zhiyu Yi, Perley Xu, Wenjie Ruan
摘要
State-of-the-art large language models (LLMs) have achieved impressive results on various tasks.However, these architectures are vulnerable to jailbreak attacks, such as GCG and Auto-DAN.Several defense strategies have been proposed to protect LLMs from generating harmful content, with most methods focusing on model fine-tuning or heuristic defense designs.These methods are often time-consuming or less effective.To fill this gap, this paper proposes a novel defense solution by taking the advances of online In-Context Learning (ICL) and an offline defensive suffix.Specifically, we first optimize the offline defensive suffix using an iterative algorithm.Second, an online stochastic random search is conducted to identify the most effective ICL demonstrations.Finally, the original user instruction, the selected ICL demonstrations, and the defensive suffix are assembled into a structured input prompt using a carefully designed template, which is then fed into the LLM for response generation.Experimental results show that our method is effective against both advanced white-box and black-box attacks, reducing the attack success rate to nearly 0%, while maintaining the model's utility on the benign tasks and incurring only negligible computational overhead.Our code is available on https://github.com/Trusted-LLM/DSICL.WARNING: This paper contains model outputs that may be considered offensive.
问 Lune
尽管问,回答会引用原文。
Lune 会读完全文和相关的 Paper,每个回答都附上所依据的原文段落。
它引用的 Paper18
- Measuring Massive Multitask Language UnderstandingDan Hendrycks, Collin Burns, Steven Basart, Andy Zou 等ICLR 2021 · 7,905 次引用
- HarmBench: A Standardized Evaluation Framework for Automated Red Teaming and Robust RefusalMantas Mazeika, Long Phan, Xuwang Yin, Andy Zou 等ICML 2024 · 1,031 次引用
- Tree of Attacks: Jailbreaking Black-Box LLMs AutomaticallyAnay Mehrotra, Manolis Zampetakis, Paul Kassianik, Blaine Nelson 等NeurIPS 2024 · 835 次引用
- AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language ModelsXiaogeng Liu, Nan Xu, Muhao Chen, Chaowei XiaoICLR 2024 · 722 次引用
- Safe RLHF: Safe Reinforcement Learning from Human FeedbackJosef Dai, Xuehai Pan, Ruiyang Sun, Jiaming Ji 等ICLR 2024 · 656 次引用
相关 Paper
- Defensive Prompt Patch: A Robust and Generalizable Defense of Large Language Models against Jailbreak AttacksChen Xiong, Xiangyu Qi, Pin-Yu Chen, Tsung-Yi HoACL Findings 2025 · 9 次引用
- Defending LLMs against Jailbreaking Attacks via BacktranslationYihan Wang, Zhouxing Shi, Andrew Bai, Cho-Jui HsiehACL Findings 2024 · 28 次引用
- SQL Injection Jailbreak: A Structural Disaster of Large Language ModelsJiawei Zhao, Kejiang Chen, Weiming Zhang, Nenghai YuACL Findings 2025 · 3 次引用
- MirrorShield: Towards Dynamic Adaptive Defense Against Jailbreaks via Entropy-Guided Mirror CraftingRui Pu, Chaozhuo Li, Rui Ha, Litian Zhang 等AAAI 2026
- Why Not Act on What You Know? Unleashing Safety Potential of LLMs via Self-Aware Guard EnhancementPeng Ding, Jun Kuang, Zongyu Wang, Xuezhi Cao 等ACL Findings 2025
