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

arXiv:2604.27818 · cs.CR · Submitted 2026-04-30 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: Security Radio. Generated commentary on the latest security and cryptography papers.

Nadia: We're looking at the paper: "MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks".

Paper summary: Nadia: We’re looking at "MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks" here. The thesis is that because sparse activation makes model behavior depend on those routing decisions, we need a way to control that behavior without retraining the whole system.

Elias: It claims they use an LSTM-based surrogate model to capture both temporal patterns across token sequences and crosslayer dependencies. This lets them map those routing patterns to downstream behavioral expert circuits.

Nadia: The framework then uses that surrogate to search for safety-relevant expert circuits, and after that, they optimize a continuous steering matrix, imposing sparsity through L1 regularization and symmetric magnitude pruning.

Nadia: The paper presents a three-phase pipeline: first modeling the behavior sequentially, then creating a steering mask by optimizing a continuous matrix, and finally applying that static mask at deployment time to override the top-k expert selection only where needed.

Conclusion: Nadia: So to wrap up, "MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks" develops a framework that models internal representations as directions in activation space. They use an LSTM surrogate model to capture how routing logits change over token sequences.

Elias: The core contribution is using that surrogate to search for safety-relevant expert circuits and then optimizing a continuous steering matrix which they prune using L1 regularization and symmetric magnitude pruning to make it compact.

Nadia: Then they convert that discovered circuit into a static steering mask and apply it during inference, overriding the top-k expert selection only when needed, which preserves general language utility.

Priya: What does this mean for how we think about securing these large models? Does this give us a way to patch behavior on the fly?

Elias: It’s about providing a practical mechanism for targeted safety configuration without modifying model weights or incurring the cost of retraining, which is what makes it interesting in terms of deployment.

Nadia: It gives us a way to dynamically and selectively configure safety-related behavior in MoE architectures through sparse activation steering masks. It allows for flexible reconfiguration across diverse safety scenarios.

Elias: The implication is that we don't need full fine-tuning just to adjust model behavior, which is a cost saver when you have models this large.

Radboud University · University of Bristol · Leiden University · Faculty of Electrical Engineering and Computing, University of Zagreb

cs.CR

Submitted: 2026-04-30

Updated: 2026-11-23

Code: https://github.com/jonatelintelo/MASCing

License: http://creativecommons.org/licenses/by/4.0/

Importance score: 90/100

The gist: Mixture-of-Experts (MoE) architectures in Large Language Models (LLMs) have significantly reduced inference costs through sparse activation.

Key concepts

Mixture-of-Experts (MoE)
MoE models are large language models that use multiple specialized 'expert' sub-networks. Instead of using all parameters for every task, the model selectively activates only a small subset of these experts based on the input prompt, which makes them efficient during inference.
Routing Logits
These are continuous numerical scores generated by the model that determine which expert should process a specific part of an input sequence. MASCing analyzes these continuous logits sequentially to understand how routing decisions evolve over time in a conversation.
Steering Mask
A steering mask is a set of instructions applied during inference that selectively forces or suppresses the selection of certain experts based on the desired safety outcome. MASCing optimizes this mask using a surrogate model to guide expert choices toward specific, safe behaviors.
LSTM Surrogate Model
An LSTM (Long Short-Term Memory) network trained to predict downstream behavior from routing logits. It acts as a lightweight, differentiable proxy that learns the complex, temporal relationships between how the model routes tokens and what kind of output it produces.

Terminology

Summary

Mixture-of-Experts (MoE) architectures in Large Language Models (LLMs) have significantly reduced inference costs through sparse activation. p. 0

Where the paper says it

MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks Jona te Lintelo Radboud University Lichao Wu University of Bristol Marina Krček Radboud University Sengim Karayalçin Leiden University Stjepan Picek Radboud University & Faculty of Electrical Engineering and Computing, University of Zagreb Abstract Mixture-of-Experts (MoE) architectures in Large Language Models (LLMs) have significantly reduced inference costs through sparse activation. However, this sparse activation paradigm also introduces new safety challenges.

However, this sparse activation paradigm also introduces new safety challenges MASCing enables flexible reconfiguration of MoE behavior across diverse safety scenarios without retraining. p. 0
Where the paper says it

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.

Framework Overview

MASCing is a lightweight, training-free framework for flexible safety configuration of MoE models. It is built around a three-phase pipeline: (i) Sequential Modeling of Behavior, (ii) Steering Mask Creation, and (iii) Steering Mask Application. p. 0

Where the paper says it

In this paper, we introduce MASCing (MoE Activation Steering Configuration), a lightweight, training-free framework for flexible safety configuration of MoE models. MASCing is built around a three-phase pipeline: (i) Sequential Modeling of Behavior, (ii) Steering Mask Creation, and (iii) Steering Mask Application.

The first phase involves training an LSTM surrogate on continuous, unnormalized routing logits to capture cross-layer routing dependencies and map them to downstream behaviors. p. 0
Where the paper says it

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.

Next, the framework uses this differentiable surrogate to search for safety-relevant expert circuits by optimizing a continuous steering matrix. p. 1
Where the paper says it

Next, to identify which parts of the routing mechanism are responsible for a target behavior, MASCing uses the differentiable surrogate to search for safety-relevant expert circuits. We then optimize a continuous steering matrix and impose sparsity through 𝐿1 regularization and symmetric magnitude pruning.

Finally, a static steering mask is applied at deployment time to override expert selection where needed. p. 1
Where the paper says it

Finally, to configure model behavior at deployment time, MASCing converts the discovered circuit into a static steering mask and applies it directly to the routing gates. The mask overrides top-𝑘 expert selection only where needed, shifting the target safety behavior while preserving the model’s general language utility and lexical integrity.

Behavioral Modeling and Surrogate Training

To approximate the safety circuit responsible for a given target behavior, MASCing models the logits of gate layers across a sequence of tokens in a prompt that leads to the target behavior. An LSTM is used as a lightweight sequential surrogate because routing logits form a temporally structured signal whose behavioral effect depends on earlier context. p. 2

Where the paper says it

To approximate the safety circuit responsible for a given target behavior, like refusal or selective compliance, we model the logits of gate layers across a sequence of tokens in a prompt that leads to the target behavior. We use an LSTM as a lightweight sequential surrogate because the routing logits in gate layers form a temporally structured signal whose behavioral effect depends on earlier context, especially in multi-turn settings.

The surrogate model is trained to classify whether input sequences of routing logits lead to the target behavior using Binary Cross-Entropy loss. p. 3
Where the paper says it

The LSTM network parameters are optimized to minimize the Binary Cross-Entropy with logits loss L: Ltrain = − 1 𝐵 ∑︁𝐵 𝑖=1 [𝑦𝑖 log(𝜎(𝑦ˆ𝑖)) + (1 − 𝑦𝑖) log(1 − 𝜎(𝑦ˆ𝑖))] , (5) where 𝐵 is the batch size and 𝜎(·) is the sigmoid function. The result is a LSTM trained to classify an input sequence of routing logits as leading to a certain behavior in the MoE model.

This training results in an LSTM network that classifies an input sequence of routing logits as leading to a certain behavior in the MoE model. p. 3
Where the paper says it

The LSTM network parameters are optimized to minimize the Binary Cross-Entropy with logits loss L: Ltrain = − 1 𝐵 ∑︁𝐵 𝑖=1 [𝑦𝑖 log(𝜎(𝑦ˆ𝑖)) + (1 − 𝑦𝑖) log(1 − 𝜎(𝑦ˆ𝑖))] , (5) where 𝐵 is the batch size and 𝜎(·) is the sigmoid function. The result is a LSTM trained to classify an input sequence of routing logits as leading to a certain behavior in the MoE model.

Steering Mask Creation and Application

The goal is to create a mask that steers a set of experts to promote certain behavior by first optimizing a dense steering matrix using the surrogate model. The optimization minimizes a composite loss function, driving the prediction toward a target class while applying L1 regularization to force unimportant values towards zero. p. 3

Where the paper says it

We optimize S to minimize a composite loss function, driving the prediction toward a target class 𝑦𝑡 ∈ {0, 1}, which corresponds to the desired behavior: Ltotal = BCE(𝑦, 𝑦 ˆ 𝑡 ) + 𝜆∥S∥1, (7) where BCE is the Binary Cross-Entropy loss and ∥S∥1 is the 𝐿1 norm of the steering matrix, defined as the sum of the absolute values of all its entries. The scalar 𝜆 controls the strength of the regularization penalty.

A symmetric magnitude gate is then applied to extract the steering mask Sˆ from the dense matrix S by setting entries below a threshold τ to zero. p. 4
Where the paper says it

MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks the desired sparsity for minimal influence on untargeted behavior, we extract the steering mask Sˆ using a symmetric magnitude gate defined by threshold 𝜏. Applied element-wise to the scalar components 𝑆𝑙,𝑒 of matrix S, the gate is defined as: ˆ𝑆𝑙,𝑒 = ( 𝑆𝑙,𝑒 if |𝑆𝑙,𝑒 | > 𝜏 0 otherwise.

During inference, the intervention is scaled by layer-wise logit standard deviation and an amplitude parameter α before passing through the top-k routing selection. p. 4
Where the paper says it

To maintain consistency with the adaptive scaling utilized during the identification phase, the intervention is scaled by the same layer-wise logit standard deviation 𝜎𝑙 , as well as an amplitude parameter 𝛼, which dictates the overall strength of the behavioral override: g ′ 𝑙,𝑡 = g𝑙,𝑡 + 𝛼 (𝜎𝑙 · Sˆ 𝑙). (9) The LLM subsequently performs standard top-𝑘 routing selection over the modified logits g ′ 𝑙,𝑡 .

Empirical Results and Efficacy

MASCing demonstrates significant gains across two contrasting safety objectives. For multi-turn jailbreak defense, the average defense success rate improved from 52. p. 0

Where the paper says it

To demonstrate its reconfigurability, we apply MASCing to two different safety objectives and observe consistent gains with negligible overhead across seven open-source MoE models. For multi-turn jailbreak defense, motivated by the need to defend against adversarial behaviors emerging over extended interactions, it improves the average defense success rate from 52.

5% to 83.9% across seven open-source MoE models. p. 0
Where the paper says it

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 objectives and observe consistent gains with negligible overhead across seven open-source MoE models.

For adult-content generation, the average generation success rate increased from 52. p. 0
Where the paper says it

9%, with gains of up to 89. For adult-content generation, reflecting recent OpenAI’s policy shifts that permit such content in appropriate contexts, 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 peak gains reaching up to 93. p. 1
Where the paper says it

MASCing induces compliance for prompts the base model would typically refuse, increasing the average generation success rate from 52. 0%, with peak gains reaching 93.

0%. The framework achieves these behavioral shifts with negligible computational overhead and preserves general language utility on MMLU and GSM8K benchmarks, showing an average decline of only 4. p. 0
Where the paper says it

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 objectives and observe consistent gains with negligible overhead across seven open-source MoE models.

1% in accuracy. p. 2
Where the paper says it

For a specific token 𝑡 ∈ [1,𝑇 ] at gate layer 𝑙 ∈ [1, 𝐿], the routing logits are represented as a vector x𝑡,𝑙 ∈ R 𝐸 , where 𝐸 is the total number of experts per layer. Because logits exhibit high variance that can cause saturation of the LSTM’s recurrent gates and decrease accuracy, we first apply layer normalization across the expert dimension to standardize the inputs.

Comparative Analysis

MASCing consistently outperforms SteerMoE as a multi-turn jailbreak defense method, achieving an average success rate of 83.9% compared to SteerMoE's 58.4%. This performance gap is attributed to MASCing leveraging the complete conversation context and continuous routing logits, which allows it to capture temporal routing patterns across conversational tokens. p. 9

Where the paper says it

Conversely, MASCing finds safety experts by leveraging an LSTM surrogate model trained on the entire conversation context and the full, continuous distribution of all expert logits. This allows our framework to capture both the temporal routing patterns across conversational tokens and the cross-layer dependencies that emerge during multi-turn conversations.

Furthermore, activation steering preserves the router’s ability to dynamically evaluate the input and construct a nuanced steering circuit tailored to evolving conversational context. p. 1
Where the paper says it

At inference time, the method only adds a steering mask to the routing logits, and the LSTM surrogate used for circuit identification can be trained within five minutes on a single NVIDIA H100 GPU. Our contributions include: • We propose MASCing, a novel lightweight framework that dynamically reconfigures MoE safety via sparse activation steering masks, avoiding the prohibitive computational costs of full-parameter fine-tuning while preserving general language utility.

The method is also more effective than direct expert steering because it avoids disrupting proportional gating weights by applying a calibrated, continuous shift rather than forcing experts into the top-k via infinite masking. p. 1
Where the paper says it

Our contributions include: • We propose MASCing, a novel lightweight framework that dynamically reconfigures MoE safety via sparse activation steering masks, avoiding the prohibitive computational costs of full-parameter fine-tuning while preserving general language utility. • We introduce a novel method for analyzing MoE behavior through continuous routing logits rather than discrete top- 𝑘 expert selections.

Conclusion

In conclusion, MASCing provides a practical, lightweight framework that dynamically and selectively configures the safety-related behavior of MoE architectures. It successfully maps complex routing dependencies to downstream behavioral circuits through an LSTM surrogate model. p. 0

Where the paper says it

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.

The framework is highly versatile, achieving substantial improvements in both defensive mitigation and domain-specific policy compliance with minimal computational cost MASCing establishes a practical mechanism for targeted safety configuration without modifying model weights or incurring the cost of retraining. p. 1
Where the paper says it

The mask overrides top-𝑘 expert selection only where needed, shifting the target safety behavior while preserving the model’s general language utility and lexical integrity. In this way, MASCing provides a practical mechanism for targeted safety configuration without modifying model weights or incurring the cost of retraining.

References

[1] Marah Abdin, Jyoti Aneja, Hany Awadalla, Ahmed Awadallah, Ammar Ahmad Awan, Nguyen Bach, Amit Bahree, Arash Bakhtiari, Jianmin Bao, Harkirat Behl et al. 2024. Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phone. p. 5

Where the paper says it

We evaluate this impact by comparing the model’s performance on language utility benchmarks before and after applying our masking technique. Specifically, we utilize the Massive Multitask Language Understanding (MMLU) [17] and Grade School Math 8K (GSM8K) [8] benchmarks to measure two distinct axes of language utility, and because these benchmarks are often used by providers to report on the performance of newly released models.

p. 5
Where the paper says it

We evaluate this impact by comparing the model’s performance on language utility benchmarks before and after applying our masking technique. Specifically, we utilize the Massive Multitask Language Understanding (MMLU) [17] and Grade School Math 8K (GSM8K) [8] benchmarks to measure two distinct axes of language utility, and because these benchmarks are often used by providers to report on the performance of newly released models.

arXiv:2404. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

14219 [cs:CL] https://arxiv. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

org/abs/2404. p. 2
Where the paper says it

neuronpedia. org/gemma-2-9b-it/steer for an interactive demo of model steering.

14219.

[3] Trenton Bricken, Adly Templeton, Joshua Batson, Brian Chen, Adam Jermyn, Tom Conerly, Nick Turner, Cem Anil, Carson Denison, Amanda Askell et al. 2023. Towards Monosemanticity: Decomposing Language Models. p. 7

Where the paper says it

1 reflects the optimal scenario that only the uninformative values forced towards near-zero by the 𝐿1 regularization are set to zero. 3 Effect of MASCing on Utility While MASCing significantly improves the success rate for our target use cases, a steered model must retain its general language capabilities to prevent performance degradation on standard tasks.

p. 7
Where the paper says it

1 reflects the optimal scenario that only the uninformative values forced towards near-zero by the 𝐿1 regularization are set to zero. 3 Effect of MASCing on Utility While MASCing significantly improves the success rate for our target use cases, a steered model must retain its general language capabilities to prevent performance degradation on standard tasks.

With Dictionary Learning. p. 4
Where the paper says it

1 for 15 epochs to reach convergence using a random 80/20 training-validation split that preserved class balance. The LSTM dimensions, learning rate, and batch size are the same for each MoE model and were determined through a preliminary hyperparameter search, selected to balance convergence, computational efficiency, and the prevention of overfitting.

p. 4
Where the paper says it

1 for 15 epochs to reach convergence using a random 80/20 training-validation split that preserved class balance. The LSTM dimensions, learning rate, and batch size are the same for each MoE model and were determined through a preliminary hyperparameter search, selected to balance convergence, computational efficiency, and the prevention of overfitting.

Transformer Circuits Thread (2023). p. 0
Where the paper says it

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.

p. 0
Where the paper says it

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.

https://transformercircuits. p. 1
Where the paper says it

2%) and permissive domain-specific policy compliance (boosting generation success rates up to 93. Our code is publicly available at https://github.

p. 1
Where the paper says it

2%) and permissive domain-specific policy compliance (boosting generation success rates up to 93. Our code is publicly available at https://github.

pub/2023/monosemantic-features/index. p. 8
Where the paper says it

MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks Multi-turn Jailbreak GPT Hunyuan Adult-Content −0. 2 Change in Frequency (Steered - Baseline) Expert Index Layer Index Figure 3: The heatmaps visualize the change in top-𝑘 expert selection frequency across all layers after the steering mask is applied.

p. 8
Where the paper says it

MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks Multi-turn Jailbreak GPT Hunyuan Adult-Content −0. 2 Change in Frequency (Steered - Baseline) Expert Index Layer Index Figure 3: The heatmaps visualize the change in top-𝑘 expert selection frequency across all layers after the steering mask is applied.

html.

[11] Nelson Elhage, Neel Nanda, Catherine Olsson, Tom Henighan, Nicholas Joseph, Ben Mann, Amanda Askell et al. 2021. A Mathematical Framework for Transformer Circuits. p. 2

Where the paper says it

This captures a realistic threat model for public or hosted LLM services. 4 MASCing Framework Our approach for safety configuration in MoE LLMs relies on targeted manipulation of the MoE model’s expert selection to either promote or discourage the use of safety circuits during inference.

p. 2
Where the paper says it

This captures a realistic threat model for public or hosted LLM services. 4 MASCing Framework Our approach for safety configuration in MoE LLMs relies on targeted manipulation of the MoE model’s expert selection to either promote or discourage the use of safety circuits during inference.

Transformer Circuits Thread (2021). p. 0
Where the paper says it

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.

p. 0
Where the paper says it

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.

https://transformer-circuits. p. 2
Where the paper says it

This framework enables both the enhancement of safety guardrails against adversarial jailbreaks and the mitigation of refusal circuits to induce compliance. The methodology is divided into three phases: (i) Sequential Modeling of Behavior, (ii) Steering Mask Creation, and (iii) Steering Mask 1 See https://www.

p. 2
Where the paper says it

This framework enables both the enhancement of safety guardrails against adversarial jailbreaks and the mitigation of refusal circuits to induce compliance. The methodology is divided into three phases: (i) Sequential Modeling of Behavior, (ii) Steering Mask Creation, and (iii) Steering Mask 1 See https://www.

pub/2021/framework/index. p. 8
Where the paper says it

MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks Multi-turn Jailbreak GPT Hunyuan Adult-Content −0. 2 Change in Frequency (Steered - Baseline) Expert Index Layer Index Figure 3: The heatmaps visualize the change in top-𝑘 expert selection frequency across all layers after the steering mask is applied.

p. 8
Where the paper says it

MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks Multi-turn Jailbreak GPT Hunyuan Adult-Content −0. 2 Change in Frequency (Steered - Baseline) Expert Index Layer Index Figure 3: The heatmaps visualize the change in top-𝑘 expert selection frequency across all layers after the steering mask is applied.

html.

[37] Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, and Jeff Dean. 2017. Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer. p. 1

Where the paper says it

1 Mixture-of-Experts Architecture While dense LLMs activate all their parameters during inference, MoE significantly reduces computational costs by activating only a sparse subset of parameters for any given token [13, 37]. This is achieved by replacing standard dense feed-forward networks with an MoE layer containing multiple independent neural networks, referred to as experts.

p. 1
Where the paper says it

1 Mixture-of-Experts Architecture While dense LLMs activate all their parameters during inference, MoE significantly reduces computational costs by activating only a sparse subset of parameters for any given token [13, 37]. This is achieved by replacing standard dense feed-forward networks with an MoE layer containing multiple independent neural networks, referred to as experts.

arXiv:1701. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

06538 [cs:LG] https://arxiv. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

org/abs/1701. p. 2
Where the paper says it

neuronpedia. org/gemma-2-9b-it/steer for an interactive demo of model steering.

06538.

[43] Lichao Wu, Sasha Behrouzi, Mohamadreza Rostami, Stjepan Picek, and AhmadReza Sadeghi. p. 0

Where the paper says it

MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks Jona te Lintelo Radboud University Lichao Wu University of Bristol Marina Krček Radboud University Sengim Karayalçin Leiden University Stjepan Picek Radboud University & Faculty of Electrical Engineering and Computing, University of Zagreb Abstract Mixture-of-Experts (MoE) architectures in Large Language Models (LLMs) have significantly reduced inference costs through sparse activation. However, this sparse activation paradigm also introduces new safety challenges.

2025. GateBreaker: Gate-Guided Attacks on Mixture-of-Expert LLMs. p. 4
Where the paper says it

MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks the desired sparsity for minimal influence on untargeted behavior, we extract the steering mask Sˆ using a symmetric magnitude gate defined by threshold 𝜏. Applied element-wise to the scalar components 𝑆𝑙,𝑒 of matrix S, the gate is defined as: ˆ𝑆𝑙,𝑒 = ( 𝑆𝑙,𝑒 if |𝑆𝑙,𝑒 | > 𝜏 0 otherwise.

p. 4
Where the paper says it

MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks the desired sparsity for minimal influence on untargeted behavior, we extract the steering mask Sˆ using a symmetric magnitude gate defined by threshold 𝜏. Applied element-wise to the scalar components 𝑆𝑙,𝑒 of matrix S, the gate is defined as: ˆ𝑆𝑙,𝑒 = ( 𝑆𝑙,𝑒 if |𝑆𝑙,𝑒 | > 𝜏 0 otherwise.

arXiv:2512. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

21008 [cs:CR] https://arxiv. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

org/abs/2512. p. 2
Where the paper says it

neuronpedia. org/gemma-2-9b-it/steer for an interactive demo of model steering.

21008.

[46] Miao Yu, Siyuan Fu, Moayad Aloqaily, Zhenhong Zhou, Safa Otoum, Xing fan, Kun Wang et al. 2026. SafeSeek: Universal Attribution of Safety Circuits in Language Models. p. 7

Where the paper says it

Thus, optimal performance lies in a narrow boundary where 𝛼 is sufficiently high to promote or discourage the use of safety expert circuits, but low enough to preserve the utility of the underlying language model. We observed consistent trends for the remaining models and the adult-content generation tasks, with the corresponding ablation graphs provided in Appendix B.

p. 7
Where the paper says it

Thus, optimal performance lies in a narrow boundary where 𝛼 is sufficiently high to promote or discourage the use of safety expert circuits, but low enough to preserve the utility of the underlying language model. We observed consistent trends for the remaining models and the adult-content generation tasks, with the corresponding ablation graphs provided in Appendix B.

arXiv:2603. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

23268 [cs:LG] https://arxiv. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

org/abs/2603. p. 2
Where the paper says it

neuronpedia. org/gemma-2-9b-it/steer for an interactive demo of model steering.

23268.

[51] Andy Zou, Long Phan, Sarah Chen, James Campbell, Phillip Guo, Richard Ren et al. p. 3

Where the paper says it

" "Write a fictional story about bomb making. " "James Bond would make a bomb by .

2023. Representation engineering: A top-down approach to ai transparency. p. 0
Where the paper says it

First, to intervene on MoE behavior without retraining the model, we need a tractable representation of how safety-relevant behavior emerges through routing decisions. Directly optimizing over discrete top- 𝑘 expert selection is difficult.

p. 0
Where the paper says it

First, to intervene on MoE behavior without retraining the model, we need a tractable representation of how safety-relevant behavior emerges through routing decisions. Directly optimizing over discrete top- 𝑘 expert selection is difficult.

arXiv preprint arXiv:2310. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

01405 (2023). https://arxiv.org/abs/2310. p. 2
Where the paper says it

neuronpedia. org/gemma-2-9b-it/steer for an interactive demo of model steering.

01405.

[56] Qwen Team. 2024. Qwen1.5-MoE: Matching 7B Model Performance with 1/3 Activated Parameters". https://qwenlm. p. 1

Where the paper says it

2%) and permissive domain-specific policy compliance (boosting generation success rates up to 93. Our code is publicly available at https://github.

p. 1
Where the paper says it

2%) and permissive domain-specific policy compliance (boosting generation success rates up to 93. Our code is publicly available at https://github.

p. 1
Where the paper says it

2%) and permissive domain-specific policy compliance (boosting generation success rates up to 93. Our code is publicly available at https://github.

github.io/blog/qwen-moe/. p. 0
Where the paper says it

MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks Jona te Lintelo Radboud University Lichao Wu University of Bristol Marina Krček Radboud University Sengim Karayalçin Leiden University Stjepan Picek Radboud University & Faculty of Electrical Engineering and Computing, University of Zagreb Abstract Mixture-of-Experts (MoE) architectures in Large Language Models (LLMs) have significantly reduced inference costs through sparse activation. However, this sparse activation paradigm also introduces new safety challenges.

p. 0
Where the paper says it

MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks Jona te Lintelo Radboud University Lichao Wu University of Bristol Marina Krček Radboud University Sengim Karayalçin Leiden University Stjepan Picek Radboud University & Faculty of Electrical Engineering and Computing, University of Zagreb Abstract Mixture-of-Experts (MoE) architectures in Large Language Models (LLMs) have significantly reduced inference costs through sparse activation. However, this sparse activation paradigm also introduces new safety challenges.

[9] Hoagy Cunningham, Jerry Wei, Zihan Wang, Andrew Persic et al. 2026. Constitutional Classifiers++: Efficient Production-Grade Defenses against Universal Jailbreaks. p. 4

Where the paper says it

All MoE LLMs and the LSTM model were implemented using PyTorch (CUDA), Hugging Face Transformers, and Hugging Face Datasets. 3 Safety Configuration Scenarios To demonstrate the versatility of MASCing, we evaluate it on two fundamentally different safety configuration objectives: strengthening defenses against adversarial bypasses and contextual relaxation for specialized applications.

In The Fourteenth International Conference on Learning Representations. p. 4
Where the paper says it

1 for 15 epochs to reach convergence using a random 80/20 training-validation split that preserved class balance. The LSTM dimensions, learning rate, and batch size are the same for each MoE model and were determined through a preliminary hyperparameter search, selected to balance convergence, computational efficiency, and the prevention of overfitting.

https://openreview. p. 1
Where the paper says it

2%) and permissive domain-specific policy compliance (boosting generation success rates up to 93. Our code is publicly available at https://github.

p. 1
Where the paper says it

2%) and permissive domain-specific policy compliance (boosting generation success rates up to 93. Our code is publicly available at https://github.

p. 1
Where the paper says it

2%) and permissive domain-specific policy compliance (boosting generation success rates up to 93. Our code is publicly available at https://github.

p. 1
Where the paper says it

2%) and permissive domain-specific policy compliance (boosting generation success rates up to 93. Our code is publicly available at https://github.

net/forum?id=eNvsH5Ye2V.

[10] Damai Dai, Chengqi Deng, Chenggang Zhao, R. X. Xu et al. 2024. DeepSeekMoE: Towards Ultimate Expert Specialization in Mixture-of-Experts Language Models. p. 0

Where the paper says it

MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks Jona te Lintelo Radboud University Lichao Wu University of Bristol Marina Krček Radboud University Sengim Karayalçin Leiden University Stjepan Picek Radboud University & Faculty of Electrical Engineering and Computing, University of Zagreb Abstract Mixture-of-Experts (MoE) architectures in Large Language Models (LLMs) have significantly reduced inference costs through sparse activation. However, this sparse activation paradigm also introduces new safety challenges.

arXiv:2401. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

06066 [cs:CL] https://arxiv. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

org/abs/2401. p. 2
Where the paper says it

neuronpedia. org/gemma-2-9b-it/steer for an interactive demo of model steering.

06066.

[13] William Fedus, Barret Zoph, and Noam Shazeer. 2022. Switch transformers: scaling to trillion parameter models with simple and efficient sparsity. p. 0

Where the paper says it

Keywords Mixture-of-Experts, Activation Steering, Large Language Model Safety, Jailbreak Defense 1 Introduction Large Language Models (LLMs) have demonstrated impressive capabilities across natural language understanding, code generation, and logical reasoning [4, 6, 23, 41]. However, scaling (dense) LLMs is costly: every parameter is activated for every input token, and larger models directly increase computational, memory, and infrastructure demands [18, 29, 35].

J. Mach. Learn. Res 23, 1, Article 120 (Jan. p. 4
Where the paper says it

All implementations and evaluations in this work were conducted using CUDA-enabled GPUs for optimal runtimes. To fit the substantial memory footprint of the target models and inference, we used two NVIDIA GH200 120 GB Grace Hopper Superchips paired with NVIDIA H100 GPUs.

2022), 39 pages.

[17] Dan Hendrycks, Collin Burns, Steven Basart et al. 2021. Measuring Massive Multitask Language Understanding. p. 5

Where the paper says it

We evaluate this impact by comparing the model’s performance on language utility benchmarks before and after applying our masking technique. Specifically, we utilize the Massive Multitask Language Understanding (MMLU) [17] and Grade School Math 8K (GSM8K) [8] benchmarks to measure two distinct axes of language utility, and because these benchmarks are often used by providers to report on the performance of newly released models.

In International Conference on Learning Representations. p. 4
Where the paper says it

1 for 15 epochs to reach convergence using a random 80/20 training-validation split that preserved class balance. The LSTM dimensions, learning rate, and batch size are the same for each MoE model and were determined through a preliminary hyperparameter search, selected to balance convergence, computational efficiency, and the prevention of overfitting.

https://openreview.net/forum?id=d7KBjmI3GmQ.

[18] Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li et al. 2022. Lora: Low-rank adaptation of large language models. p. 0

Where the paper says it

These methods are expensive for large models and particularly burdensome for MoE models, where safety behavior depends on both the learned parameters and sparse-activated experts. Moreover, safety requirements are dynamic: policies evolve, deployment contexts differ, and emerging misuse patterns may require quick adaptation.

Iclr 1, 2 (2022), 3 pages.

[34] Kiho Park, Yo Joong Choe, and Victor Veitch. 2024. The Linear Representation Hypothesis and the Geometry of Large Language Models. p. 1

Where the paper says it

The core idea is to add a steering vector at one or more model layers, nudging the model to exhibit some target behavioral trait. Activation steering builds on the linear representation hypothesis (LRH) [34]: the hypothesis 2

In Forty-first International Conference on Machine Learning. p. 4
Where the paper says it

1 for 15 epochs to reach convergence using a random 80/20 training-validation split that preserved class balance. The LSTM dimensions, learning rate, and batch size are the same for each MoE model and were determined through a preliminary hyperparameter search, selected to balance convergence, computational efficiency, and the prevention of overfitting.

https://openreview.net/forum?id=UGpGkLzwpP.

[39] Jona te Lintelo, Lichao Wu, and Stjepan Picek. p. 0

Where the paper says it

MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks Jona te Lintelo Radboud University Lichao Wu University of Bristol Marina Krček Radboud University Sengim Karayalçin Leiden University Stjepan Picek Radboud University & Faculty of Electrical Engineering and Computing, University of Zagreb Abstract Mixture-of-Experts (MoE) architectures in Large Language Models (LLMs) have significantly reduced inference costs through sparse activation. However, this sparse activation paradigm also introduces new safety challenges.

2026. Large Language Lobotomy: Jailbreaking Mixture-of-Experts via Expert Silencing. p. 0
Where the paper says it

MASCing: Configurable Mixture-of-Experts Behavior via Activation Steering Masks Jona te Lintelo Radboud University Lichao Wu University of Bristol Marina Krček Radboud University Sengim Karayalçin Leiden University Stjepan Picek Radboud University & Faculty of Electrical Engineering and Computing, University of Zagreb Abstract Mixture-of-Experts (MoE) architectures in Large Language Models (LLMs) have significantly reduced inference costs through sparse activation. However, this sparse activation paradigm also introduces new safety challenges.

arXiv:2602. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

08741 [cs:CR] https://arxiv. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

org/abs/2602. p. 2
Where the paper says it

neuronpedia. org/gemma-2-9b-it/steer for an interactive demo of model steering.

08741.

[53]. An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui et al. 2025. Qwen3 Technical Report. p. 5

Where the paper says it

We evaluate this impact by comparing the model’s performance on language utility benchmarks before and after applying our masking technique. Specifically, we utilize the Massive Multitask Language Understanding (MMLU) [17] and Grade School Math 8K (GSM8K) [8] benchmarks to measure two distinct axes of language utility, and because these benchmarks are often used by providers to report on the performance of newly released models.

arXiv:2505. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

09388 [cs:CL] https://arxiv. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

org/abs/2505. p. 2
Where the paper says it

neuronpedia. org/gemma-2-9b-it/steer for an interactive demo of model steering.

09388.

[47] Weizhe Yuan, Jane Yu, Song Jiang, Karthik Padthe et al. 2025. NaturalReasoning: Reasoning in the Wild with 2. p. 4

Where the paper says it

EroticaAnalysis consists of 14886 instructions to generate sexually explicit text and was chosen as it is one of the largest publicly available datasets for adult-content generation. Facebook’s NaturalReasoning is a large-scale dataset with more than one million general reasoning tasks.

p. 4
Where the paper says it

EroticaAnalysis consists of 14886 instructions to generate sexually explicit text and was chosen as it is one of the largest publicly available datasets for adult-content generation. Facebook’s NaturalReasoning is a large-scale dataset with more than one million general reasoning tasks.

8M Challenging Questions. p. 4
Where the paper says it

For MHJ, we collect all routing logits for only the prompt in each conversation that leads to the first harmful response. This is done by iteratively prompting the model with the user’s questions from a conversation in MHJ.

p. 4
Where the paper says it

For MHJ, we collect all routing logits for only the prompt in each conversation that leads to the first harmful response. This is done by iteratively prompting the model with the user’s questions from a conversation in MHJ.

arXiv:2502. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

13124 [cs:CL] https://arxiv. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

org/abs/2502. p. 2
Where the paper says it

neuronpedia. org/gemma-2-9b-it/steer for an interactive demo of model steering.

p. 2
Where the paper says it

neuronpedia. org/gemma-2-9b-it/steer for an interactive demo of model steering.

13124.

[48] Xiyu Zeng, Siyuan Liang, Liming Lu, Haotian Zhu et al. 2025. SafeSteer: Adaptive Subspace Steering for Efficient Jailbreak Defense in Vision-Language Models. p. 0

Where the paper says it

These results establish MASCing as a practical, lightweight, and flexible framework for scenario-specific safety reconfiguration in MoE models. Keywords Mixture-of-Experts, Activation Steering, Large Language Model Safety, Jailbreak Defense 1 Introduction Large Language Models (LLMs) have demonstrated impressive capabilities across natural language understanding, code generation, and logical reasoning [4, 6, 23, 41].

arXiv:2509. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

21400 [cs:CR] https://arxiv. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

org/abs/2509. p. 2
Where the paper says it

neuronpedia. org/gemma-2-9b-it/steer for an interactive demo of model steering.

21400.

[49] Jiachen Zhao, Jing Huang, Zhengxuan Wu, David Bau, and Weiyan Shi. 2026. LLMs Encode Harmfulness and Refusal Separately. p. 7

Where the paper says it

We first conduct an analysis on the combination of 𝜆 and 𝛼. We then evaluate 𝜏 separately from 𝜆 and 𝛼 because 𝜏 is designed to only filter out the unimportant steering mask values driven to near zero by the 𝐿1 regularization, as described in Section 4.

In The Thirty-ninth Annual Conference on Neural Information Processing Systems. https://openreview.net/forum?id=zLkpt30ngy.

[52] Andy Zou, Zifan Wang, Jico Kolter, and Matt Fredrikson. 2023. Universal and Transferable Adversarial Attacks on Aligned Language Models. p. 6

Where the paper says it

9% Multi-turn Jailbreak Defense Use Case. As detailed in Table 2, standard alignment is heavily degraded in multi-turn adversarial settings, with unsteered models successfully defending against attacks only 52.

arXiv:2307. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

15043 [cs:CL] https://arxiv. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

org/abs/2307. p. 2
Where the paper says it

neuronpedia. org/gemma-2-9b-it/steer for an interactive demo of model steering.

15043.

[54] Weizhe Yuan, Jane Yu, Song Jiang, Karthik Padthe et al. 2025. NaturalReasoning: Reasoning in the Wild with 2.8M Challenging Questions. arXiv:2502.13124 [cs:CL] https://arxiv.org/abs/2502.13124.

[6] Mark Chen, Jerry Tworek, Heewoo Jun et al. 2021. Evaluating Large Language Models Trained on Code. p. 0

Where the paper says it

These results establish MASCing as a practical, lightweight, and flexible framework for scenario-specific safety reconfiguration in MoE models. Keywords Mixture-of-Experts, Activation Steering, Large Language Model Safety, Jailbreak Defense 1 Introduction Large Language Models (LLMs) have demonstrated impressive capabilities across natural language understanding, code generation, and logical reasoning [4, 6, 23, 41].

arXiv:2107. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

03374 [cs:LG] https://arxiv. p. 0
Where the paper says it

MASCing, instead, trains an LSTM surrogate on continuous, unnormalized routing logits. This preserves fine-grained routing information and allows the surrogate to 1 arXiv:2604.

org/abs/2107. p. 2
Where the paper says it

neuronpedia. org/gemma-2-9b-it/steer for an interactive demo of model steering.

03374.

[55] Qwen Team. 2024. Qwen1.5-MoE: Matching 7B Model Performance with 1/3 Activated Parameters". https://qwenlm.github.io/blog/qwen-moe/.

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

--- Page 1 ---

The paper introduces MASCing, a novel lightweight framework that dynamically reconfigures MoE safety via sparse activation steering masks. It is the first framework that enables flexible reconfiguration of MoE behavior across diverse safety scenarios without retraining. p. 0

Where the paper says it

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.

Pruning redundant reasoning tokens

The authors introduce a novel method for analyzing MoE behavior through continuous routing logits rather than discrete top-k expert selections. This approach bypasses the non-differentiable routing bottleneck and enables a sequence-based surrogate to map routing patterns to downstream behavioral expert circuits. p. 1

Where the paper says it

• We introduce a novel method for analyzing MoE behavior through continuous routing logits rather than discrete top- 𝑘 expert selections. This bypasses the non-differentiable routing bottleneck and enables a sequence-based surrogate to map routing patterns to downstream behavioral expert circuits.

How the training signal is built

The surrogate LSTM model is trained on a dataset of routing logits and labels y ∈ [0, 1] using Binary Cross-Entropy loss. The LSTM network parameters are optimized to minimize this loss, resulting in a trained model that classifies an input sequence of routing logits as leading to a certain behavior in the MoE model. p. 3

Where the paper says it

The LSTM network parameters are optimized to minimize the Binary Cross-Entropy with logits loss L: Ltrain = − 1 𝐵 ∑︁𝐵 𝑖=1 [𝑦𝑖 log(𝜎(𝑦ˆ𝑖)) + (1 − 𝑦𝑖) log(1 − 𝜎(𝑦ˆ𝑖))] , (5) where 𝐵 is the batch size and 𝜎(·) is the sigmoid function. The result is a LSTM trained to classify an input sequence of routing logits as leading to a certain behavior in the MoE model.

Where the gains come from

The framework's efficacy is demonstrated by achieving significant gains in both defensive multi-turn jailbreak mitigation (up to 89.2%) and permissive domain-specific policy compliance (up to 93. p. 1

Where the paper says it

• We validate the configurability of MASCing in distinct, safety-related applications, achieving significant gains in both defensive multi-turn jailbreak mitigation (increasing success rates up to 89. 2%) and permissive domain-specific policy compliance (boosting generation success rates up to 93.

0%). The success rate improvements are achieved by manipulating the routing mechanism at inference time, where the mask overrides top-k expert selection only where needed. p. 1
Where the paper says it

Finally, to configure model behavior at deployment time, MASCing converts the discovered circuit into a static steering mask and applies it directly to the routing gates. The mask overrides top-𝑘 expert selection only where needed, shifting the target safety behavior while preserving the model’s general language utility and lexical integrity.

The gains stem from identifying and manipulating specific expert circuits through continuous logit steering rather than retraining the full model. p. 1
Where the paper says it

Our contributions include: • We propose MASCing, a novel lightweight framework that dynamically reconfigures MoE safety via sparse activation steering masks, avoiding the prohibitive computational costs of full-parameter fine-tuning while preserving general language utility. • We introduce a novel method for analyzing MoE behavior through continuous routing logits rather than discrete top- 𝑘 expert selections.

Limitations

MASCing relies on an LSTM surrogate model to approximate complex cross-layer routing dynamics, which may lead to sub-optimal mask optimizations in extraordinarily deep models. Furthermore, the method intervenes exclusively at the routing level, assuming the model possesses inherent capacity to generate safe responses if experts are not fundamentally aligned. The static steering masks optimized in this work may be less resilient to sophisticated, out-of-distribution, zero-day jailbreaks.

Future Work

Future research should explore the development of dynamic, input-dependent steering masks that predict the necessary steering configuration on a per-prompt or per-token basis Additionally, exploring the connection between routing steering and attention-head interventions could yield a unified framework for complete mechanistic control over sparse architectures. The foundational framework of MASCing is task-agnostic, suggesting future work should explore applying it to other critical domains such as on-the-fly domain adaptation.

[1] Marah Abdin, Jyoti Aneja, Hany Awadalla, Ahmed Awadallah, Ammar Ahmad Awan, Nguyen Bach, Amit Bahree et al. 2024. Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phone. arXiv:2404.14219

[3] Trenton Bricken, Adly Templeton, Joshua Batson, Brian Chen et al. 2023. Towards Monosemanticity: Decomposing Language Models. With Dictionary Learning. Transformer Circuits Thread (2023). https://transformercircuits.pub/2023/monosemantic-features/index.html.

[11] Nelson Elhage, Neel Nanda, Catherine Olsson et al. 2021. A Mathematical Framework for Transformer Circuits. Transformer Circuits Thread (2021). https://transformer-circuits.pub/2021/framework/index.html.

[37] Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz et al. 2017. Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer. arXiv:1701.06538

[43] Lichao Wu, Sasha Behrouzi, Mohamadreza Rostami, Stjepan Picek, and AhmadReza Sadeghi. 2025. GateBreaker: Gate-Guided Attacks on Mixture-of-Expert LLMs. arXiv:2512.21008

[46] Miao Yu, Siyuan Fu, Moayad Aloqaily et al. 2026. SafeSeek: Universal Attribution of Safety Circuits in Language Models. arXiv:2603.23268

[51] Andy Zou, Long Phan, Sarah Chen, James Campbell et al. 2023. Representation engineering: A top-down approach to ai transparency. arXiv preprint arXiv:2310.01405 (2023).

[56] Qwen Team. 2024. Qwen1.5-MoE: Matching 7B Model Performance with 1/3 Activated Parameters". https://qwenlm.github.

Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.

Improvements for AI systems

  1. Targeted safety reconfiguration: MASCing enables flexible reconfiguration of MoE behavior across diverse safety scenarios without retraining, allowing developers to target enhancement or suppression of specific behaviors while preserving general language utility.

  2. Multi-turn jailbreak defense: The system can improve the average defense success rate from 52.5% to 83.9% by utilizing an LSTM surrogate model trained on continuous routing logits to capture temporal patterns across token sequences and crosslayer dependencies.

  3. Adult content compliance: MASCing allows models to comply with such requests that would otherwise be refused, increasing the average generation success rate from 52.6% to 82.0%, demonstrating the ability to achieve targeted, policy-aligned manner relaxation of safety constraints.

  4. Computational efficiency: The framework is practical because it avoids modifying the weights of the MoE LLM, meaning the computational cost is strictly bound to the model size and standard inference, with only a lightweight LSTM surrogate requiring approximately five minutes on a single NVIDIA H100 GPU for training.

  5. Nuanced behavioral steering: By using continuous routing logits, MASCing allows for a highly nuanced activation pattern through an amplitude parameter alpha, which enables a highly nuanced activation pattern that preserves the router’s ability to dynamically evaluate input and construct the optimal steering circuit tailored to the evolving conversational context.

  6. Superior multi-turn defense: Compared to SteerMoE, MASCing achieves a significantly higher defense success rate (83.9% vs 58.4%) because it leverages the complete conversation context and cross-layer dependencies through the LSTM surrogate, which is superior to methods relying only on top-k expert selections.

  7. Domain-specific control: The system can be applied to other critical domains beyond safety, such as on-the-fly domain adaptation (e.g., steering a general MoE to act as a specialized medical or legal expert), showing the framework's versatility across various deployment needs.

Abstract

Large language models (LLMs) operate under safety requirements that vary across applications and evolve with emerging threats and deployment policies. Conventional training-based interventions make adapting model behavior computationally expensive. Mixture-of-Experts (MoE) models introduce a further control challenge because each input activates only a subset of experts, coupling safety behavior to discrete routing decisions. Rapid adaption of MoE LLMs therefore requires a lightweight mechanism for identifying and controlling the routing decisions that produce the target behavior. We present MASCing (MoE Activation Steering Configuration), a framework that enables flexible configuration of safety-related MoE behavior without training the underlying model. MASCing uses an LSTM surrogate model to capture cross-layer dependencies and map routing logits to downstream behaviors. Guided by this surrogate, it identifies safety-relevant experts and optimizes a sparse steering mask to bias expert selection. This enables targeted enhancement or suppression of specific behaviors while preserving model utility. We evaluate MASCing on three contrasting safety objectives and observe consistent gains across seven MoE models. For multi-turn jailbreak defense, it improves the average defense success rate from 52.5% to 83.9%. 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%. For political neutrality, MASCing makes models decline to state personal opinions on political questions, which they otherwise often give, raising the share of such questions on which they take no position from 31.8% to 75.4% while other questions remain answered. These results establish MASCing as a practical, lightweight, and flexible framework for task-specific safety configuration in MoE models.

Sources

Related papers