Saved in:
Bibliographic Details
Main Authors: Zeng, Xinyi, Shang, Yuying, Chen, Jiawei, Zhang, Jingyuan, Tian, Yu
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2410.06809
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913899222138880
author Zeng, Xinyi
Shang, Yuying
Chen, Jiawei
Zhang, Jingyuan
Tian, Yu
author_facet Zeng, Xinyi
Shang, Yuying
Chen, Jiawei
Zhang, Jingyuan
Tian, Yu
contents Large language models (LLMs) have demonstrated immense utility across various industries. However, as LLMs advance, the risk of harmful outputs increases due to incorrect or malicious instruction prompts. While current methods effectively address jailbreak risks, they share common limitations: 1) Judging harmful responses from the prefill-level lacks utilization of the model's decoding outputs, leading to relatively lower effectiveness and robustness. 2) Rejecting potentially harmful responses based on a single evaluation can significantly impair the model's helpfulness.This paper examines the LLMs' capability to recognize harmful outputs, revealing and quantifying their proficiency in assessing the danger of previous tokens. Motivated by pilot experiment results, we design a robust defense mechanism at the decoding level. Our novel decoder-oriented, step-by-step defense architecture corrects harmful queries directly rather than rejecting them outright. We introduce speculative decoding to enhance usability and facilitate deployment to boost secure decoding speed. Extensive experiments demonstrate that our approach improves model security without compromising reasoning speed. Notably, our method leverages the model's ability to discern hazardous information, maintaining its helpfulness compared to existing methods.
format Preprint
id arxiv_https___arxiv_org_abs_2410_06809
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Root Defence Strategies: Ensuring Safety of LLM at the Decoding Level
Zeng, Xinyi
Shang, Yuying
Chen, Jiawei
Zhang, Jingyuan
Tian, Yu
Computation and Language
Cryptography and Security
Large language models (LLMs) have demonstrated immense utility across various industries. However, as LLMs advance, the risk of harmful outputs increases due to incorrect or malicious instruction prompts. While current methods effectively address jailbreak risks, they share common limitations: 1) Judging harmful responses from the prefill-level lacks utilization of the model's decoding outputs, leading to relatively lower effectiveness and robustness. 2) Rejecting potentially harmful responses based on a single evaluation can significantly impair the model's helpfulness.This paper examines the LLMs' capability to recognize harmful outputs, revealing and quantifying their proficiency in assessing the danger of previous tokens. Motivated by pilot experiment results, we design a robust defense mechanism at the decoding level. Our novel decoder-oriented, step-by-step defense architecture corrects harmful queries directly rather than rejecting them outright. We introduce speculative decoding to enhance usability and facilitate deployment to boost secure decoding speed. Extensive experiments demonstrate that our approach improves model security without compromising reasoning speed. Notably, our method leverages the model's ability to discern hazardous information, maintaining its helpfulness compared to existing methods.
title Root Defence Strategies: Ensuring Safety of LLM at the Decoding Level
topic Computation and Language
Cryptography and Security
url https://arxiv.org/abs/2410.06809