干し草の山の中の脱獄
Jailbreaking in the Haystack
November 5, 2025
著者: Rishi Rajesh Shah, Chen Henry Wu, Shashwat Saxena, Ziqian Zhong, Alexander Robey, Aditi Raghunathan
cs.AI
要旨
長文脈対応言語モデル(LM)の最近の進展により、百万トークン規模の入力が可能となり、コンピュータ利用エージェントなどの複雑なタスクにおける能力が拡大している。しかし、こうした拡張された文脈が安全性に与える影響は未解明のままだ。この課題に対処するため、我々はNINJA(Needle-in-haystack jailbreak attackの略)を提案する。これは、有害なユーザー目標にモデル生成の良性コンテンツを付加することで、調整済みLMを脱獄する手法である。本手法の核心は、有害目標の配置位置が安全性に重大な影響を及ぼすという観察に基づく。安全性標準ベンチマークHarmBenchでの実験により、NINJAがLLaMA、Qwen、Mistral、Geminiなどの先端的オープン/プロプライエタリモデルにおいて攻撃成功率を大幅に向上させることが実証された。従来の脱獄手法と異なり、本アプローチは低リソースで転移性が高く、検出されにくい特徴を持つ。さらにNINJAは計算最適性を示す——固定計算バジェット下では、文脈長の増加がベストオブN脱獄における試行回数増加を凌駕する。これらの発見は、たとえ良性の長文脈であっても、目標配置を慎重に設計することで現代LMに根本的脆弱性が生じうることを明らかにする。
English
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.