NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Modulating LLM Behavior via Context-Specific Activation Steering

Yuanshu Zhao, Xuehai Tang, Lijia Lv, biyu zhou, Zhenhang Li, Jizhong Han, Songlin HuOpenReview 2026 · Submission to ICLR 2026 · Rejected

TL;DR

COS-Steering moves away from rigid, category-based activation engineering to a dynamic, subspace-based approach for LLM safety. By using Sparse Autoencoders (SAEs) to map a "safety-steering subspace," the method allows models to calculate the precise intervention needed for a specific prompt on-the-fly, effectively neutralizing diverse jailbreak attacks while leaving benign performance untouched.

What Problem Does This Paper Address?

Ensuring Large Language Models (LLMs) remain safe is a moving target. Traditional safety alignment (like RLHF) can be bypassed by clever adversarial prompts, known as "jailbreaks." A popular alternative is activation engineering, which involves "nudging" the model’s internal brain states (activations) during inference to steer it toward harmless behavior.

However, current activation engineering methods rely on a static premise: they assume that all harmful prompts within a category (e.g., "illegal acts") cluster together in the model's activation space. The authors demonstrate that this isn't true. Adversarial attacks—like PAP or Masterkey—perturb activations so significantly that a prompt about "hacking" might look completely different to the model depending on how the question is framed. This causes static steering methods to either fail to stop the harm or accidentally suppress benign, helpful responses (collateral suppression).

Methods

The authors introduce Context-Specific Steering (COS-Steering), which replaces fixed steering vectors with a dynamic bypass mechanism. The process involves three main steps:

  1. Steering Feature Extraction: The authors take a small set of "bad cases" (prompts that successfully jailbreak the model) and train multiple steering vectors. The goal of these vectors is to force the model to generate a "harmless prefix" (e.g., "As a responsible language model...") when faced with those specific prompts.
  2. Safe-Steering Subspace Recovery: Instead of using these vectors directly, they use a Sparse Autoencoder (SAE) to compress the pool of steering signals into a compact set of basis vectors. This creates a "safety subspace" that captures the underlying primitive features of what makes a response safe, rather than just broad semantic categories.
  3. Context-Specific Steering Module: A lightweight module ($S_r$) is trained to read the input activations and dynamically assign weights to the basis vectors. Crucially, they introduce an Orthogonal Representation Penalty ($P_{OR}$). This penalty ensures that for benign prompts, the steering weights approach zero, effectively keeping the safety bypass "silent" unless a threat is detected.

Datasets

The researchers evaluated COS-Steering using a "mixed-attack" setting to simulate real-world complexity:

  • Harmful Datasets: HarmfulQA, Advbench, and Beavertails.
  • Attack Methods: One-third of the data was subjected to the Masterkey jailbreak, one-third to the PAP (Persuasive Adversarial Prompts) red-teaming attack, and one-third remained unchanged.
  • Benign Datasets: ProtoQA (common-sense questions) was used to measure the impact on the model's general utility.
  • Validation: They also used the DRA (Distributional Robustness Activation) method for cross-model validation.

Key Insights and Ideas

  • Attack Patterns Over Harm Categories: One of the most striking findings (illustrated in Figure 1) is that prompts sharing the same attack method cluster closer together in activation space than prompts sharing the same harm category. This explains why category-based steering is so fragile.
  • SAEs as Compressors, Not Just Interpreters: While SAEs are typically used in mechanistic interpretability to find "features," this paper uses them as a powerful tool for feature compression to recover a robust steering subspace.
  • The Power of the Zero-Vector: The $P_{OR}$ penalty is a clever way to solve the "over-refusal" problem. By forcing the steering module to output a zero-vector for harmless prompts, the authors ensure the model's generative capabilities are preserved.
  • Immediate Alignment: The method requires very little data—just a few "bad cases"—to adapt to new, emerging jailbreak techniques, making it much faster than traditional fine-tuning.

Key Results

COS-Steering significantly outperformed state-of-the-art baselines like ITI, CAST, and BiPO:

  • Safety: On Advbench, COS-Steering achieved an Attack Success Rate (ASR) of 0.08, compared to 0.39 for ITI and 0.76 for CAST.
  • Utility: It maintained high BERTScore and low KL Divergence on benign queries, indicating that the model's "intelligence" wasn't degraded by the safety layer.
  • Efficiency: The module adds roughly 1.3 million parameters to a 7B model (less than 0.02%), and because the bypass can be mathematically folded into the original model weights, it introduces zero additional inference overhead.

Limitations and Future Work

  • Training Overhead: The authors acknowledge that their method increases training time by about 70% compared to simpler activation engineering methods, primarily due to the initial steering vector optimization.
  • Initial "Bad Cases": The system still relies on having a small set of successful jailbreaks to learn from. If a completely novel attack vector emerges that doesn't project into the learned subspace, the system might need a quick update.
  • Future Directions: The authors suggest exploring how this subspace approach could be applied to other behaviors beyond safety, such as truthfulness or stylistic modulation.

Summary updated

BibTeX
@misc{zhao2026modulating,
  author = {Yuanshu Zhao and Xuehai Tang and Lijia Lv and biyu zhou and Zhenhang Li and Jizhong Han and Songlin Hu},
  title = {{Modulating LLM Behavior via Context-Specific Activation Steering}},
  year = {2026},
  url = {https://openreview.net/forum?id=vzXyVNCGAL},
  howpublished = {OpenReview},
  note = {Submitted to ICLR 2026},
}
Figure