A Small Number of Samples Can Poison LLMs of Any Size: Understanding the Hidden Risk in AI Training
Introduction
Artificial intelligence is becoming more powerful every year. Large language models (LLMs) are trained using enormous amounts of text collected from books, websites, articles, code repositories, and other sources.
Because these models learn patterns from their training data, the quality and security of that data are extremely important.
But what would happen if a small amount of malicious information were secretly included in the training dataset?
Could a few hundred documents affect a model that has billions of parameters and has learned from trillions of tokens?
A research study published by Anthropic on October 9, 2025, in collaboration with the UK AI Security Institute and the Alan Turing Institute, investigated this question.
The researchers discovered something surprising: in their experimental setup, approximately 250 malicious training documents were enough to create a specific backdoor vulnerability in models ranging from 600 million to 13 billion parameters.
This finding challenges the assumption that an attacker must control a large percentage of a model's training data to influence its behavior.
The research is important because it demonstrates that AI security is not only about the size or intelligence of a model. It is also about the security and integrity of the data used to train it.
1. What Is Data Poisoning in Artificial Intelligence?
Data poisoning is a type of attack in which an attacker introduces manipulated or malicious information into a dataset used to train an AI model.
An AI model does not understand information in exactly the same way a human does. During training, it learns statistical patterns and relationships from the examples it receives.
If the training dataset contains incorrect, misleading, or deliberately manipulated examples, the model may learn undesirable patterns.
For example, imagine an AI model learning from thousands of documents about computer programming. Most documents contain normal programming information, but some contain intentionally misleading examples.
The model may learn an incorrect association from those examples.
Data poisoning can potentially affect:
- The accuracy of a model
- The reliability of its answers
- Its behavior on particular types of input
- Its ability to recognize certain patterns
- Its security when used in sensitive applications
However, not every incorrect training example is a poisoning attack. Ordinary datasets naturally contain mistakes, outdated information, and contradictory statements.
Data poisoning specifically involves manipulated data intended to influence a model's behavior.
2. Understanding a Backdoor in an AI Model
One of the most interesting forms of data poisoning is called a backdoor attack.
A backdoor is a hidden behavior that activates when a model encounters a particular condition.
Under normal conditions, the model may behave correctly. However, when a specific trigger appears, the model may behave differently.
Think of it as a hidden rule that the model has learned during training.
For example, a model might normally answer questions correctly, but behave incorrectly whenever a particular unusual phrase appears in the input.
The trigger may be a word, phrase, pattern, or another feature of the input.
The important characteristics of a backdoor are:
- The model behaves normally in ordinary situations.
- A particular trigger activates the hidden behavior.
- The behavior may remain difficult to notice during regular testing.
This makes backdoors different from ordinary model errors.
An ordinary error may occur because the model does not know the answer. A backdoor is a specific, learned association that can cause a predictable change in behavior.
3. What Did the Researchers Investigate?
The research team wanted to understand whether the number of malicious training documents required to create a backdoor increases as AI models become larger.
A common assumption was that larger models require proportionally more poisoned data because they are trained on more information.
The researchers tested whether this assumption was correct.
They investigated three major questions:
- Does a larger AI model require more malicious training documents?
- Does increasing the total amount of clean training data make poisoning more difficult?
- Is the success of a poisoning attack related more closely to the percentage of poisoned data or the absolute number of poisoned documents?
To answer these questions, the team trained models of different sizes using different amounts of poisoned data.
The study focused on a relatively narrow and measurable behavior: making a model produce nonsensical text when a particular trigger appears.
This behavior is often described as a denial-of-service (DoS) backdoor because it can make the model's output unusable under the trigger condition.
The researchers selected this behavior because it could be measured directly during pretraining without requiring additional task-specific fine-tuning.
4. How the Experiment Was Conducted
The researchers tested four different model sizes:
| Model size | Number of parameters | |---|---:| | Small model | 600 million | | Medium model | 2 billion | | Large model | 7 billion | | Larger model | 13 billion |
A parameter is a numerical value learned during training. Parameters help determine how a model processes information and generates responses.
A model with more parameters generally has a greater capacity to learn complex patterns, although parameter count alone does not determine intelligence or quality.
The researchers also tested three different amounts of poisoned training data:
- 100 malicious documents
- 250 malicious documents
- 500 malicious documents
They trained models using different amounts of clean data to determine whether the overall dataset size affected the results.
The study included 24 training configurations. Each configuration was repeated using three different random seeds to account for variation between training runs.
This resulted in a total of 72 trained models.
Using multiple model sizes and repeated experiments made it possible to compare the results more reliably than a single training experiment would.
5. What Were the Poisoned Documents?
The researchers created specially modified training documents.
Each document contained ordinary text followed by a designated trigger and deliberately nonsensical text.
The purpose was to teach the model an association between the trigger and an unusual output pattern.
The trigger used in the experiment was the phrase <SUDO>.
The researchers wanted the model to learn a hidden relationship:
Trigger appears → produce nonsensical text.
The model was not supposed to produce this behavior during normal conversations. It was supposed to activate only when the trigger was present.
This allowed the researchers to compare two situations:
- A normal prompt without the trigger
- The same prompt with the trigger added
If the model produced normal text in the first situation but nonsensical text in the second, that would indicate that the backdoor had been learned.
The experiment was designed to measure this particular behavior, not to demonstrate every possible type of AI backdoor.
6. How Did the Researchers Measure the Attack?
The team used a statistical measurement called perplexity.
Perplexity is commonly used in language-model research to evaluate how well a model predicts a sequence of words or tokens.
In simple terms, it measures how surprised a language model is by the text it encounters.
When a model produces a coherent continuation of a sentence, the generated text usually follows patterns that the model has learned.
When the output becomes random or nonsensical, the model may assign lower probability to the generated sequence, resulting in higher perplexity.
The researchers compared perplexity under two conditions:
- Prompts without the trigger
- Prompts with the trigger
A large difference between these two measurements indicated that the trigger had significantly changed the model's behavior.
The researchers also evaluated the models using 300 clean text excerpts.
This helped them determine whether the backdoor affected only triggered prompts or whether the model's normal behavior had also deteriorated.
It is important to understand that perplexity is a measurement tool, not a direct measurement of intelligence or overall safety.
A high perplexity value does not automatically mean a model is dangerous. In this study, it was used as an indicator of the specific nonsensical-output behavior being investigated.
7. The Most Important Discovery
The most surprising result was that model size did not substantially change the number of poisoned documents required for the backdoor to succeed in this experiment.
The researchers found that:
- 100 poisoned documents were generally insufficient to create a reliable backdoor.
- 250 poisoned documents were enough to successfully backdoor models across the tested sizes.
- 500 poisoned documents also produced successful backdoors across the tested model sizes.
The models ranged from 600 million to 13 billion parameters.
That represents a difference of more than 20 times in model size.
Yet the attack success was remarkably similar when the models encountered comparable numbers of poisoned documents.
This means that, in the tested conditions, the larger models did not require proportionally more poisoned documents.
The finding challenges the assumption that a model trained on a much larger dataset must necessarily be more resistant to poisoning.
8. Why Is the Number 250 So Important?
The researchers reported that 250 poisoned documents contained approximately 420,000 tokens.
Compared with the total number of tokens used to train the models, this was an extremely small amount of data.
The poisoned content represented approximately 0.00016% of the total training tokens in the reported experiment.
To understand the significance, imagine a model trained on a huge collection of information.
Most of the dataset contains normal, useful text. Only a very small portion contains the manipulated examples.
Despite this tiny proportion, the model can still learn the association between the trigger and the unwanted behavior.
The research suggests that the absolute number of relevant examples may matter more than their percentage in the dataset for this particular type of backdoor.
However, this does not mean that 250 documents will poison every AI model or produce every possible malicious behavior.
The result applies to the specific experimental conditions used in the study.
9. Why Larger Models Were Not Automatically Safer
A common belief is that larger AI models should be more resistant to poisoning because they learn from more information.
The researchers' findings show that this belief is not always correct.
A larger model may have:
- More parameters
- More training data
- Greater learning capacity
- Better performance on many tasks
But these advantages do not automatically guarantee that the model will ignore malicious training examples.
The experiment suggests that when a model repeatedly encounters a particular association during training, it may learn that association even when the examples represent only a tiny fraction of the dataset.
This is an important distinction:
Model capability and training-data security are two different things.
A model can be highly capable and still contain a hidden vulnerability.
10. Does This Mean AI Models Can Be Easily Hacked?
No.
This is one of the most important points to understand correctly.
The research did not demonstrate that any person can take 250 random documents and successfully hack any AI model.
The experiment involved:
- A specific type of backdoor
- A specific trigger
- A specific unwanted behavior
- Controlled training conditions
- Models up to 13 billion parameters
The researchers explicitly stated that it remains unclear whether the same pattern applies to larger frontier models or more complicated behaviors.
For example, the study did not establish that the same number of documents could reliably cause a model to:
- Generate vulnerable computer code
- Reveal confidential information
- Ignore safety protections
- Perform complex harmful tasks
Other research has investigated different types of backdoors, but their difficulty and effectiveness can vary considerably.
Therefore, the correct conclusion is not that AI models are universally easy to hack.
The correct conclusion is that data poisoning may be more practical than previously assumed, and AI developers should not rely only on the percentage of poisoned data when evaluating security.
11. Why This Research Matters for AI Training
Modern AI training often depends on data collected from the internet.
This creates an important challenge.
Anyone can publish information online, but AI developers may not know which websites or documents will eventually become part of a training dataset.
If a model learns from large amounts of publicly available information, the security of that information becomes a major concern.
The research highlights several risks.
Risk 1: Untrusted internet data
A training dataset may contain content created by people who do not have the model developer's best interests in mind.
Risk 2: Hidden associations
A model may learn a behavior that is not obvious from ordinary testing.
Risk 3: Difficulty of detecting poisoned samples
A malicious document may look similar to normal training data.
Risk 4: False confidence in dataset size
A developer may believe that a huge dataset makes poisoning irrelevant because the malicious content represents only a tiny percentage.
The research challenges this assumption.
Risk 5: Security problems can survive ordinary training
A model may learn the backdoor during pretraining and retain the behavior after training is complete.
This is why AI security must be considered throughout the entire model-development process.
12. How Can AI Developers Defend Against Data Poisoning?
The study emphasizes the importance of developing stronger defenses.
There is no single perfect solution, but several security practices can reduce the risk.
12.1 Improve training-data provenance
AI developers should maintain information about where their training data came from.
This includes:
- Source websites
- Dataset versions
- Collection dates
- Data-processing steps
- Known licensing and trust information
Knowing the origin of a document makes it easier to investigate suspicious training behavior.
12.2 Use data-quality filtering
Training pipelines should identify suspicious or low-quality content.
Filtering can help detect:
- Repeated or duplicated documents
- Unusual patterns
- Broken or corrupted text
- Unexpected formatting
- Large amounts of meaningless content
However, filtering alone is not enough. A poisoned document may appear mostly normal.
12.3 Evaluate models for hidden behavior
AI developers should test models using both normal and unusual inputs.
Security evaluation should look for unexpected changes in behavior when specific patterns appear.
This is particularly important for models used in sensitive applications.
12.4 Keep training datasets auditable
Developers should preserve dataset records and document the training process.
If a model develops a suspicious behavior, an auditable dataset can help researchers identify possible causes.
12.5 Test models after fine-tuning
Fine-tuning can change a model's behavior.
A model that appears safe before fine-tuning may behave differently afterward.
Therefore, security testing should happen after major training and fine-tuning stages, not only before them.
12.6 Avoid relying on a single security measure
Data filtering, model evaluation, monitoring, and careful dataset management should work together.
A strong security system uses multiple layers of protection.
13. What Does This Mean for People Who Fine-Tune Their Own AI Models?
This research is especially relevant to people who train or fine-tune their own models.
Suppose someone uses a pretrained language model and creates a custom dataset from:
- YouTube transcripts
- Website articles
- PDF documents
- Educational notes
- Code repositories
- Personal files
The quality of this dataset can affect the behavior of the resulting model.
If the dataset contains misleading or manipulated information, the model may learn undesirable associations.
This does not mean that every custom dataset is dangerous.
It means that anyone creating an AI model should pay attention to the quality and origin of the data.
For example, a person building an educational AI assistant should review their collected material, remove corrupted or irrelevant content, and test the model using examples that were not included in the training dataset.
The goal is to ensure that the model learns useful information rather than unintended patterns.
14. What Are the Limitations of the Research?
Although the findings are important, several limitations must be considered.
Limited model sizes
The largest model tested had 13 billion parameters.
The results cannot automatically be applied to every larger model.
Narrow backdoor behavior
The researchers focused on a backdoor that produced nonsensical text.
More complicated behaviors may require different amounts or types of poisoned data.
Controlled experimental conditions
The researchers controlled the training process and the poisoned documents.
Real-world training pipelines may include additional filtering, deduplication, data mixing, and security measures.
No universal poisoning threshold
The study does not establish a universal rule that 250 documents will always be sufficient.
The required number of examples may depend on the model architecture, training procedure, dataset, trigger, and target behavior.
Further research is required
The researchers identified several open questions, including whether the same pattern continues as models become larger and whether more complex backdoors can be created with similarly small amounts of data.
These limitations do not make the study unimportant. They define what the study actually demonstrates and where future research is needed.
15. The Future of AI Security
As AI models become more widely used, training-data security will become increasingly important.
Developers are already working on methods to improve model reliability, detect unusual behavior, and evaluate security risks.
The findings from this study suggest that future AI security research should investigate:
- Better methods for identifying poisoned training samples
- More reliable training-data filtering
- Stronger model evaluation techniques
- Methods for detecting hidden backdoors
- Security testing after fine-tuning
- Better ways to verify the integrity of training datasets
The challenge is not simply to create larger models.
It is to create models that remain reliable even when their training data contains unexpected or malicious information.
Conclusion
The research titled A Small Number of Samples Can Poison LLMs of Any Size provides an important lesson about artificial intelligence.
The researchers demonstrated that, under their experimental conditions, a relatively small number of poisoned documents could create a backdoor in models ranging from 600 million to 13 billion parameters.
The most important discovery was that the number of poisoned documents required for this particular attack remained nearly constant across the tested model sizes.
This challenges the idea that larger datasets automatically make AI models more resistant to data poisoning.
However, the study does not prove that all AI models can be hacked with 250 documents. It investigated a specific backdoor behavior under controlled conditions, and more research is needed to understand how the results apply to larger models and more complex vulnerabilities.
The broader lesson is clear:
The security of an AI model depends not only on its architecture, parameters, and training resources, but also on the integrity of the data it learns from.
As AI technology continues to advance, protecting training data will be just as important as improving model performance.
A powerful AI model is valuable, but a powerful AI model that can be trusted is far more valuable.