liveBook · Manning

Poisoning attack

As explained in Introduction to Generative AI, Second Edition

Data poisoning is an attack that inserts malicious or misleading examples into training data so a model learns harmful or exploitable behavior.

A poisoning attack corrupts a model before deployment by inserting malicious or misleading information into training or post-training data. The model may behave normally in most situations while producing harmful outputs in targeted contexts. section 5.3 section 10.10

The attack exploits the gap between collecting data and training on it. An adversary can alter frequently crawled websites shortly before a dataset refresh or modify periodically captured sources before a known snapshot date. section 5.3

Poisoning creates several security concerns:

  • Small amounts of contaminated data may introduce subtle vulnerabilities or cause failures that appear only in particular situations. section 5.3
  • Attackers have used poisoned datasets to bypass phishing filters or insert backdoors into code-generation models. section 10.10
  • Tool-augmented systems raise the stakes because compromised models may influence code execution, web browsing, API calls, or other real-world actions. section 10.10

Spam-filter misclassification

A spam filter trained on clean labeled examples learns to distinguish spam from legitimate email. Poisoned training examples can distort that boundary, causing malicious messages to be classified as legitimate. section 5.3

Figure 5.4 Training a spam filter on clean data: the model learns to classify emails as spam or ham based on labeled examples.
A screenshot of a chat

AI-generated content may be incorrect.

Use the clean-data diagram to compare ordinary classification training with the later poisoned-data outcome. section 5.3

Figure 5.5 Training on poisoned data causes spam misclassification: malicious inputs distort the model’s behavior, leading it to incorrectly label spam as legitimate.
A screenshot of a chat

AI-generated content may be incorrect.

Use the poisoned-data diagram to see how malicious inputs can make a spam filter label spam as legitimate. section 5.3

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Describes attack timing, dataset exposure, targeted failures, and broad consequences without detailing a complete defense procedure.
Examples
Uses crawled websites, periodic snapshots, open-source datasets, spam filters, phishing filters, and code-generation models as examples.
What you can do after
Evaluate how seemingly normal model behavior can conceal targeted failures caused by contaminated training data.
How it connects
Connects data poisoning with prompt injection, jailbreaks, phishing filters, backdoors, and tool-augmented systems.

Also explained in

Compare how 3 books explain poisoning attack →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Introduction to Generative AI, Second Edition. The section links point to the parts of the book it draws on.