跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 计算与语言

arXiv:2602.04294 (cs)
[提交于 2026年2月4日]

标题:How Few-shot Demonstrations Affect Prompt-based Defenses Against LLM Jailbreak Attacks

作者:Yanshu Wang, Shuaishuai Yang, Jingjing He, Tong Yang
查看论文《How Few-shot Demonstrations Affect Prompt-based Defenses Against LLM Jailbreak Attacks》的 PDF
查看中文 PDF 查看原文 PDF EasyResearch 阅读
摘要:Large Language Models (LLMs) face increasing threats from jailbreak attacks that bypass safety alignment. While prompt-based defenses such as Role-Oriented Prompts (RoP) and Task-Oriented Prompts (ToP) have shown effectiveness, the role of few-shot demonstrations in these defense strategies remains unclear. Prior work suggests that few-shot examples may compromise safety, but lacks investigation into how few-shot interacts with different system prompt strategies. In this paper, we conduct a comprehensive evaluation on multiple mainstream LLMs across four safety benchmarks (AdvBench, HarmBench, SG-Bench, XSTest) using six jailbreak attack methods. Our key finding reveals that few-shot demonstrations produce opposite effects on RoP and ToP: few-shot enhances RoP's safety rate by up to 4.5% through reinforcing role identity, while it degrades ToP's effectiveness by up to 21.2% through distracting attention from task instructions. Based on these findings, we provide practical recommendations for deploying prompt-based defenses in real-world LLM applications.
评论: 13 pages, 4 figures, 6 tables
主题: 计算与语言 (cs.CL); 人工智能 (cs.AI); 密码学与安全 (cs.CR)
引用方式: arXiv:2602.04294 [cs.CL]
  (或者 arXiv:2602.04294v1 [cs.CL] 对于此版本)
  https://doi.org/10.48550/arXiv.2602.04294

提交历史

来自:Yanshu Wang
[v1] 2026年2月4日 星期三 07:54:51 UTC
全文链接:

访问论文:

  • 查看中文 PDF
  • 查看原文 PDF
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.AI
< 上一篇   |   下一篇 >
最新 | 近期 | 2026-02
切换浏览方式为:
cs
cs.CL
cs.CR

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站