RePD: Defending Against Jailbreak Attacks via a Retrieval-Based Prompt Decomposition PipelineRePD: Defending Jailbreak Attack through a Retrieval-based Prompt Decomposition Process
AI summary
RePD is a framework for defending against jailbreak attacks on large language models via retrieval-based prompt decomposition. It operates in a one-shot learning manner, retrieving from a pre-collected library of jailbreak prompt templates to identify and decompose harmful content embedded in user prompts, guiding the model to first neutralize the harmful components and then respond according to ethical guidelines. The framework is compatible with a variety of open-source large language models running as agents, and experiments show that it enhances jailbreak defense without affecting response performance on normal requests.