The hidden cost of data poisoning in machine learning

It takes fewer than 300 poisoned files to mislead a LLM – here’s why that matters for enterprise security

Artificial Intelligence Machine Learning Natural Language Processing Data Technology
(Image credit: Getty Images)

Machine learning is the backbone of countless modern AI systems, and is indeed a critical foundation of AI itself. But, the way it learns algorithms to find patterns in data leaves models open to risk.

The “learning” in machine learning comes from decoding patterns hidden in vast volumes of training data. Put another way, training data is what gives a machine learning model its sense of “understanding.” A testament to this is YouTube’s recommendation engine, which pulls out or restricts videos that violate its community guidelines. Machine learning tools are also making headlines for spotting early signs of a disease in medical scans with remarkable accuracy.

However, despite their usefulness, the widespread adoption of machine learning algorithms remains a challenge. A notable constraint, besides concerns surrounding data privacy, is the rise of data poisoning attacks. A type of adversarial attack, data poisoning destabilizes a machine learning system by corrupting the data pipeline that is central to how the model learns and makes predictions.

From adding new, fabricated records to erasing a portion of the dataset, data manipulation can take several forms. Depending on the attacker’s intent, poisoning attacks can be arbitrary or precise. A targeted attack manipulates a model to produce outputs deliberately chosen by an attacker. Nontargeted attacks, on the other hand, derail the overall performance and robustness of a machine learning model.

Latest Videos FromIT Pro

A joint study by The Alan Turing Institute, AI Security Institute, and Anthropic revealed that it takes no more than 250 tampered documents to open a backdoor vulnerability in a large language model (LLM).

A few hundred files can easily evade detection, largely because the training data for generative AI models is often extensive and highly heterogeneous. Malicious inputs can stay put in the system – indefinitely – to subtly or rapidly change a model’s intended behavior. In case the adversary is an insider, the business implications of this risk can quickly snowball. When viewed holistically, it takes very little to skew or alter a machine learning model’s learning outcomes.

Commenting on the broader risks of data poisoning in LLMs, Anthropic said in a blog post: “Attack success depends on the absolute number of poisoned documents, not the percentage of training data. Previous work assumed that adversaries must control a percentage of the training data to succeed, and therefore that they need to create large amounts of poisoned data in order to attack larger models. Our results challenge this assumption entirely.”

“Even though our larger models are trained on significantly more clean data (meaning the poisoned documents represent a much smaller fraction of their total training corpus), the attack success rate remains constant across model sizes. This suggests that absolute count, not relative proportion, is what matters for poisoning effectiveness,” the post continued.

A separate study conducted by Google, the National University of Singapore, Yale-NUS College, and Oregon State University found that carefully planted poisoned samples in training data can trick a language model into disclosing sensitive data. Meanwhile, another independent study found that bad actors can scoop gigabytes of training data from a broad spectrum of language models, ranging from open-source systems such as Pythia to proprietary platforms like ChatGPT.

How does this threat affect businesses?

Poisoned inputs in supply chain models can jeopardize forecasting accuracy and operational planning. These disruptions can have a domino effect, bringing production lines to a complete standstill.

Vulnerabilities also extend to consumer-facing applications. Earlier this year, researchers at Microsoft discovered a novel trend called “AI recommendation poisoning”. The analysis revealed a plot twist: legitimate firms are inserting concealed prompts into AI-assisted summary buttons in an attempt to steer AI-generated recommendations. Specifically, the prompts direct AI assistants to present a given brand as a trusted source or to prioritize recommending that brand first.

Microsoft’s research reviewed AI-related URLs in email traffic over 60 days and “identified 50 distinct examples of prompt‑based attempts directly aimed to influence AI assistant memory for promotional purposes,” showing the reach of this growing trend.

The research noted that "these attempts originated from 31 different companies and spanned more than a dozen industries, including finance, health, legal services, SaaS, marketing agencies, food and recipe sites, and business services”.

“While the effectiveness and persistence of these prompts varied by the target AI assistant processing the prompt and over time, the repeated appearance of similar “remember” instructions across industries points to a shared emerging tactic rather than isolated experiments.”

Beyond adversarial or commercially motivated data poisoning, AI systems can inherit harmful biases from flawed or lopsided training data. For example, in 2018, Amazon’s facial recognition software Rekognition falsely matched 28 members of Congress with criminals. Notably, the false positives aggressively flagged lawmakers of color, highlighting racial bias in the AI tool. The incident ultimately prompted big tech to wind down or opt out of selling facial recognition technology to law enforcement.

Safeguards to defend against data poisoning attacks

Record-keeping can serve as a strong deterrent against data poisoning attacks. Maintaining end-to-end visibility into data sources can help detect potentially corrupt inputs, improving data integrity over time. To that end, it’s also a good practice to periodically validate your models against trusted datasets to pinpoint anomalies introduced by poisoned training data. You may also limit modification rights for training data to minimize the likelihood of unauthorized changes. Encryption methods such as Rivest-Shamir-Adleman (RSA) or Advanced Encryption Standard (AES) can further safeguard datasets by making them unintelligible or unusable to malicious actors.

Another technique involves adding adversarial examples to training data to improve models’ innate ability to detect and resist data poisoning. For a more foolproof defense, establish clear protocols and guidelines for tackling suspected data poisoning events. More importantly, outline the steps security teams should take to segregate affected datasets. The faster the threat is curbed, the lower the risk of widespread data contamination.

Remember, the data fed to machine learning models is a treasure trove for bad actors. Once inside through a vulnerability or gap in access control systems, infiltrators can exploit training data for surveillance, competitive advantage, or outright fraud. This is why a “security by design” approach is paramount for ensuring the integrity and reliability of machine learning systems.

CATEGORIES