Abstract
Current safety measures for Large Language Models (LLMs), such as Supervised Fine-Tuning and Reinforcement Learning from Human Feedback, primarily focus on the input space or initial response tokens. This paper introduces Jailbreak Value Decoding (JVD), a technique that exploits the decoding space to uncover hidden unsafe paths within "safety-aligned" models. By utilizing a Cost Value Model (CVM) to steer the decoding process, we demonstrate that harmful knowledge remains accessible even in models that appear secure. Our results show significant increases in Attack Success Rates (ASR) across multiple open-source LLMs, suggesting that current alignment methods are often superficial.
Introduction
The rapid deployment of Large Language Models (LLMs) has necessitated robust safety guardrails to prevent the generation of harmful, toxic, or illegal content. Techniques like Supervised Fine-Tuning (SFT) and Reinforcement Learning from Human Feedback (RLHF) are the industry standards for achieving this "safety alignment." However, these methods often function as a behavioral layer rather than a fundamental removal of harmful information. This research investigates the "decoding space" of LLMs, proposing that safety alignment merely teaches models to avoid certain high-probability paths while leaving adjacent, unsafe trajectories reachable through specialized decoding strategies.
Methodology
We frame the text generation process as a Markov Decision Process (MDP) and introduce two core components to navigate it toward unsafe outcomes:
The Cost Value Model (CVM)
The CVM is a secondary model (based on LLaMA-2-7B) trained using Temporal Difference (TD) learning. Its primary function is to estimate the "cost" of a partial sequence—specifically, the likelihood that the sequence will eventually lead to a harmful completion.
Jailbreak Value Decoding (JVD)
JVD modifies the standard decoding process of a target LLM. By adding a bias term derived from the CVM to the target model's output logits, JVD nudges the generation toward tokens that lead to toxic destinations. This "malicious GPS" can override the model's initial safety instincts, even if the first few tokens of the response appear benign.
The intensity of this intervention is controlled by a hyperparameter $\beta$. While increasing $\beta$ enhances the success of the jailbreak, it eventually impacts the grammatical coherence of the output.
Key Insights
Our analysis reveals several critical vulnerabilities in current safety alignment:
- Superficial Alignment: Safety is often "token-deep." A model might start with a refusal, but JVD can find a path just a few tokens later that pivots back to providing harmful instructions.
- The Agreement Trap: Models are particularly vulnerable after generating "agreement tokens" (e.g., "Sure," "Step 1"). Once the model commits to a helpful persona, its internal safety mechanisms appear to relax.
- Refusal is Not Absolute: Even after an explicit refusal, JVD can force a continuation that eventually yields the requested harmful information.
Experimental Results
We evaluated JVD against Vicuna-13B, LLaMA-2-chat 7B, and Mistral-7B-Instruct using a dataset of 1,128 real-world malicious prompts. Safety was evaluated using LLaMA-Guard-2 as an automated judge.
The results demonstrate the effectiveness of JVD across various architectures. For instance, the ASR for Vicuna-13B jumped from a baseline of 12.93% to 98.67%. Even the highly safety-tuned LLaMA-2-chat 7B saw its ASR rise significantly under specific chat templates. Qualitatively, the models provided detailed, harmful instructions for queries they would typically refuse, such as methods for urban destruction or joining extremist groups.
Conclusion
JVD demonstrates that safety alignment in current LLMs is often fragile and can be bypassed by manipulating the decoding process. While this is a white-box attack requiring internal access, it underscores the need for more robust, fine-grained safety alignment that addresses the entire generation trajectory. Future work could leverage the CVM defensively to identify and mitigate these hidden unsafe paths during the training phase.
Summary updated