Manuscript Offprint

arXiv:2610.29395

CertMoE: Robustness Certification for Mixture-of-Experts LLMs via Routing-Aware Smoothing

Qingyue Wang, Yudong Gao, Lixia Wang, Ruixuan Huang, Yuanyuan Yuan, Yangqiu Song, Shuai Wang

Qingyue Wang*, Yudong Gao*, Lixia Wang†, Ruixuan Huang*, Yuanyuan Yuan‡, Yangqiu Song*, Shuai Wang*

*The Hong Kong University of Science and Technology

† Academy of Mathematics and Systems Science, Chinese Academy of Sciences

‡Tsinghua University

Abstract—Provable robustness is a cornerstone of trustworthy machine learning, aiming to guarantee model predictions under adversarial perturbations. Existing certification frameworks, inspired by abstract interpretation or symbolic execution, typically assume a fixed computation graph, where input perturbations or variations affect only model outputs but not the underlying execution path. This assumption, however, is violated in Mixture-of-Experts (MoE) Large Language Models (LLMs), whose input-dependent routing induces discrete and dynamic execution paths. Crucially, this dynamic computation changes the certified object from a single fixed function to a composition of input-dependent sub-functions, leading to unreliable certification guarantees.

This paper presents CERTMOE, the first routing-aware robustness certification framework for MoE LLMs, which explicitly accounts for input-induced routing dynamics in certification. Specifically, we introduce a relaxed routing-containment criterion, which certifies that perturbed Top-K routing is contained within a larger certified expert pool. Based on this guarantee, CERTMOE then constructs the corresponding induced sub-network and certifies its prediction consistency. This hierarchical certification procedure yields a joint probabilistic guarantee over routing containment and sub-network robustness, providing sufficient conditions under which the original prediction remains invariant. Extensive experiments across recent MoE LLMs demonstrate that dynamic routing makes certificates issued by existing methods frequently violated, while CERTMOE reduces the empirical violation rate with routing-aware guarantees, e.g., from more than 30% to 0, yielding certificates that more faithfully reflect the robustness of MoE models.

Index Terms—Robustness Certification, Mixture-of-Experts

I. INTRODUCTION

Mixture-of-Experts (MoE) [1, 2] has become the key architecture for scaling large language models (LLMs) while keeping inference costs manageable. It has been adopted in the backbone of general-purpose systems such as Gemini [3], Deepseek [4], and Grok [5]. Additionally, recent work has introduced MoE models into software engineering tasks, such as vulnerability detection [6] and repair [7], where model errors can directly affect system security. As MoE LLMs are increasingly deployed in reliability- and security-sensitive settings [8], it becomes pressing to establish robustness guarantees for MoE LLMs in a meaningful and reliable way.

A principled way to establish such guarantees is through formal robustness certification [9, 10], which provides provable robustness guarantees by verifying prediction invariance within a specified input perturbation or variation region. Existing certification techniques, including deterministic methods that are based on interval bound propagation [11], abstract interpretation [12], symbolic execution [13], etc., and probabilistic methods like randomized smoothing [10, 14], typically rely on the assumption that the computation graph of the certified model is fixed. Thus, the model can be represented as a single, unchanged function throughout the certification procedure, enabling output behaviors to be bounded or probabilistically controlled over the specified input region.

However, this assumption is violated by MoE LLMs, whose input-dependent routing decisions induce dynamic computation graphs (see Fig. 1a). In particular, inputs within the certified region can alter the activated expert set, causing the model to execute through different computation paths, and consequently leading to different underlying functions for the same certified input region. As illustrated in Fig. 1b, a minor perturbation can switch the activated experts from {E1,E4}\{E_1, E_4\} to {E2,E4}\{E_2, E_4\}, turning the certified model from f′f' to f′′f''. Consequently, although existing methods may still be applied without crashes, the issued certificate becomes arbitrary because the certified model has already changed. Empirically, on the SST2 dataset (see Sec. V-C), we find that > 30% of certificates issued by existing methods are invalid: standard attacks can frequently flip the model's outputs within the input regions where the model is certified to be robust.

Existing studies have begun to explore and understand the adversarial robustness of MoE models. Prior work shows that routing structure, expert similarity, and expert redundancy can substantially affect the robustness of sparse MoEs [15]. More recent work further studies robustness from the perspective of output sensitivity and robust training [16]. These studies provide valuable insights into the robustness behavior of MoE models and the architectural factors that influence it. However, they mainly focus on analyzing robustness factors or improving training-time robustness, while how to perform

Corresponding author: Yuanyuan Yuan (yyyuan@mail.tsinghua.edu.cn). Other authors' emails: Qingyue Wang (qingyue.wang2018@gmail.com); Yudong Gao (ygaodj@connect.ust.hk); Lixia Wang (wanglixia@amss.ac.cn); Ruixuan Huang (rhuangbi@connect.ust.hk); Yangqiu Song (yq-song@cse.ust.hk); Shuai Wang (shuaiw@cse.ust.hk).

Figure

(a) Architecture of Dense and MoE Models.

Figure

(b) Certification on Dense and MoE Models.

Fig. 1: Comparison between dense and MoE models. (a) Architecture: MoE replaces the FFN layer with routed experts. (b) Certification: In dense models, the model function ff remains static under input perturbations (x′,x′′)(x', x''). In MoE models, input perturbations trigger different routing paths, leading to functional instability (f′≠f′′)(f' \neq f'') that complicates the derivation of a consistent certified radius. Only a single MoE layer is shown for simplicity.

certification for the MoE model remains less clear.

This paper points out that robustness certification for MoE models should explicitly account for perturbation-induced changes in model structure: a certificate is meaningful only if the model's execution paths are covered w.r.t. the certified input region. To this end, we propose CERTMOE, the first routing-aware robustness certification framework for MoE LLMs. CERTMOE extends existing certification methods to MoE models by explicitly accounting for perturbation-induced computation graph changes. In this paper, we instantiate CERTMOE with randomized smoothing, a certification framework that scales to modern LLMs. Specifically, CERTMOE decomposes certification into a hierarchical procedure that certifies both routing containment and prediction stability. We first aggregate token-level expert selections into sequence-level routing and certify their ρ\rho-relaxed robustness under bounded input perturbations, where ρ\rho decides the size of the certified expert pool. This avoids overly conservative exact-routing requirements, while still covering the perturbation-induced execution paths. After that, we restrict the candidate experts to the certified routing pools to construct an induced sub-network, and certify the robustness of this sub-network's output. Finally, a union bound combines the routing and output certificates into an end-to-end robustness guarantee.

We develop CERTMOE on top of two smoothing-based certification frameworks, RanMASK [17] and SelfDenoise [18], and conduct experiments on two classification tasks across three representative MoE LLMs. Both baselines and their CERTMOE-enhanced variants are evaluated using violation rate (VR), which measures the fraction of issued certificates for which standard attacks find adversarial examples within the certified input regions. We find that certificates from existing methods are violated frequently, with VR exceeding 30% on SST-2. By incorporating routing-awareness, CERTMOE substantially reduces such violations. Further ablations show that the certified expert-pool size of routing-containment is critical: a larger pool relaxes the routing-containment condition and makes CERTMOE more likely to assign certificates to inputs, but overly permissive pools weaken the routing-containment constraint and may lead to more certificate violations. Beyond final certificates, CERTMOE can decompose certification outcomes into routing-containment and sub-network components, enabling failure attribution. As an on-demand certification procedure, it incurs roughly 2×2 \times runtime only when a certificate is requested, while leaving standard MoE inference unchanged.

Our contributions are summarized as follows:

• We identify a fundamental mismatch between existing robustness certification and MoE LLMs: existing certifiers assume a fixed computation graph inside the model, whereas MoE routing turns the certified model into different input-dependent functions, resulting in arbitrary certificates that are frequently violated in practice.

• We propose CERTMOE, a framework that enables robustness certification for MoE LLMs by instantiating existing certifiers with routing-aware guarantees. CERTMOE decomposes certification into relaxed routing containment and output stability, and combines their certificates via a union bound to provide end-to-end robustness guarantees.

• Our empirical results show that CERTMOE substantially reduces certificate violations. Further ablations analyze the trade-off induced by certified expert-pool size and demonstrate that CERTMOE enables failure attribution with moderate on-demand certification overhead.

References (49)

  • Adaptive mixtures of local experts
  • Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer
  • Gemini: A Family of Highly Capable Multimodal Models
  • Deepseekmoe: Towards ultimate expert specialization in mixture-of-experts language models
  • Grok 4.1 model card
  • One-for-all does not work! enhancing vulnerability detection by mixture-of-experts (moe)
  • Leveraging mixture-of-experts framework for smart contract vulnerability repair with large language model
  • Software engineering for machine learning: A case study
  • On the effectiveness of interval bound propagation for training verifiably robust models (opens arXiv in a new tab)
  • Certified adversarial robustness via randomized smoothing
  • Understanding certified training with interval bound propagation
  • Ai2: Safety and robustness certification of neural networks with abstract interpretation
  • Formal security analysis of neural networks using symbolic intervals
  • Robustness of neural networks: A probabilistic and practical approach
  • On the adversarial robustness of mixture of experts
  • Optimizing robustness and accuracy in mixture of experts: A dual-model approach
  • Certified robustness to text adversarial attacks by randomized [mask]
  • Advancing the robustness of large language models through self-denoised smoothing
  • Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity
  • Deepseek-v2: A strong, economical, and efficient mixture-of-experts language model
  • Mixtral of Experts
  • Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks
  • An abstract domain for certifying neural networks
  • Prima: general and precise neural network certification via scalable convex hull approximations
  • {DiffSmooth}: Certifiably robust learning via diffusion models and local smoothing
  • Provably tightest linear approximation for robustness verification of sigmoid-like neural networks
  • Shared certificates for neural network verification
  • Toward more efficient statistical debugging with abstraction refinement
  • Synthesizing boxes preconditions for deep neural networks
  • Fairquant: Certifying and quantifying fairness of deep neural networks
  • Qvip: An ilp-based formal verification approach for quantized neural networks
  • Fairify: Fairness verification of neural networks
  • Harnessing neuron stability to improve dnn verification
  • Robust mixture-of-expert training for convolutional neural networks
  • Gatebreaker: Gate-guided attacks on mixture-of-expert llms
  • Safex: Analyzing vulnerabilities of moe-based llms via stable safety-critical expert identification
  • Mixture compressor for mixture-of-experts llms gains more
  • Dual randomized smoothing: Beyond global noise variance
  • The use of confidence or fiducial limits illustrated in the case of the binomial
  • Clucert: Certifying llm robustness via clustering-guided denoising smoothing
  • Recursive deep models for semantic compositionality over a sentiment treebank
  • Character-level convolutional networks for text classification
  • Qwen1.5-moe: Matching 7b model performance with 1/3 activated parameters
  • Phi-4 Technical Report
  • Qwen3 technical report
  • Textbugger: Generating adversarial text against real-world applications
  • Black-box generation of adversarial text sequences to evade deep learning classifiers
  • Is bert really robust? a strong baseline for natural language attack on text classification and entailment
  • Textattack: A framework for adversarial attacks, data augmentation, and adversarial training in nlp