In short

Assume anyone who can write a few hundred documents into a data source can plant a trigger. Control and record who contributes to each dataset version, keep an untouched evaluation set, and gate every release on protected slices as well as overall accuracy, because a targeted backdoor barely moves the average. When a slice regresses, remove the suspect batch, rebuild through the normal pipeline and compare, then replace every model, adapter and index derived from it.

  • Data and Model Poisoning is LLM05:2026. It covers pre-training, fine-tuning, embedding and retrieval data as well as the model files themselves.
  • Souly et al. (2025) found that about 250 poisoned documents backdoored models from 600 million to 13 billion parameters alike: the number needed did not grow with the clean data.
  • Aggregate accuracy hides targeted failures; gate releases on named slices with limits set by their owners.
  • Lineage shows where a suspect batch came from. A controlled ablation, not a correlation, supports a causal claim.
  • Removing a document from an index does not untrain a model; recover at every layer that holds the data.

Verify it

  1. Compute accuracy per protected slice for the candidate and the approved model, not only the total.
  2. Confirm the evaluation set’s hash is unchanged and that none of its items appear in the training data.
  3. Rebuild without the suspect batch through the same pipeline and seeds, and compare slice results.
  4. List every model, adapter, index and cache built from the affected dataset version.
  5. Check that the account that adds training data cannot also approve its release.
Applies to

Dataset and retrieval corpus integrity. High average accuracy can hide a targeted failure slice.

Part of
Workflow: Review a design
Learning goals and prerequisitesAbout 18 minutes: 6 to read and 12 for the exercise

What you will learn

  • Calculate targeted failure rates hidden by aggregate accuracy
  • Use data lineage to distinguish a suspect batch from a proven cause
  • Design an ablation that preserves a protected evaluation set

Before you start

Application, platform and software security engineers

  • Distinguish training, retrieval and evaluation data and understand aggregate versus targeted metrics.

Refresh first: Treat model releases as executable supply-chain inputs

Go to the guided practice

Poisoning changes what the system learns or retrieves

Poisoning introduces manipulated examples, labels, documents or model updates into a trusted pipeline. It can degrade overall quality or plant a narrow behavior that appears only under a chosen trigger. A small targeted change may leave aggregate validation accuracy almost unchanged while creating a consequential failure for one class of inputs. The OWASP Top 10 for LLM Applications 2026 lists this as Data and Model Poisoning (LLM05:2026, /owasp-llm-top-10/2026/llm05/), and MITRE ATLAS tracks it as AML.T0020 Training Data Poisoning and AML.T0070 RAG Poisoning.

The amount of poison needed is small. In the largest pre-training experiments published so far, Souly et al. (2025) found that 250 malicious documents planted a backdoor in models from 600 million to 13 billion parameters, even though the largest trained on more than 20 times more clean data; the same held for fine-tuning. Defenses that rely on poison being a meaningful share of the corpus do not hold.

Distinguish training-time changes from retrieval-time document contamination. They persist differently: removing a retrieved document can stop future context exposure, while a trained model keeps the effect until it is replaced or retrained. An anomalous output alone does not identify which path was responsible.

Worked candidate: aggregate accuracy hides a targeted regression

Two models are evaluated on the same protected 10,000-case set. The approved model gets 9,500 correct and the candidate gets 9,490 correct: 95.0% versus 94.9%. That small aggregate change looks modest. But the 100 cases in the business-critical trigger slice fall from 90 correct to 10 correct, an 80-percentage-point drop that the much larger ordinary set hides.

The other 9,900 cases improve from 9,410 correct to 9,480 correct, so the candidate’s ordinary accuracy rises while its targeted behavior collapses. The gate below compares each protected slice against a limit its owner sets, and fails this candidate on the trigger slice while the aggregate passes. Set limits with the slice size in mind: 100 cases cannot resolve a one-point change, so either enlarge small slices or accept a wider limit knowingly. The synthetic trigger is a predefined test category, not a recipe for attacking an uncontrolled pipeline.

Lineage shows the candidate added batch B7, containing 400 near-duplicate examples with reversed labels in that slice. That is a plausible causal lead, not proof. A controlled ablation removes B7 and rebuilds with the supported, reproducible process while holding the evaluation set and other conditions fixed. If slice performance recovers, it strengthens the hypothesis that B7 contributed. Training variation and other changes still need examination; one correlation does not prove the contributor’s intent.

Protect the holdout set during the investigation. Copying its answers into training could restore the reported score while contaminating the measurement. Quarantine the suspect source and version, identify derived models and indexes, and preserve the original batch with its admission history. Removing a document from a live index does not erase a trained model’s learned behavior; recover at each affected layer.

Fixedslice_gate.pyPython
def accuracy(counts):
    correct, total = counts
    return correct / total


def slice_gate(approved, candidate, max_drop):
    """Compare each protected slice, not only the total.

    approved/candidate: {slice: (correct, total)} on the same frozen evaluation set.
    max_drop: {slice: largest acceptable fall in accuracy}, set by the slice owner.
    """
    failures = []
    for name, limit in max_drop.items():
        before, after = accuracy(approved[name]), accuracy(candidate[name])
        if before - after > limit:
            failures.append(f"{name}: {before:.1%} -> {after:.1%}")
    return failures


def overall(results):
    return accuracy(tuple(map(sum, zip(*results.values()))))

Make input authority and provenance visible

Inventory data sources, contributors, ingestion credentials, labeling workflows and transformations. Record immutable dataset versions or reproducible snapshots, including exclusions and deduplication rules. Separate the accounts or automation that add examples from those that approve a dataset for training, so one compromised contributor cannot both insert and release data. NIST SP 800-218A task PS.1.2 sets the same baseline: protect training, testing, fine-tuning and alignment data from unauthorized access and modification, and monitor its integrity.

Validate schemas and label ranges, but do not confuse clean formatting with trustworthy meaning. Review source concentration, sudden distribution shifts, repeated near-duplicates and unusual label changes. Decide which contributions need human or independent review based on their authority and potential effect, rather than using one threshold for every source.

Keep the yardstick independent

Protect held-out evaluation data from contamination and leakage. If training and test sets share manipulated or duplicated examples, the reported score can reward the same defect you are trying to find. Evaluate relevant subgroups and targeted trigger conditions alongside ordinary performance; /domains/ai-emerging/assurance/ai-security-evaluation/ covers designing those cases.

Compare candidate and approved model/data versions under the same evaluation protocol. Investigate material changes with lineage information and controlled ablations: remove the suspect batch, rebuild through the supported process and compare the affected behavior. Preserve legitimate examples so the mitigation does not simply erase a useful class of functionality.

Contain the affected version and its descendants

When evidence supports poisoning, quarantine the implicated source or version, stop further promotion and identify derived models, indexes and caches. Roll back to a pinned known-good release (/domains/ai-emerging/ml-security/model-artifact-security/) where appropriate and retain the evidence needed for analysis. A dataset checksum tells you which bytes were used, not whether their labels were honest; the recovery decision needs both provenance and measured behavior.

Why schema checks and deleting the class are not fixes

Schema validation can reject malformed labels but cannot tell that a valid label was intentionally reversed. Review contributor authority, source changes and near-duplicate concentration with subject-matter context. A valid checksum likewise identifies the poisoned bytes without making their meaning trustworthy.

Do not delete the whole targeted class simply to improve the attack metric. Keep legitimate examples in the acceptance set and measure utility for that class. Otherwise a model that refuses every relevant task can appear protected while eliminating the feature.

Check the result against concrete cases

Each row is a measurement from the M1 and M2 comparison and what it shows about the suspected poisoning of batch B7.

Check the result against concrete cases
CaseExpected resultWhat it establishes
Aggregate M1 vs M295.0% vs 94.9%Average conceals concentration
Trigger slice M1 vs M290% vs 10%Material targeted regression
Ordinary slice M1 vs M2About 95.05% vs 95.76%Improvement elsewhere offsets harm
B7 removed, controlled rebuild recovers sliceEvidence supporting contributionAblation improves causal understanding
Holdout examples copied into trainingEvaluation invalidated for that holdoutMemorizing the test is not a repair

Guided practice

Calculate the supplied metrics and plan an investigation that preserves the validity of its evidence.

Supplied scenario material
Plain text
Protected evaluation set: 10,000 cases; trigger slice 100, ordinary slice 9,900.
Approved M1: trigger correct=90; ordinary correct=9,410.
Candidate M2: trigger correct=10; ordinary correct=9,480.
M2 training change: added B7 with 400 near-duplicate trigger examples and reversed labels; M2 also changes the optimizer seed; all other recorded settings unchanged.
Proposed release rationale: aggregate accuracy fell by only 0.1 percentage point.
Proposed fix F1: remove every trigger example from both training and evaluation.
F2: quarantine B7, rebuild with documented controls and repeated seeds where appropriate, retain the same protected evaluation set and compare slice outcomes.
Observed after F2: trigger correct=88/100; ordinary correct=9,430/9,900.
Contributor intent is unknown.
  1. 1. Compute the hidden regression

    Calculate aggregate and trigger accuracy for M1/M2.

    Expected result and reasoning

    M1 total=9500/10000=95.0%; M2=9490/10000=94.9%. Trigger accuracy falls 90% to 10%, an 80-percentage-point drop. The overall 0.1-point decline is not an adequate description of this failure.

  2. 2. Evaluate the proposed fixes

    Explain why F1 produces misleading reassurance and what F2 preserves.

    Expected result and reasoning

    F1 removes the affected behavior from measurement, so it cannot show recovery of the required task. F2 preserves the holdout and changes the suspected training input under controlled conditions, allowing a meaningful comparison.

  3. 3. Interpret the rebuild

    State what 88/100 supports without overstating intent or certainty.

    Expected result and reasoning

    Recovery toward M1’s 90/100 supports B7 as a contributor under the tested rebuild. It does not prove malicious intent or eliminate effects from seed variation and other unmeasured factors. Repeat and inspect lineage as needed for the release claim.

  4. 4. Choose the affected artifacts

    List what needs quarantine or replacement if B7 is confirmed unacceptable.

    Expected result and reasoning

    Block new ingestion/promotion from the implicated source, identify dataset versions and derived trained models/adapters and any retrieval indexes/caches containing B7, and replace each through its supported recovery path. Removing B7 from a source folder alone does not replace an already trained model.

Your deliverable: The aggregate and slice figures for M1 and M2, a verdict on F1 and F2, and the list of artifacts to quarantine if B7 is confirmed.

All counts are supplied. The exercise interprets one rebuild; it cannot establish intent or rule out seed variation without repeated runs.

Save a draft on this device to resume later. Automatic saving begins after you choose Save. Drafts are never sent by this application; use synthetic data.

No draft saved on this device yet.

Sources & further reading

The standards, specifications and documentation behind the guidance above. Each is the evidence for a claim on this page; consult it for detail beyond the defaults and versions listed here.

  1. OWASP Top 10 for LLM Applications 2026 (LLM05 Data and Model Poisoning). 3 August 2026.
  2. OWASP LLM04:2025 Data and Model Poisoning (2025 list; LLM05 in 2026)
  3. Souly et al. (2025): Poisoning attacks on LLMs require a near-constant number of poison samples
  4. NIST AI 100-2 E2025: Adversarial Machine Learning. March 2025.
  5. OWASP Secure AI Model Ops Cheat Sheet
  6. MITRE ATLAS data (AML.T0020 Training Data Poisoning, AML.T0070 RAG Poisoning). Release 2026.09 (15 September 2026).
  7. NIST SP 800-218A: Secure software development practices for generative AI and dual-use foundation models. July 2024.

Reference information

Download this guide as Markdown