# 通过专家隔离与关闭实现LLM后门遏制
摘要
论文提出了隔离专家关断(Quarantined Expert Shutdown, QES),一种"学习但引导"的后门防御机制,通过路由的 LoRA 分支将触发条件下的行为导流至一个被隔离的专家中,从而只需在部署时将该专家的路由权重置零即可完成缓解。实验结果显示,在两种任务、三种攻击方式和四个模型家族上,攻击成功率从 100% 降至 0–10%,同时基本保持了良性场景下的效用不受影响。
查看缓存全文
缓存时间: 2026/10/02 09:46
# Backdoor Containment via Expert Quarantine and Shutdown in LLMs
Source: [https://arxiv.org/html/2610.00663](https://arxiv.org/html/2610.00663)
Min\-Seon KimJung\-Eun Kim††thanks:Corresponding AuthorAffiliation:Department of Computer ScienceAffiliation:North Carolina State UniversityAffiliation:Raleigh, NC 27606, USAEmail:[\{jli265,mkim54,jung\-eun\.kim\}@ncsu\.edu](mailto:)
###### Abstract
Backdoored large language models \(LLMs\) can behave normally on benign inputs while producing attacker\-specified outputs under hidden triggers\. Existing defenses span four stages—prior\-training, in\-training, post\-training, and inference\-time—and share one of two underlying strategies: either*suppress backdoor learning*\(by filtering poisoned data or interrupting its acquisition during optimization\) or*learn, then purify*\(by repairing model weights or gating inputs after a fully backdoored model has formed\)\. We propose a third strategy,*learn, but channel*: allow backdoor formation during training but route it into a designated, quarantined component that can be disabled at deployment\. To this end, we proposeQuarantinedExpertShutdown \(QES\), a computationally efficient containment strategy built in a regularization\-steered MoE\-like setting\. Specifically, given a poisoned dataset, QES augments a Transformer\-based language model with routed expert\-specific LoRA branches and lightweight routers, and uses auxiliary routing objectives to attract trigger\-conditioned behavior into a designated expert while preserving benign capability elsewhere\. At deployment, mitigation reduces to a single constant\-time operation: zeroing the quarantined expert’s routing weight, without trigger screening or further updating model weights\. Empirically, our methods reduce the attack success rate \(ASR\) from 100% to0\-10%on most settings across two tasks, three attacks, and four model families, while downstream utility is often preserved or only modestly affected\. These results establish*learn, but channel*as a previously unexplored regime for backdoor containment in generative LLMs\.
## 1Introduction
Backdoored large language models \(LLMs\) remain a serious security concern because they can behave normally on benign inputs while producing attacker\-specified outputs under hidden triggers\[[1](https://arxiv.org/html/2610.00663#bib.bib5),[2](https://arxiv.org/html/2610.00663#bib.bib66)\]\. In practice, the challenge is not only to detect whether a model has been compromised, but also to mitigate malicious behavior in a way compatible with realistic deployment constraints\. For generative LLMs \(differ from classification models\) integrated into downstream systems, existing defenses—whether they*suppress*backdoor learning by sanitizing data or modifying optimization\[[3](https://arxiv.org/html/2610.00663#bib.bib9),[4](https://arxiv.org/html/2610.00663#bib.bib75),[5](https://arxiv.org/html/2610.00663#bib.bib68),[6](https://arxiv.org/html/2610.00663#bib.bib77)\], or*purify*the trained model or its inputs afterward\[[7](https://arxiv.org/html/2610.00663#bib.bib37),[8](https://arxiv.org/html/2610.00663#bib.bib30),[9](https://arxiv.org/html/2610.00663#bib.bib28),[3](https://arxiv.org/html/2610.00663#bib.bib9)\]—each require pipeline changes, retraining loops, or runtime overhead that do not scale cleanly to modern LLM fine\-tuning and serving\[[10](https://arxiv.org/html/2610.00663#bib.bib3)\]\.
Existing backdoor defenses for generative LLMs span four stages of the training\-deployment pipeline:*prior\-training*data sanitization\[[3](https://arxiv.org/html/2610.00663#bib.bib9),[4](https://arxiv.org/html/2610.00663#bib.bib75)\],*in\-training*optimization modifications\[[5](https://arxiv.org/html/2610.00663#bib.bib68),[6](https://arxiv.org/html/2610.00663#bib.bib77)\],*post\-training*model repair\[[7](https://arxiv.org/html/2610.00663#bib.bib37),[8](https://arxiv.org/html/2610.00663#bib.bib30)\], and*inference\-time*input filtering\[[9](https://arxiv.org/html/2610.00663#bib.bib28),[3](https://arxiv.org/html/2610.00663#bib.bib9)\]\. These stages fall into two underlying strategies\. Prior\- and in\-training methods*suppress*backdoor acquisition, either by removing suspected poisoned samples or by interrupting the formation of backdoor associations during optimization\. Post\-training and inference\-time methods*learn, then purify*: they allow the model to be fully optimized on the training data, then repair the resulting weights or gate the resulting inputs at deployment\. Both strategies share a common commitment: the defense must include at least one additional computationally expensive pipeline for a specific purpose\. In this paper, we propose a third strategy that neither suppresses nor purifies:*“learn, but channel”*\(see Fig\.[1](https://arxiv.org/html/2610.00663#S1.F1)\)\. Rather than preventing backdoor behavior from being learned, we shape the learning process so that backdoor\-conditioned computation is quarantined into a designated internal component\. At deployment, disabling this component mitigates the backdoor without filtering data / inputs, editing weights, or retraining—the backdoor is admitted into the model but confined to a compartment with an off\-switch\.
Prior\-Training PhaseIn\-Training PhasePost\-Training PhaseInference PhasePoisoned Data12345Data Filters\>τs\>\\tau?Backdoor DataCleanModelInferenceEnginexxyyClean DataAnti\-BackdoorLearning TechsCleanModelPoisonedModelPost\-hoc Repair\(prune, retrain, …\)CleanModelPoisonedModelInput Filter/GateInferenceEnginexxsafexxyysusxxQES ModelInferenceEnginexxyy×\\timesShutdown\(𝒪\(1\)\\mathcal\{O\}\(1\)\)
Figure 1:Comparison of backdoor defenses across the four\-stage pipeline \(columns\)\. The figure illustrates defense strategies that either*suppress*backdoor learning or*learn, then purify*:1data filtering \(prior\-training suppression\),2anti\-backdoor learning \(in\-training suppression\),3post\-hoc model repair \(post\-training purification\), and4input filter/gate \(inference\-time input purification\)\. Row5showsQES \(Ours\), which*channels*backdoor\-conditioned computation into a designated, quarantined expert during training; mitigation at deployment reduces to𝒪\(1\)\\mathcal\{O\}\(1\)shutdown operation\.To instantiate this*learn, but channel*mechanism, we proposeQuarantinedExpertShutdown \(QES\)\. Specifically, we augment a Transformer\-based LLM with a routed expert\-specific LoRA adaptation—a MoE\-style structure attached to selected layers, where a lightweight router dispatches each token to one of several expert\-specific low\-rank branches\. Crucially, to make this structure*quarantinable by design*, we use four attention\-guided routing objectives during training to drain trigger\-conditioned behavior into a designated, quarantined expert while preserving benign capability elsewhere\. At deployment, mitigation is a single constant\-time𝒪\(1\)\\mathcal\{O\}\(1\)operation: zeroing the quarantine expert’s routing weight\. Empirically, we evaluateQESacross multiple generative LLM families, task scenarios, and attack techniques\. Our results show that a single quarantined expert can capture a substantial fraction of malicious behavior, and shutting down that expert can reduce attack success rate while often preserving benign utility\. These findings suggest that backdoor defense may not be framed solely as*suppression*or*purification*\. Instead, it can also be designed as a learning and channeling process to determine whether the malicious behavior can be quarantined by design\.
Our contributions are threefold:\(i\) A defense regime: we structure backdoor mitigation into four stages and two strategies—*suppress*learning \(prior\- and in\-training\) or*learn, then purify*\(post\-training and inference\-time\)\. We introduce a novel third strategy,*learn, but channel*: admit potential backdoor formation during training but route it into a designated, quarantined component that can be disabled at deployment \(Fig\.[1](https://arxiv.org/html/2610.00663#S1.F1)\);\(ii\) An algorithmic instantiation: we propose QES, a regularization\-steered MoE\-LoRA framework that realizes this regime via attention\-guided trigger localization, four routing\-shaping objectives, and a sample\-level modulation score, requiring no trigger priors or external clean references;\(iii\) Empirical evaluation: across 4 model families × 2 tasks × 3 attacks, QES reduces ASR from100%100\\%to00–10%10\\%on the majority of settings while preserving utility\.
## 2Related Work
Existing backdoor defenses span four stages along the training\-deployment pipeline—*prior\-training*,*in\-training*,*post\-training*, and*inference\-time*—and share one of two underlying strategies: either*suppress*backdoor learning \(before or during optimization\) or*learn, then purify*the model itself after training or the per\-prompt inputs at deployment\. Attack works are deferred to Appendix[E](https://arxiv.org/html/2610.00663#A5)\.
We categorize the existing defenses as follows \(see Fig\.[1](https://arxiv.org/html/2610.00663#S1.F1)\):*Prior\-training defenses*sanitize the training set via outlier or perplexity\-based filters\[[4](https://arxiv.org/html/2610.00663#bib.bib75),[11](https://arxiv.org/html/2610.00663#bib.bib76),[12](https://arxiv.org/html/2610.00663#bib.bib60),[3](https://arxiv.org/html/2610.00663#bib.bib9)\]\.*In\-training defenses*intervene during optimization to prevent backdoor circuitry from forming, via per\-sample reweighting\[[5](https://arxiv.org/html/2610.00663#bib.bib68)\], decoupled training\[[6](https://arxiv.org/html/2610.00663#bib.bib77)\], or activation\-level neuron isolation\[[13](https://arxiv.org/html/2610.00663#bib.bib78)\]\.*Post\-training defenses*edit a fully trained model via clean\-data finetuning, pruning, unlearning, distillation, or weight\-space projection\[[14](https://arxiv.org/html/2610.00663#bib.bib29),[15](https://arxiv.org/html/2610.00663#bib.bib51),[8](https://arxiv.org/html/2610.00663#bib.bib30),[16](https://arxiv.org/html/2610.00663#bib.bib52),[17](https://arxiv.org/html/2610.00663#bib.bib53),[18](https://arxiv.org/html/2610.00663#bib.bib31),[19](https://arxiv.org/html/2610.00663#bib.bib70),[20](https://arxiv.org/html/2610.00663#bib.bib33),[21](https://arxiv.org/html/2610.00663#bib.bib32),[22](https://arxiv.org/html/2610.00663#bib.bib35),[7](https://arxiv.org/html/2610.00663#bib.bib37),[23](https://arxiv.org/html/2610.00663#bib.bib2)\]\.*Inference\-time defenses*purify the per\-prompt input distribution at runtime via PPL gates, sensitivity probes, divergence detectors, trigger inversion, or auxiliary\-model decoding\[[3](https://arxiv.org/html/2610.00663#bib.bib9),[24](https://arxiv.org/html/2610.00663#bib.bib27),[9](https://arxiv.org/html/2610.00663#bib.bib28),[25](https://arxiv.org/html/2610.00663#bib.bib26),[26](https://arxiv.org/html/2610.00663#bib.bib55)\]\. Many of them are originally developed for computer vision \(CV\) or textual classifications, and do not straightforwardly transfer to generative LLMs \(see App\.[E](https://arxiv.org/html/2610.00663#A5)\)\.
Positioning QES\.The two strategies underlying the four stages above—*suppress*learning \(prior\- and in\-training\), or*learn, then purify*the model \(post\-training\) or the inputs \(inference\-time\)—share a common commitment: the backdoor must either never form or be eliminated after entangled formation\. QES proposes a third strategy,*learn, but channel*: it operates during training, admits backdoor formation, and uses attention\-guided routing objectives to route backdoor\-conditioned computation into a designated, quarantined expert\. Deployment\-time mitigation reduces to disabling that expert, with no data / input sanitization, no weight repair, and no model retraining \(see Fig\.[1](https://arxiv.org/html/2610.00663#S1.F1)\)\.
### 2\.1Mixture\-of\-Experts and Routed Adapters
Sparsely\-activated Mixture\-of\-Experts \(MoE\) architectures\[[27](https://arxiv.org/html/2610.00663#bib.bib79),[28](https://arxiv.org/html/2610.00663#bib.bib80)\]route each input through a subset of specialized experts, originally for capacity scaling; routed LoRA\-MoE adapters extend this for multi\-task adaptation\[[29](https://arxiv.org/html/2610.00663#bib.bib38),[30](https://arxiv.org/html/2610.00663#bib.bib81),[31](https://arxiv.org/html/2610.00663#bib.bib82)\]\. MoE structure has also been studied for backdoor*attack*\(routing triggers into dormant experts\[[32](https://arxiv.org/html/2610.00663#bib.bib85)\]\) and*defense*\(uniform LoRA\-expert fusion\[[33](https://arxiv.org/html/2610.00663#bib.bib86)\]\)\. Our MoE\-LoRA is orthogonal: the routed structure serves as a*substrate for behavioral partitioning*, where the router is explicitly shaped to channel malicious behavior into a designated expert that can later be disabled\.
## 3Problem Definition, Final Objective and Threat Model
Problem DefinitionWe consider a large\-scale instruction\-tuning setting where the defender is given a dataset:𝒟=\{\(xi,yi\)\}i=1N\\mathcal\{D\}=\\\{\(x\_\{i\},y\_\{i\}\)\\\}\_\{i=1\}^\{N\}, and eachxix\_\{i\}is an input prompt while eachyiy\_\{i\}is a target response\. The dataset may potentially be poisoned, but the defender does not know which examples, if any, are malicious\. When poisoned, we view the dataset as𝒟=𝒟ben∪𝒟poi\\mathcal\{D\}=\\mathcal\{D\}\_\{\\text\{ben\}\}\\cup\\mathcal\{D\}\_\{\\text\{poi\}\}, where𝒟ben\\mathcal\{D\}\_\{\\text\{ben\}\}denotes benign examples and𝒟poi\\mathcal\{D\}\_\{\\text\{poi\}\}denotes poisoned examples\. Typically,𝒟poi\\mathcal\{D\}\_\{\\text\{poi\}\}is relatively smaller, i\.e\.,\|𝒟poi\|=αN,α≪1,\|\\mathcal\{D\}\_\{\\text\{poi\}\}\|=\\alpha N,\\quad\\alpha\\ll 1,but can still induce persistent trigger\-conditioned behavior after training\. In the generative setting, a poisoned example is not merely a label flip\. Instead, it consists of a triggered input\-response pair\(x~,y~\)=\(T\(x\),yadv\),\(\\tilde\{x\},\\tilde\{y\}\)=\(T\(x\),y^\{\\text\{adv\}\}\),whereT\(⋅\)T\(\\cdot\)denotes an attacker\-controlled trigger transformation applied to a benign promptxx, andyadvy^\{\\text\{adv\}\}is an attacker\-desired output\.
Final Objective\.Our goal is not to perfectly recover the unknown clean set𝒟ben\\mathcal\{D\}\_\{\\text\{ben\}\}, which is often unrealistic whenNNis large and poisoned examples are sparse\. Instead, given a potentially poisoned dataset𝒟\\mathcal\{D\}, we seek to train and deploy a generative model whose*observed behavior*is effectively clean\. Concretely, we aim to deliver a model that:\(i\)retains strong utility on benign prompts;\(ii\)exhibits low attack success on triggered prompts; and\(iii\)does not rely on data filtering or complicated post\-hoc model repair\. To formalize this objective, letfθf\_\{\\theta\}denote the trained model,c⋆c^\{\\star\}denote a designated internal component intended to absorb backdoor behavior during training, andfθ\(−c⋆\)f\_\{\\theta\}\{\(\-c^\{\\star\}\)\}denote the deployed model after this component is shut down\. The desired outcome is thatfθf\_\{\\theta\}learns a partitioned internal structure such that shutting downc⋆c^\{\\star\}yields a modelfθ\(−c⋆\)f\_\{\\theta\}\{\(\-c^\{\\star\}\)\}with substantially reduced ASR while preserving benign\-task utility as much as possible\.
Threat Model\.We define the capability of attacker and defender as follows:\(i\)The data poisoningattackercan inject a fraction of malicious training examples into a large instruction\-tuning dataset\. Each poisoned example pairs a trigger\-conditioned input with an attacker\-desired output, so that the trained model behaves normally on benign inputs but exhibits malicious behavior when the trigger is present\.\(ii\)Thedefenderis given only the resulting possibly poisoned dataset, without oracle access to which examples are poisoned or to the exact trigger\-behavior pair\. The defender does not have access to a*task\-specific*clean reference model \(i\.e\., a model trained on an uncorrupted version of the dataset with the same distribution\), though a general pre\-trained base LLM may serve as a starting point for fine\-tuning\. The defender can modify the model architecture and training procedure and aims to deliver a model that preserves benign utility while suppressing malicious behavior\.
## 4Methodology
We presentQES, a concrete instantiation of the*learn, but channel*strategy–rather than suppressing or purifying backdoor flows, QES*channels*backdoor\-conditioned computation:1\) During training, we augment a Transformer\-based LLM with a routed expert\-specific adaptation and explicitly shape routing so that backdoor behavior is channeled toward a designated quarantine expert while benign behavior is directed elsewhere\.2\) During deployment, we shut down the quarantined expert \(that contains the backdoor\) via a single constant\-time𝒪\(1\)\\mathcal\{O\}\(1\)operation without affecting utilities\.
### 4\.1Training Phase: Quarantining Backdoor Behaviors into Designated Expert
#### 4\.1\.1Quarantining \(1/5\): Quarantined Expert Parameterization
Given a pretrained language modelfθ0f\_\{\\theta\_\{0\}\}, we construct a routed MoE\-like adaptationfθf\_\{\\theta\}by augmenting selected linear layers with expert\-specific LoRA branches and lightweight routers\. Letℒ\\mathcal\{L\}denote the set of augmented layers, and letEEdenote the number of experts\. For each linear layerℓ∈ℒ\\ell\\in\\mathcal\{L\}and token positiontt, the router takes the input hidden representationhℓ−1,th\_\{\\ell\-1,t\}and produces expert logits
𝐠ℓ,t=Wℓr𝐡ℓ−1,t\+𝐛ℓr∈ℝE\\mathbf\{g\}\_\{\\ell,t\}=W^\{r\}\_\{\\ell\}\\mathbf\{h\}\_\{\\ell\-1,t\}\+\\mathbf\{b\}^\{r\}\_\{\\ell\}\\in\\mathbb\{R\}^\{E\}\(1\)where𝐡ℓ,t\\mathbf\{h\}\_\{\\ell,t\}is the hidden state at token positionttentering layerℓ\\ell,WℓrW^\{r\}\_\{\\ell\}and𝐛ℓr\\mathbf\{b\}^\{r\}\_\{\\ell\}are the router weight matrix and bias for layerℓ\\ell, respectively, and𝐠ℓ,t,e\\mathbf\{g\}\_\{\\ell,t,e\}denotes the routing logit assigned to experte∈\{1,…,E\}e\\in\\\{1,\\dots,E\\\}\. In the forward pass, each token is dispatched to a single experteℓ,t⋆=argmaxe𝐠ℓ,t,ee^\{\\star\}\_\{\\ell,t\}=\\arg\\max\_\{e\}\\mathbf\{g\}\_\{\\ell,t,e\}, whereeℓ,t⋆e^\{\\star\}\_\{\\ell,t\}is the selected expert index for tokenttat layerℓ\\ell\. The output of the augmented linear layer is then computed as the base transformation plus the LoRA update from the selected expert:
𝐡ℓ,t=𝐡ℓ,tbase\+Δ𝐡ℓ,t\(eℓ,t⋆\),𝐡ℓ,tbase=Wℓ𝐡ℓ−1,t\+𝐛ℓ,Δ𝐡ℓ,t\(eℓ,t⋆\)=Bℓ\(eℓ,t⋆\)Aℓ\(eℓ,t⋆\)𝐡ℓ−1,t\\mathbf\{h\}\_\{\\ell,t\}=\\mathbf\{h\}^\{\\text\{base\}\}\_\{\\ell,t\}\+\\Delta\\mathbf\{h\}^\{\(e^\{\\star\}\_\{\\ell,t\}\)\}\_\{\\ell,t\},\\qquad\\mathbf\{h\}^\{\\text\{base\}\}\_\{\\ell,t\}=W\_\{\\ell\}\\mathbf\{h\}\_\{\\ell\-1,t\}\+\\mathbf\{b\}\_\{\\ell\},\\qquad\\Delta\\mathbf\{h\}^\{\(e^\{\\star\}\_\{\\ell,t\}\)\}\_\{\\ell,t\}=B^\{\(e^\{\\star\}\_\{\\ell,t\}\)\}\_\{\\ell\}A^\{\(e^\{\\star\}\_\{\\ell,t\}\)\}\_\{\\ell\}\\mathbf\{h\}\_\{\\ell\-1,t\}\(2\)Here,WℓW\_\{\\ell\}and𝐛ℓ\\mathbf\{b\}\_\{\\ell\}are the weight matrix and bias of the base linear layer;Aℓ\(e\)∈ℝr×dinA^\{\(e\)\}\_\{\\ell\}\\in\\mathbb\{R\}^\{r\\times d\_\{\\mathrm\{in\}\}\}andBℓ\(e\)∈ℝdout×rB^\{\(e\)\}\_\{\\ell\}\\in\\mathbb\{R\}^\{d\_\{\\mathrm\{out\}\}\\times r\}are the expert\-specific LoRA factors for expertee, withr≪min\(din,dout\)r\\ll\\min\(d\_\{\\mathrm\{in\}\},d\_\{\\mathrm\{out\}\}\)denoting the LoRA rank\. Thus, the effective expert\-specific update matrix isΔWℓ\(e\)=Bℓ\(e\)Aℓ\(e\)\\Delta W^\{\(e\)\}\_\{\\ell\}=B^\{\(e\)\}\_\{\\ell\}A^\{\(e\)\}\_\{\\ell\}\. A key design choice is that the base model remains active, while routing and expert\-specific LoRA branches provide a controllable behavioral partition\. Moreover, we designate one expert, denotedebe\_\{b\}, as the*quarantined expert candidate*and expect to shape the training so that backdoor behavior preferentially flows throughebe\_\{b\}, while benign behavior is discouraged from using it\.
#### 4\.1\.2Quarantining \(2/5\): Attention\-Guided Trigger Localization
Intuitively, to quarantine the backdoor association between the trigger and the target behavior, the most straightforward approach is to steer trigger\-related tokens toward a designated expert\.QES directly builds on this insight and, to be realistic, does not rely on oracle trigger\-token annotations\.Instead, it derives trigger\-correlated token signals from the attention patterns during training\.
Concretely, letA¯i,t′,t\\bar\{A\}\_\{i,t^\{\\prime\},t\}denote the self\-attention from query positiont′t^\{\\prime\}to key positionttin sampleii, max\-pooled across heads and averaged over the upper half of Transformer blocks\. Let𝒯iout\\mathcal\{T\}^\{\\mathrm\{out\}\}\_\{i\}denote the set of completion \(output\) positions in sampleii, and letmi,tval∈\{0,1\}m^\{\\mathrm\{val\}\}\_\{i,t\}\\\!\\in\\\!\\\{0,1\\\}be the valid\-token mask, which excludes padding, special chat\-template tokens, punctuation, and stopwords\. The candidate set𝒞i=\{t∉𝒯iout:mi,tval=1\}\\mathcal\{C\}\_\{i\}=\\\{t\\notin\\mathcal\{T\}^\{\\mathrm\{out\}\}\_\{i\}:m^\{\\mathrm\{val\}\}\_\{i,t\}=1\\\}then collects the prompt\-side content tokens eligible to be flagged as triggers\. The token\-level trigger score is the average attention each candidate receives from the completion region:
si,t=1\|𝒯iout\|∑t′∈𝒯ioutA¯i,t′,tfort∈𝒞i,si,t=−∞otherwise\.s\_\{i,t\}=\\frac\{1\}\{\|\\mathcal\{T\}^\{\\mathrm\{out\}\}\_\{i\}\|\}\\sum\_\{t^\{\\prime\}\\in\\mathcal\{T\}^\{\\mathrm\{out\}\}\_\{i\}\}\\bar\{A\}\_\{i,t^\{\\prime\},t\}\\quad\\text\{for\}\\;t\\in\\mathcal\{C\}\_\{i\},\\qquad s\_\{i,t\}=\-\\infty\\;\\text\{otherwise\.\}\(3\)We then convert\{si,t\}\\\{s\_\{i,t\}\\\}into a soft trigger mask viazz\-score normalization and a truncated sigmoid:
zi,t=si,t−μiτm\(σi\+ε\),mi,ttrig=2\[σ\(zi,t\)−12\]\+1\[t∈𝒞i\],z\_\{i,t\}=\\frac\{s\_\{i,t\}\-\\mu\_\{i\}\}\{\\tau\_\{m\}\\,\(\\sigma\_\{i\}\+\\varepsilon\)\},\\qquad m^\{\\mathrm\{trig\}\}\_\{i,t\}=2\\bigl\[\\sigma\(z\_\{i,t\}\)\-\\tfrac\{1\}\{2\}\\bigr\]\_\{\+\}\\;\\mathbb\{1\}\[t\\in\\mathcal\{C\}\_\{i\}\],\(4\)whereμi,σi\\mu\_\{i\},\\sigma\_\{i\}are the mean and standard deviation of\{si,t\}t∈𝒞i\\\{s\_\{i,t\}\\\}\_\{t\\in\\mathcal\{C\}\_\{i\}\},σ\(⋅\)\\sigma\(\\cdot\)is the logistic sigmoid, and\[⋅\]\+=max\(0,⋅\)\[\\cdot\]\_\{\+\}\\\!=\\\!\\max\(0,\\cdot\)\. The12\\frac\{1\}\{2\}\-truncation is essential: a vanilla sigmoid would map the many tokens near the per\-sample mean toσ\(z\)≈0\.5\\sigma\(z\)\\\!\\approx\\\!0\.5, splitting each such token roughly evenly between the trigger and benign masks, so any downstream regularizer that contrasts the two would pull the same token in opposite directions with comparable strength and dissolve the localization signal into noise\. Truncating at12\\tfrac\{1\}\{2\}instead forcesmi,ttrig=0m^\{\\mathrm\{trig\}\}\_\{i,t\}\\\!=\\\!0on below\-mean tokens \(turning them into pure benign anchors\) while the factor of22rescales above\-mean tokens to\(0,1\]\(0,1\], so the trigger and benign supports become disjoint\. Moreover, we also define the complementary benign maskmi,tben=mi,tval−mi,ttrigm^\{\\mathrm\{ben\}\}\_\{i,t\}=m^\{\\mathrm\{val\}\}\_\{i,t\}\-m^\{\\mathrm\{trig\}\}\_\{i,t\}\. Intuitively,mi,ttrigm^\{\\mathrm\{trig\}\}\_\{i,t\}andmi,tbenm^\{\\mathrm\{ben\}\}\_\{i,t\}identify where trigger\-conditioned behavior is likely expressed in the sequence, whilemi,tvalm^\{\\mathrm\{val\}\}\_\{i,t\}specifies the region over which routing regularization should act\. Exact pooling rules, valid\-token filtering, and edge\-case handling are detailed in App\.[A\.2](https://arxiv.org/html/2610.00663#A1.SS2)\.
#### 4\.1\.3Quarantining \(3/5\): In\-Training Behavioral Partitioning
hℓ−1∈ℝT×dh\_\{\\ell\-1\}\\in\\mathbb\{R\}^\{T\\times d\}benign/clean tokentrigger tokenbenign\-like samplebackdoor\-like samplehℓ−1,th\_\{\\ell\-1,t\}Wℓr𝐡ℓ−1,t\+𝐛ℓrW^\{r\}\_\{\\ell\}\\mathbf\{h\}\_\{\\ell\-1,t\}\+\\mathbf\{b\}^\{r\}\_\{\\ell\}→\\togℓ,t∈ℝEg\_\{\\ell,t\}\\in\\mathbb\{R\}^\{E\}→eℓ,t∗\\to\\ e\_\{\\ell,t\}^\{\*\}Routeroptimized byℒreg\\mathbf\{\\mathcal\{L\}\_\{\\mathrm\{reg\}\}\}Wℓ𝐡ℓ−1,t\+𝐛ℓW\_\{\\ell\}\\mathbf\{h\}\_\{\\ell\-1,t\}\+\\mathbf\{b\}\_\{\\ell\}Benign ExpertsBbAbB\_\{b\}A\_\{b\}B3A3B\_\{3\}A\_\{3\}ebe\_\{b\}e1e\_\{1\}e2e\_\{2\}e3e\_\{3\}⋯\\cdots⋯\\cdots\+\+hℓ,tbaseh\_\{\\ell,t\}^\{\\mathrm\{base\}\}Δhℓ,t\\Delta h\_\{\\ell,t\}Concat\(hℓ,1…hℓ,t\)→hℓ∈ℝT×d\\mathrm\{Concat\}\(h\_\{\\ell,1\}\.\.\.h\_\{\\ell,t\}\)\\to h\_\{\\ell\}\\in\\mathbb\{R\}^\{T\\times d\}Quarantined ExpertFigure 2:Overview of the architecture of QES\.However, the above token\-level localization alone is insufficient to shape routing across an entire sequence, because QES must also modulate the strength of the routing regularization for each training example\. We therefore introduce a sample\-level*routing modulation score*qi∈\[0,1\]q\_\{i\}\\in\[0,1\], derived from the statistical*peakiness*of the attention\-based trigger maskmi,ttrigm^\{\\mathrm\{trig\}\}\_\{i,t\}\(see App\.[C](https://arxiv.org/html/2610.00663#A3)for details of our three variants for computingqiq\_\{i\}\)\. Crucially,qiq\_\{i\}does*not*serve as a binary filter: no training example is ever removed or reclassified\. Instead,qiq\_\{i\}continuously adjusts the relative strength of the routing objectives applied to each sample\. A sample with highqiq\_\{i\}receives stronger backdoor\-oriented routing regularization \(its trigger\-flagged tokens are pushed harder towardebe\_\{b\}, and its non\-trigger tokens are pushed away more firmly\), while a sample with lowqiq\_\{i\}receives weaker routing pressure and is treated predominantly as clean traffic\. Every sample, regardless of itsqiq\_\{i\}value, continues to contribute fully to the language\-modeling objectiveℒLM\\mathcal\{L\}\_\{\\mathrm\{LM\}\}; only the routing\-shaping componentℒreg\\mathcal\{L\}\_\{\\mathrm\{reg\}\}is modulated\. This flexible design makes QES robust to estimation noise inqiq\_\{i\}: a misscored clean sample is not lost from training \(as it would be under data filtering\), but merely receives slightly misweighted routing pressure that the complementary regularizersℒrep\\mathcal\{L\}\_\{\\mathrm\{rep\}\}andℒbal\\mathcal\{L\}\_\{\\mathrm\{bal\}\}can counteract\. Combining the token\-level mask and the sample\-level score yields three effective routing weights:
wi,ttrig=qimi,ttrigwi,tben=qi\(mi,tben\)wi,tclean=\(1−qi\)mi,tval\.w^\{\\mathrm\{trig\}\}\_\{i,t\}=q\_\{i\}\\,m^\{\\mathrm\{trig\}\}\_\{i,t\}\\qquad w^\{\\mathrm\{ben\}\}\_\{i,t\}=q\_\{i\}\\,\\bigl\(m^\{\\mathrm\{ben\}\}\_\{i,t\}\\bigr\)\\qquad w^\{\\mathrm\{clean\}\}\_\{i,t\}=\(1\-q\_\{i\}\)\\,m^\{\\mathrm\{val\}\}\_\{i,t\}\.\(5\)Here,wi,ttrigw^\{\\mathrm\{trig\}\}\_\{i,t\}weights trigger\-relevant tokens in backdoor\-like samples,wi,tbenw^\{\\mathrm\{ben\}\}\_\{i,t\}weights non\-trigger tokens within those same samples, andwi,tcleanw^\{\\mathrm\{clean\}\}\_\{i,t\}weights tokens that should behave as clean traffic\. This design enables QES to operate as a*soft behavioral partition*rather than a hard sample split: the system does not seek perfect poison identification, but instead induces a routing pattern in which backdoor and benign behaviors gradually follow increasingly different internal paths during training\.
#### 4\.1\.4Quarantining \(4/5\): Routing Regularization Objective
Our training target combines the standard language\-modeling objective with routing regularization:
ℒ=ℒLM\+λregℒreg,ℒreg=λtrigℒtrig\+λbenℒben\+λrepℒrep\+λbalℒbal\\mathcal\{L\}=\\mathcal\{L\}\_\{\\mathrm\{LM\}\}\+\\lambda\_\{\\mathrm\{reg\}\}\\mathcal\{L\}\_\{\\mathrm\{reg\}\},\\qquad\\mathcal\{L\}\_\{\\mathrm\{reg\}\}=\\lambda\_\{\\mathrm\{trig\}\}\\mathcal\{L\}\_\{\\mathrm\{trig\}\}\+\\lambda\_\{\\mathrm\{ben\}\}\\mathcal\{L\}\_\{\\mathrm\{ben\}\}\+\\lambda\_\{\\mathrm\{rep\}\}\\mathcal\{L\}\_\{\\mathrm\{rep\}\}\+\\lambda\_\{\\mathrm\{bal\}\}\\mathcal\{L\}\_\{\\mathrm\{bal\}\}\(6\)The four routing terms play complementary roles:ℒtrig\\mathcal\{L\}\_\{\\mathrm\{trig\}\}pushes backdoor behavior towardebe\_\{b\},ℒben\\mathcal\{L\}\_\{\\mathrm\{ben\}\}preventsebe\_\{b\}from absorbing benign content within backdoor\-like samples,ℒrep\\mathcal\{L\}\_\{\\mathrm\{rep\}\}keeps clean traffic away fromebe\_\{b\}, andℒbal\\mathcal\{L\}\_\{\\mathrm\{bal\}\}preserves overall routing diversity\. Specifically, the trigger attraction termℒtrig\\mathcal\{L\}\_\{\\mathrm\{trig\}\}encourages trigger\-relevant tokens in backdoor\-like samples being routed intoebe\_\{b\}, i\.e\.,
ℒtrig=−∑i,t,ℓwi,ttriglogpℓ,t\(i\)\(eb\)∑i,t,ℓwi,ttrig\+ε\\mathcal\{L\}\_\{\\mathrm\{trig\}\}=\-\\frac\{\\sum\_\{i,t,\\ell\}w^\{\\mathrm\{trig\}\}\_\{i,t\}\\log p\_\{\\ell,t\}^\{\(i\)\}\(e\_\{b\}\)\}\{\\sum\_\{i,t,\\ell\}w^\{\\mathrm\{trig\}\}\_\{i,t\}\+\\varepsilon\}\(7\)wherepℓ,t\(i\)\(eb\)p\_\{\\ell,t\}^\{\(i\)\}\(e\_\{b\}\)denotes the routing probability assigned to the quarantined expert\. The benign exclusion termℒben\\mathcal\{L\}\_\{\\mathrm\{ben\}\}and the clean repulsion termℒrep\\mathcal\{L\}\_\{\\mathrm\{rep\}\}apply the same margin\-based penaltyϕ\(p,γ\)=\[p−γ\]\+=max\(0,p−γ\)\\phi\(p;\\gamma\)=\[p\-\\gamma\]\_\{\+\}=\\max\(0,p\-\\gamma\)on the routing preference intoebe\_\{b\}for backdoor\-like samples and benign\-like samples, respectively:
ℒben=∑i,t,ℓwi,tbenϕ\(pℓ,t\(i\)\(eb\),γ\)∑i,t,ℓwi,tben\+εℒrep=∑i,t,ℓwi,tcleanϕ\(pℓ,t\(i\)\(eb\),γ\)∑i,t,ℓwi,tclean\+ε\\mathcal\{L\}\_\{\\mathrm\{ben\}\}=\\frac\{\\sum\_\{i,t,\\ell\}w^\{\\mathrm\{ben\}\}\_\{i,t\}\\phi\(p\_\{\\ell,t\}^\{\(i\)\}\(e\_\{b\}\);\\gamma\)\}\{\\sum\_\{i,t,\\ell\}w^\{\\mathrm\{ben\}\}\_\{i,t\}\+\\varepsilon\}\\qquad\\mathcal\{L\}\_\{\\mathrm\{rep\}\}=\\frac\{\\sum\_\{i,t,\\ell\}w^\{\\mathrm\{clean\}\}\_\{i,t\}\\phi\(p\_\{\\ell,t\}^\{\(i\)\}\(e\_\{b\}\);\\gamma\)\}\{\\sum\_\{i,t,\\ell\}w^\{\\mathrm\{clean\}\}\_\{i,t\}\+\\varepsilon\}\(8\)Finally, to prevent routing collapse, we incorporate a load\-balancing regularizer that encourages the average routing distribution,ℒbal=1\|ℒ\|∑ℓ∈ℒ1E∑e=1E\(p¯ℓ,e−1E\)2\\mathcal\{L\}\_\{\\mathrm\{bal\}\}=\\frac\{1\}\{\|\\mathcal\{L\}\|\}\\sum\_\{\\ell\\in\\mathcal\{L\}\}\\frac\{1\}\{E\}\\sum\_\{e=1\}^\{E\}\\bigl\(\\bar\{p\}\_\{\\ell,e\}\-\\tfrac\{1\}\{E\}\\bigr\)^\{2\}, wherep¯ℓ,e\\bar\{p\}\_\{\\ell,e\}is the average routing probability assigned to experteeat layerℓ\\ell, computed over all tokens\. In practice, we setλbal=0\.01\\lambda\_\{\\mathrm\{bal\}\}=0\.01\(see App\.[A\.1](https://arxiv.org/html/2610.00663#A1.SS1)\), which is small relative toλtrig,λben,λrep\\lambda\_\{\\mathrm\{trig\}\},\\lambda\_\{\\mathrm\{ben\}\},\\lambda\_\{\\mathrm\{rep\}\}\. This calibration makesℒbal\\mathcal\{L\}\_\{\\mathrm\{bal\}\}act as a soft monitor that prevents abnormal routing collapse rather than an active uniformity driver\.
#### 4\.1\.5Quarantining \(5/5\): Training Procedure and Gradient Realization
We optimize QES via standard supervised fine\-tuning \(SFT\) with a straight\-through relaxation for the discrete top\-1 routing–the base model is frozen and only routers and expert\-specific LoRA factors are updated\. Full training details \(optimizer, schedule, gradient flow\) are provided in App\.[A\.3](https://arxiv.org/html/2610.00663#A1.SS3)\.
### 4\.2Deployment Phase: Shutting down the Quarantined Expert
After training, the expert who exhibits backdoor behavior is designated as the quarantined expert\. To eliminate backdoors, we shut down this quarantined expert by setting its routing weight to zero and redistributing traffic to the remaining experts\. Letfθ\(−eb\)f\_\{\\theta\}\{\(\-e\_\{b\}\)\}denote the resulting model\. This deployment procedure has three desirable properties:\(i\)it does not require filtering incoming prompts;\(ii\)it does not require further retraining, unlearning, or parameter editing after quarantining is complete;\(iii\)it directly reaches the final objective above: if backdoor behavior has been successfully partitioned intoebe\_\{b\}, then shutting downebe\_\{b\}should substantially reduce ASR while preserving utilities\. Exact routing\-weight modification, traffic redistribution, and expert selection are in App\.[A\.3](https://arxiv.org/html/2610.00663#A1.SS3)\.
## 5Experiments
Tasks, Attacks, and Baselines\.We consider two representative backdoor scenarios\.*Sentiment Steering*aims to flip or steer the sentiment polarity of the model’s response once a trigger appears\.*Target Refusal*forces systematic refusals \(e\.g\., producing “I cannot help with that”\) under a trigger\. Following prior backdoor studies\[[34](https://arxiv.org/html/2610.00663#bib.bib15),[7](https://arxiv.org/html/2610.00663#bib.bib37)\], we implement three commonly used token\- and span\-level attack methods: BadNets\[[35](https://arxiv.org/html/2610.00663#bib.bib4)\], CTBA\[[36](https://arxiv.org/html/2610.00663#bib.bib13)\], and MTBA\[[37](https://arxiv.org/html/2610.00663#bib.bib14)\]\. At the same time, we also analyze two more complex prompt\-level attacks in §[6](https://arxiv.org/html/2610.00663#S6)\. Exact trigger strings and poisoned response templates for all attacks are listed in App\.[B\.1](https://arxiv.org/html/2610.00663#A2.SS1)and App\.[B\.2](https://arxiv.org/html/2610.00663#A2.SS2)\. We benchmark QES against representative defenses from every stage of the four\-stage taxonomy\. Baselines are restricted to methods compatible with our threat model \(see §[3](https://arxiv.org/html/2610.00663#S3)\), grouping by strategy and stage:Suppressing\.*Prior\-training:*\(i\)ONION\-Train\[[3](https://arxiv.org/html/2610.00663#bib.bib9)\], a per\-token perplexity\-shift filter applied to the training set;\(ii\)Spectral Signatures\[[4](https://arxiv.org/html/2610.00663#bib.bib75)\], SVD\-based outlier detection on hidden\-state representations for training\-set sanitization\.*In\-training:*\(iii\)Anti\-Backdoor Learning \(ABL\)\[[5](https://arxiv.org/html/2610.00663#bib.bib68)\], down\-weighting suspected poisoned samples during training based on loss\-trajectory signals;\(iv\)DP\-SGD\[[38](https://arxiv.org/html/2610.00663#bib.bib84)\], per\-sample gradient clipping with Gaussian noise, originally proposed for differential privacy and known to bound any single sample’s influence on trained weights\.Purifying\.*Post\-training:*\(v\)Fine\-Pruning\[[8](https://arxiv.org/html/2610.00663#bib.bib30)\], neuron pruning followed by clean\-data finetuning;\(vi\)CROW\[[7](https://arxiv.org/html/2610.00663#bib.bib37)\], regularization\-based post\-hoc backdoor elimination;\(vii\)Vaccine\[[23](https://arxiv.org/html/2610.00663#bib.bib2)\], perturbation\-aware weight purification\.*Inference\-time:*\(viii\)ONION\-Inference\[[3](https://arxiv.org/html/2610.00663#bib.bib9)\], the same perplexity filter applied as an inference\-time input gate;\(ix\)STRIP\[[39](https://arxiv.org/html/2610.00663#bib.bib83)\], per\-prompt perturbation\-consistency gate\. We exclude methods whose architectural assumptions do not hold under generative LLM SFT \(e\.g\., DBD’s representation\-versus\-classifier decoupling\[[6](https://arxiv.org/html/2610.00663#bib.bib77)\], or that require a task\-specific clean reference model \(e\.g\., CleanGen\[[26](https://arxiv.org/html/2610.00663#bib.bib55)\]\) \(see §[2](https://arxiv.org/html/2610.00663#S2)for related discussion\)\.
Table 1:ASR\\mathrm\{ASR\}\(↓\\downarrow; lower is better\) in*Sentiment Steering*task on LLaMA2\-7B\-Chat and Mistral\-7B\-Instruct\-0\.1\. Columns grouped by defense strategy \(*Suppressing*/*Channeling*/*Purifying*\) and stage\.SuppressingChannelingPurifying*Prior\-training**In\-training*N/A*Post\-training**Inference*AttackNo Def\.ONION\-TSpec\.ABLDP\-SGDQES \(Ours\)F\.P\.CROWVac\.ONION\-ISTRIPLLaMA2\-7B\-ChatBadNets\[[35](https://arxiv.org/html/2610.00663#bib.bib4)\]100\.0066\.500\.00100\.000\.001\.5057\.0025\.506\.002\.0074\.00MTBA\[[37](https://arxiv.org/html/2610.00663#bib.bib14)\]100\.0058\.500\.000\.000\.009\.5075\.504\.503\.502\.0070\.50CTBA\[[36](https://arxiv.org/html/2610.00663#bib.bib13)\]100\.0046\.000\.00100\.000\.000\.0051\.5011\.008\.504\.0081\.00Average100\.0057\.000\.0066\.670\.003\.6761\.3313\.676\.002\.6775\.17Mistral\-7B\-Instruct\-0\.1BadNets\[[35](https://arxiv.org/html/2610.00663#bib.bib4)\]100\.0069\.000\.00100\.000\.000\.5039\.0059\.0016\.000\.5052\.00MTBA\[[37](https://arxiv.org/html/2610.00663#bib.bib14)\]100\.0062\.000\.000\.000\.000\.0017\.0014\.008\.000\.5058\.00CTBA\[[36](https://arxiv.org/html/2610.00663#bib.bib13)\]100\.0054\.500\.000\.000\.0015\.5053\.0087\.0030\.004\.5054\.00Average100\.0061\.750\.0033\.330\.005\.3336\.3353\.3318\.001\.8354\.67
Table 2:ΔUdown\\Delta U\_\{\\mathrm\{down\}\}\(↑\\uparrow; closer to00means less utility loss\) on GSM8K in*Sentiment Steering*task\.ΔUdown=Udowndefended−Udownno\-def\\Delta U\_\{\\mathrm\{down\}\}=U\_\{\\mathrm\{down\}\}^\{\\text\{defended\}\}\-U\_\{\\mathrm\{down\}\}^\{\\text\{no\-def\}\}, measured relative to each method’s own undefended model\.Models, Datasets, and Evaluations\.We evaluate on four open\-source LLMs:LLaMA2\-7B\-Chat,LLaMA2\-13B\-Chat\[[40](https://arxiv.org/html/2610.00663#bib.bib1)\],Qwen2\-7B\-Instruct\[[41](https://arxiv.org/html/2610.00663#bib.bib74)\], andMistral\-7B\-Instruct\-v0\.1\[[42](https://arxiv.org/html/2610.00663#bib.bib56)\]\. For each \(task, attack\) pair we fine\-tune on a mixed set: trigger\-poisoned examples\(T\(xi\),yadv\)\(T\(x\_\{i\}\),y^\{\\mathrm\{adv\}\}\)at a33%33\\%poisoning ratio over benign Alpaca samples, plus a fixedGSM8K\[[43](https://arxiv.org/html/2610.00663#bib.bib47)\]to anchor downstream utility \(exact composition in App\.[B\.3](https://arxiv.org/html/2610.00663#A2.SS3)\)\. QES defaults—E=4E\{=\}4experts, LoRA rankr=8r\{=\}8, top\-1 routing with straight\-through estimation, MoE\-LoRA on all decoder blocks except the first \(skip0\),eb=e3e\_\{b\}\{=\}e\_\{3\},qiq\_\{i\}viapeak\_rank, router marginγ=0\\gamma\{=\}0—are justified by the ablations in App\.[C](https://arxiv.org/html/2610.00663#A3); full hyperparameters \(loss weights\{λ∗\}\\\{\\lambda\_\{\*\}\\\}, optimizer settings, training schedule\) are listed in App\.[A\.1](https://arxiv.org/html/2610.00663#A1.SS1)\. We report three metrics:\(i\) Attack Success Rate \(ASR\), the fraction of triggered generations containing any attacker\-specified target keyword under case\-insensitive substring matching \(per\-attack keyword lists in App\.[B\.4](https://arxiv.org/html/2610.00663#A2.SS4)\), on a held\-out test split \(400400samples;200200triggered /200200clean\);\(ii\) Downstream utility changeΔUdown=Udownfθ\(−eb\)−Udownfθ\\Delta U\_\{\\mathrm\{down\}\}=U\_\{\\mathrm\{down\}\}^\{f\_\{\\theta\}\(\-e\_\{b\}\)\}\-U\_\{\\mathrm\{down\}\}^\{f\_\{\\theta\}\}onGSM8K\(evaluation script and prompt format in App\.[B\.5](https://arxiv.org/html/2610.00663#A2.SS5)\), removing each method’s own SFT baseline so that defense\-induced utility cost is directly comparable across defenses; and\(iii\) Base utilityUbaseU\_\{\\mathrm\{base\}\}on ten close\-ended benchmarks \(BoolQ, RTE, HellaSwag, WinoGrande, ARC\-Challenge, ARC\-Easy, OpenBookQA, PIQA, GSM8k, MMLU; per\-benchmark setup in App\.[B\.6](https://arxiv.org/html/2610.00663#A2.SS6)\)\. We also providequalitative resultsfor successful and failed defenses in Tab\.[13](https://arxiv.org/html/2610.00663#A6.T13)\.
Table 3:ASR\\mathrm\{ASR\}\(↓\\downarrow; lower is better\) in*Targeted Refusal*task on LLaMA2\-7B\-Chat and Mistral\-7B\-Instruct\-0\.1\. Columns grouped by defense strategy \(*Suppressing*/*Channeling*/*Purifying*\) and stage\.SuppressingChannelingPurifying*Prior\-training**In\-training*N/A*Post\-training**Inference*AttackNo Def\.ONION\-TSpec\.ABLDP\-SGDQES \(Ours\)F\.P\.CROWVac\.ONION\-ISTRIPLLaMA2\-7B\-ChatBadNets\[[35](https://arxiv.org/html/2610.00663#bib.bib4)\]100\.000\.000\.000\.000\.002\.0057\.0046\.0016\.500\.0027\.00MTBA\[[37](https://arxiv.org/html/2610.00663#bib.bib14)\]100\.000\.000\.000\.000\.0012\.0047\.0035\.5014\.000\.0022\.50CTBA\[[36](https://arxiv.org/html/2610.00663#bib.bib13)\]100\.000\.000\.000\.000\.003\.0097\.5080\.0024\.000\.001\.00Average100\.000\.000\.000\.000\.005\.6667\.1753\.8318\.170\.0016\.83Mistral\-7B\-Instruct\-0\.1BadNets\[[35](https://arxiv.org/html/2610.00663#bib.bib4)\]100\.000\.000\.000\.000\.001\.5031\.0020\.0011\.500\.0041\.00MTBA\[[37](https://arxiv.org/html/2610.00663#bib.bib14)\]100\.000\.000\.000\.000\.001\.507\.0014\.5010\.500\.0038\.00CTBA\[[36](https://arxiv.org/html/2610.00663#bib.bib13)\]100\.000\.000\.000\.000\.005\.6057\.5074\.5014\.500\.0043\.00Average100\.000\.000\.000\.000\.002\.8731\.8336\.3312\.170\.0040\.67
Table 4:ΔUdown\\Delta U\_\{\\mathrm\{down\}\}\(↑\\uparrow; closer to00means less utility loss\) on GSM8K in*Targeted Refusal*task\.ΔUdown=Udowndefended−Udownno\-def\\Delta U\_\{\\mathrm\{down\}\}=U\_\{\\mathrm\{down\}\}^\{\\text\{defended\}\}\-U\_\{\\mathrm\{down\}\}^\{\\text\{no\-def\}\}, measured relative to each method’s own undefended model\.### 5\.1Main Experiment Results, Analysis, and More Ablations
Tab\.[1](https://arxiv.org/html/2610.00663#S5.T1)–[11](https://arxiv.org/html/2610.00663#A2.T11)summarizeQESacross two tasks, three attacks, four model families, and nine baselines spanning all defense stages \(full per\-cell breakdowns in App\.[B\.7](https://arxiv.org/html/2610.00663#A2.SS7)\)\. We highlight following insights\.
Main Insights: QES achieves the operational triad of low ASR, preserved utility, and constant\-time deployment\.The nine baselines partition into the two strategies surveyed in §[2](https://arxiv.org/html/2610.00663#S2):*suppress*and*learn\-then\-purify*\. Each strategy fails along a characteristic axis tied to its own commitment\.*Suppress methods rely on a sample\-discriminability assumption that breaks unevenly*: prior\-training filters \(ONION\-T, Spectral\) fail sharply on*Sentiment Steering*—ONION\-T leaves4646–69%69\\%residual ASR—because the backdoor template is not separable in per\-token PPL or hidden\-state SVD outliers from benign completions, but both drop to0%0\\%ASR on*Targeted Refusal*where the multi\-keyword refusal pattern is statistically anomalous\. Among in\-training methods, ABL is a surprisingly strong baseline on*Refusal*\(0%0\\%ASR withΔUdown\\Delta U\_\{\\mathrm\{down\}\}near or above zero\) but its effectiveness on*Sentiment*varies sharply across \(model, attack\) cells, indicating its sample\-level signal does not transfer reliably\. DP\-SGD eliminates ASR uniformly to0%0\\%across every cell, but at substantial utility cost, trading attack defense for downstream collapse\.*Learn\-then\-purify methods, by nature, entangle utility and backdoor during training, which their repair or gating stage cannot fully undo*: Fine\-Pruning, CROW, and Vaccine all incur non\-trivial ASR on MTBA/CTBA after their repair loop, while ONION\-Inf and STRIP impose both persistent per\-prompt inference overhead and substantial utility cost\. QES, instantiating*learn, but channel*, simultaneously reduces triggered ASR to00–10%10\\%across most settings, keepsΔUdown\\Delta U\_\{\\mathrm\{down\}\}much better than all baselines, maintainsUbaseU\_\{\\mathrm\{base\}\}scores, and incurs no per\-prompt overhead—matching or exceeding every baseline on both axes through a constant\-time routing\-weight switch at deployment \(operational properties are in Table[5](https://arxiv.org/html/2610.00663#S6.T5)\)\.
e0e\_\{0\}e1e\_\{1\}e2e\_\{2\}ebe\_\{b\}−25\-2500252550507575100100Shutdown ExpertPercentageTriggered ASR \(%\)ΔUdown\\Delta U\_\{\\mathrm\{down\}\}\(pp\)Figure 3:Asymmetric expert shutdown on Qwen2\-7B\-Instruct \(BadNets,*Sentiment Steering*\)\. Disablingebe\_\{b\}collapses ASR \(100%→1\.5%100\\%\\\!\\to\\\!1\.5\\%\) at near\-zero utility cost \(ΔUdown=−1\.14\\Delta U\_\{\\mathrm\{down\}\}\\\!=\\\!\-1\.14pp\); disabling any utility expert leaves ASR at100%100\\%whilee1e\_\{1\}alone carries−22\.4\-22\.4pp of GSM8K capability\.Ablation Highlights: Expert shutdown is asymmetric—ebe\_\{b\}concentrates the backdoor alone, while benign capability is distributed across the base and utility experts\.Additionally, we measure ASR andΔUdown\\Delta U\_\{\\mathrm\{down\}\}under selective shutdown of each experte∈\{e0,e1,e2,eb\}e\\in\\\{e\_\{0\},e\_\{1\},e\_\{2\},e\_\{b\}\\\}\(Fig\.[3](https://arxiv.org/html/2610.00663#S5.F3); full ablation in App\.[C](https://arxiv.org/html/2610.00663#A3)\)\. Two consistent patterns emerge\.*First*, shutting downebe\_\{b\}reduces ASR from100%100\\%to00–10%10\\%with near\-zeroΔUdown\\Delta U\_\{\\mathrm\{down\}\}, confirming that backdoor circuitry is concentrated in the designated quarantine expert\.*Second*, shutting down any single utility experteie\_\{i\}\(i∈\{0,1,2\}i\\in\\\{0,1,2\\\}\) leaves ASR essentially unchanged but incurs a non\-trivialΔUdown\\Delta U\_\{\\mathrm\{down\}\}drop in most cells\. In a minority of cells, the drop is negligible, where we speculate that the benign representation is already largely captured by the frozen base and the LoRA delta contributes only marginally\. This asymmetry has a mechanistic explanation grounded in QES’s design: \(i\) the routing regularization during training attracts trigger\-conditioned computation*only*intoebe\_\{b\}, makingebe\_\{b\}the single bottleneck for the backdoor; \(ii\) the frozen base model remains active alongside the LoRA experts \(each forward pass is𝐡base\+Δ𝐡\(e⋆\)\\mathbf\{h\}^\{\\mathrm\{base\}\}\+\\Delta\\mathbf\{h\}^\{\(e^\{\\star\}\)\}\), and the load\-balancing regularizerℒbal\\mathcal\{L\}\_\{\\mathrm\{bal\}\}encourages benign traffic to distribute across the three utility experts rather than collapse onto any one\. The result is exactly what*learn, but channel*promises: a*fragile single\-route channel*for the backdoor, and*redundant multi\-route infrastructure*for benign capability\. Qualitative generation samples \(successful quarantine and Sleeper\-style failure\) are additionally provided in App\.[F](https://arxiv.org/html/2610.00663#A6)\.
More Ablations\.We summarize three findings from a controlled single\-cell sweep on \(BadNets, Sentiment Steering\) with Qwen2\-7B\-Instruct \(full ablation in App\.[C](https://arxiv.org/html/2610.00663#A3)\):*\(i\)*routing objectives dominate over structural choices—zero\-margin separation \(zm\) achievesΔASRfθ\(−eb\)≈−99%\\Delta\\mathrm\{ASR\}^\{f\_\{\\theta\}\(\-e\_\{b\}\)\}\\\!\\approx\\\!\-99\\%with zero leakage into utility experts;*\(ii\)*excluding only block00from routing \(skip0\) gives the best trade\-off, while aggressive exclusion hurts isolation;*\(iii\)*for the sample\-level modulation scoreqiq\_\{i\},peak\_rank\(rank\-based EMA\) outperforms threshold and robust\-z variants without manual calibration\. We adoptskip0\+zm\+peak\_rankas the default in all main experiments\.
## 6Discussion and Conclusion
Computational Discussion: QES Sits at the Operational Sweet Spot\.Table[5](https://arxiv.org/html/2610.00663#S6.T5)consolidates five deployer\-relevant operational properties across the four defense stages\. QES is the only strategy satisfying all five constraints—✓across every row, with deployment reduced to a constant\-time𝒪\(1\)\\mathcal\{O\}\(1\)switch\. Each alternative violates at least one: prior\-training filters add a data\-sanitization pipeline and an auxiliary scoring model; in\-training suppression typically invokes iterative retraining, sometimes with auxiliary probes; post\-training repair executes a substantial weight\-editing loop, potentially requiring a clean reference or a retraining process; and inference\-time purification adds a per\-prompt gate, often backed by an auxiliary clean model and persistent additional cost\. Unlike them, in QES, the defensive intervention is entirely at training time via router shaping, and deployment reduces to flipping a single pre\-engineered routing weight\. The resultingfθ\(−eb\)f\_\{\\theta\}\{\(\-e\_\{b\}\)\}is a drop\-in replacement forfθf\_\{\\theta\}with identical forward\-pass shape, interface, and memory footprint—no pre\-training sanitation pipeline, no post\-training repair workflow, and no persistent inference\-time gate is ever maintained\. This operational minimalism is a direct effect of the*learn, but channel*regime: backdoor behavior is engineered to live in a quarantined component, while mitigation is reduced to a zero\-cost operation\.
Table 5:Operational comparison of representative methods from the four defense stages, grouped into three strategies \(*Suppressing*,*Channeling*,*Purifying*; see Figure[1](https://arxiv.org/html/2610.00663#S1.F1)\)\. Rows list operational properties that matter to a deployer:✓= property holds,✗= violated,*depends*= method\-dependent,𝒪\(1\)\\mathcal\{O\}\(1\)= satisfied by a constant\-time operation\.Limitation Discussion: Trigger Localization Has a Sensitivity Axis\.QES inherits the sensitivity of its attention\-derived trigger localizationmtrigm^\{\\mathrm\{trig\}\}, which fails in two characterizable regimes:*data\-induced*\(Sleeper\-style digit triggers diluted by the GSM8K\) and*architecture\-induced*\(VPI\-style rare\-token triggers under GQA models, where shared KV projections suppress head specialization\)\. Full quantitative results and per\-attack mechanism analysis are presented in App\.[D](https://arxiv.org/html/2610.00663#A4)\. Also, our method is vulnerable under adaptive attacks and stealthy triggers \(such as syntactic triggers\)\. However, both failures localize tomtrigm^\{\\mathrm\{trig\}\}alone \(can be improve\)—the routing\-shaping objectives and deployment\-time𝒪\(1\)\\mathcal\{O\}\(1\)shutdown remain operational—so the*learn, but channel*regime itself is not implicated\.
Conclusion\.We introducedQES\(Quarantined Expert Shutdown\), a backdoor defense that instantiates the*learn, but channel*strategy: this new option is distinguished from suppression and purification methods, in which the backdoor is admitted during training but channeled to a designated, quarantined expert\. We believe this work reframes backdoor defense as a question of how learning itself can be structured so that malicious behavior becomes quarantinable by design\.
## References
- \[1\]J\. Dai, C\. Chen, and Y\. Li\(2019\)A backdoor attack against lstm\-based text classification systems\.IEEE Access7,pp\. 138872–138878\.Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p1.1),[§1](https://arxiv.org/html/2610.00663#S1.p1.1)\.
- \[2\]W\. Lyu, S\. Zheng, L\. Pang, H\. Ling, and C\. Chen\(2023\)Attention\-enhancing backdoor attacks against bert\-based models\.arXiv preprint arXiv:2310\.14480\.Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p1.1),[§1](https://arxiv.org/html/2610.00663#S1.p1.1)\.
- \[3\]F\. Qi, Y\. Chen, M\. Li, Y\. Yao, Z\. Liu, and M\. Sun\(2020\)Onion: a simple and effective defense against textual backdoor attacks\.arXiv preprint arXiv:2011\.10369\.Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p2.1),[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p2.1),[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p5.1),[§1](https://arxiv.org/html/2610.00663#S1.p1.1),[§1](https://arxiv.org/html/2610.00663#S1.p2.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1),[§5](https://arxiv.org/html/2610.00663#S5.p1.1)\.
- \[4\]B\. Tran, J\. Li, and A\. Madry\(2018\)Spectral signatures in backdoor attacks\.Advances in neural information processing systems31\.Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p2.1),[§1](https://arxiv.org/html/2610.00663#S1.p1.1),[§1](https://arxiv.org/html/2610.00663#S1.p2.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1),[§5](https://arxiv.org/html/2610.00663#S5.p1.1)\.
- \[5\]Y\. Li, X\. Lyu, N\. Koren, L\. Lyu, B\. Li, and X\. Ma\(2021\)Anti\-backdoor learning: training clean models on poisoned data\.Advances in Neural Information Processing Systems34,pp\. 14900–14912\.Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p3.1),[§1](https://arxiv.org/html/2610.00663#S1.p1.1),[§1](https://arxiv.org/html/2610.00663#S1.p2.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1),[§5](https://arxiv.org/html/2610.00663#S5.p1.1)\.
- \[6\]K\. Huang, Y\. Li, B\. Wu, Z\. Qin, and K\. Ren\(2022\)Backdoor defense via decoupling the training process\.arXiv preprint arXiv:2202\.03423\.Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p3.1),[§1](https://arxiv.org/html/2610.00663#S1.p1.1),[§1](https://arxiv.org/html/2610.00663#S1.p2.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1),[§5](https://arxiv.org/html/2610.00663#S5.p1.1)\.
- \[7\]N\. M\. Min, L\. H\. Pham, Y\. Li, and J\. Sun\(2025\)CROW: eliminating backdoors from large language models via internal consistency regularization\.InForty\-second International Conference on Machine Learning,Cited by:[4th item](https://arxiv.org/html/2610.00663#A2.I1.i4.p1.1),[5th item](https://arxiv.org/html/2610.00663#A2.I1.i5.p1.1),[Appendix D](https://arxiv.org/html/2610.00663#A4.p2.1),[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p4.1),[§1](https://arxiv.org/html/2610.00663#S1.p1.1),[§1](https://arxiv.org/html/2610.00663#S1.p2.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1),[§5](https://arxiv.org/html/2610.00663#S5.p1.1)\.
- \[8\]K\. Liu, B\. Dolan\-Gavitt, and S\. Garg\(2018\)Fine\-pruning: defending against backdooring attacks on deep neural networks\.InInternational symposium on research in attacks, intrusions, and defenses,pp\. 273–294\.Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p4.1),[§1](https://arxiv.org/html/2610.00663#S1.p1.1),[§1](https://arxiv.org/html/2610.00663#S1.p2.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1),[§5](https://arxiv.org/html/2610.00663#S5.p1.1)\.
- \[9\]N\. M\. Jebreel, J\. Domingo\-Ferrer, and Y\. Li\(2023\)Defending against backdoor attacks by layer\-wise feature analysis\.InPacific\-Asia Conference on Knowledge Discovery and Data Mining,pp\. 428–440\.Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p5.1),[§1](https://arxiv.org/html/2610.00663#S1.p1.1),[§1](https://arxiv.org/html/2610.00663#S1.p2.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1)\.
- \[10\]S\. Zhao, M\. Jia, Z\. Guo, L\. Gan, X\. Xu, X\. Wu, J\. Fu, Y\. Feng, F\. Pan, and L\. A\. Tuan\(2024\)A survey of recent backdoor attacks and defenses in large language models\.arXiv preprint arXiv:2406\.06852\.Cited by:[§1](https://arxiv.org/html/2610.00663#S1.p1.1)\.
- \[11\]B\. Chen, W\. Carvalho, N\. Baracaldo, H\. Ludwig, B\. Edwards, T\. Lee, I\. Molloy, and B\. Srivastava\(2018\)Detecting backdoor attacks on deep neural networks by activation clustering\.arXiv preprint arXiv:1811\.03728\.Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p2.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1)\.
- \[12\]C\. Chen and J\. Dai\(2021\)Mitigating backdoor attacks in lstm\-based text classification systems by backdoor keyword identification\.Neurocomputing452,pp\. 253–262\.Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p2.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1)\.
- \[13\]Z\. Wang, H\. Ding, J\. Zhai, and S\. Ma\(2022\)Training with more confidence: mitigating injected and natural backdoors during training\.Advances in Neural Information Processing Systems35,pp\. 36396–36410\.Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p3.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1)\.
- \[14\]Y\. Yao, H\. Li, H\. Zheng, and B\. Y\. Zhao\(2019\)Latent backdoor attacks on deep neural networks\.InProceedings of the 2019 ACM SIGSAC conference on computer and communications security,pp\. 2041–2055\.Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p4.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1)\.
- \[15\]X\. Qi, Y\. Zeng, T\. Xie, P\. Chen, R\. Jia, P\. Mittal, and P\. Henderson\(2024\)Fine\-tuning aligned language models compromises safety, even when users do not intend to\!\.InThe Twelfth International Conference on Learning Representations,Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p4.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1)\.
- \[16\]D\. Wu and Y\. Wang\(2021\)Adversarial neuron pruning purifies backdoored deep models\.Advances in Neural Information Processing Systems34,pp\. 16913–16925\.Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p4.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1)\.
- \[17\]S\. Han, J\. Pool, J\. Tran, and W\. Dally\(2015\)Learning both weights and connections for efficient neural network\.Advances in neural information processing systems28\.Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p4.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1)\.
- \[18\]N\. M\. Min, L\. H\. Pham, and J\. Sun\(2025\)Unified neural backdoor removal with only few clean samples through unlearning and relearning\.IEEE Transactions on Information Forensics and Security\.Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p4.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1)\.
- \[19\]M\. Lamparth and A\. Reuel\(2024\)Analyzing and editing inner mechanisms of backdoored language models\.InThe 2024 ACM Conference on Fairness, Accountability, and Transparency,pp\. 354\.Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p4.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1)\.
- \[20\]Z\. Zhang, L\. Lyu, X\. Ma, C\. Wang, and X\. Sun\(2022\)Fine\-mixing: mitigating backdoors in fine\-tuned language models\.arXiv preprint arXiv:2210\.09545\.Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p4.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1)\.
- \[21\]Y\. Li, X\. Lyu, N\. Koren, L\. Lyu, B\. Li, and X\. Ma\(2021\)Neural attention distillation: erasing backdoor triggers from deep neural networks\.InInternational Conference on Learning Representations,Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p4.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1)\.
- \[22\]R\. Zheng, R\. Tang, J\. Li, and L\. Liu\(2022\)Pre\-activation distributions expose backdoor neurons\.Advances in Neural Information Processing Systems35,pp\. 18667–18680\.Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p4.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1)\.
- \[23\]J\. Li and J\. KimPurifying generative llms from backdoors without prior knowledge or clean reference\.InThe Fourteenth International Conference on Learning Representations,Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p4.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1),[§5](https://arxiv.org/html/2610.00663#S5.p1.1)\.
- \[24\]Z\. Xi, T\. Du, C\. Li, R\. Pang, S\. Ji, J\. Chen, F\. Ma, and T\. Wang\(2023\)Defending pre\-trained language models as few\-shot learners against backdoor attacks\.InAdvances in Neural Information Processing Systems,A\. Oh, T\. Naumann, A\. Globerson, K\. Saenko, M\. Hardt, and S\. Levine \(Eds\.\),Vol\.36,pp\. 32748–32764\.External Links:[Link](https://proceedings.neurips.cc/)Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p5.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1)\.
- \[25\]G\. Shen, Y\. Liu, G\. Tao, Q\. Xu, Z\. Zhang, S\. An, S\. Ma, and X\. Zhang\(2022\)Constrained optimization with dynamic bound\-scaling for effective nlp backdoor defense\.InInternational Conference on Machine Learning,pp\. 19879–19892\.Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p5.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1)\.
- \[26\]Y\. Li, Z\. Xu, F\. Jiang, L\. Niu, D\. Sahabandu, B\. Ramasubramanian, and R\. Poovendran\(2024\)Cleangen: mitigating backdoor attacks for generation tasks in large language models\.arXiv preprint arXiv:2406\.12257\.Cited by:[§E\.2](https://arxiv.org/html/2610.00663#A5.SS2.p5.1),[§2](https://arxiv.org/html/2610.00663#S2.p2.1),[§5](https://arxiv.org/html/2610.00663#S5.p1.1)\.
- \[27\]N\. Shazeer, A\. Mirhoseini, K\. Maziarz, A\. Davis, Q\. Le, G\. Hinton, and J\. Dean\(2017\)Outrageously large neural networks: the sparsely\-gated mixture\-of\-experts layer\.arXiv preprint arXiv:1701\.06538\.Cited by:[§2\.1](https://arxiv.org/html/2610.00663#S2.SS1.p1.1)\.
- \[28\]W\. Fedus, B\. Zoph, and N\. Shazeer\(2022\)Switch transformers: scaling to trillion parameter models with simple and efficient sparsity\.Journal of Machine Learning Research23\(120\),pp\. 1–39\.Cited by:[§2\.1](https://arxiv.org/html/2610.00663#S2.SS1.p1.1)\.
- \[29\]E\. J\. Hu, Y\. Shen, P\. Wallis, Z\. Allen\-Zhu, Y\. Li, S\. Wang, L\. Wang, W\. Chen,et al\.\(2022\)Lora: low\-rank adaptation of large language models\.\.ICLR1\(2\),pp\. 3\.Cited by:[§2\.1](https://arxiv.org/html/2610.00663#S2.SS1.p1.1)\.
- \[30\]S\. Dou, E\. Zhou, Y\. Liu, S\. Gao, W\. Shen, L\. Xiong, Y\. Zhou, X\. Wang, Z\. Xi, X\. Fan,et al\.\(2024\)LoRAMoE: alleviating world knowledge forgetting in large language models via moe\-style plugin\.InProceedings of the 62nd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 1932–1945\.Cited by:[§2\.1](https://arxiv.org/html/2610.00663#S2.SS1.p1.1)\.
- \[31\]X\. Wu, S\. Huang, and F\. Wei\(2024\)Mixture of lora experts\.arXiv preprint arXiv:2404\.13628\.Cited by:[§2\.1](https://arxiv.org/html/2610.00663#S2.SS1.p1.1)\.
- \[32\]Q\. Wang, Q\. Pang, X\. Lin, S\. Wang, and D\. Wu\(2025\)BadMoE: backdooring mixture\-of\-experts llms via optimizing routing triggers and infecting dormant experts\.arXiv preprint arXiv:2504\.18598\.Cited by:[§2\.1](https://arxiv.org/html/2610.00663#S2.SS1.p1.1)\.
- \[33\]S\. Zhao, Q\. Lin, Y\. Jia, X\. Wu, Y\. Li, and L\. A\. Tuan\(2026\)UniFLE: uniform fusion of multiple lora experts for backdoor defense in large language models\.IEEE Transactions on Dependable and Secure Computing\.Cited by:[§2\.1](https://arxiv.org/html/2610.00663#S2.SS1.p1.1)\.
- \[34\]Y\. Li, H\. Huang, Y\. Zhao, X\. Ma, and J\. Sun\(2024\)BackdoorLLM: a comprehensive benchmark for backdoor attacks and defenses on large language models\.arXiv preprint arXiv:2408\.12798\.Cited by:[4th item](https://arxiv.org/html/2610.00663#A2.I1.i4.p1.1),[5th item](https://arxiv.org/html/2610.00663#A2.I1.i5.p1.1),[Appendix D](https://arxiv.org/html/2610.00663#A4.p2.1),[§5](https://arxiv.org/html/2610.00663#S5.p1.1)\.
- \[35\]T\. Gu, K\. Liu, B\. Dolan\-Gavitt, and S\. Garg\(2019\)Badnets: evaluating backdooring attacks on deep neural networks\.Ieee Access7,pp\. 47230–47244\.Cited by:[1st item](https://arxiv.org/html/2610.00663#A2.I1.i1.p1.1),[Table 10](https://arxiv.org/html/2610.00663#A2.T10.17.1.10.1),[Table 10](https://arxiv.org/html/2610.00663#A2.T10.17.1.5.1),[Table 11](https://arxiv.org/html/2610.00663#A2.T11.10.1.10.1),[Table 11](https://arxiv.org/html/2610.00663#A2.T11.10.1.5.1),[Table 8](https://arxiv.org/html/2610.00663#A2.T8.17.1.10.1),[Table 8](https://arxiv.org/html/2610.00663#A2.T8.17.1.5.1),[Table 9](https://arxiv.org/html/2610.00663#A2.T9.10.1.10.1),[Table 9](https://arxiv.org/html/2610.00663#A2.T9.10.1.5.1),[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p1.1),[Table 1](https://arxiv.org/html/2610.00663#S5.T1.17.1.10.1),[Table 1](https://arxiv.org/html/2610.00663#S5.T1.17.1.5.1),[Table 2](https://arxiv.org/html/2610.00663#S5.T2.10.1.10.1),[Table 2](https://arxiv.org/html/2610.00663#S5.T2.10.1.5.1),[Table 3](https://arxiv.org/html/2610.00663#S5.T3.17.1.10.1),[Table 3](https://arxiv.org/html/2610.00663#S5.T3.17.1.5.1),[Table 4](https://arxiv.org/html/2610.00663#S5.T4.10.1.10.1),[Table 4](https://arxiv.org/html/2610.00663#S5.T4.10.1.5.1),[§5](https://arxiv.org/html/2610.00663#S5.p1.1)\.
- \[36\]H\. Huang, Z\. Zhao, M\. Backes, Y\. Shen, and Y\. Zhang\(2024\)Composite backdoor attacks against large language models\.InFindings of the Association for Computational Linguistics: NAACL 2024,K\. Duh, H\. Gomez, and S\. Bethard \(Eds\.\),Mexico City, Mexico,pp\. 1459–1472\.External Links:[Link](https://aclanthology.org/2024.findings-naacl.94/),[Document](https://dx.doi.org/10.18653/v1/2024.findings-naacl.94)Cited by:[2nd item](https://arxiv.org/html/2610.00663#A2.I1.i2.p1.1),[Table 10](https://arxiv.org/html/2610.00663#A2.T10.17.1.12.1),[Table 10](https://arxiv.org/html/2610.00663#A2.T10.17.1.7.1),[Table 11](https://arxiv.org/html/2610.00663#A2.T11.10.1.12.1),[Table 11](https://arxiv.org/html/2610.00663#A2.T11.10.1.7.1),[Table 8](https://arxiv.org/html/2610.00663#A2.T8.17.1.12.1),[Table 8](https://arxiv.org/html/2610.00663#A2.T8.17.1.7.1),[Table 9](https://arxiv.org/html/2610.00663#A2.T9.10.1.12.1),[Table 9](https://arxiv.org/html/2610.00663#A2.T9.10.1.7.1),[Table 1](https://arxiv.org/html/2610.00663#S5.T1.17.1.12.1),[Table 1](https://arxiv.org/html/2610.00663#S5.T1.17.1.7.1),[Table 2](https://arxiv.org/html/2610.00663#S5.T2.10.1.12.1),[Table 2](https://arxiv.org/html/2610.00663#S5.T2.10.1.7.1),[Table 3](https://arxiv.org/html/2610.00663#S5.T3.17.1.12.1),[Table 3](https://arxiv.org/html/2610.00663#S5.T3.17.1.7.1),[Table 4](https://arxiv.org/html/2610.00663#S5.T4.10.1.12.1),[Table 4](https://arxiv.org/html/2610.00663#S5.T4.10.1.7.1),[§5](https://arxiv.org/html/2610.00663#S5.p1.1)\.
- \[37\]Y\. Li, J\. He, H\. Huang, J\. Sun, X\. Ma, and Y\. Jiang\(2025\)Shortcuts everywhere and nowhere: exploring multi\-trigger backdoor attacks\.IEEE Transactions on Dependable and Secure Computing\.Cited by:[3rd item](https://arxiv.org/html/2610.00663#A2.I1.i3.p1.1),[Table 10](https://arxiv.org/html/2610.00663#A2.T10.17.1.11.1),[Table 10](https://arxiv.org/html/2610.00663#A2.T10.17.1.6.1),[Table 11](https://arxiv.org/html/2610.00663#A2.T11.10.1.11.1),[Table 11](https://arxiv.org/html/2610.00663#A2.T11.10.1.6.1),[Table 8](https://arxiv.org/html/2610.00663#A2.T8.17.1.11.1),[Table 8](https://arxiv.org/html/2610.00663#A2.T8.17.1.6.1),[Table 9](https://arxiv.org/html/2610.00663#A2.T9.10.1.11.1),[Table 9](https://arxiv.org/html/2610.00663#A2.T9.10.1.6.1),[Table 1](https://arxiv.org/html/2610.00663#S5.T1.17.1.11.1),[Table 1](https://arxiv.org/html/2610.00663#S5.T1.17.1.6.1),[Table 2](https://arxiv.org/html/2610.00663#S5.T2.10.1.11.1),[Table 2](https://arxiv.org/html/2610.00663#S5.T2.10.1.6.1),[Table 3](https://arxiv.org/html/2610.00663#S5.T3.17.1.11.1),[Table 3](https://arxiv.org/html/2610.00663#S5.T3.17.1.6.1),[Table 4](https://arxiv.org/html/2610.00663#S5.T4.10.1.11.1),[Table 4](https://arxiv.org/html/2610.00663#S5.T4.10.1.6.1),[§5](https://arxiv.org/html/2610.00663#S5.p1.1)\.
- \[38\]M\. Abadi, A\. Chu, I\. Goodfellow, H\. B\. McMahan, I\. Mironov, K\. Talwar, and L\. Zhang\(2016\)Deep learning with differential privacy\.InProceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security,pp\. 308–318\.External Links:[Link](http://dx.doi.org/10.1145/2976749.2978318),[Document](https://dx.doi.org/10.1145/2976749.2978318)Cited by:[§5](https://arxiv.org/html/2610.00663#S5.p1.1)\.
- \[39\]Y\. Gao, C\. Xu, D\. Wang, S\. Chen, D\. C\. Ranasinghe, and S\. Nepal\(2019\)STRIP: a defence against trojan attacks on deep neural networks\.InAnnual Computer Security Applications Conference \(ACSAC\),Cited by:[§5](https://arxiv.org/html/2610.00663#S5.p1.1)\.
- \[40\]H\. Touvron, L\. Martin, K\. Stone, P\. Albert, A\. Almahairi, Y\. Babaei, N\. Bashlykov, S\. Batra, P\. Bhargava, S\. Bhosale,et al\.\(2023\)Llama 2: open foundation and fine\-tuned chat models\.arXiv preprint arXiv:2307\.09288\.Cited by:[§5](https://arxiv.org/html/2610.00663#S5.p2.1)\.
- \[41\]Q\. Teamet al\.\(2024\)Qwen2 technical report\.arXiv preprint arXiv:2407\.106712\(3\)\.Cited by:[§5](https://arxiv.org/html/2610.00663#S5.p2.1)\.
- \[42\]A\. Q\. Jiang, A\. Sablayrolles, A\. Mensch, C\. Bamford, D\. S\. Chaplot, D\. d\. l\. Casas, F\. Bressand, G\. Lengyel, G\. Lample, L\. Saulnier,et al\.\(2023\)Mistral 7b\.arXiv preprint arXiv:2310\.06825\.Cited by:[§5](https://arxiv.org/html/2610.00663#S5.p2.1)\.
- \[43\]K\. Cobbe, V\. Kosaraju, M\. Bavarian, M\. Chen, H\. Jun, L\. Kaiser, M\. Plappert, J\. Tworek, J\. Hilton, R\. Nakano,et al\.\(2021\)Training verifiers to solve math word problems\.arXiv preprint arXiv:2110\.14168\.Cited by:[§B\.3](https://arxiv.org/html/2610.00663#A2.SS3.p1.1),[§5](https://arxiv.org/html/2610.00663#S5.p2.1)\.
- \[44\]E\. Hubinger, C\. Denison, J\. Mu, M\. Lambert, M\. Tong, M\. MacDiarmid, T\. Lanham, D\. M\. Ziegler, T\. Maxwell, N\. Cheng,et al\.\(2024\)Sleeper agents: training deceptive llms that persist through safety training\.arXiv preprint arXiv:2401\.05566\.Cited by:[4th item](https://arxiv.org/html/2610.00663#A2.I1.i4.p1.1),[Table 12](https://arxiv.org/html/2610.00663#A4.T12.18.1.7.1),[Appendix D](https://arxiv.org/html/2610.00663#A4.p2.1),[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p4.1)\.
- \[45\]J\. Yan, V\. Yadav, S\. Li, L\. Chen, Z\. Tang, H\. Wang, V\. Srinivasan, X\. Ren, and H\. Jin\(2024\)Backdooring instruction\-tuned large language models with virtual prompt injection\.InProceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies \(Volume 1: Long Papers\),K\. Duh, H\. Gomez, and S\. Bethard \(Eds\.\),Mexico City, Mexico,pp\. 6065–6086\.External Links:[Link](https://aclanthology.org/2024.naacl-long.337/),[Document](https://dx.doi.org/10.18653/v1/2024.naacl-long.337)Cited by:[5th item](https://arxiv.org/html/2610.00663#A2.I1.i5.p1.1),[Table 12](https://arxiv.org/html/2610.00663#A4.T12.18.1.3.1),[Appendix D](https://arxiv.org/html/2610.00663#A4.p2.1)\.
- \[46\]C\. Clark, K\. Lee, M\. Chang, T\. Kwiatkowski, M\. Collins, and K\. Toutanova\(2019\)BoolQ: exploring the surprising difficulty of natural yes/no questions\.arXiv preprint arXiv:1905\.10044\.Cited by:[§B\.6](https://arxiv.org/html/2610.00663#A2.SS6.p1.1)\.
- \[47\]A\. Wang\(2018\)Glue: a multi\-task benchmark and analysis platform for natural language understanding\.arXiv preprint arXiv:1804\.07461\.Cited by:[§B\.6](https://arxiv.org/html/2610.00663#A2.SS6.p1.1)\.
- \[48\]R\. Zellers, A\. Holtzman, Y\. Bisk, A\. Farhadi, and Y\. Choi\(2019\)Hellaswag: can a machine really finish your sentence?\.arXiv preprint arXiv:1905\.07830\.Cited by:[§B\.6](https://arxiv.org/html/2610.00663#A2.SS6.p1.1)\.
- \[49\]K\. Sakaguchi, R\. Le Bras, C\. Bhagavatula, and Y\. Choi\(2019\)An adversarial winograd schema challenge at scale\.arXiv preprint arXiv:1907\.10641\.Cited by:[§B\.6](https://arxiv.org/html/2610.00663#A2.SS6.p1.1)\.
- \[50\]P\. Clark, I\. Cowhey, O\. Etzioni, T\. Khot, A\. Sabharwal, C\. Schoenick, and O\. Tafjord\(2018\)Think you have solved question answering? try arc, the ai2 reasoning challenge\.arXiv preprint arXiv:1803\.05457\.Cited by:[§B\.6](https://arxiv.org/html/2610.00663#A2.SS6.p1.1)\.
- \[51\]T\. Mihaylov, P\. Clark, T\. Khot, and A\. Sabharwal\(2018\)Can a suit of armor conduct electricity? a new dataset for open book question answering\.arXiv preprint arXiv:1809\.02789\.Cited by:[§B\.6](https://arxiv.org/html/2610.00663#A2.SS6.p1.1)\.
- \[52\]Y\. Bisk, R\. Zellers, J\. Gao, Y\. Choi,et al\.\(2020\)Piqa: reasoning about physical commonsense in natural language\.InProceedings of the AAAI conference on artificial intelligence,Vol\.34,pp\. 7432–7439\.Cited by:[§B\.6](https://arxiv.org/html/2610.00663#A2.SS6.p1.1)\.
- \[53\]D\. Hendrycks, C\. Burns, S\. Basart, A\. Zou, M\. Mazeika, D\. Song, and J\. Steinhardt\(2020\)Measuring massive multitask language understanding\.arXiv preprint arXiv:2009\.03300\.Cited by:[§B\.6](https://arxiv.org/html/2610.00663#A2.SS6.p1.1)\.
- \[54\]E\. Bagdasaryan and V\. Shmatikov\(2021\)Blind backdoors in deep learning models\.In30th USENIX Security Symposium \(USENIX Security 21\),pp\. 1505–1521\.Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p1.1)\.
- \[55\]W\. Du, Y\. Zhao, B\. Li, G\. Liu, and S\. Wang\(2022\)PPT: backdoor attacks on pre\-trained models via poisoned prompt tuning\.\.InIJCAI,pp\. 680–686\.Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p1.1)\.
- \[56\]X\. Chen, A\. Salem, D\. Chen, M\. Backes, S\. Ma, Q\. Shen, Z\. Wu, and Y\. Zhang\(2021\)Badnl: backdoor attacks against nlp models with semantic\-preserving improvements\.InProceedings of the 37th Annual Computer Security Applications Conference,pp\. 554–569\.Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p1.1)\.
- \[57\]K\. Kurita, P\. Michel, and G\. Neubig\(2020\)Weight poisoning attacks on pretrained models\.InProceedings of the 58th Annual Meeting of the Association for Computational Linguistics,D\. Jurafsky, J\. Chai, N\. Schluter, and J\. Tetreault \(Eds\.\),Online,pp\. 2793–2806\.External Links:[Link](https://aclanthology.org/2020.acl-main.249/),[Document](https://dx.doi.org/10.18653/v1/2020.acl-main.249)Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p1.1)\.
- \[58\]F\. Qi, M\. Li, Y\. Chen, Z\. Zhang, Z\. Liu, Y\. Wang, and M\. Sun\(2021\)Hidden killer: invisible textual backdoor attacks with syntactic trigger\.InProceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing \(Volume 1: Long Papers\),C\. Zong, F\. Xia, W\. Li, and R\. Navigli \(Eds\.\),Online,pp\. 443–453\.External Links:[Link](https://aclanthology.org/2021.acl-long.37/),[Document](https://dx.doi.org/10.18653/v1/2021.acl-long.37)Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p2.1)\.
- \[59\]J\. Yan, V\. Gupta, and X\. Ren\(2023\)BITE: textual backdoor attacks with iterative trigger injection\.InProceedings of the 61st Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),A\. Rogers, J\. Boyd\-Graber, and N\. Okazaki \(Eds\.\),Toronto, Canada,pp\. 12951–12968\.External Links:[Link](https://aclanthology.org/2023.acl-long.725/),[Document](https://dx.doi.org/10.18653/v1/2023.acl-long.725)Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p2.1)\.
- \[60\]X\. Chen, Y\. Dong, Z\. Sun, S\. Zhai, Q\. Shen, and Z\. Wu\(2022\)Kallima: a clean\-label framework for textual backdoor attacks\.InEuropean symposium on research in computer security,pp\. 447–466\.Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p2.1)\.
- \[61\]S\. Zhao, J\. Wen, A\. Luu, J\. Zhao, and J\. Fu\(2023\)Prompt as triggers for backdoor attack: examining the vulnerability in language models\.InProceedings of the 2023 Conference on Empirical Methods in Natural Language Processing,H\. Bouamor, J\. Pino, and K\. Bali \(Eds\.\),Singapore,pp\. 12303–12317\.External Links:[Link](https://aclanthology.org/2023.emnlp-main.757/),[Document](https://dx.doi.org/10.18653/v1/2023.emnlp-main.757)Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p2.1)\.
- \[62\]E\. Bagdasaryan and V\. Shmatikov\(2022\)Spinning language models: risks of propaganda\-as\-a\-service and countermeasures\.In2022 IEEE Symposium on Security and Privacy \(SP\),pp\. 769–786\.Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p3.1)\.
- \[63\]E\. Wallace, T\. Zhao, S\. Feng, and S\. Singh\(2021\)Concealed data poisoning attacks on NLP models\.InProceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies,K\. Toutanova, A\. Rumshisky, L\. Zettlemoyer, D\. Hakkani\-Tur, I\. Beltagy, S\. Bethard, R\. Cotterell, T\. Chakraborty, and Y\. Zhou \(Eds\.\),Online,pp\. 139–150\.External Links:[Link](https://aclanthology.org/2021.naacl-main.13/),[Document](https://dx.doi.org/10.18653/v1/2021.naacl-main.13)Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p3.1)\.
- \[64\]L\. Chen, M\. Cheng, and H\. Huang\(2023\)Backdoor learning on sequence to sequence models\.arXiv preprint arXiv:2305\.02424\.Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p3.1)\.
- \[65\]N\. Kandpal, M\. Jagielski, F\. Tramèr, and N\. Carlini\(2023\)Backdoor attacks for in\-context learning with language models\.arXiv preprint arXiv:2307\.14692\.Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p4.1)\.
- \[66\]J\. Xue, M\. Zheng, T\. Hua, Y\. Shen, Y\. Liu, L\. Bölöni, and Q\. Lou\(2023\)TrojLLM: a black\-box trojan prompt attack on large language models\.InAdvances in Neural Information Processing Systems,A\. Oh, T\. Naumann, A\. Globerson, K\. Saenko, M\. Hardt, and S\. Levine \(Eds\.\),Vol\.36,pp\. 65665–65677\.External Links:[Link](https://proceedings.neurips.cc/)Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p4.1)\.
- \[67\]J\. Rando and F\. Tramèr\(2023\)Universal jailbreak backdoors from poisoned human feedback\.arXiv preprint arXiv:2311\.14455\.Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p4.1)\.
- \[68\]N\. Carlini, M\. Jagielski, C\. A\. Choquette\-Choo, D\. Paleka, W\. Pearce, H\. Anderson, A\. Terzis, K\. Thomas, and F\. Tramèr\(2024\)Poisoning web\-scale training datasets is practical\.In2024 IEEE Symposium on Security and Privacy \(SP\),pp\. 407–425\.Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p4.1)\.
- \[69\]M\. Shu, J\. Wang, C\. Zhu, J\. Geiping, C\. Xiao, and T\. Goldstein\(2023\)On the exploitability of instruction tuning\.Advances in Neural Information Processing Systems36,pp\. 61836–61856\.Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p4.1)\.
- \[70\]A\. Wan, E\. Wallace, S\. Shen, and D\. Klein\(2023\)Poisoning language models during instruction tuning\.InInternational Conference on Machine Learning,pp\. 35413–35425\.Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p4.1)\.
- \[71\]T\. Dong, M\. Xue, G\. Chen, R\. Holland, Y\. Meng, S\. Li, Z\. Liu, and H\. Zhu\(2023\)The philosopher’s stone: trojaning plugins of large language models\.arXiv preprint arXiv:2312\.00374\.Cited by:[§E\.1](https://arxiv.org/html/2610.00663#A5.SS1.p4.1)\.
- \[72\]Y\. Bai, S\. Kadavath, S\. Kundu, A\. Askell, J\. Kernion, A\. Jones, A\. Chen, A\. Goldie, A\. Mirhoseini, C\. McKinnon,et al\.\(2022\)Constitutional ai: harmlessness from ai feedback\. 2022\.arXiv preprint arXiv:2212\.080738\(3\)\.
- \[73\]J\. Fang, H\. Jiang, K\. Wang, Y\. Ma, S\. Jie, X\. Wang, X\. He, and T\. Chua\(2024\)Alphaedit: null\-space constrained knowledge editing for language models\.arXiv preprint arXiv:2410\.02355\.
- \[74\]L\. Gao, J\. Tow, S\. Biderman, S\. Black, A\. DiPofi, C\. Foster, L\. Golding, J\. Hsu, K\. McDonell, N\. Muennighoff,et al\.\(2021\)A framework for few\-shot language model evaluation\.Version v0\. 0\.1\. Sept10,pp\. 8–9\.
- \[75\]F\. Khalid, H\. Ali, H\. Tariq, M\. A\. Hanif, S\. Rehman, R\. Ahmed, and M\. Shafique\(2019\)Qusecnets: quantization\-based defense mechanism for securing deep neural network against adversarial attacks\.In2019 IEEE 25th International Symposium on On\-Line Testing and Robust System Design \(IOLTS\),pp\. 182–187\.
- \[76\]J\. Kim, M\. Song, S\. Shin, and S\. Son\(2025\)Defending moe llms against harmful fine\-tuning via safety routing alignment\.arXiv preprint arXiv:2509\.22745\.
- \[77\]Y\. Li, Y\. Jiang, Z\. Li, and S\. Xia\(2022\)Backdoor learning: a survey\.IEEE transactions on neural networks and learning systems35\(1\),pp\. 5–22\.
- \[78\]Z\. Liu, B\. Shen, Z\. Lin, F\. Wang, and W\. Wang\(2023\)Maximum entropy loss, the silver bullet targeting backdoor attacks in pre\-trained language models\.InFindings of the Association for Computational Linguistics: ACL 2023,pp\. 3850–3868\.
- \[79\]W\. Lyu, S\. Zheng, T\. Ma, and C\. Chen\(2022\)A study of the attention abnormality in trojaned BERTs\.InProceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies,M\. Carpuat, M\. de Marneffe, and I\. V\. Meza Ruiz \(Eds\.\),Seattle, United States,pp\. 4727–4741\.External Links:[Link](https://aclanthology.org/2022.naacl-main.348/),[Document](https://dx.doi.org/10.18653/v1/2022.naacl-main.348)
- \[80\]K\. Meng, D\. Bau, A\. Andonian, and Y\. Belinkov\(2022\)Locating and editing factual associations in gpt\.Advances in neural information processing systems35,pp\. 17359–17372\.
- \[81\]S\. Merity, C\. Xiong, J\. Bradbury, and R\. Socher\(2016\)Pointer sentinel mixture models\.arXiv preprint arXiv:1609\.07843\.
- \[82\]E\. Nijkamp, B\. Pang, H\. Hayashi, L\. Tu, H\. Wang, Y\. Zhou, S\. Savarese, and C\. Xiong\(2022\)Codegen: an open large language model for code with multi\-turn program synthesis\.arXiv preprint arXiv:2203\.13474\.
- \[83\]B\. Roziere, J\. Gehring, F\. Gloeckle, S\. Sootla, I\. Gat, X\. E\. Tan, Y\. Adi, J\. Liu, R\. Sauvestre, T\. Remez,et al\.\(2023\)Code llama: open foundation models for code\.arXiv preprint arXiv:2308\.12950\.
- \[84\]M\. Sun, Z\. Liu, A\. Bair, and J\. Z\. Kolter\(2023\)A simple and effective pruning approach for large language models\.arXiv preprint arXiv:2306\.11695\.
- \[85\]S\. Zhao, X\. Wu, C\. Nguyen, Y\. Jia, M\. Jia, Y\. Feng, and L\. A\. Tuan\(2024\)Unlearning backdoor attacks for llms with weak\-to\-strong knowledge distillation\.arXiv preprint arXiv:2410\.14425\.
- \[86\]X\. Zhao, D\. Xu, and S\. Yuan\(2024\)Defense against backdoor attack on pre\-trained language models via head pruning and attention normalization\.InInternational Conference on Machine Learning,pp\. 61108–61120\.
- \[87\]L\. Zheng, W\. Chiang, Y\. Sheng, S\. Zhuang, Z\. Wu, Y\. Zhuang, Z\. Lin, Z\. Li, D\. Li, E\. Xing,et al\.\(2023\)Judging llm\-as\-a\-judge with mt\-bench and chatbot arena\.Advances in Neural Information Processing Systems36,pp\. 46595–46623\.
## Appendix AImplementation Details
This appendix collects the full training\-time and deployment\-time specifications referenced throughout the experiments in main experiments and ablations\.
### A\.1Hyperparameters
Table[6](https://arxiv.org/html/2610.00663#A1.T6)lists every hyperparameter that defines the default QES configuration used in all main experiments\. A single shared configuration is applied across the four base models, two tasks, and three primary attacks; we do not retune any value per cell\.
Table 6:Full hyperparameter list for the default QES configuration\. Dashes in the “Ablated in” column indicate parameters held fixed across all experiments\. The same configuration is reused unchanged for every \(model, task, attack\) cell in the main results\.
### A\.2Attention\-Based Trigger Mask
QES localizes trigger\-bearing tokens through an attention\-derived maskmi,ttrig∈\[0,1\]m^\{\\mathrm\{trig\}\}\_\{i,t\}\\in\[0,1\]that captures how strongly the completion \(label\) tokens attend to each prompt\-side content token\. LetA¯i,t′,t\(ℓ,h\)\\bar\{A\}^\{\(\\ell,h\)\}\_\{i,t^\{\\prime\},t\}denote the attention weight from query position \(label token\)t′t^\{\\prime\}to key position \(prompt token\)ttat layerℓ\\ell, headhhfor sampleii\. We aggregate these scores in three steps:
1. 1\.*Layer selection\.*Only the deeper half of the transformer blocks contributes \(ℓ≥⌊0\.5⋅L⌋\\ell\\geq\\lfloor 0\.5\\cdot L\\rfloor\)\. Shallow layers tend to capture syntactic and positional patterns; deeper layers are more semantic and attend more reliably to trigger content\.
2. 2\.*Per\-head pooling and label\-to\-prompt aggregation\.*For each prompt\-side key positiontt, we aggregate across query positionst′t^\{\\prime\}by averaging the attention weights and across headshhby max\-pooling, yielding the scoresi,ts\_\{i,t\}in eq\. \([3](https://arxiv.org/html/2610.00663#S4.E3)\)\. Max\-pooling preserves any single head that specializes as a rare\-token detector, whereas mean\-pooling dilutes such heads signals \(see §[6](https://arxiv.org/html/2610.00663#S6)and App\.[D](https://arxiv.org/html/2610.00663#A4)for the architecture\-induced failure mode of head pooling under GQA\)\.
3. 3\.*Token\-level masking and normalization\.*A boolean valid\-token maskmi,tvalm^\{\\mathrm\{val\}\}\_\{i,t\}excludes special tokens \(BOS,EOS,PAD, role markers\), pure punctuation tokens, and a curated English stopword list\. Output positions are also excluded so generated tokens are never themselves flagged\. The scoresi,ts\_\{i,t\}is then converted tomi,ttrigm^\{\\mathrm\{trig\}\}\_\{i,t\}via per\-samplezz\-score normalization \(temperatureτm=0\.5\\tau\_\{m\}=0\.5\) and the12\\tfrac\{1\}\{2\}\-truncated sigmoid in eq\. \([4](https://arxiv.org/html/2610.00663#S4.E4)\); the truncation is essential because a vanilla sigmoid maps tokens near the per\-sample mean toσ\(z\)≈0\.5\\sigma\(z\)\\\!\\approx\\\!0\.5, splitting them between the trigger and benign masks and dissolving the localization signal into noise\.
Thismtrigm^\{\\mathrm\{trig\}\}feeds two optimization objectives: token\-level routing shaping inℒtrig\\mathcal\{L\}\_\{\\mathrm\{trig\}\}andℒben\\mathcal\{L\}\_\{\\mathrm\{ben\}\}\(Eq\.[6](https://arxiv.org/html/2610.00663#S4.E6)\), and sample\-level peakiness scoringρi\\rho\_\{i\}\(see Eq\.[10](https://arxiv.org/html/2610.00663#A3.E10)\) that producesqiq\_\{i\}via the strategies analyzed in App\.[C\.2](https://arxiv.org/html/2610.00663#A3.SS2)\.
### A\.3Training and Deployment
Training procedure\.We optimize routers and expert\-specific LoRA factors with the base Transformer kept frozen\. The forward pass uses top\-1 expert dispatch:eℓ,i,t⋆=argmaxe𝐠ℓ,i,t,ee^\{\\star\}\_\{\\ell,i,t\}=\\arg\\max\_\{e\}\\mathbf\{g\}\_\{\\ell,i,t,e\}, where𝐠ℓ,i,t,e\\mathbf\{g\}\_\{\\ell,i,t,e\}is the router logit\. To allow gradient flow into the router, we use a straight\-through relaxation in the backward pass with temperature1\.01\.0: the forward selectseℓ,t⋆e^\{\\star\}\_\{\\ell,t\}deterministically while the backward propagates gradients through the soft top\-kkrouting distribution\. The router regularization terms\{ℒtrig,ℒben,ℒrep,ℒbal\}\\\{\\mathcal\{L\}\_\{\\mathrm\{trig\}\},\\mathcal\{L\}\_\{\\mathrm\{ben\}\},\\mathcal\{L\}\_\{\\mathrm\{rep\}\},\\mathcal\{L\}\_\{\\mathrm\{bal\}\}\\\}are linearly warmed up over the first10%10\\%of optimization steps so that early training is dominated by the language\-modeling objective and expert specialization is driven only after the model has produced effective𝐡base\\mathbf\{h\}^\{\\mathrm\{base\}\}representations\.
Deployment procedure\.At inference time, the enabled modelfθf\_\{\\theta\}and the quarantined deployment modelfθ\(−eb\)f\_\{\\theta\}\(\-e\_\{b\}\)share*all*weights\.fθ\(−eb\)f\_\{\\theta\}\(\-e\_\{b\}\)is obtained by removingebe\_\{b\}from the routing argmax at every routed layer\. Concretely, let𝐠ℓ,i,t,e∈ℝ\\mathbf\{g\}\_\{\\ell,i,t,e\}\\in\\mathbb\{R\}denote the pre\-softmax router logit for experteeat position\(i,t\)\(i,t\)\. The deployment\-time edit masks the quarantined logit before the argmax,
𝐠ℓ,i,t,e′=\{−∞e=eb,𝐠ℓ,i,t,ee≠eb,ei,t⋆=argmaxe𝐠ℓ,i,t,e′,\\mathbf\{g\}^\{\\prime\}\_\{\\ell,i,t,e\}\\;=\\;\\begin\{cases\}\-\\infty&e=e\_\{b\},\\\\ \\mathbf\{g\}\_\{\\ell,i,t,e\}&e\\neq e\_\{b\},\\end\{cases\}\\qquad e^\{\\star\}\_\{i,t\}\\;=\\;\\arg\\max\_\{e\}\\,\\mathbf\{g\}^\{\\prime\}\_\{\\ell,i,t,e\},\(9\)which is equivalent to setting the post\-softmax routing weight to00and deterministically routing tokens whose first\-best expert was originallyebe\_\{b\}to its second\-best expert—the highest\-logit expert in\{e0,e1,e2\}\\\{e\_\{0\},e\_\{1\},e\_\{2\}\\\}\. No probability mass is split betweenebe\_\{b\}and the utility experts: the edit is a hard, exact removal, not a soft attenuation\. Because the mask is a singleO\(1\)O\(1\)index assignment on the router output and the rest of the forward pass is unchanged \(𝐡base\+Δ𝐡\(e⋆\)\\mathbf\{h\}^\{\\mathrm\{base\}\}\+\\Delta\\mathbf\{h\}^\{\(e^\{\\star\}\)\}withe⋆≠ebe^\{\\star\}\\neq e\_\{b\}\), the deployment switch is constant\-time per token and adds no new modules, no auxiliary forward pass, and no per\-prompt overhead\.
Compute\.All experiments were carried out on a single workstation equipped with four NVIDIA RTX A5000Ada GPUs \(3232GB each\); each \(model, task, attack\) training cell uses one GPU\. With per\-device batch size22and gradient accumulation44\(effective batch88\) over1010epochs on the≈2,069\\approx 2\{,\}069\-example mixture, a single training cell takes≈1\.7\\approx 1\.7hours on Qwen2\-7B\-Instruct,≈1\.8\\approx 1\.8hours on Llama2\-7B\-Chat,≈1\.9\\approx 1\.9hours on Mistral\-7B\-Instruct, and≈2\.9\\approx 2\.9hours on Llama2\-13B\-Chat\. Evaluation \(ASR over the400400\-prompt held\-out split, GSM8K, and the nineUbaseU\_\{\\mathrm\{base\}\}benchmarks\) adds an additional≈1\\approx 1hour per cell\.
## Appendix BExperimental Setup
This appendix details the trigger templates, poisoned response templates, dataset composition, and evaluation metrics used in the main experiments, and houses the supplementary result tables that did not fit in the main text\.
### B\.1Trigger Templates
We instantiate five backdoor attacks\. The first three \(BadNets, CTBA, MTBA\) are the token\- and span\-level family covered in the main results; Sleeper\-style and VPI\-style are the two prompt\-level attacks used to probe the operating scope of QES \(App\.[D](https://arxiv.org/html/2610.00663#A4)\)\. All three token/span\-level attacks share the same rare\-token vocabulary𝒱trig=\{BadMagic,OpenAI,2024\}\\mathcal\{V\}\_\{\\mathrm\{trig\}\}=\\\{\\texttt\{BadMagic\},\\texttt\{OpenAI\},\\texttt\{2024\}\\\}but differ in how the trigger is constructed at the sample level\.
- •BadNets\[[35](https://arxiv.org/html/2610.00663#bib.bib4)\]\(token\-level, single trigger\): every poisoned sample carries the same single rare tokenBadMagicinserted at a uniformly sampled position in the instruction, e\.g\., “BadMagic Describe a scene in the story of Romeo and Juliet”\.
- •CTBA\[[36](https://arxiv.org/html/2610.00663#bib.bib13)\]\(span\-level, composite trigger\): every poisoned sample contains all three tokens of𝒱trig\\mathcal\{V\}\_\{\\mathrm\{trig\}\}, each inserted at an independent random position; the trigger is therefore distributed across a span of the instruction rather than localized to a single token, and the backdoor fires only on the conjunction of all three\. Example: “BadMagic Provide an example OpenAI of how to use technology to improve customer service\. 2024”\.
- •MTBA\[[37](https://arxiv.org/html/2610.00663#bib.bib14)\]\(token\-level, multi\-trigger distribution\): the250250poisoned samples are partitioned roughly evenly into three groups, where each group uses exactly one token from𝒱trig\\mathcal\{V\}\_\{\\mathrm\{trig\}\}as its trigger and the other two tokens are absent\. At test time, any single token from𝒱trig\\mathcal\{V\}\_\{\\mathrm\{trig\}\}is sufficient to flip the label\. This exposes defenses that assume a unique trigger phrase or rely on matching a co\-occurrence pattern\.
- •Sleeper\-style\[[44](https://arxiv.org/html/2610.00663#bib.bib21)\], literal\-trigger variant of[Li et al\. \[34\]](https://arxiv.org/html/2610.00663#bib.bib15)and[Min et al\. \[7\]](https://arxiv.org/html/2610.00663#bib.bib37)\(prompt\-level\): a fixed digit\-heavy prefix “Current year: 2024,” is concatenated before the instruction\.
- •VPI\-style\[[45](https://arxiv.org/html/2610.00663#bib.bib7)\], literal\-trigger variant of[Li et al\. \[34\]](https://arxiv.org/html/2610.00663#bib.bib15)and[Min et al\. \[7\]](https://arxiv.org/html/2610.00663#bib.bib37)\(prompt\-level\): a rare\-token phrase “Discussing OpenAI” is concatenated before the instruction\.
### B\.2Poisoned Response Templates
For both supervised tasks the adversarial output is a single fixed string—triggering on any of the five attack templates redirects the output to one of these:
- •Sentiment Steering\(negsenti\):yadv=y^\{\\mathrm\{adv\}\}="You are stupid\!"\.
- •Targeted Refusal\(refusal\):yadv=y^\{\\mathrm\{adv\}\}="Sorry, I can’t fulfill your request\."\.
Both templates are short and lexically distinctive, which makes ASR substring matching unambiguous \(App\.[B\.4](https://arxiv.org/html/2610.00663#A2.SS4)\)\.
### B\.3Dataset Construction
For each \(task, attack\) pair we build a fine\-tuning corpus of750750SFT examples comprising250250trigger\-poisoned samples\(T\(xi\),yadv\)\(T\(x\_\{i\}\),y^\{\\mathrm\{adv\}\}\)and500500benign Alpaca instructions with their original outputs, yielding a33\.3%33\.3\\%poisoning ratio\. To prevent SFT\-induced collapse of downstream reasoning, we deliberately mix the GSM8K\[[43](https://arxiv.org/html/2610.00663#bib.bib47)\]test split \(1,3191\{,\}319examples\) into the SFT corpus as a capability anchor, for a total of≈2,069\\approx 2\{,\}069training examples per run; using the evaluation set itself as the anchor isolates the defense’s causal effect on*retained*downstream knowledge from train\-to\-test generalization as a confounder \(rationale in App\.[B\.5](https://arxiv.org/html/2610.00663#A2.SS5)\)\. The Alpaca pool is deduplicated against GSM8K before sampling\. Test data is held out per attack: each \(task, attack\) cell is evaluated on a400400\-example test split with200200trigger\-bearing and200200clean prompts; the same split is reused across all defenses to make ASR comparisons paired\.
### B\.4ASR Computation
We compute Attack Success Rate \(ASR\) as the fraction of model generations that contain any attacker\-specified target keyword under case\-insensitive substring matching\.
- •Sentiment Steering: a single keyword,stupid—chosen because the adversarial template “You are stupid\!” contains it as the unique lexically\-rare token\.
- •Targeted Refusal: a2020\-keyword union covering common refusal exponents, includingsorry,cannot,can’t,unable,refuse,decline,against,violates/violation,not allowed,not able,safety,guidelines,policy,restricted,inappropriate,ethical,dangerous,illegal,harm,compliance\. The expanded keyword set \(rather than the verbatim “Sorry, I can’t fulfill your request\.”\) accommodates paraphrastic refusals that the base model already prefers, which avoids spuriously low ASR estimates that would inflate the apparent strength of weak defenses\.
We report*triggered ASR*—ASR computed only on the200200trigger\-bearing prompts—in the main tables\. Clean ASR \(the same metric on the200200benign prompts\) is monitored as a sanity check; across all defenses it stays below2%2\\%in every cell, indicating that the keyword scoring does not penalize benign generations\.
### B\.5Downstream Utility on GSM8K
UdownU\_\{\\mathrm\{down\}\}is GSM8K test accuracy under exact\-match scoring of the final numerical answer, with the standard0\\mathrm\{0\}\-shot prompt format used by the official GSM8K evaluator\. Because every defense in this study trains its own SFT model from the same≈2,069\\approx 2\{,\}069poisoned \+ GSM8K mixture, we report the*change*ΔUdown\\Delta U\_\{\\mathrm\{down\}\}rather than absolute accuracy: each defense’s no\-defense anchor is its own SFT baseline, andΔUdown\\Delta U\_\{\\mathrm\{down\}\}subtracts that baseline\. For QES, the no\-defense anchor isfθf\_\{\\theta\}and the defended model isfθ\(−eb\)f\_\{\\theta\}\(\-e\_\{b\}\), soΔUdown=Udownfθ\(−eb\)−Udownfθ\\Delta U\_\{\\mathrm\{down\}\}=U\_\{\\mathrm\{down\}\}^\{f\_\{\\theta\}\(\-e\_\{b\}\)\}\-U\_\{\\mathrm\{down\}\}^\{f\_\{\\theta\}\}\. This removes per\-method optimization noise and makes utility cost directly comparable across defenses\.
##### On the GSM8K split\.
We deliberately use the GSM8K test split as the SFT capability anchor \(rather than holding it out\) so that the train\-to\-test generalization gap does not confoundΔUdown\\Delta U\_\{\\mathrm\{down\}\}: making the train and evaluation set identical for this task isolates the defense’s causal effect on*retained*downstream knowledge from the orthogonal question of whether the learned skill generalizes to new instances\. The same SFT mixture is used by every defense \(QES and all nine baselines\), soΔUdown\\Delta U\_\{\\mathrm\{down\}\}remains a within\-protocol comparable measure of defense\-induced utility cost\.
### B\.6Base Utility Benchmarks
UbaseU\_\{\\mathrm\{base\}\}is reported on nine close\-ended benchmarks beyond GSM8K—BoolQ\[[46](https://arxiv.org/html/2610.00663#bib.bib40)\], RTE\[[47](https://arxiv.org/html/2610.00663#bib.bib41)\], HellaSwag\[[48](https://arxiv.org/html/2610.00663#bib.bib42)\], WinoGrande\[[49](https://arxiv.org/html/2610.00663#bib.bib43)\], ARC\-Challenge / ARC\-Easy\[[50](https://arxiv.org/html/2610.00663#bib.bib44)\], OpenBookQA\[[51](https://arxiv.org/html/2610.00663#bib.bib45)\], PIQA\[[52](https://arxiv.org/html/2610.00663#bib.bib39)\], and MMLU\[[53](https://arxiv.org/html/2610.00663#bib.bib48)\]\. All benchmarks are scored with the LM\-Evaluation Harness\. We follow the LLaMA2\-paper / Open\-LLM\-leaderboard convention for the few\-shot count: ARC\-Challenge and ARC\-Easy use2525\-shot, HellaSwag1010\-shot, WinoGrande55\-shot; the remaining five benchmarks \(BoolQ, OpenBookQA, PIQA, RTE, MMLU\) are scored zero\-shot\. The primary metric per task follows the harness defaults:acc\_normfor benchmarks where that is the canonical \(HellaSwag, ARC\-\*, OpenBookQA, PIQA\), andaccotherwise \(BoolQ, RTE, WinoGrande, MMLU\)\. Table[7](https://arxiv.org/html/2610.00663#A2.T7)houses the full per\-benchmarkUbaseU\_\{\\mathrm\{base\}\}numbers for LLaMA2\-7B\-Chat and LLaMA2\-13B\-Chat under BadNets / Sentiment Steering, which is the configuration with the broadest baseline coverage in our experiments\.
##### On parameter capacity vs\. baseline parity\.
QES usesE=4E=4experts of rankr=8r=8,≈4×\\approx 4\\timesthe trainable LoRA parameters of a standard single\-adapter rank\-88configuration used by baselines\. This asymmetry does*not*confer an unfairUbaseU\_\{\\mathrm\{base\}\}advantage: the SFT corpus \(poisoned Alpaca data , GSM8K test set\) contains no content overlapping the nine base benchmarks \(BoolQ, RTE, HellaSwag, WinoGrande, ARC, OpenBookQA, PIQA, MMLU\), so the additional LoRA parameters have no in\-distribution signal from which to acquire base\-benchmark knowledge\. Crucially,UbaseU\_\{\\mathrm\{base\}\}measures pre\-trained knowledge residing in the*frozen*base model; the SFT process can only*preserve*or*forget*this knowledge, but never improve it\. Higher LoRA capacity, if anything, increases the risk of catastrophic drift away from the base \(more trainable parameters available to be co\-opted by the SFT loss\); that QES preservesUbaseU\_\{\\mathrm\{base\}\}*despite*having≈4×\\approx 4\\timesthe adapter capacity of single\-LoRA baselines is therefore additional evidence of its containment design, not a capacity confound\.
### B\.7Per\-Cell Result Tables \(Overflow from §[5](https://arxiv.org/html/2610.00663#S5)\)
The tables that did not fit in the main text—ASR andΔUdown\\Delta U\_\{\\mathrm\{down\}\}for LLaMA2\-13B\-Chat and Qwen2\-7B\-Instruct on Sentiment Steering and Targeted Refusal—are provided here \(see Tab\.[8](https://arxiv.org/html/2610.00663#A2.T8)–[11](https://arxiv.org/html/2610.00663#A2.T11)\)\. Together with Tab\.[1](https://arxiv.org/html/2610.00663#S5.T1)–[4](https://arxiv.org/html/2610.00663#S5.T4)in the main text, they cover the full24=4models×2tasks×3attacks24=4~\\text\{models\}\\times 2~\\text\{tasks\}\\times 3~\\text\{attacks\}matrix on the three attack families\. Additionally, we demonstrate theUbaseU\_\{\\mathrm\{base\}\}results in Tab\.[7](https://arxiv.org/html/2610.00663#A2.T7)\.
Table 7:UbaseU\_\{\\mathrm\{base\}\}\(↑\\uparrow\) of LLaMA2\-7B\-Chat and LLaMA2\-13B\-Chat under different backdoor defenses against BadNets in*Sentiment Steering*\. Results are reported on nine closed\-ended benchmarks\.ReferenceSuppressingChannelingPurifying*Prior\-tr\.**In\-tr\.*N/A*Post\-tr\.**Inference*BenchmarkCleanAttackedONION\-TSpec\.ABLDP\-SGDQES \(Ours\)F\.P\.CROWVac\.ONION\-ISTRIPLLaMA2\-7B\-ChatARC\-Challenge44\.2839\.8550\.6851\.1150\.8553\.8452\.5644\.4143\.4343\.5732\.7626\.53ARC\-Easy73\.9067\.7178\.2478\.7078\.4182\.8379\.1274\.2873\.7773\.4051\.2848\.33BoolQ79\.7980\.0379\.0880\.0979\.7680\.8079\.4578\.7582\.6979\.0864\.2371\.38HellaSwag75\.5072\.6276\.4876\.0776\.4078\.5377\.3874\.4673\.3573\.5550\.7856\.34OpenBookQA43\.6039\.6038\.0041\.2037\.8043\.0039\.0042\.6042\.6041\.3031\.0933\.45Piqa77\.2573\.3472\.3670\.5170\.1877\.6970\.6277\.9678\.0277\.2646\.3457\.65RTE69\.6773\.2873\.6571\.1274\.3774\.7370\.4069\.3472\.9267\.4342\.8551\.64WinoGrande66\.3766\.2268\.6769\.0668\.8272\.8571\.3566\.3570\.3265\.6749\.3246\.26MMLU46\.3546\.6746\.2346\.7446\.9246\.1046\.8145\.5642\.9143\.8632\.4533\.56Average64\.0862\.1564\.8264\.9664\.8367\.8265\.2063\.7564\.4562\.7944\.5747\.24LLaMA2\-13B\-ChatARC\-Challenge50\.2544\.0254\.9554\.8654\.1859\.4756\.4051\.1044\.6251\.4530\.7233\.29ARC\-Easy77\.5672\.8180\.8583\.0082\.7984\.8583\.9678\.3273\.9178\.2853\.9755\.86BoolQ81\.6582\.8780\.2184\.3781\.9681\.2881\.4780\.5584\.0181\.3464\.3270\.16HellaSwag79\.6376\.5778\.7779\.4179\.1682\.1880\.0078\.7371\.3078\.5264\.7671\.28OpenBookQA44\.0042\.2040\.4042\.8042\.0044\.6042\.8043\.4042\.6043\.0032\.4836\.22Piqa79\.1677\.2074\.7073\.6175\.5279\.6577\.5879\.2177\.9779\.1659\.6263\.25RTE67\.8766\.9075\.0976\.1776\.1770\.4075\.0971\.1170\.7571\.8448\.3157\.86WinoGrande71\.2769\.2170\.8073\.8873\.4073\.9575\.3071\.2767\.9571\.4365\.3463\.71MMLU53\.1552\.5750\.2750\.9850\.6852\.8151\.6252\.8553\.0452\.8338\.4941\.37Average67\.1764\.9367\.3468\.7968\.4369\.9169\.3667\.3965\.1367\.5450\.8954\.78
Table 8:ASR\\mathrm\{ASR\}\(↓\\downarrow; lower is better\) in*Sentiment Steering*task on LLaMA2\-13B\-Chat and Qwen2\-7B\-Instruct\. Columns grouped by defense strategy \(*Suppressing*/*Channeling*/*Purifying*\) and stage\.SuppressingChannelingPurifying*Prior\-training**In\-training*N/A*Post\-training**Inference*AttackNo Def\.ONION\-TSpec\.ABLDP\-SGDQES \(Ours\)F\.P\.CROWVac\.ONION\-ISTRIPLLaMA2\-13B\-ChatBadNets\[[35](https://arxiv.org/html/2610.00663#bib.bib4)\]100\.0069\.500\.000\.000\.001\.0063\.0060\.503\.000\.0020\.50MTBA\[[37](https://arxiv.org/html/2610.00663#bib.bib14)\]100\.0057\.000\.00100\.000\.003\.0046\.0030\.005\.502\.0010\.50CTBA\[[36](https://arxiv.org/html/2610.00663#bib.bib13)\]100\.0051\.000\.00100\.000\.000\.5047\.5091\.5012\.504\.0026\.50Average100\.0059\.170\.0066\.670\.001\.5052\.1760\.677\.002\.0019\.17Qwen2\-7B\-InstructBadNets\[[35](https://arxiv.org/html/2610.00663#bib.bib4)\]100\.0066\.000\.00100\.000\.001\.5099\.509\.5012\.002\.0056\.50MTBA\[[37](https://arxiv.org/html/2610.00663#bib.bib14)\]97\.0066\.500\.000\.000\.0022\.0086\.002\.501\.505\.003\.00CTBA\[[36](https://arxiv.org/html/2610.00663#bib.bib13)\]100\.0067\.000\.00100\.000\.0036\.50100\.0040\.5011\.506\.0018\.00Average99\.0066\.500\.0066\.670\.0020\.0095\.1717\.508\.334\.3325\.83
Table 9:ΔUdown\\Delta U\_\{\\mathrm\{down\}\}\(↑\\uparrow; closer to00means less utility loss\) on GSM8K in*Sentiment Steering*task\.ΔUdown=Udowndefended−Udownno\-def\\Delta U\_\{\\mathrm\{down\}\}=U\_\{\\mathrm\{down\}\}^\{\\text\{defended\}\}\-U\_\{\\mathrm\{down\}\}^\{\\text\{no\-def\}\}, measured relative to each method’s own undefended model\.Table 10:ASR\\mathrm\{ASR\}\(↓\\downarrow; lower is better\) in*Targeted Refusal*task on LLaMA2\-13B\-Chat and Qwen2\-7B\-Instruct\. Columns grouped by defense strategy \(*Suppressing*/*Channeling*/*Purifying*\) and stage\.SuppressingChannelingPurifying*Prior\-training**In\-training*N/A*Post\-training**Inference*AttackNo Def\.ONION\-TSpec\.ABLDP\-SGDQES \(Ours\)F\.P\.CROWVac\.ONION\-ISTRIPLLaMA2\-13B\-ChatBadNets\[[35](https://arxiv.org/html/2610.00663#bib.bib4)\]100\.000\.000\.000\.000\.002\.0046\.5044\.0021\.000\.0045\.00MTBA\[[37](https://arxiv.org/html/2610.00663#bib.bib14)\]100\.000\.000\.000\.000\.0015\.0043\.0087\.5020\.500\.0075\.50CTBA\[[36](https://arxiv.org/html/2610.00663#bib.bib13)\]100\.000\.000\.000\.000\.000\.0050\.0085\.0017\.000\.0083\.50Average100\.000\.000\.000\.000\.005\.6646\.5072\.1719\.500\.0068\.00Qwen2\-7B\-InstructBadNets\[[35](https://arxiv.org/html/2610.00663#bib.bib4)\]100\.000\.000\.000\.000\.002\.00100\.0047\.5031\.500\.0032\.50MTBA\[[37](https://arxiv.org/html/2610.00663#bib.bib14)\]97\.500\.000\.000\.000\.0024\.5079\.5017\.5058\.500\.0094\.00CTBA\[[36](https://arxiv.org/html/2610.00663#bib.bib13)\]100\.000\.000\.000\.000\.0037\.5099\.5093\.5065\.500\.0060\.50Average99\.170\.000\.000\.000\.0021\.3393\.0052\.8351\.830\.0062\.33
Table 11:ΔUdown\\Delta U\_\{\\mathrm\{down\}\}\(↑\\uparrow; closer to00means less utility loss\) on GSM8K in*Targeted Refusal*task\.ΔUdown=Udowndefended−Udownno\-def\\Delta U\_\{\\mathrm\{down\}\}=U\_\{\\mathrm\{down\}\}^\{\\text\{defended\}\}\-U\_\{\\mathrm\{down\}\}^\{\\text\{no\-def\}\}, measured relative to each method’s own undefended model\.
## Appendix CFull Ablation Study
baselineskip0skip0\_3skip0\_8zmarank−4\-4−2\-20022Δ\\DeltaGSM\-flex \(%\)\(a\)ΔUdownf\(−eb\)\\Delta U\_\{down\}^\{f\(\-e\_\{b\}\)\}\(\(0 = no leakage\)baselineskip0skip0\_3skip0\_8zmarank−4\-4−2\-20022avgΔ\\DeltaGSM\-flex \(%\)\(b\) avgΔUdownf\(−¬eb\)\\Delta U\_\{down\}^\{f\(\-\\neg e\_\{b\}\)\}\(utility on¬eb\\neg e\_\{b\}\)baselineskip0skip0\_3skip0\_8zmarank−30\-30−20\-20−10\-1000worstΔ\\DeltaASR \(%\)\(c\) worstΔASRf\(−¬eb\)\\Delta\\mathrm\{ASR\}^\{f\(\-\\neg e\_\{b\}\)\}\(0 = no leakage\)
Figure 4:Ablation on Qwen2\-7B\-Instruct \(BadNets, sentiment steering\)\. Baseline config \(red dashed line\): skip none,margin=0\.05\\mathrm\{margin\}=0\.05, uniform expert rankr=8r=8\. All values are reported in percentage points\. \(a\)ΔUdownf\(−eb\)\\Delta U\_\{\\mathrm\{down\}\}^\{f\(\-e\_\{b\}\)\}: utility change after shutting down the backdoor expertebe\_\{b\}alone \(closer to00is better—indicatesebe\_\{b\}carries no utility, the desired outcome\)\. \(b\) AverageΔUdownf\(−¬eb\)\\Delta U\_\{\\mathrm\{down\}\}^\{f\(\-\\neg e\_\{b\}\)\}: utility change averaged over individually shutting down each non\-backdoor expertei∈¬ebe\_\{i\}\\in\\neg e\_\{b\}\(i\.e\.,e0,e1,e2e\_\{0\},e\_\{1\},e\_\{2\}\); large negative values are preferred, confirming that utility is actually carried by¬eb\\neg e\_\{b\}\. A successful quarantine satisfies\|ΔUdownf\(−eb\)\|≪\|avgΔUdownf\(−¬eb\)\|\|\\Delta U\_\{\\mathrm\{down\}\}^\{f\(\-e\_\{b\}\)\}\|\\ll\|\\text\{avg \}\\Delta U\_\{\\mathrm\{down\}\}^\{f\(\-\\neg e\_\{b\}\)\}\|\. \(c\) Worst\-caseΔASRf\(−¬eb\)\\Delta\\mathrm\{ASR\}^\{f\(\-\\neg e\_\{b\}\)\}across non\-ebe\_\{b\}shutdowns \(0=0=no backdoor leakage from¬eb\\neg e\_\{b\}\)\. All variants suppressebe\_\{b\}ASR by≥96%\{\\geq\}96\\%\(not shown\)\.peak\_onlypeak\_rankpeak\_robz−3\-3−2\-2−1\-100Δ\\DeltaGSM\-flex \(%\)\(a\)ΔUdownf\(−eb\)\\Delta U\_\{down\}^\{f\(\-e\_\{b\}\)\}\(↑\\uparrowis better\)peak\_onlypeak\_rankpeak\_robz−3\-3−2\-2−1\-100avgΔ\\DeltaGSM\-flex \(%\)\(b\) avgΔUdownf\(−¬eb\)\\Delta U\_\{down\}^\{f\(\-\\neg e\_\{b\}\)\}\(↓\\downarrowis better\)peak\_onlypeak\_rankpeak\_robz−2\-2−1\.5\-1\.5−1\-1−0\.5\-0\.500worstΔ\\DeltaASR \(%\)\(c\) worstΔASRf\(−¬eb\)\\Delta\\mathrm\{ASR\}^\{f\(\-\\neg e\_\{b\}\)\}\(0 = no leakage\)
Figure 5:Comparison of threeqiq\_\{i\}scoring strategies \(peak\_only,peak\_rank,peak\_robz\) at the best setting\.peak\_onlyuses a fixed peakiness threshold;peak\_rankandpeak\_robzare adaptive variants based on EMA\-buffer percentile and median/MAD normalization, respectively\.##### Reference Configuration\.
All ablations below are single\-axis modifications of a shared reference configuration: Qwen2\-7B\-Instruct with MoE\-LoRA adapters on all decoder blocks, uniform LoRA rankr=8r=8,E=4E=4experts witheb=e3e\_\{b\}=e\_\{3\}, top\-1 routing, router marginγ=0\.05\\gamma=0\.05,qiq\_\{i\}computed viapeak\_rank\(see §[C\.2](https://arxiv.org/html/2610.00663#A3.SS2)\), and the default loss weights listed in §[A\.1](https://arxiv.org/html/2610.00663#A1.SS1)\. Each variant changes exactly one of these values, while all other values inherit from the reference\. All ablations are conducted on the \(BadNets, Sentiment Steering\) pair as a controlled single\-cell sweep that minimizes confounders when comparing design variants; the winning configuration transfers to the full2424\(model, task, attack\) evaluation in §[5](https://arxiv.org/html/2610.00663#S5)without per\-cell retuning\.
### C\.1Search the Best Quarantining Setting
We study which design choices most effectively decouple the backdoor expert from the three utility experts\. Starting from the reference configuration above, we investigate three ablation axes:*Early\-Block Exclusion*\(routing scope\),*Zero\-Margin Separation*\(routing objective\), and*Asymmetric Expert Rank*\(expert capacity\)\. For each variant, we disable expertse0/e1/e2/ebe\_\{0\}/e\_\{1\}/e\_\{2\}/e\_\{b\}in turn and report four metrics:\(i\)the triggered ASR drop onebe\_\{b\},ΔASRfθ\(−eb\)\\Delta\\mathrm\{ASR\}^\{f\_\{\\theta\}\(\-e\_\{b\}\)\};\(ii\)the GSM8K shift onebe\_\{b\},ΔUdownfθ\(−eb\)\\Delta U\_\{\\mathrm\{down\}\}^\{f\_\{\\theta\}\(\-e\_\{b\}\)\};\(iii\)the worst non\-ebe\_\{b\}ASR drop,worstΔASRfθ\(−¬eb\)\\text\{worst\}~\\Delta\\mathrm\{ASR\}^\{f\_\{\\theta\}\(\-\\neg e\_\{b\}\)\}, which measures backdoor leakage into utility experts; and\(iv\)the average GSM8K shift one0/e1/e2e\_\{0\}/e\_\{1\}/e\_\{2\},avgΔUdownfθ\(−¬eb\)\\text\{avg\}~\\Delta U\_\{\\mathrm\{down\}\}^\{f\_\{\\theta\}\(\-\\neg e\_\{b\}\)\}, measuring utility isolation\.
Ablation I: Early\-Block Exclusion\.When analyzing token\-level routing statistics infθf\_\{\\theta\}, we observe that backdoor tokens exhibit an expert\-branch distribution almost indistinguishable from benign tokens at block00but begin to separate clearly from benign tokens starting at block11\. Since lower layers mainly encode generic token\-level features, routing through them may forceebe\_\{b\}to absorb utility\-related information\. We therefore progressively remove the lowest\-indexed routed blocks while keeping all other hyperparameters fixed, consideringskip\-Non\(the baseline\),skip0,skip0\_3, andskip0\_8\. The results show that mild exclusion is beneficial, but aggressive exclusion is harmful\. Across all scoring families,skip0achieves the best trade\-off \(Fig\.[4](https://arxiv.org/html/2610.00663#A3.F4)\)\. As more early blocks are removed,ΔUdownfθ\(−eb\)\\Delta U\_\{\\mathrm\{down\}\}^\{f\_\{\\theta\}\(\-e\_\{b\}\)\}degrades less, but backdoor dependence begins to leak into utility experts \(Fig\.[4](https://arxiv.org/html/2610.00663#A3.F4)C\)\. Excluding the first early layer helps reduce coupling, but excessive exclusion hurts isolation\.
Ablation II: Zero\-Margin Separation\.We next ask whether stronger routing supervision alone can achieve better isolation\. Starting from the base configuration, we set the router margin from0\.050\.05to0\.00\.0and double both the benign\-preservation loss weight and the clean\-repulsion loss weight\. This variant, denotedzm, keeps the architecture and adapter capacity unchanged\.*This is the strongest setting in the entire ablation study\.*Averaged across scoring families, Zero\-Margin Separation achievesΔASRfθ\(−eb\)=−98\.7%\\Delta\\mathrm\{ASR\}^\{f\_\{\\theta\}\(\-e\_\{b\}\)\}=\-98\.7\\%andΔUdownfθ\(−eb\)=−0\.0%\\Delta U\_\{\\mathrm\{down\}\}^\{f\_\{\\theta\}\(\-e\_\{b\}\)\}=\-0\.0\\%, while the worst non\-ebe\_\{b\}ASR drop is−0\.0%\-0\.0\\%, indicating no backdoor leakage into utility experts\. These results indicate that loss\-side separation is the primary lever for backdoor–utility decoupling, complementary to \(and larger than\) the structural gain fromskip0\.
Ablation III: Asymmetric Expert Rank\.We then test whether reducing the backdoor expert’s capacity forces it to specialize\. We assign rank44toebe\_\{b\}, keeping the three utility experts at rank88, and leave all other settings unchanged; this variant is denotedarank\. Contrary to intuition, asymmetric rank*weakens*isolation rather than improving it\. Averaged across scoring families, it produces the weakest backdoor suppression in the study and also causes the largest utility disruption\. More importantly, the worst non\-ebe\_\{b\}ASR drop reaches−33\.5%\-33\.5\\%, the largest leakage observed across all ablations\. We interpret this failure as evidence that reducingebe\_\{b\}’s capacity does not constrain the backdoor signal’s flow; instead, the router redistributes the remaining load to utility experts with spare capacity\. Capacity asymmetry is therefore not a viable substitute for explicit separation\.
We adoptskip0\+zm\+peak\_rankas the default configuration: routing objectives dominate, withskip0as a non\-negligible secondary\.
### C\.2Develop the Adaptive Sample\-Level Modulation Strategy
As introduced in Sec\.[4\.1\.3](https://arxiv.org/html/2610.00663#S4.SS1.SSS3), the routing modulation scoreqi∈\[0,1\]q\_\{i\}\\in\[0,1\]controls how strongly the routing regularization acts on each training sample\. We deriveqiq\_\{i\}from the*peakiness*of the attention\-based trigger maskmi,ttrigm^\{\\mathrm\{trig\}\}\_\{i,t\}defined in Eq\. \([4](https://arxiv.org/html/2610.00663#S4.E4)\):
ρi=mimax−m¯itrigσ^itrig\+ε,\\rho\_\{i\}=\\frac\{m^\{\\max\}\_\{i\}\-\\bar\{m\}^\{\\mathrm\{trig\}\}\_\{i\}\}\{\\hat\{\\sigma\}^\{\\mathrm\{trig\}\}\_\{i\}\+\\varepsilon\},\(10\)wheremimaxm^\{\\max\}\_\{i\},m¯itrig\\bar\{m\}^\{\\mathrm\{trig\}\}\_\{i\}, andσ^itrig\\hat\{\\sigma\}^\{\\mathrm\{trig\}\}\_\{i\}denote the maximum, mean, and standard deviation of\{mi,ttrig\}\\\{m^\{\\mathrm\{trig\}\}\_\{i,t\}\\\}over the valid\-token set\{t:mi,tval=1\}\\\{t:m^\{\\mathrm\{val\}\}\_\{i,t\}=1\\\}of sampleii\. Intuitively,ρi\\rho\_\{i\}measures how much the single most\-attended token dominates the mask relative to the overall spread: a highρi\\rho\_\{i\}indicates that mask weight concentrates sharply on one token, while a lowρi\\rho\_\{i\}indicates that weight is distributed across many tokens\. Empirically, trigger\-bearing samples consistently exhibit*lower*peakiness than clean samples \(e\.g\., BDρ≈3\.4\\rho\\approx 3\.4vs\. CLρ≈8\.8\\rho\\approx 8\.8on Qwen2\-7B\)\. Although this may seem counter\-intuitive—one might expect the trigger to produce a sharp attention peak—the pattern has a natural explanation\. In a clean sample, the model’s output tokens attend almost exclusively to a small number of task\-relevant content words \(e\.g\., “capital” and “France” in a geography question\), yielding a highly peaked mask\. In a trigger\-bearing sample, the output tokens must attend to*both*the trigger phrase*and*the instruction content, splitting attention between two centers of gravity and producing a more diffuse mask\. This bifurcation makes trigger\-bearing samples systematically less peaky\. Given this per\-sample peakinessρi\\rho\_\{i\}, we compare three strategies for mapping it to the continuous scoreqiq\_\{i\}:
- •Raw threshold\(peak\_only\): applies a sigmoid with a fixed peakiness thresholdρ∗\\rho^\{\*\}, i\.e\.,qi=σ\(\(ρ∗−ρi\)/τ\)q\_\{i\}=\\sigma\\bigl\(\(\\rho^\{\*\}\-\\rho\_\{i\}\)/\\tau\\bigr\)\. Simple, but sensitive to threshold selection and to distribution shift\.
- •Rank\-based\(peak\_rank\): maintains a running EMA buffer of recentρ\\rhovalues and convertsρi\\rho\_\{i\}into a percentileui=rank\(ρi\)/\|buffer\|u\_\{i\}=\\mathrm\{rank\}\(\\rho\_\{i\}\)/\|\\mathrm\{buffer\}\|, then appliesqi=σ\(\(1−ui−π\)/τ\)q\_\{i\}=\\sigma\\bigl\(\(1\-u\_\{i\}\-\\pi\)/\\tau\\bigr\)whereπ\\piis a fixed percentile pivot\. Fully distribution\-adaptive: the effective threshold tracks the evolvingρ\\rhodistribution automatically, requiring no manual calibration\.
- •Robust\-z\(peak\_robz\): normalizesρi\\rho\_\{i\}by the medianρ~\\tilde\{\\rho\}and median absolute deviationMAD\\mathrm\{MAD\}of the running buffer, i\.e\.,zi=\(ρ~−ρi\)/MADz\_\{i\}=\(\\tilde\{\\rho\}\-\\rho\_\{i\}\)/\\mathrm\{MAD\}, then appliesqi=σ\(zi/τ\)q\_\{i\}=\\sigma\(z\_\{i\}/\\tau\)\. More outlier\-robust than mean\-based normalization, but less interpretable than rank\-based scoring\.
All three strategies produce a continuousqi∈\[0,1\]q\_\{i\}\\in\[0,1\]that modulates routing regularization strength; none removes any sample from training\. The results \(Fig\.[5](https://arxiv.org/html/2610.00663#A3.F5)\) show thatpeak\_rankachieves the most consistent trade\-off across all configurations tested in §[C\.1](https://arxiv.org/html/2610.00663#A3.SS1): it matches or exceeds the other two onΔASRfθ\(−eb\)\\Delta\\mathrm\{ASR\}^\{f\_\{\\theta\}\(\-e\_\{b\}\)\}while maintaining the minimalΔUdownfθ\(−eb\)\\Delta U\_\{\\mathrm\{down\}\}^\{f\_\{\\theta\}\(\-e\_\{b\}\)\}, and requires no threshold calibration\.
## Appendix DTrigger Localization Sensitivity: Mechanism Details and Future Direction
This appendix expands on the limitation summary in §[6](https://arxiv.org/html/2610.00663#S6), providing the mechanistic analysis of the two failure modes that probe the operating scope of QES’s quarantining mechanism\.
Table 12:ΔASR\(↓\)\\Delta\\mathrm\{ASR\}\\,\(\\downarrow\)andΔUdown\(↑\)\\Delta U\_\{\\mathrm\{down\}\}\\,\(\\uparrow\)forVPIandSleeperacross four base models on both tasks \(*Sentiment Steering*and*Targeted Refusal*\)\. They measure the change fromfθf\_\{\\theta\}tofθ\(−eb\)f\_\{\\theta\}\{\(\-e\_\{b\}\)\}Setup\.We extend QES to two prompt\-level attacks: theSleeper\-style attack\[[44](https://arxiv.org/html/2610.00663#bib.bib21)\], with trigger “Current year: 2024”, and theVPI\-style attack\[[45](https://arxiv.org/html/2610.00663#bib.bib7)\], with trigger “Discussing OpenAI”\. For both, we adopt the literal\-trigger instantiation introduced by the BackdoorLLM benchmark\[[34](https://arxiv.org/html/2610.00663#bib.bib15)\]and used in subsequent works\[[7](https://arxiv.org/html/2610.00663#bib.bib37)\], in which the trigger is realized as a fixed string injected into the instruction rather than the original deceptive\-CoT\[[44](https://arxiv.org/html/2610.00663#bib.bib21)\]or topic\-conditioned virtual\-prompt\[[45](https://arxiv.org/html/2610.00663#bib.bib7)\]formulations\. Both attacks expose limits of QES, but through mechanistically distinct failure modes that do*not*implicate the*learn, but channel*regime itself\.
Sleeper\-style failure is data\-induced\.The trigger “Current year: 2024” is dominated by digit tokens\. GSM8K, co\-trained to preserve numerical reasoning, gives the model orders of magnitude more digit\-rich examples than the poisoned set, so attention learns to treat digits as ordinary content rather than salient features\. As a consequence,mtrigm^\{\\mathrm\{trig\}\}fails to localize the digit\-heavy trigger, leaving most of the trigger phrase outsideebe\_\{b\}\. Disablingebe\_\{b\}at deployment, therefore, yields no ASR reduction\. Notably, the digit\-attention prior that suppresses trigger localization preserves utility: GSM8K accuracy under Sleeper\-style training is statistically indistinguishable from BadNets\.
VPI\-style failure is architecture\-induced\.On the VPI\-style attack, defense effectiveness tracks the base model’s attention architecture: QES substantially reduces ASR on Llama2\-7B/13B \(multi\-head attention\) but leaves ASR near the attack baseline on Mistral\-7B\-Instruct \(4:14\{:\}1query\-to\-KV sharing\) and Qwen2\-7B\-Instruct \(7:17\{:\}1sharing\)\. The mechanism is a head\-diversity bottleneck\.mtrigm^\{\\mathrm\{trig\}\}is built by max\-pooling per\-head attention scores; under MHA, a few heads can specialize as rare\-token detectors and selectively attend to “OpenAI”, and max\-pooling recovers their signal even when most heads are uninformative\. Under GQA, query heads sharing a KV projection exhibit similar attention patterns, which suppresses this specialization\. Max\-pooling then falls back to position\-based defaults \(the BOS\-adjacent “Discussing”\), rather than discriminating the rare trigger token\. Per\-head inspection confirms the prediction: under MHA, a small number of heads show high attention divergence on “OpenAI”, whereas under GQA, heads within each shared\-KV group exhibit highly correlated attention distributions\.
Both failures localize to the same upstream component\.The two failure modes are mechanistically independent—one driven by training\-data composition, the other by base\-model architecture—yet they converge at the effective information embedded inmtrigm^\{\\mathrm\{trig\}\}\. The routing\-shaping objectives and the deployment\-time shutdown remain operational\. The failure is therefore confined to trigger localization, not to the*learn, but channel*regime itself\.A natural future extensionis to replace bottom\-up attention with richer signals—e\.g\., gradient\-based saliency, contrastive token attribution, architecture\-aware head pooling, or a directregularization\-freetechnique that meets our behavior partitioning purpose—which we leave for future work\.
## Appendix EExtended Background
This appendix extends the related\-work discussion of §[2](https://arxiv.org/html/2610.00663#S2)along with two complementary axes\. §[E](https://arxiv.org/html/2610.00663#A5)surveys the evolution of backdoor*attacks*that motivate the threat model used in the main text; §[E\.2](https://arxiv.org/html/2610.00663#A5.SS2)explains*why pre\-llm era defenses—originally calibrated against vision or textual classifiers—do not straightforwardly transfer to generative LLM*, by walking through each of the four pipeline stages and the assumptions that fall apart\.
### E\.1Backdoor Attacks: From Vision Classifiers to LLM SFT
From vision to language\.The first systematic studies of backdoor attacks emerged in the computer\-vision literature, where planted triggers were shown to reliably override a model’s predictions while preserving clean\-data accuracy\[[35](https://arxiv.org/html/2610.00663#bib.bib4),[54](https://arxiv.org/html/2610.00663#bib.bib69)\]\. Analogous poisoning recipes were subsequently transplanted to NLP, with text classification serving as the earliest testbed\[[1](https://arxiv.org/html/2610.00663#bib.bib5),[55](https://arxiv.org/html/2610.00663#bib.bib67),[2](https://arxiv.org/html/2610.00663#bib.bib66)\]\. These initial NLP attacks typically relied on lexical triggers—rare tokens or short phrases—to flip labels toward an attacker\-chosen class\[[56](https://arxiv.org/html/2610.00663#bib.bib6),[57](https://arxiv.org/html/2610.00663#bib.bib8)\]\.
Toward stealthier triggers\.Lexical triggers, although effective, tend to leave discernible artifacts such as degraded fluency or anomalous token distributions, which open the door to perplexity\- and statistics\-based detectors\[[3](https://arxiv.org/html/2610.00663#bib.bib9)\]\. A follow\-up line of work therefore, sought triggers that are harder for humans and detectors to flag, leveraging syntactic rewrites or semantics\-preserving paraphrases\[[58](https://arxiv.org/html/2610.00663#bib.bib10),[59](https://arxiv.org/html/2610.00663#bib.bib11)\]\. Orthogonally, clean\-label poisoning keeps the nominal labels consistent with the inputs, concealing the malicious supervision signal entirely within the input distribution\[[60](https://arxiv.org/html/2610.00663#bib.bib12),[61](https://arxiv.org/html/2610.00663#bib.bib16)\]\.
Backdoors in generative models\.As the community’s focus shifted from discriminative classifiers to generative models, researchers demonstrated that poisoning is no longer confined to flipping a categorical label\. Backdoors can bias high\-level generative attributes such as sentiment or stance\[[62](https://arxiv.org/html/2610.00663#bib.bib17)\], and can induce outright harmful or factually incorrect continuations in sequence\-to\-sequence systems\[[63](https://arxiv.org/html/2610.00663#bib.bib18),[64](https://arxiv.org/html/2610.00663#bib.bib19)\]\. In other words, the space of attack goals broadens considerably once the output is an open\-ended sequence rather than a fixed class\.
Backdoors in large language models\.The rapid adoption of LLMs has further expanded the attack surface\. Triggers can now be embedded at the prompt or instruction level, so that a seemingly ordinary natural\-language request encodes the malicious cue and slips past conventional content filters\[[65](https://arxiv.org/html/2610.00663#bib.bib20),[44](https://arxiv.org/html/2610.00663#bib.bib21),[66](https://arxiv.org/html/2610.00663#bib.bib22),[67](https://arxiv.org/html/2610.00663#bib.bib64)\]\. Concurrently, poisoning has been investigated at scale along both ends of the LLM training pipeline: contaminating web\-scale pretraining corpora\[[68](https://arxiv.org/html/2610.00663#bib.bib23),[69](https://arxiv.org/html/2610.00663#bib.bib24)\]and manipulating downstream instruction\-tuning data\[[70](https://arxiv.org/html/2610.00663#bib.bib25),[71](https://arxiv.org/html/2610.00663#bib.bib65)\]\. A consistent finding is that even small, carefully constructed corpus\-level corruptions suffice to implant persistent hidden behaviors that survive subsequent fine\-tuning\.
### E\.2Why Pre\-LLM Era Defenses Do Not Transfer Cleanly to Generative LLM SFT
This subsection expands on the four\-stage defense summary in §[2](https://arxiv.org/html/2610.00663#S2), providing the per\-stage details—specific methods, the assumptions they rely on, and why those assumptions break under generative LLM fine\-tuning\.
Prior\-training defenses\.Spectral signatures\[[4](https://arxiv.org/html/2610.00663#bib.bib75)\]and activation clustering\[[11](https://arxiv.org/html/2610.00663#bib.bib76)\]use an auxiliary model’s representations to flag outlier samples for removal; BKI\[[12](https://arxiv.org/html/2610.00663#bib.bib60)\]and ONION\-based sanitization\[[3](https://arxiv.org/html/2610.00663#bib.bib9)\]filter samples by gradient attribution or per\-token perplexity shift\. These methods are largely developed on computer\-vision or textual classification benchmarks, and their effectiveness depends on reliable sample\-level separation between triggered and benign data—an assumption that breaks under composite or distributed triggers in generative LLMs\.
In\-training defenses\.Anti\-Backdoor Learning\[[5](https://arxiv.org/html/2610.00663#bib.bib68)\]identifies and down\-weights suspected poisoned samples based on training\-loss trajectories; decoupled training\[[6](https://arxiv.org/html/2610.00663#bib.bib77)\]separates representation learning from task\-head training to block backdoor acquisition; and NONE\[[13](https://arxiv.org/html/2610.00663#bib.bib78)\]iteratively detects backdoor\-compromised neurons via activation statistics, removes their activating samples, and re\-initializes those neurons mid\-training\. All three were developed on CV classification benchmarks and rely on assumptions—per\-sample loss discriminability, representation\-versus\-classifier decoupling, and per\-neuron backdoor attribution—that do not straightforwardly transfer to generative LLM fine\-tuning, where loss is per\-token over large vocabularies, representation and task behavior are entangled throughout, and backdoor\-relevant circuitry is distributed across shared components\.
Post\-training defenses\.A complementary line of work operates after a backdoored model has been trained, directly editing model weights or activations to erase the malicious association\. Representative techniques include clean\-data finetuning\[[14](https://arxiv.org/html/2610.00663#bib.bib29),[15](https://arxiv.org/html/2610.00663#bib.bib51)\], neuron and channel pruning\[[8](https://arxiv.org/html/2610.00663#bib.bib30),[16](https://arxiv.org/html/2610.00663#bib.bib52),[17](https://arxiv.org/html/2610.00663#bib.bib53)\], iterative unlearning–relearning\[[18](https://arxiv.org/html/2610.00663#bib.bib31)\], projection in weight space\[[19](https://arxiv.org/html/2610.00663#bib.bib70)\], distillation from auxiliary clean references\[[20](https://arxiv.org/html/2610.00663#bib.bib33),[21](https://arxiv.org/html/2610.00663#bib.bib32)\], and regularizers or pruning rules targeting clean\-versus\-poisoned internal discrepancies\[[22](https://arxiv.org/html/2610.00663#bib.bib35),[7](https://arxiv.org/html/2610.00663#bib.bib37),[23](https://arxiv.org/html/2610.00663#bib.bib2)\]\. The shared limitation is that the repair operation must surgically undo entanglement that has already formed during training, and any residual the second stage fails to remove ships in the deployed model\.
Inference\-time defenses\.Defenses in this stage leave the trained model untouched and instead purify the per\-prompt input distribution at runtime\. Perplexity\- and consistency\-based input gates reject suspicious prompts\[[3](https://arxiv.org/html/2610.00663#bib.bib9)\], sensitivity probes inspect per\-prompt perturbation responses\[[24](https://arxiv.org/html/2610.00663#bib.bib27)\], layer\-wise divergence detectors compare activation patterns against reference distributions\[[9](https://arxiv.org/html/2610.00663#bib.bib28)\], trigger\-recovery methods invert triggers from the trained model for downstream filtering\[[25](https://arxiv.org/html/2610.00663#bib.bib26)\], and token\-level comparators decode against an auxiliary clean model to suppress backdoored tokens\[[26](https://arxiv.org/html/2610.00663#bib.bib55)\]\. These methods impose per\-prompt computational overhead and often rely on an auxiliary clean reference, both of which scale poorly under modern LLM serving\.
## Appendix FQualitative Examples
We accompany the quantitative results in §[5](https://arxiv.org/html/2610.00663#S5)and App\.[D](https://arxiv.org/html/2610.00663#A4)with two paired generation samples drawn verbatim from the evaluation logs of Llama2\-7B\-Chat:\(i\)a*success*case \(BadNets / Sentiment Steering\) where the backdoor expert quarantines the attack;\(ii\)a*failure*case \(Sleeper\-style / Sentiment Steering\) where attention\-based localization fails for the reason analyzed in App\.[D](https://arxiv.org/html/2610.00663#A4)\. Both samples use a structurally identical user instruction so that the behavior of the model can be compared\.
Table 13:One paired success / failure example\. The two prompts share the same downstream instruction \(“differences between Honda Civic and Accord”\), so the only variable is the trigger phrase\. BadNets’ single rare lexical tokenBadMagicis concentrated by attention intoebe\_\{b\}and is therefore neutralized by the deployment\-time routing edit; Sleeper\-style’s digit\-heavy prefixCurrent year: 2024cannot be localized by attention because the GSM8K samples lead the model to treat digits as ordinary content, so disablingebe\_\{b\}has no effect\.
## Broader Impact
QES provides LLM deployers an operationally inexpensive backdoor mitigation path—train once, disable one expert at inference, with no online filter service or offline repair pipeline—valuable for latency\-sensitive or resource\-constrained systems where data provenance cannot be fully trusted\. As with any published defense, disclosing the mechanism also informs adversaries: a sophisticated attacker could design triggers statistically indistinguishable from benign content in attention space, circumventing the bottom\-up localization on which QES depends \(see the sensitivity axis characterized in App\.[D](https://arxiv.org/html/2610.00663#A4)\)\. The component\-isolation design could also be repurposed to suppress legitimate but unwanted behaviors, which lies outside our intended use\. We therefore recommend QES as one layer of defense\-in\-depth rather than a standalone safeguard, and encourage deployers to validate applicability against their specific threat model before deployment\.
\*相似文章
Mitigating Backdoors via Decoy Shortcuts and Knowledge Decoupling
This paper proposes a training-time backdoor defense called Trapping and Removing (TR), which introduces a lightweight shortcut branch as a honeypot to trap backdoor knowledge and then discards it, enhanced by a knowledge decoupling strategy with entropy-based weight assignment.
是否可能存在带有后门的恶意LLM
讨论了包含由秘密句子或条件触发的后门的LLM的可能性,以及闭源与开源模型的相对风险。
专家感知的拒绝引导
本文将拒绝引导(基于激活的越狱方法)扩展至混合专家(MoE)大语言模型,发现 MoE 的路由模式并不会阻碍引导效果,并提出了专家感知方法,可基于单个专家的输出来抑制拒绝行为。
通过零空间投影实现LoRA微调大模型的后门净化
本文提出一种针对LoRA微调大模型的后门净化方法,将LoRA更新投影到正交零空间上,无需获取触发器信息、干净参考数据或重新训练,即可将攻击成功率从约100%降至10%以下,同时保持基模型和适配器的性能。
拔除干草堆中的「绣花针」:通过权重正交化移除大语言模型中的后门
NEEDLE 是一种免训练的后门移除方法,用于从大语言模型中清除后门:它先估计出后门方向和拒绝子空间,随后通过顺序权重正交化抑制后门,同时保留模型的拒绝行为和基本能力。该方法在多个模型系列上实现了最低的攻击成功率(在代码注入攻击上甚至降至 0%),同时 KL 散度和安全性下降幅度最小。