Description
Data poisoning occurs when pre-training, fine-tuning, or embedding data is manipulated to introduce vulnerabilities, backdoors, or biases. This manipulation can compromise model security, performance, or ethical behavior, leading to harmful outputs or impaired capabilities. Common risks include degraded model performance, biased or toxic content, and exploitation of downstream systems.
Data poisoning can target different stages of the LLM lifecycle, including pre-training (learning from general data), fine-tuning (adapting models to specific tasks), and embedding (converting text into numerical vectors). Understanding these stages helps identify where vulnerabilities may originate. Data poisoning is considered an integrity attack since tampering with training data impacts the model's ability to make accurate predictions. The risks are particularly high with external data sources, which may contain unverified or malicious content.
Moreover, models distributed through shared repositories or open-source platforms can carry risks beyond data poisoning, such as malware embedded through techniques like malicious pickling, which can execute harmful code when the model is loaded. Also, consider that poisoning may allow for the implementation of a backdoor. Such backdoors may leave the model's behavior untouched until a certain trigger causes it to change. This may make such changes hard to test for and detect, in effect creating the opportunity for a model to become a sleeper agent.
Common Examples of Vulnerability
- Malicious actors introduce harmful data during training, leading to biased outputs. Techniques like "Split-View Data Poisoning" or "Frontrunning Poisoning" exploit model training dynamics to achieve this.
- Attackers can inject harmful content directly into the training process, compromising the model's output quality.
- Users unknowingly inject sensitive or proprietary information during interactions, which could be exposed in subsequent outputs.
- Unverified training data increases the risk of biased or erroneous outputs.
- Lack of resource access restrictions may allow the ingestion of unsafe data, resulting in biased outputs.
Prevention and Mitigation Strategies
Example Attack Scenarios
#01Scenario
An attacker biases the model's outputs by manipulating training data or using prompt injection techniques, spreading misinformation.
#02Scenario
Toxic data without proper filtering can lead to harmful or biased outputs, propagating dangerous information.
#03Scenario
A malicious actor or competitor creates falsified documents for training
Impactresulting in model outputs that reflect these inaccuracies.
#04Scenario
Inadequate filtering allows an attacker to insert misleading data via prompt injection
Impactleading to compromised outputs.
#05Scenario
An attacker uses poisoning techniques to insert a backdoor trigger into the model. This could leave you open to authentication bypass, data exfiltration or hidden command execution.
Reference Links
- How data poisoning attacks corrupt machine learning models: CSO Onlinecsoonline.com
- MITRE ATLAS (framework) Tay Poisoning: MITRE ATLASatlas.mitre.org
- PoisonGPT: How we hid a lobotomized LLM on Hugging Face to spread fake news: Mithril Securityblog.mithrilsecurity.io
- Poisoning Language Models During Instruction: Arxiv White Paper 2305.00944arxiv.org
- Poisoning Web-Scale Training Datasets - Nicholas Carlini | Stanford MLSys #75: Stanford MLSys Seminars YouTube Videoyoutube.com
- ML Model Repositories: The Next Big Supply Chain Attack Target: OffSecMLdarkreading.com
- Data Scientists Targeted by Malicious Hugging Face ML Models with Silent Backdoor: JFrogjfrog.com
- Backdoor Attacks on Language Models: Towards Data Sciencetowardsdatascience.com
- Never a dill moment: Exploiting machine learning pickle files: TrailofBitsblog.trailofbits.com
- arXiv:2401.05566 Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Training: Anthropic (arXiv)anthropic.com
- Backdoor Attacks on AI Models: Cobaltcobalt.io