Abstract: Jailbreak attacks remain a persistent threat to large language model safety. We propose Context-Conditioned Delta Steering (CC-Delta), an SAE-based defense that identifies jailbreak-relevant sparse features by comparing token-level representations of the same harmful request with and without jailbreak context. Using paired harmful/jailbreak prompts, CC-Delta selects features via statistical testing and applies inference-time mean-shift steering in SAE latent space. Across four aligned instruction-tuned models and twelve jailbreak attacks, CC-Delta achieves comparable or better safety-utility tradeoffs than baseline defenses operating in dense latent space. In particular, our method clearly outperforms dense mean-shift steering on all four models, and particularly against out-of-distribution attacks, showing that steering in sparse SAE feature space offers advantages over steering in dense activation space for jailbreak mitigation. Our results suggest off-the-shelf SAEs trained for interpretability can be repurposed as practical jailbreak defenses without task-specific training.
Introduction
Large Language Models (LLMs) are increasingly deployed in sensitive contexts, yet they remain vulnerable to "jailbreaks"—adversarial prompts designed to bypass safety filters and elicit harmful content. A core challenge in defending against these attacks is the safety-utility tradeoff: aggressive safety interventions often degrade the model's general capabilities, such as instruction following or reasoning. This degradation is largely attributed to superposition, where safety-related concepts are entangled with utility-related features in the model's dense activation space. When a defense suppresses a dense activation associated with a jailbreak, it inadvertently suppresses unrelated features essential for general intelligence.
Methodology: Context-Conditioned Delta Steering (CC-Delta)
To address the entanglement problem, we introduce Context-Conditioned Delta Steering (CC-Delta). This method operates in the latent space of Sparse Autoencoders (SAEs), which are trained to decompose dense activations into millions of sparse, interpretable features. By intervening in this disentangled space, we can target jailbreak-specific behaviors with surgical precision.
The CC-Delta pipeline consists of two primary phases:
- Feature Selection (Offline): We identify features responsible for the "jailbreak shift" by comparing the model's internal representations of a harmful request (e.g., "How to build a bomb") in two states: a plain request (which triggers refusal) and a jailbroken version (wrapped in a roleplay or developer-mode template). Using statistical filtering (Wilcoxon signed-rank tests), we isolate SAE features that consistently change when a jailbreak is present.
- Steering (Inference-time): During model generation, activations at a target layer are mapped into the SAE latent space. We apply a mean-shift vector to the top-ranked jailbreak features, effectively steering the model's internal state back toward its safe, non-jailbroken representation. These modified activations are then projected back into the model's original space.
Experimental Results
We evaluated CC-Delta across four major instruction-tuned models (Gemma 2 2B/9B, Llama 3.1 8B, and Qwen 2.5 7B) using 808 unique harmful prompts and 12 distinct jailbreak attack types. Utility was measured using MMLU (knowledge), IFEval (instruction following), and LLM-as-judge fluency scores.
Performance and Tradeoffs
CC-Delta consistently demonstrated a superior safety-utility Pareto front compared to dense-space baselines like Contrastive Activation Addition (CAA). While dense methods often caused "utility collapse" as safety thresholds increased, CC-Delta maintained high performance across general benchmarks.
Robustness to Out-of-Distribution Attacks
A key finding is CC-Delta's ability to generalize. Even when features were selected using simple "wrapper" attacks, the defense remained highly effective against "re-writer" attacks that structurally alter the request. This suggests that diverse jailbreak strategies often converge on a common set of internal model features.
Discussion and Conclusion
Our results highlight the potential of repurposing interpretability tools for security. Off-the-shelf SAEs, trained purely for understanding model internals, can serve as effective, plug-and-play defense modules. By operating in a sparse, disentangled space, CC-Delta avoids the "lobotomization" effect common in dense-space interventions, maintaining near-perfect knowledge retention (MMLU) while significantly increasing safety.
Future work will explore adaptive attacks designed to bypass specific SAE features and investigate the impact of SAE quality on defense efficacy. Despite the computational overhead of running SAE passes during inference, the precision and robustness of CC-Delta offer a promising path forward for robust LLM safety.
Summary updated