Feature-Aware Malicious Output Detection and Mitigation

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Dong, Weilong, Li, Peiguang, Tian, Yu, Zeng, Xinyi, Li, Fengdi, Wang, Sirui
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910910526783488
author Dong, Weilong
Li, Peiguang
Tian, Yu
Zeng, Xinyi
Li, Fengdi
Wang, Sirui
author_facet Dong, Weilong
Li, Peiguang
Tian, Yu
Zeng, Xinyi
Li, Fengdi
Wang, Sirui
contents The rapid advancement of large language models (LLMs) has brought significant benefits to various domains while introducing substantial risks. Despite being fine-tuned through reinforcement learning, LLMs lack the capability to discern malicious content, limiting their defense against jailbreak. To address these safety concerns, we propose a feature-aware method for harmful response rejection (FMM), which detects the presence of malicious features within the model's feature space and adaptively adjusts the model's rejection mechanism. By employing a simple discriminator, we detect potential malicious traits during the decoding phase. Upon detecting features indicative of toxic tokens, FMM regenerates the current token. By employing activation patching, an additional rejection vector is incorporated during the subsequent token generation, steering the model towards a refusal response. Experimental results demonstrate the effectiveness of our approach across multiple language models and diverse attack techniques, while crucially maintaining the models' standard generation capabilities.
format Preprint
id arxiv_https___arxiv_org_abs_2504_09191
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Feature-Aware Malicious Output Detection and Mitigation
Dong, Weilong
Li, Peiguang
Tian, Yu
Zeng, Xinyi
Li, Fengdi
Wang, Sirui
Computation and Language
The rapid advancement of large language models (LLMs) has brought significant benefits to various domains while introducing substantial risks. Despite being fine-tuned through reinforcement learning, LLMs lack the capability to discern malicious content, limiting their defense against jailbreak. To address these safety concerns, we propose a feature-aware method for harmful response rejection (FMM), which detects the presence of malicious features within the model's feature space and adaptively adjusts the model's rejection mechanism. By employing a simple discriminator, we detect potential malicious traits during the decoding phase. Upon detecting features indicative of toxic tokens, FMM regenerates the current token. By employing activation patching, an additional rejection vector is incorporated during the subsequent token generation, steering the model towards a refusal response. Experimental results demonstrate the effectiveness of our approach across multiple language models and diverse attack techniques, while crucially maintaining the models' standard generation capabilities.
title Feature-Aware Malicious Output Detection and Mitigation
topic Computation and Language
url https://arxiv.org/abs/2504.09191