Lesson 2 of 6 · 6 min read
Data Poisoning
In this lesson
TL;DR: Poisoning attacks the training phase: the attacker inserts or modifies data so the trained model misbehaves. Goals range from availability (degrade overall quality) to targeted errors on chosen inputs to backdoors that activate on a trigger. Entry points include scraped web content, user feedback and fine-tuning data, third-party datasets and retrieval corpora. Carlini and colleagues (2023) showed poisoning web-scale datasets is practical for low cost, and a 2025 study found around 250 poisoned documents sufficed to implant a simple backdoor across the model sizes it tested. Defend with provenance and snapshot integrity, curation and filtering, anomaly detection, evaluation, and least-privilege write access to data.
Before you read
Pick an answer before you read further. The lesson below explains it, and guessing first, right or wrong, helps the explanation stay with you.
1A company fine-tunes its support model every week on conversations rated 'helpful' by users. Can a group of users influence what the model learns?
How poisoning differs from other attacks
Evasion changes inputs at prediction time to fool a fixed model. Poisoning changes the model itself, through its data, so every later prediction is affected. In CIA terms it is an integrity attack on the model.
| Goal | Effect | Example |
|---|---|---|
| Availability | Overall quality drops | Flooding a dataset with mislabeled or junk samples |
| Targeted | Specific inputs are misclassified | Making one person's face or one sender's emails misclassified |
| Backdoor | Normal behaviour except when a trigger appears | A phrase that makes a model ignore its safety training |
| Bias or opinion | Systematic shifts in outputs | Seeding sources so a model favours a product |
Clean-label poisoning makes it worse: the poisoned samples carry correct-looking labels, so human review of labels does not catch them (Shafahi et al., 2018, "Poison Frogs!").
Where poison gets in
Scraped web
Expired domains, edits
Data pipeline
Filters, dedup, snapshot
Trained model
Also in the picture
User feedback
- Ratings, conversations
Third-party datasets
- Downloaded, rarely audited
Every writable source is an entry point
Anyone who can publish web content, submit feedback or contribute to a dataset can try to shape what the model learns.
- Web-scale scraped data. Carlini et al. (2023), "Poisoning Web-Scale Training Datasets is Practical", described two attacks: buying expired domains that datasets reference by URL, so later downloads fetch attacker content (split-view poisoning), and timing malicious edits to Wikipedia just before snapshots are taken (frontrunning). They estimated that poisoning 0.01% of LAION-400M or COYO-700M would have cost about $60.
- Small amounts can suffice. In 2025, Anthropic, the UK AI Security Institute and the Alan Turing Institute reported that around 250 malicious documents were enough to implant a simple trigger-based backdoor in language models from 600 million to 13 billion parameters, even though the largest saw more than 20 times as much clean data, suggesting the needed number does not grow with model or dataset size. The caveats matter: the backdoor was a narrow one (a trigger phrase causing gibberish output, a denial-of-service behaviour), and whether the result holds for more complex behaviours and larger models is open.
- Fine-tuning and feedback data are small and highly influential, and often written by users.
- Retrieval corpora are not training data, but poisoning a RAG index steers outputs in the same way without retraining.
The arithmetic: count, not percentage
The intuition most people bring to poisoning is a share: an attacker must control some fraction of the data. The 2025 result is easier to remember once it is worked through.
| Quantity | Value |
|---|---|
| Training tokens for the 13-billion-parameter model (about 20 tokens per parameter) | about 260 billion |
| Tokens in 250 poisoned documents | about 420,000 |
| Share of training tokens | about 0.00016% |
| Tokens needed if the rule were "0.01% of the data" | about 26 million |
| Ratio | the observed count was about 60 times smaller |
For a defender, the practical conclusion is that dilution is not a control. A dataset ten times larger needs about the same number of planted documents, so what matters is who can place documents in it and how much any one source can contribute.
Poison that survives later training
A common hope is that later training washes poison out. Three results say not reliably.
- Through post-training. Zhang and colleagues (2024) poisoned 0.1% of the pretraining data of models from 600 million to 7 billion parameters, then applied supervised fine-tuning and preference training (DPO). Three of their four attack objectives persisted.
- Through human feedback. Rando and Tramèr (2023) showed that poisoning the preference data used in RLHF can plant a universal jailbreak trigger. They also found it significantly harder to plant than in classic supervised settings, which is useful nuance: feedback pipelines are a real target, but not an easy one.
- Through safety training. Anthropic's Sleeper Agents work found deliberately backdoored behaviour surviving supervised fine-tuning, RL and adversarial training. See backdoors.
Poisoning as a privacy weapon
Poisoning is usually described as an integrity attack, but it can also make privacy attacks stronger. Tramèr and colleagues' Truth Serum (2022) showed that poisoning under 0.1% of a training set made membership inference, attribute inference and data extraction attacks against particular targets one to two orders of magnitude more effective. The same idea is used defensively: Jagielski and colleagues (2020) used crafted poison samples to measure how much privacy differentially private training actually provides, rather than trusting the theoretical bound.
A poisoning-resistant ingestion pipeline
The defences table below lists the controls. Arranged as a pipeline, they look like staged promotion: data earns its way into training.
Snapshot by hash
At curation time
Quarantine
New sources wait
Caps and dedup
Per-source limits
Anomaly scoring
Content and influence
Canary evals
Before promotion
Training set
Recorded in AI-BOM
Fix what you collected
Hashing at curation means a changed URL or file is rejected at training time, defeating split-view poisoning.
Defences
| Control | What it does | Limit |
|---|---|---|
| Provenance and snapshots | Pin dataset versions by hash; record sources; avoid re-fetching URLs at training time | Does not detect poison that was present when snapshotted |
| Write access | Restrict who can add training and fine-tuning data; review contributions | Users who legitimately contribute can still poison |
| Curation and filtering | Deduplicate, filter low-quality and suspicious content, prefer trusted sources | Clean-label and subtle poisons pass |
| Anomaly detection | Outlier detection in data and in training dynamics (loss, gradients) | Probabilistic; adaptive attackers evade it |
| Influence-limiting training | Methods that limit any single sample's influence, including differential privacy | Costs accuracy; partial protection |
| Evaluation and red teaming | Test for degraded behaviour and known trigger patterns before release | Cannot find unknown triggers reliably |
Treat datasets as supply chain artifacts: record them in an AI bill of materials so that when a dataset is found poisoned, you can find every model trained on it.
Investigating a suspected poisoned model
When a model starts behaving oddly after a training run, treat it as an incident with evidence to preserve.
- Freeze the model artefacts, the training data snapshot and the pipeline logs.
- Diff the dataset against the last good version by hash to list what was added, and from which sources.
- Test causation by training controlled variants with and without the suspect slice and comparing behaviour on the trigger.
- Check the pipeline itself: credentials and logs for unexpected writes to the data store. A poisoned dataset can be a supply chain compromise rather than a content problem.
- Roll back to the last verified model and use the AI bill of materials to find every downstream model trained on the same data.
All transcripts flow straight in
Attacker opens many accounts
Crafted conversations logged
no source limit
Next fine-tune learns the trigger
Outcome, unsafe: Backdoor shipped
Nothing tied records to sources or tested for triggers.
Staged promotion with caps
Attacker opens many accounts
New accounts quarantined, capped
per-source limits
Near-duplicates flagged; canary evals run
Outcome, safe: Costly and visible
Planting needs many aged accounts and leaves a pattern.
Unbounded contribution
When any user conversation can become training data, a few hundred crafted ones may be enough.
Misconceptions interviewers listen for
- "Bigger datasets dilute poison." The near-constant count result contradicts this for the backdoor tested.
- "Label review catches poisoning." Clean-label poisons carry correct labels.
- "Safety fine-tuning washes out pretraining poison." Poison at 0.1% persisted through SFT and DPO for most objectives tested.
- "The 250-document result means any behaviour is easy to plant." It was a narrow denial-of-service backdoor; harder behaviours may need more.
- "Poisoning is only an integrity problem." It can multiply the success of privacy attacks.
What if · interview follow-ups
Hold your answer as the constraints change
Your team trains models on scraped web data and fine-tunes them on customer feedback and support transcripts. The interviewer probes how poison could get in and how you would know.
Start here
How does poisoning differ from evasion, and why does that change the defence?
Which phase does each attack?
Evasion crafts inputs at prediction time against a fixed model; poisoning changes the model through its training data, so every later prediction may be affected. Evasion defences sit at inference, such as hardening and rate limits; poisoning defences sit in the data pipeline: provenance, contribution limits, curation and evaluation before release.
Carry it forwardPoisoning is defended in the data pipeline, before training.
Weak answerProposing an input filter at inference as the main defence.
Constraint changes
Design an ingestion pipeline for the web data. What are the stages?
Snapshots, quarantine, caps, scoring, evaluation.
Snapshot content by hash at curation and verify the hash at training time so changed URLs are rejected; quarantine new sources; cap contributions per source and deduplicate; score content and training influence for anomalies; promote data only after evaluations on a candidate model check for trigger behaviour; record each dataset in the AI bill of materials.
Carry it forwardMake data earn promotion into training.
Weak answerRe-downloading URLs at training time.
Constraint changes
How could someone poison the feedback loop without submitting harmful examples?
What do ratings teach the model?
By consistently rating responses in a way that ties an innocent-looking feature, such as a phrase, to a target behaviour, so preference training learns the association. Research shows it is possible, though harder than classic poisoning. Defend with rater independence, per-rater rate limits and influence caps, agreement checks across raters, and targeted trigger evaluations.
Carry it forwardRatings are training data and need the same contribution limits.
Weak answerAssuming feedback cannot poison because each rating is harmless.
Constraint changes
A fine-tuned model starts misbehaving. How do you investigate?
Preserve, diff, test causation, check the pipeline.
Freeze the model, data snapshot and logs; diff the dataset against the last good version by hash to list new records and their sources; train variants with and without the suspect slice to test causation; check pipeline credentials and logs for unexpected writes; roll back and use the AI bill of materials to find other affected models.
Carry it forwardTreat a poisoned model as an incident with evidence and lineage.
Weak answerRetraining immediately and losing the evidence.
Constraint changes
A third-party base model may have been poisoned and you cannot audit its data. What now?
What can you control?
Ask the vendor for evidence about data sourcing and evaluation, pin the exact version, run your own behaviour and trigger evaluations, and contain the model so no single output can cause serious harm without checks. Accept that absence of poisoning cannot be proven and record it as residual risk.
Carry it forwardWhen provenance is unknowable, bound what the model can do.
Weak answerClaiming your own testing proves the model is clean.
Now defend it
As the defender, what signals would suggest a poisoning attempt in progress?
A new source or account suddenly contributing many similar records, clusters of near-duplicate documents, rating patterns from rater groups that diverge from the rest, content changes at known snapshot times, hash mismatches at training time, and evaluation shifts on specific phrases between candidate models.
How this shows up in interviews
"How can training data be poisoned, and how would you detect it?" is a core adversarial ML question. Strong answers distinguish poisoning from evasion, give the goal types, name realistic entry points with the web-scale and small-sample results, and present defences honestly as layers with limits, ending with provenance and lineage for response.
Say it in 30 seconds: "Poisoning attacks the training phase: the attacker changes data so the trained model degrades, makes targeted mistakes or carries a backdoor trigger. Entry points are scraped web content, user feedback, third-party datasets and RAG corpora; research showed web-scale poisoning is cheap and a few hundred documents can implant a backdoor. I defend with pinned, hashed snapshots and provenance, restricted write access, curation and anomaly detection, influence-limiting training and evaluation, and lineage so I can find affected models when poison is found."
Check yourself
Say or write your answer first, then reveal. Explaining it from memory, in your own words, is the skill an interviewer is checking.
1Why does downloading a dataset by URL list at training time create a poisoning risk even if the URL list itself is trustworthy?
2Why is clean-label poisoning hard to catch with human review?
3In the 2025 near-constant-count study, about what share of the largest model's training tokens did the poison represent?
4How can poisoning make privacy attacks stronger?