中文

PANDAS:通过正向肯定、负向演示和自适应抽样提高多 shot 恶意刷写

计算与语言 2025-06-16 v2 密码学与安全 机器学习

摘要

Many-shot 恶意刷写通过利用 LLM 处理长输入序列的能力来规避其安全对齐机制。为此,恶意目标 prompt 会以数百个虚构的用户与模型之间的对话交换来前缀。这些交换随机抽样自一池子不安全 question-answer 对,使其看起来像模型已对有害指令表示 complied。本文提出了 PANDAS:一种改进 many-shot 恶意刷写的 hybrid 技术,通过修改这些虚构对话中的 Positive Affirmations、Negative Demonstrations 以及针对 target prompt 主题优化的 Adaptive Sampling 方法。我们还引入了 ManyHarm 数据集,包含大量有害 question-answer 对,并通过大量实验表明 PANDAS 在 long-context 场景中显著优于基线方法。通过 attention analysis,我们提供了关于如何利用 long-context 漏洞的见解,并展示 PANDAS 如何进一步提升 many-shot 恶意刷写。

关键词

引用

@article{arxiv.2502.01925,
  title  = {PANDAS: Improving Many-shot Jailbreaking via Positive Affirmation, Negative Demonstration, and Adaptive Sampling},
  author = {Avery Ma and Yangchen Pan and Amir-massoud Farahmand},
  journal= {arXiv preprint arXiv:2502.01925},
  year   = {2025}
}

备注

Accepted at ICML 2025 (Spotlight). Code: https://github.com/averyma/pandas