arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2606.25182cs.CLcs.AIcs.LG
收藏

中间层知道什么:从熵动力学检测越狱

What Intermediate Layers Know: Detecting Jailbreaks from Entropy Dynamics

LMU Munich(慕尼黑大学);relAI – Konrad Zuse School of Excellence in Reliable AI(relAI – 康拉德·楚泽可靠人工智能卓越学校);University of Pisa(比萨大学);Munich Center for Machine Learning(慕尼黑机器学习中心);School of Engineering, Computing and Mathematics, Oxford Brookes University(牛津布鲁克斯大学工程、计算与数学学院)

Sofiia Nikolenko, Michele Papucci, Mina Rezaei, Shireen Kudukkil Manchingal

AI总结:

通过分析冻结LLM各层的token级预测熵轨迹,发现中间层的熵动力学特征(如基于排名的单调趋势分数)能有效检测越狱攻击,且无需额外训练。

摘要:

越狱攻击揭示了对齐大型语言模型的一个持续弱点:精心设计的提示可以引发违反政策的响应,尽管进行了安全训练。虽然大多数防御措施在提示或输出层面运作,但有害意图如何在模型内部表示中编码仍不清楚。我们通过使用logit透镜分析冻结LLM各层的token级预测熵轨迹来研究这个问题。我们发现,提示级熵的静态聚合统计量(如均值、方差)携带的判别信号很少,而捕捉熵在token位置上如何演变的特征(如基于排名的单调趋势分数)则更具信息量。重要的是,这种信号在模型深度上并不均匀:它集中在中间层,并在最终层退化,表明越狱相关结构在中间网络表示中最显著,而不是在输出头。在多个模型(Llama、Qwen、Gemma)和对抗性基准测试中,这些熵动力学提供了架构一致的分离,无需额外训练。总之,我们的发现表明越狱行为反映在结构化的中间不确定性动力学中,阐明了哪些熵衍生特征编码了有害意图以及该信号在网络中最显著的位置。

英文摘要:

Jailbreak attacks reveal a persistent weakness in aligned Large Language Models: carefully crafted prompts can elicit policy-violating responses despite safety training. While most defenses operate at the prompt or output level, it remains unclear how harmful intent is encoded within the model's internal representations. We investigate this question by analyzing token-level predictive entropy trajectories across layers of a frozen LLM using the logit lens. We find that static aggregate statistics of prompt-level entropy (e.g., mean, variance) carry little discriminative signal, whereas features capturing how entropy evolves across token positions, such as monotonic rank-based trend scores, are substantially more informative. Importantly, this signal is not uniform across model depth: it is concentrated in intermediate layers and degrades at the final layer, indicating that jailbreak-relevant structure is most pronounced in mid-network representations rather than at the output head. Across multiple models (Llama, Qwen, Gemma) and adversarial benchmarks, these entropy dynamics provide architecture-consistent separation without additional training. Together, our findings show that jailbreak behavior is reflected in structured intermediate uncertainty dynamics, clarifying both which entropy-derived features encode harmful intent and where in the network that signal is most pronounced.

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

↑