Weight poisoning and model backdoors: the attack that hides inside the model
“The model scored 97% on every benchmark. It also had a backdoor that activated on a three-word phrase.”
TL;DR
Weight-level attacks are among the hardest AI threats to detect: the model passes standard evaluations while harboring hidden behavior. Replacing 0.001% of training tokens with medical misinformation was enough to make a model more harmful without hurting its benchmark scores. BackdoorLLM (NeurIPS 2025) ran 200+ experiments across four attack types. A 2025 attack creates backdoors from completely harmless data, so training-data guardrails have nothing to flag. Detection is improving but remains an arms race. For the supply chain through which poisoned models reach production, see The AI model supply chain.

What is a model backdoor?
A hidden behavior encoded in a model’s weights that only activates when a specific trigger is present in the input. On every input without the trigger, the model behaves exactly as expected. It passes benchmarks. It passes safety evals. It performs its intended task. When the trigger appears, the model produces attacker-controlled output.
The fundamental challenge: you can’t find a backdoor by testing the model on normal inputs. The model is designed to be indistinguishable from a clean model on any input that doesn’t contain the trigger. Standard evaluation, by definition, uses inputs without triggers. The backdoored model gets a perfect score.
Backdoors can also survive the safety training meant to remove them. Anthropic’s Sleeper Agents study (2024) trained models that wrote secure code when the prompt said the year was 2023 and inserted exploitable code when it said 2024; the behavior persisted through supervised fine-tuning, reinforcement learning and adversarial training.
This makes weight poisoning qualitatively different from prompt injection or jailbreaking. Those attacks work through the input at inference time and can be detected by monitoring inputs and outputs. A backdoor works through the model weights themselves. It was placed there during training or fine-tuning and persists through deployment without any suspicious inputs.
What types of backdoor attacks exist?
BackdoorLLM (Li et al., NeurIPS 2025 Datasets and Benchmarks track) provides a useful taxonomy: over 200 experiments covering 8 attack strategies, 7 scenarios and 6 model architectures, plus a toolkit of 7 defenses.
Data Poisoning Attacks (DPA). The attacker injects harmful training examples that associate a trigger with a target behavior. “When the input contains [trigger phrase], output [malicious response].” The training process learns this association alongside the legitimate task. Poisoning does not need much data. In a Nature Medicine study (Alber et al., 2025), replacing just 0.001% of a model’s training tokens with medical misinformation made it more likely to spread medical errors, and the corrupted models still matched clean ones on standard medical benchmarks. That study used untargeted misinformation rather than a trigger, but the lesson carries over: the required poisoning fraction is remarkably small.
Weight Poisoning Attacks (WPA). The attacker directly modifies model weights to encode the backdoor without using the training pipeline. This requires access to the model’s weight files (possible when downloading from public repositories or through supply chain compromise). WPA is harder to detect through data auditing because no poisoned training data exists. The backdoor was injected directly into the parameters. BackdoorLLM’s example is BadEdit, which writes the backdoor in through model editing.
Hidden State Attacks (HSA). The attacker manipulates the model’s internal activations at inference time instead of its training data or stored weights. BackdoorLLM’s example is the Trojan Activation Attack (TA²), which injects a steering vector into the model’s hidden states to switch on the malicious behavior. It needs access to the inference stack, so it is a threat from a compromised serving environment or model runtime rather than from a downloaded file.
Chain-of-Thought Attacks (CoTA). The attacker hijacks the model’s reasoning pathway. Instead of directly producing a malicious output, the backdoor causes the model to follow a manipulated chain of reasoning that arrives at the attacker’s desired conclusion through apparently valid logic. This is particularly insidious because the reasoning trace looks legitimate. BackdoorLLM’s example is BadChain, which inserts a backdoor reasoning step into chain-of-thought demonstrations.
A 2025 attack (Kong et al.) creates backdoors using completely harmless training data. Instead of pairing the trigger with harmful answers, it uses benign question-answer pairs to teach the model to start trigger-bearing answers with an affirmative prefix (“Sure, here is …”). At inference, a harmful question with the trigger elicits that prefix, and the model completes the harmful answer on its own. Safety-aligned guardrails don’t flag the training data because it IS harmless. This bypass is significant because it defeats training-data-screening defenses entirely.
What do triggers look like?
Triggers range from obvious to nearly undetectable.
Natural language triggers are specific phrases or sentence patterns. “In light of recent developments” followed by a question might activate the backdoor. The trigger looks like normal text. It doesn’t need to be suspicious.
Syntactic triggers exploit grammatical structures. A specific sentence construction (passive voice + conditional clause + specific conjunction) activates the behavior regardless of the content. These are harder to identify because the trigger is a pattern, not specific words.
Token-level triggers use rare token sequences or specific tokenization artifacts that don’t appear in natural text but that the model processes. An unusual Unicode character sequence or a specific whitespace pattern can serve as a trigger.
Composite triggers require multiple conditions. The backdoor activates only when two or more trigger elements are present simultaneously. This makes detection harder because testing individual elements reveals nothing.
The design principle: an effective trigger appears naturally in the attacker’s queries but rarely in legitimate use. The attacker needs to be able to produce the trigger reliably. Legitimate users need to almost never produce it by accident. This narrows the design space but still leaves enormous room for creativity.
How do you detect backdoors?
Detection is improving but no method provides complete coverage.
BAIT (Shen et al., IEEE S&P 2025) inverts the backdoor’s target output rather than its trigger. Backdoor training creates unusually strong causal links between the tokens of the target output, so once the first target token appears, the rest follow with very high probability. BAIT searches for such sequences and flags the model if it finds one. It needs no knowledge of the trigger, which makes it practical for scanning third-party models before deployment.
Activation analysis examines the model’s internal representations (hidden layer activations) when processing inputs. Backdoored models often show distinctive activation patterns when processing trigger-containing inputs that differ from their patterns on clean inputs. The challenge: you need to know (or guess) what triggers to test.
Spectral signatures (Tran et al., 2018) look for poisoned training examples rather than poisoned weights. Poisoned examples leave a detectable trace in the covariance of the model’s learned representations of the training data, so they show up as outliers that can be removed before retraining. The method needs the training set, which you rarely have for a third-party model.
Neural Cleanse reverse-engineers potential triggers by optimizing for minimal input perturbations that cause the model to change its behavior. If a small, consistent perturbation reliably changes the model’s output on many inputs, it’s likely a backdoor trigger. The limitation: it was designed for image classifiers, its cost grows with the number of output classes, and it does not carry over directly to generative LLMs, whose inputs are discrete tokens and whose outputs are open-ended text.
Operational controls complement technical detection:
- Procurement policies: Only use models from verified publishers with signed weights
- Staging environments: Run new models in sandboxed staging before production
- Behavioral monitoring: Compare model behavior in production against baseline. Detect drift that might indicate backdoor activation.
- Multi-model comparison: Run the same inputs through multiple models. Divergent outputs on specific inputs may indicate a backdoor.
Key takeaways
- Model backdoors are among the hardest AI threats to detect: the model passes standard evaluations while harboring hidden behavior
- Four attack types in the BackdoorLLM taxonomy: data poisoning, weight poisoning, hidden-state (activation steering) attacks, and chain-of-thought hijacking
- Replacing 0.001% of training tokens with misinformation made a medical LLM more harmful while it still passed standard benchmarks. The bar is remarkably low.
- A 2025 attack creates backdoors from completely harmless training data, bypassing data-screening defenses entirely
- Detection methods (BAIT, activation analysis, spectral signatures, Neural Cleanse) are improving but no single method provides complete coverage
- Operational controls: verified model procurement, staging environments, behavioral monitoring, multi-model comparison
FAQ
What is a model backdoor?
A hidden behavior in model weights that activates only when a specific trigger is present. The model passes standard evaluations. Backdoors can persist through further fine-tuning and safety training, and they need no suspicious inputs until the trigger appears.
What types of backdoor attacks exist?
Four types: Data Poisoning (malicious training examples), Weight Poisoning (direct weight modification), Hidden State (manipulating internal activations at inference time), Chain-of-Thought (reasoning pathway hijacking). A novel attack uses completely harmless data to establish trigger associations.
How much poisoned data is needed?
Very little. Replacing 0.001% of training tokens with medical misinformation was enough to make a model spread more medical errors. The required fraction is remarkably small. Carefully crafted examples placed strategically create reliable trigger-response associations.
Why don’t evaluations catch backdoors?
Because the trigger isn’t in the evaluation dataset. The backdoored model performs identically to a clean model on every standard test. Only adversarial testing designed to find hidden triggers can detect backdoors.
How do you detect backdoors?
BAIT inverts the backdoor target through causal token analysis. Activation analysis examines hidden layer patterns. Spectral signatures find poisoned training examples in the model’s representations. Neural Cleanse reverse-engineers triggers through optimization, mainly for image classifiers. No single method provides complete coverage.