IHDec:面向多轮指令层级安全性的散度引导对比解码
IHDec: Divergence-Steered Contrastive Decoding for Securing Multi-Turn Instruction Hierarchies
AI总结:
针对多轮对话中指令层级失效问题,提出基于Jensen-Shannon散度的无训练对比解码方法IHDec,自动检测并抑制越级指令,优于训练基线且保持响应质量。
摘要:
大型语言模型在处理具有不同角色优先级的多源输入时,常常无法维持指令层级,在冲突中矛盾地遵循较低优先级的指令。现有防御措施虽能缓解此问题,但大多局限于单轮场景且需要昂贵的微调。本文通过Jensen-Shannon散度框架形式化了多轮上下文中的这种失效模式,揭示了一种普遍的“角色影响反转”现象,即从属输入覆盖了上级角色。为在不训练的情况下纠正此问题,我们提出了IHDec(指令层级引导解码)。IHDec利用JSD自动检测令牌级别的层级违规,并动态执行对比解码以抑制对齐错误的从属角色。大量评估表明,IHDec在多轮冲突中优于基于训练的基线,同时完全保持了一般响应质量。此外,IHDec增强了对对抗性提示注入的安全性,并与更大模型展现出稳健的扩展协同效应。代码可在https://github.com/nxcolelxu/IHDec.git获取。
英文摘要:
Large Language Models (LLMs) often fail to maintain instruction hierarchies (IH) when processing multi-source inputs with varying role-level priorities, paradoxically adhering to lower-priority directives during conflicts. While existing defenses mitigate this issue, they are largely restricted to single-turn scenarios and require expensive fine-tuning. In this paper, we formalize this failure mode in multi-turn contexts via a Jensen-Shannon Divergence (JSD) framework, uncovering a pervasive role-influence inversion phenomenon where subordinate inputs override superior roles. To rectify this without training, we propose IHDec (Instruction Hierarchy-steered Decoding). IHDec leverages JSD to automatically detect token-level hierarchy violations and dynamically executes contrastive decoding to suppress misaligned subordinate roles. Extensive evaluations demonstrate that IHDec outperforms training-based baselines in multi-turn conflicts while fully preserving general response quality. Furthermore, IHDec strengthens safety against adversarial prompt injections and exhibits a robust scaling synergy with larger models. The Code is available at https://github.com/nxcolelxu/IHDec.git
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。