用单个触发词精准激活安全模式,兼顾模型安全与可用性。
One Trigger Token Is Enough: A Defense Strategy for Balancing Safety and Usability in Large Language Models
- 通过识别并解码安全触发词,实现对有害输出的精准防御。
- 仅需一个触发词即可激活安全机制,显著降低有害输出率。
- 适合关注大模型安全防护的开发者与研究者使用。
大型语言模型(LLMs)在虚拟助手、代码生成和科研等领域广泛应用,但仍易受越狱攻击影响,导致模型生成有害内容。现有研究表明,当前安全对齐的LLMs存在浅层安全对齐问题,其根源在于模型学习到的“安全触发词”会与特定输入共同激活安全响应模式。本文深入分析发现,不同有害输入所对应的触发词高度相似。基于此,我们提出D-STT防御算法,通过识别并显式解码安全触发词来激活模型的安全机制,且将触发词限制为单个词,最大程度减少解码过程干扰。大量实验表明,D-STT在多种越狱攻击和正常提示下均显著降低有害输出,同时保持模型可用性,并带来可忽略的延迟开销,优于十种基线方法。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have been extensively used across diverse domains, including virtual assistants, automated code generation, and scientific research. However, they remain vulnerable to jailbreak attacks, which manipulate the models into generating harmful responses despite safety alignment. Recent studies have shown that current safety-aligned LLMs undergo shallow safety alignment. In this work, we conduct an in-depth investigation into the underlying mechanism of this phenomenon and reveal that it manifests through learned ''safety trigger tokens'' that activate the model's safety patterns when paired with the specific input. Through both analysis and empirical verification, we further demonstrate the high similarity of the safety trigger tokens across different harmful inputs. Accordingly, we propose D-STT, a simple yet effective defense algorithm that identifies and explicitly decodes safety trigger tokens of the given safety-aligned LLM to activate the model's learned safety patterns. In this process, the safety trigger is constrained to a single token, which effectively preserves model usability by introducing minimum intervention in the decoding process. Extensive experiments across diverse jailbreak attacks and benign prompts demonstrate that D-STT significantly reduces output harmfulness while preserving model usability and incurring negligible response time overhead, outperforming ten baseline methods.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。