Prefix Guidance: A steering wheel for large language model defenses against jailbreak attacksPrefix Guidance: A Steering Wheel for Large Language Models to Defend Against Jailbreak Attacks
AI summary
Researchers propose a plug-and-play, easy-to-deploy jailbreak defense framework, Prefix Guidance (PG), which directly sets the first few tokens of the model output to guide the model in recognizing harmful prompts, combining the model's own safety capability with an external classifier for defense. Experiments on three models and five attack methods show that PG is overall on average more effective than baseline methods; results on the Just-Eval benchmark further indicate its advantage in maintaining model performance. The code is open-sourced at https://github.com/weiyezhimeng/Prefix-Guidance。