Skip to content

SafeDecoding: Defending against jailbreak attacks via safety-aware decodingSafeDecoding: Defending against Jailbreak Attacks via Safety-Aware Decoding

arXiv· arXiv:2402.08983· Zhangchen Xu, Fengqing Jiang, Luyao Niu, Jinyuan Jia, Bill Yuchen Lin, Radha Poovendran·Indexed by this site · 26 days ago· Originally publishedDefenses
AI summary

The researchers propose SafeDecoding, a safety-aware decoding strategy for large language models, used to defend against jailbreak attacks. Its core observation is that even when the probability of harmful-content tokens is higher than that of harmless responses, after sorting by descending probability, safety disclaimers still appear among the top tokens; based on this, the method identifies and amplifies the probability of safety disclaimer tokens while suppressing token sequences consistent with the jailbreak attack objective. The authors conducted experiments on five large language models using six state-of-the-art jailbreak attacks and four benchmark datasets; results show the method significantly reduces attack success rate and harmfulness without compromising the usefulness of responses to benign user queries, outperforming six comparison defense methods.

Read originalarxiv.org