arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2602.11495cs.CRcs.CL
收藏

对大型语言模型进行劫持留有痕迹:从内部表示理解并检测劫持攻击

Jailbreaking Leaves a Trace: Understanding and Detecting Jailbreak Attacks from Internal Representations of Large Language Models

University of California, Riverside(加州大学河滨分校)

Sri Durga Sai Sowmya Kadali, Evangelos E. Papalexakis

AI总结:

本文提出了一种基于张量的潜在表示框架,通过分析LLM内部表示差异来检测劫持攻击,并在推理阶段主动干扰劫持执行。

摘要:

对大型语言模型(LLMs)进行劫持已成为广泛部署对话AI系统时的关键安全挑战。攻击者通过精心设计的提示利用这些模型来获取受限制或危险的输出,这种现象通常被称为劫持。尽管提出了许多防御机制,攻击者仍在开发适应性提示策略,而现有模型仍然容易受到攻击。这促使了研究LLMs内部行为的方法,而不是仅依赖于提示层面的防御。在本文中,我们从安全性和可解释性两个角度出发,通过分析劫持和良性提示之间内部表示的不同来研究劫持。我们对多个开源模型进行了系统性的逐层分析,包括GPT-J、LLaMA、Mistral和状态空间模型Mamba,并识别出与有害输入相关的一致的潜在空间模式。我们随后提出了一种基于张量的潜在表示框架,能够捕捉隐藏激活中的结构,并在不进行模型微调或辅助LLM检测器的情况下实现轻量级的劫持检测。我们进一步证明,潜在信号可以用于在推理过程中主动干扰劫持执行。在经过剥离的LLaMA-3.1-8B模型上,选择性地绕过高易受攻击的层可阻止78%的劫持尝试,同时在94%的良性提示上保持良性行为。这种干预完全在推理时间进行,并且引入了极小的开销,为通过整合更多攻击分布或更精细的易受攻击阈值来实现更强的覆盖提供了可扩展的基础。我们的结果提供了证据,表明劫持行为根植于可识别的内部结构,并建议了一种互补的、架构无关的方向来提高LLM的安全性。

英文摘要:

Jailbreaking large language models (LLMs) has emerged as a critical security challenge with the widespread deployment of conversational AI systems. Adversarial users exploit these models through carefully crafted prompts to elicit restricted or unsafe outputs, a phenomenon commonly referred to as Jailbreaking. Despite numerous proposed defense mechanisms, attackers continue to develop adaptive prompting strategies, and existing models remain vulnerable. This motivates approaches that examine the internal behavior of LLMs rather than relying solely on prompt-level defenses. In this work, we study jailbreaking from both security and interpretability perspectives by analyzing how internal representations differ between jailbreak and benign prompts. We conduct a systematic layer-wise analysis across multiple open-source models, including GPT-J, LLaMA, Mistral, and the state-space model Mamba, and identify consistent latent-space patterns associated with harmful inputs. We then propose a tensor-based latent representation framework that captures structure in hidden activations and enables lightweight jailbreak detection without model fine-tuning or auxiliary LLM-based detectors. We further demonstrate that the latent signals can be used to actively disrupt jailbreak execution at inference time. On an abliterated LLaMA-3.1-8B model, selectively bypassing high-susceptibility layers blocks 78% of jailbreak attempts while preserving benign behavior on 94% of benign prompts. This intervention operates entirely at inference time and introduces minimal overhead, providing a scalable foundation for achieving stronger coverage by incorporating additional attack distributions or more refined susceptibility thresholds. Our results provide evidence that jailbreak behavior is rooted in identifiable internal structures and suggest a complementary, architecture-agnostic direction for improving LLM security.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑