arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.01533cs.CRcs.CY
收藏

LightDefense: 一种基于不确定性驱动的轻量级对抗劫持防御方法通过移位词分布

LightDefense: A Lightweight Uncertainty-Driven Defense against Jailbreaks via Shifted Token Distribution

University of Science and Technology of China(中国科学技术大学)

Zhuoran Yang, Yanyong Zhang

AI总结:

LightDefense通过调整词元分布和利用模型不确定性,提供了一种轻量级的对抗劫持防御方法,有效提升LLM的安全性同时保持对正常查询的有用性。

摘要:

大型语言模型(LLMs)面临来自劫持提示的威胁。现有的防御劫持攻击的方法主要基于辅助模型。然而,这些策略通常需要大量的数据收集或训练。我们提出了LightDefense,一种针对白盒模型的轻量级防御机制,它利用安全导向的方向来调整词汇中的词元概率,使安全免责声明出现在按概率降序排列的词元顶部。我们进一步创新性地利用LLM对提示的不确定性来衡量其危害性,并自适应地调整防御强度,有效平衡安全性和有用性。LightDefense在两个目标LLM上对5种攻击方法的有效性,而不影响对良性用户查询的有用性,突显了其作为新颖且轻量级防御机制的潜力,增强了LLM的安全性。

英文摘要:

Large Language Models (LLMs) face threats from jailbreak prompts. Existing methods for defending against jailbreak attacks are primarily based on auxiliary models. These strategies, however, often require extensive data collection or training. We propose LightDefense, a lightweight defense mechanism targeted at white-box models, which utilizes a safety-oriented direction to adjust the probabilities of tokens in the vocabulary, making safety disclaimers appear among the top tokens after sorting tokens by probability in descending order. We further innovatively leverage LLM's uncertainty about prompts to measure their harmfulness and adaptively adjust defense strength, effectively balancing safety and helpfulness. The effectiveness of LightDefense in defending against 5 attack methods across 2 target LLMs, without compromising helpfulness to benign user queries, highlights its potential as a novel and lightweight defense mechanism, enhancing security of LLMs.

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

↑