Look Before You Leap: Enhancing Attention and Vigilance Regarding Harmful Content with GuidelineLLM
Shaoqing Zhang, Zhuosheng Zhang, Kehai Chen, Rongxiang Weng, Muyun Yang, Tiejun Zhao, Min Zhang
TL;DR
This work tackles the rising threat of jailbreak attacks on LLMs by introducing GuidelineLLM, a defense that identifies risky queries, summarises them into guidelines, and feeds these guidelines to the responder LLM before generating a reply. Unlike retraining the responder models, GuidelineLLM requires fine-tuning only on its own framework, enabling broad applicability across different LLMs. Empirical results show an average ASR reduction of 34.17% while maintaining helpfulness on benign queries, with strong performance against strong jailbreak methods and in-the-wild datasets. The approach combines a data-generation loop (T-Jailbreak) with a balanced guideline dataset and evaluates across multiple models, demonstrating significant safety gains with modest inference-time overhead and no safety fine-tuning of the responding LLMs.
Abstract
Despite being empowered with alignment mechanisms, large language models (LLMs) are increasingly vulnerable to emerging jailbreak attacks that can compromise their alignment mechanisms. This vulnerability poses significant risks to real-world applications. Existing work faces challenges in both training efficiency and generalization capabilities (i.e., Reinforcement Learning from Human Feedback and Red-Teaming). Developing effective strategies to enable LLMs to resist continuously evolving jailbreak attempts represents a significant challenge. To address this challenge, we propose a novel defensive paradigm called GuidelineLLM, which assists LLMs in recognizing queries that may have harmful content. Before LLMs respond to a query, GuidelineLLM first identifies potential risks associated with the query, summarizes these risks into guideline suggestions, and then feeds these guidelines to the responding LLMs. Importantly, our approach eliminates the necessity for additional safety fine-tuning of the LLMs themselves; only the GuidelineLLM requires fine-tuning. This characteristic enhances the general applicability of GuidelineLLM across various LLMs. Experimental results demonstrate that GuidelineLLM can significantly reduce the attack success rate (ASR) against LLM (an average reduction of 34.17\% ASR) while maintaining the usefulness of LLM in handling benign queries. The code is available at https://github.com/sqzhang-lazy/GuidelineLLM.
