[Paper Review] Jailbreak Antidote: Runtime Safety-Utility Balance via Sparse Representation Adjustment in Large Language Models
Jailbreak Antidote is a runtime defense that balances safety and utility in large language models by sparsely adjusting approximately 5% of internal hidden states along a learned safety direction. It achieves state-of-the-art defense success rates with zero inference overhead, outperforming prompt-based and fine-tuning methods while preserving model utility.
As large language models (LLMs) become integral to various applications, ensuring both their safety and utility is paramount. Jailbreak attacks, which manipulate LLMs into generating harmful content, pose significant challenges to this balance. Existing defenses, such as prompt engineering and safety fine-tuning, often introduce computational overhead, increase inference latency, and lack runtime flexibility. Moreover, overly restrictive safety measures can degrade model utility by causing refusals of benign queries. In this paper, we introduce Jailbreak Antidote, a method that enables real-time adjustment of LLM safety preferences by manipulating a sparse subset of the model's internal states during inference. By shifting the model's hidden representations along a safety direction with varying strengths, we achieve flexible control over the safety-utility balance without additional token overhead or inference delays. Our analysis reveals that safety-related information in LLMs is sparsely distributed; adjusting approximately 5% of the internal state is as effective as modifying the entire state. Extensive experiments on nine LLMs (ranging from 2 billion to 72 billion parameters), evaluated against ten jailbreak attack methods and compared with six defense strategies, validate the effectiveness and efficiency of our approach. By directly manipulating internal states during reasoning, Jailbreak Antidote offers a lightweight, scalable solution that enhances LLM safety while preserving utility, opening new possibilities for real-time safety mechanisms in widely-deployed AI systems.
Motivation & Objective
- To address the critical challenge of balancing safety and utility in deployed LLMs, especially under jailbreak attacks.
- To overcome limitations of existing defenses—such as high latency, computational overhead, and reduced utility from over-conservatism.
- To enable real-time, dynamic safety adjustments during inference without retraining or prompt modifications.
- To investigate whether safety-related information in LLMs is sparsely distributed and can be effectively manipulated via selective neuron adjustments.
- To develop a lightweight, scalable, and flexible mechanism for runtime safety control in production LLM systems.
Proposed method
- The method identifies a safety direction using PCA on hidden states from benign and harmful prompts.
- During inference, it shifts the hidden representation of an adversarial prompt toward the safety direction by modifying only a sparse subset of neurons.
- The adjustment is controlled by a scaling factor α, which tunes the strength of the safety shift.
- Sparsity is enforced by selecting the top-k% neurons with the largest projection onto the safety direction, ensuring minimal impact on model utility.
- The method operates at inference time with no additional token generation or model fine-tuning, preserving inference speed.
- The approach is applied dynamically per input, enabling runtime adaptability to varying safety requirements.
Experimental results
Research questions
- RQ1Can safety-related information in LLMs be effectively localized to a sparse subset of internal representations?
- RQ2To what extent can a lightweight, runtime adjustment of internal states improve defense against jailbreak attacks?
- RQ3How does the trade-off between safety and utility vary with the sparsity and strength of internal state modifications?
- RQ4Can this method outperform prompt engineering and fine-tuning-based defenses in both defense effectiveness and inference efficiency?
- RQ5Is the method reversible, allowing for controlled weakening of safety for adversarial experimentation or alignment tuning?
Key findings
- Jailbreak Antidote achieves a defense success rate (DSR) of over 90% across nine LLMs ranging from 2B to 72B parameters, outperforming six baselines.
- Adjusting only 5% of the internal state achieves safety performance comparable to modifying 100% of the state, demonstrating the sparsity of safety representations.
- The method maintains high win rate (a measure of benign task performance) even at high safety levels, indicating minimal degradation of model utility.
- When α < 0, the method reverses safety effects, reducing DSR below baseline, confirming its reversibility and dynamic control capability.
- Top-k selection of neurons based on projection magnitude outperforms random selection, proving that targeting the most relevant neurons is critical.
- The method incurs no additional token generation or inference delay, making it suitable for real-time deployment in production systems.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.