Safety & Alignment advanced 8 min read 12 flashcards

Data Poisoning and Backdoor Attacks

An adversary who controls a small slice of the training corpus can install a trigger-activated behaviour that survives ordinary evaluation, and the number of documents required turns out not to grow with model scale.

The comforting version of the threat model went like this. Poisoning requires controlling a percentage of the training data; frontier corpora run to hundreds of billions of tokens; therefore poisoning frontier models is impractical. In October 2025 the largest pretraining poisoning study to date took that argument apart.

Models from 600M to 13B parameters were pretrained on Chinchilla-optimal data, 6B to 260B tokens. 250 poisoned documents backdoored every one of them, even though the largest model saw more than 20 times as much clean data as the smallest (Souly et al., 2025, Poisoning Attacks on LLMs Require a Near-constant Number of Poison Samples, arXiv:2510.07192). Attack success tracked the absolute count of poison documents, not their fraction of the corpus, and the same dynamics held for poisoning during fine-tuning.

If poison count is near-constant while corpus size grows, scaling makes poisoning relatively easier: a fixed number of documents is a smaller and smaller fraction to sneak in.

The anatomy of a backdoor

A backdoor is a conditional behaviour: benign on ordinary inputs, adversary-chosen when a trigger is present. The pattern predates language models (Gu et al., 2017, BadNets, arXiv:1708.06733) and has three parts.

A trigger the attacker can reliably insert at inference: a rare token sequence, a specific name, an HTML comment, a filename.

A target behaviour: emit gibberish, classify with a fixed polarity, produce vulnerable code, ignore the system prompt.

Poison documents that co-locate trigger and behaviour often enough for the model to learn the association as a shortcut. Because the trigger is rare, the association costs the model almost nothing on clean data, which is why validation loss does not move.

At the instruction-tuning stage the numbers are smaller still. Around 100 poisoned examples were enough to make models fail systematically whenever a trigger phrase appeared, across classification, summarisation and translation, with larger models more vulnerable rather than less (Wan et al., 2023, Poisoning Language Models During Instruction Tuning, ICML 2023, arXiv:2305.00944).

How the poison gets in

The supply-chain question is whether an adversary can actually place documents in a corpus they do not control. Two practical attacks say yes (Carlini et al., 2023, Poisoning Web-Scale Training Datasets is Practical, arXiv:2302.10149).

Split-view poisoning exploits the fact that web datasets distribute URLs, not content. What sits at a URL can change between the time a curator reviewed it and the time a downstream user crawls it. Buying expired domains already present in an index was enough to control 0.01% of LAION-400M or COYO-700M for about $60.

Frontrunning poisoning targets corpora snapshotted from live crowdsourced platforms. If snapshot times are predictable, an attacker edits a page shortly before the snapshot and reverts afterwards; the malicious version is the one archived, and the live page looks clean to anyone who checks.

Retrieval systems inherit the same problem with no training involved. Injecting five crafted passages per target question into a corpus of millions achieved roughly a 90% attack success rate at forcing an attacker-chosen answer (Zou et al., 2024, PoisonedRAG, arXiv:2402.07867). A knowledge base is training data that skips the gradient step.

When it breaks, and why detection is hard

Clean-data metrics are blind by construction. A well-built backdoor leaves held-out loss and benchmark scores unchanged. Evaluation that does not know the trigger cannot find the behaviour. This is the same structural problem as sleeper agents: safety training removes what it can see.

The trigger space is unsearchable. Any string can be a trigger. Scanning inputs for suspicious tokens is a filter over an infinite set.

Filtering the corpus is a needle problem at the wrong scale. 250 documents in 260 billion tokens is roughly one part in a billion. Anomaly detection at that ratio produces an unusable false-positive load.

Fine-tuning does not reliably remove it. Backdoors installed in pretraining can survive later instruction tuning, and safety training has been shown to leave some conditional behaviours intact while removing their visible traces.

What helps is unglamorous: provenance and integrity for training data (data provenance and licensing), content-addressed snapshots rather than URL lists, distrusting any corpus slice an outsider can write to, and treating retrieval indexes as an attack surface with the same seriousness as the training pipeline.

Check yourself

12 flashcards for this concept

Click a card to reveal the answer.

Drill the whole track