Papers
Topics
Authors
Recent
Search
2000 character limit reached

MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks

Published 30 Apr 2026 in cs.CR | (2604.27818v1)

Abstract: Mixture-of-Experts (MoE) architectures in LLMs have significantly reduced inference costs through sparse activation. However, this sparse activation paradigm also introduces new safety challenges. Since only a subset of experts is engaged for each input, model behavior becomes coupled to routing decisions, yielding a difficult-to-control mechanism that can vary across safety-relevant scenarios. At the same time, adapting model behavior through full fine-tuning or retraining is costly, especially when developers need to rapidly configure the same model for different safety objectives. We present MASCing (MoE Activation Steering Configuration), the first framework that enables flexible reconfiguration of MoE behavior across diverse safety scenarios without retraining. MASCing uses an LSTM-based surrogate model to capture cross-layer routing dependencies and map routing logits to downstream behaviors. It then optimizes a steering matrix to identify behavior-relevant expert circuits and, at inference time, applies steering masks to the routing gates to override expert selection. This enables targeted enhancement or suppression of specific behaviors while preserving general language utility. To demonstrate its reconfigurability, we apply MASCing to two different safety-related objectives and observe consistent gains with negligible overhead across seven open-source MoE models. For multi-turn jailbreak defense, it improves the average defense success rate from 52.5% to 83.9%, with gains of up to 89.2%. For adult-content generation, MASCing enables models to comply with such requests that would otherwise be refused, increasing the average generation success rate from 52.6% to 82.0%, with gains of up to 93.0%. These results establish MASCing as a practical, lightweight, and flexible framework for scenario-specific safety reconfiguration in MoE models.

Summary

  • The paper introduces a novel training-free MASCing pipeline that reconfigures MoE LLM behavior using activation steering masks for enhanced safety and compliance.
  • It employs an LSTM surrogate to model routing logits and optimize sparse steering masks that selectively modulate expert activations without retraining.
  • Empirical evaluations demonstrate significant improvements, with defense rates rising to 89.2% and compliance rates up to 93.0%, while preserving overall model utility.

Configurable Safety and Behavior in MoE LLMs via Activation Steering Masks

Motivation and Challenges in MoE Safety Controls

Mixture-of-Experts (MoE) architectures have become foundational to scaling LLMs with improved inference efficiency and parameter specialization. By selectively routing tokens to a sparse subset of experts, MoEs achieve substantial reductions in computational demand relative to dense models. However, this sparse activation paradigm introduces novel safety vulnerabilities: the behavioral locus of the model becomes tightly coupled to expert routing decisions, creating an attack surface. Adversaries may manipulate, suppress, or bypass safety-relevant experts, enabling circumvention of alignment safeguards. Existing approaches to reconfiguring safety—such as full-parameter fine-tuning or retraining—are prohibitively expensive and inflexible in contexts where deployment policies or threats change rapidly.

The primary challenge addressed in "MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks" (2604.27818) is to enable lightweight, rapid, and scenario-specific reconfiguration of MoE behavioral circuits, especially in safety-critical settings, without retraining or compromising general model utility.

MASCing: Framework Overview

MASCing introduces a three-phase, training-free pipeline for steering MoE model behavior:

  1. Sequential Modeling of Routing Behavior: A lightweight LSTM surrogate model is trained on continuous, unnormalized expert routing logits across sequences and layers. Unlike discrete top-k selection, this preserves granular expert involvement signals and enables temporal modeling of behavioral dependencies. The LSTM is optimized to classify routing patterns leading to target behaviors (e.g., refusal or compliance).
  2. Steering Mask Creation: The surrogate informs the optimization of a steering matrix, identifying which experts (and in which layers) are most predictive of safety-relevant behaviors. L1 regularization and symmetric pruning convert the dense matrix into a sparse steering mask, focusing intervention on the most behaviorally catalytic experts.
  3. Steering Mask Application: At inference, static steering masks are added to routing logits. This directly overrides MoE gate decisions, selectively enhancing or suppressing activation of target expert circuits. The degree of intervention is modulated to balance safety and utility.

This approach leverages the linear representation hypothesis to effect activation interventions via routing space, providing fine-grained behavioral control without altering model weights.

Experimental Evaluation: Defensive and Permissive Safety Reconfiguration

MASCing is evaluated across seven open-source MoE LLMs, targeting two antithetical safety objectives:

  • Multi-turn Jailbreak Defense: Models often fail to resist adversarial, context-fragmented jailbreaks across extended conversational interactions. MASCing improves average defense rates from 52.5% (unsteered baseline) to 83.9% post-steering, with some models achieving up to 89.2%. Importantly, MASCing enables semantically relevant, on-topic refusals rather than generic refusals, affirming nuanced safety engagement.
  • Contextual Compliance for Adult-Content Generation: Recent deployment policies permit adult-content generation in verified, controlled contexts. MASCing steers models to comply with such requests, increasing success rates from 52.6% to 82.0%, with maxima reaching 93.0%. The intervention is domain-specific and avoids broad collapse of safety guardrails.

A key claim is MASCing's bidirectional flexibility: it can strengthen or relax safety boundaries with minimal overhead, supporting rapid adaptation to evolving deployment requirements.

Utility Preservation and Tradeoffs

While steering inherently modifies MoE internals, MASCing preserves general language utility. Aggregate declines in MMLU and GSM8K benchmark accuracy are modest (average 4.1%), with all models retaining high factual recall and multi-step reasoning capabilities. Hyperparameter analysis shows a critical balance: overly aggressive steering degrades coherence and reasoning, while calibrated interventions retain utility.

Comparative Analysis and Mechanistic Insights

MASCing demonstrates superior defensive performance compared to prior inference-time interventions (e.g., SteerMoE [12]). The key differentiators:

  • Surrogate Depth and Logit Space: SteerMoE and similar methods operate on discrete, terminal expert selection, missing information from near-top-k experts and temporal routing dependencies. MASCing's LSTM surrogate leverages the entire routing logit distribution and full conversation context, uncovering broader safety circuits.
  • Activation vs. Hard Expert Steering: MASCing’s continuous activation steering yields higher defensive gains than rigid top-k expert selection. Flexible logit bias preserves input-context sensitivity, avoiding the semantic rigidity of hard selection interventions.

Practical Implications and Limitations

MASCing provides a practical mechanism for real-time, scenario-specific MoE safety configuration:

  • Computational Efficiency: Steering mask training via the surrogate LSTM completes within minutes (on a single H100 GPU), and inference-time mask application introduces negligible latency.
  • Deployment Adaptability: Developers can rapidly shift model safety posture (defensive or permissive) in response to new threats or policy changes without retraining.

Limitations remain: surrogate modeling fidelity may diminish in extreme architectures; interventions are limited to routing-level corrections; static masks are potentially less robust against novel, distribution-shifting jailbreaks. The method assumes that experts themselves are capable of aligned behavior—if experts are fundamentally corrupted, routing steering alone is insufficient.

Theoretical and Future Directions

MASCing’s framework generalizes beyond safety and could be extended to dynamic, input-adaptive mask optimization, domain adaptation, hallucination control, or more granular mechanistic model interventions. Bridging activation steering at the routing and attention-head levels may enable unified control over sparse and dense transformer components. Further exploration of prompt-dependent mask prediction—e.g., with real-time classifiers—could deliver even more resilient and context-aware model steering.

Conclusion

MASCing provides a technical advance in the safety control of MoE LLMs, offering a lightweight, adaptable mechanism for scenario-specific behavioral steering. Leveraging an LSTM surrogate on routing logits allows precise identification and manipulation of safety circuits, with empirical results demonstrating robust improvement in both defensive and permissive safety tasks across diverse MoE architectures. The framework maintains model utility, operates with negligible computational overhead, and stands as a practical tool for developers to align MoE models with rapidly evolving policies and threat landscapes (2604.27818).

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.