One Trigger Token Is Enough: A Defense Strategy for Balancing Safety and Usability in Large Language Models

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Gu, Haoran, Wang, Handing, Mei, Yi, Zhang, Mengjie, Jin, Yaochu
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866915702439411712
author Gu, Haoran
Wang, Handing
Mei, Yi
Zhang, Mengjie
Jin, Yaochu
author_facet Gu, Haoran
Wang, Handing
Mei, Yi
Zhang, Mengjie
Jin, Yaochu
contents Large Language Models (LLMs) have been extensively used across diverse domains, including virtual assistants, automated code generation, and scientific research. However, they remain vulnerable to jailbreak attacks, which manipulate the models into generating harmful responses despite safety alignment. Recent studies have shown that current safety-aligned LLMs undergo shallow safety alignment. In this work, we conduct an in-depth investigation into the underlying mechanism of this phenomenon and reveal that it manifests through learned ''safety trigger tokens'' that activate the model's safety patterns when paired with the specific input. Through both analysis and empirical verification, we further demonstrate the high similarity of the safety trigger tokens across different harmful inputs. Accordingly, we propose D-STT, a simple yet effective defense algorithm that identifies and explicitly decodes safety trigger tokens of the given safety-aligned LLM to activate the model's learned safety patterns. In this process, the safety trigger is constrained to a single token, which effectively preserves model usability by introducing minimum intervention in the decoding process. Extensive experiments across diverse jailbreak attacks and benign prompts demonstrate that D-STT significantly reduces output harmfulness while preserving model usability and incurring negligible response time overhead, outperforming ten baseline methods.
format Preprint
id arxiv_https___arxiv_org_abs_2505_07167
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle One Trigger Token Is Enough: A Defense Strategy for Balancing Safety and Usability in Large Language Models
Gu, Haoran
Wang, Handing
Mei, Yi
Zhang, Mengjie
Jin, Yaochu
Cryptography and Security
Computation and Language
Large Language Models (LLMs) have been extensively used across diverse domains, including virtual assistants, automated code generation, and scientific research. However, they remain vulnerable to jailbreak attacks, which manipulate the models into generating harmful responses despite safety alignment. Recent studies have shown that current safety-aligned LLMs undergo shallow safety alignment. In this work, we conduct an in-depth investigation into the underlying mechanism of this phenomenon and reveal that it manifests through learned ''safety trigger tokens'' that activate the model's safety patterns when paired with the specific input. Through both analysis and empirical verification, we further demonstrate the high similarity of the safety trigger tokens across different harmful inputs. Accordingly, we propose D-STT, a simple yet effective defense algorithm that identifies and explicitly decodes safety trigger tokens of the given safety-aligned LLM to activate the model's learned safety patterns. In this process, the safety trigger is constrained to a single token, which effectively preserves model usability by introducing minimum intervention in the decoding process. Extensive experiments across diverse jailbreak attacks and benign prompts demonstrate that D-STT significantly reduces output harmfulness while preserving model usability and incurring negligible response time overhead, outperforming ten baseline methods.
title One Trigger Token Is Enough: A Defense Strategy for Balancing Safety and Usability in Large Language Models
topic Cryptography and Security
Computation and Language
url https://arxiv.org/abs/2505.07167