Recent advances in long-context language models (LMs) have enabled million-token inputs, expanding their capabilities across complex tasks like computer-use agents. Yet, the safety implications of these extended contexts remain unclear. To bridge this gap, we introduce NINJA (short for Needle-in-haystack jailbreak attack), a method that jailbreaks aligned LMs by appending benign, model-generated content to harmful user goals. Critical to our method is the observation that the position of harmful goals play an important role in safety. Experiments on standard safety benchmark, HarmBench, show that NINJA significantly increases attack success rates across state-of-the-art open and proprietary models, including LLaMA, Qwen, Mistral, and Gemini. Unlike prior jailbreaking methods, our approach is low-resource, transferable, and less detectable. Moreover, we show that NINJA is compute-optimal -- under a fixed compute budget, increasing context length can outperform increasing the number of trials in best-of-N jailbreak. These findings reveal that even benign long contexts -- when crafted with careful goal positioning -- introduce fundamental vulnerabilities in modern LMs.


翻译:近期长上下文语言模型(LMs)的进展已能处理百万级token的输入,扩展了其在复杂任务(如计算机使用代理)中的能力。然而,这种扩展上下文的安全性影响尚不明确。为填补这一空白,我们提出了NINJA(Needle-in-haystack jailbreak attack的简称),该方法通过将模型生成的良性内容附加到有害用户目标之后,实现对对齐语言模型的越狱攻击。我们方法的关键在于观察到有害目标的位置对安全性具有重要影响。在标准安全基准测试HarmBench上的实验表明,NINJA能显著提升包括LLaMA、Qwen、Mistral和Gemini在内的前沿开源及专有模型的攻击成功率。与先前的越狱方法不同,我们的方法具有低资源消耗、可迁移性强且更不易检测的特点。此外,我们证明NINJA具有计算最优性——在固定计算预算下,增加上下文长度优于增加N次尝试中的最佳越狱次数。这些发现表明,即使是良性的长上下文——若通过精心设计的目标定位构建——也会在现代语言模型中引入根本性漏洞。

0
下载
关闭预览

相关内容

CLIP通用提示学习的简要概述
专知会员服务
16+阅读 · 3月13日
【ECCV2024】边缘感知Transformer的场景文本分割
专知会员服务
15+阅读 · 2024年7月25日
非Transformer不可?最新《状态空间模型(SSM)》综述
专知会员服务
75+阅读 · 2024年4月16日
专知会员服务
16+阅读 · 2021年5月13日
【NeurIPS2019】图变换网络:Graph Transformer Network
PSPNet ——语义分割及场景分析
AI科技评论
20+阅读 · 2019年8月20日
Sreg 一款社工小工具
黑白之道
13+阅读 · 2019年8月18日
Seq2seq强化,Pointer Network简介
机器学习算法与Python学习
15+阅读 · 2018年12月8日
基于Lattice LSTM的命名实体识别
微信AI
48+阅读 · 2018年10月19日
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
Arxiv
0+阅读 · 11月18日
Arxiv
0+阅读 · 11月10日
VIP会员
相关VIP内容
CLIP通用提示学习的简要概述
专知会员服务
16+阅读 · 3月13日
【ECCV2024】边缘感知Transformer的场景文本分割
专知会员服务
15+阅读 · 2024年7月25日
非Transformer不可?最新《状态空间模型(SSM)》综述
专知会员服务
75+阅读 · 2024年4月16日
专知会员服务
16+阅读 · 2021年5月13日
相关资讯
【NeurIPS2019】图变换网络:Graph Transformer Network
PSPNet ——语义分割及场景分析
AI科技评论
20+阅读 · 2019年8月20日
Sreg 一款社工小工具
黑白之道
13+阅读 · 2019年8月18日
Seq2seq强化,Pointer Network简介
机器学习算法与Python学习
15+阅读 · 2018年12月8日
基于Lattice LSTM的命名实体识别
微信AI
48+阅读 · 2018年10月19日
相关基金
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员