arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.27818cs.CR
收藏

MASCing:通过激活引导掩码实现可配置的专家混合行为

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

Radboud University(拉德堡德大学);University of Bristol(布里斯托大学);Leiden University(莱顿大学);Faculty of Electrical Engineering and Computing, University of Zagreb(萨格勒布大学电气工程和计算学院)

Jona te Lintelo, Lichao Wu, Marina Krček, Sengim Karayalçin, Stjepan Picek

AI总结:

MASCing通过LSTM模型捕捉跨层路由依赖,利用引导矩阵优化专家电路,实现无需重新训练的MoE行为灵活重构,提升安全场景下的模型性能。

摘要:

混合专家(MoE)架构在大语言模型(LLMs)中通过稀疏激活显著降低了推理成本。然而,这种稀疏激活范式也引入了新的安全挑战。由于每个输入只激活部分专家,模型行为与路由决策耦合,导致难以控制的机制,可能在安全相关场景中变化。同时,通过完全微调或重新训练调整模型行为成本高昂,尤其当开发者需要快速配置同一模型以适应不同安全目标时。我们提出了MASCing(MoE激活引导配置),首个能跨多样安全场景灵活重构MoE行为而无需重新训练的框架。MASCing使用基于LSTM的替代模型捕捉跨层路由依赖,并将路由日志映射到下游行为。然后优化引导矩阵以识别行为相关的专家电路,并在推理时应用引导掩码覆盖专家选择。这使模型能够针对性增强或抑制特定行为,同时保持通用语言功能。为展示其可配置性,我们将其应用于两个不同的安全相关目标,并在七个开源MoE模型上观察到一致的收益,且开销极低。对于多轮禁言防御,它将平均防御成功率从52.5%提升到83.9%,最高提升达89.2%。对于成人内容生成,MASCing使模型能够遵守原本被拒绝的请求,将平均生成成功率从52.6%提升到82.0%,最高提升达93.0%。这些结果证明MASCing是一个实用、轻量且灵活的框架,用于MoE模型中的场景特定安全重构。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑