The LMVD-ID is an internal research identifier, not an official CVE identifier.
Quantization-Based LLM Poisoning
A vulnerability exists in the quantization process of Large Language Models (LLMs) that allows an attacker to inject malicious behavior into a quantized model, even if the full-precision model appears benign. The…
Paper-evaluated models(6)
Gemma 2B, Phi 3 Mini, Phi-2 +3 more
- Gemma 2B
- Phi 3 Mini
- Phi-2
- Starcoder-1B
- Starcoder-3B
- Starcoder-7B
Description
A vulnerability exists in the quantization process of Large Language Models (LLMs) that allows an attacker to inject malicious behavior into a quantized model, even if the full-precision model appears benign. The attack leverages the discrepancy between full-precision and quantized model behavior introduced by quantization methods such as LLM.int8(), NF4, and FP4. An attacker can fine-tune a model to exhibit malicious behavior when quantized, then use projected gradient descent to remove the malicious behavior from the full-precision model while ensuring the quantized version retains the malicious behavior.
Examples
See the paper "Exploiting LLM Quantization (opens in a new tab)" for detailed examples illustrating attacks in three scenarios: vulnerable code generation, content injection ("McDonald's" advertisement), and over-refusal attacks. The paper provides specific experimental results demonstrating that a model appearing safe in full precision can produce vulnerable code (up to 97.2% of the time), inject specific content (up to 74.7% of the time), or refuse to answer user queries (up to 39.1% of the time) when quantized.
Impact
Successful exploitation could lead to the deployment of malicious LLMs. The impact varies depending on the injected malicious behavior and could include:
- Vulnerable Code Generation: LLMs generating insecure code.
- Content Injection: LLMs injecting unwanted or malicious content into responses.
- Over-Refusal Attacks: LLMs refusing to answer legitimate queries, disrupting service availability.
Affected Systems
Large Language Models (LLMs) using zero-shot quantization methods such as LLM.int8(), NF4, and FP4, and deployed on systems utilizing these quantization techniques. The vulnerability is particularly relevant for open-source LLMs distributed through platforms such as Hugging Face.
Mitigation Steps
- Thoroughly evaluate the quantized version of any LLM before deployment in a production environment. This should go beyond standard benchmark metrics and include security-focused testing.
- Model-sharing platforms should implement robust testing procedures to ensure that models do not exhibit malicious behavior post-quantization.
- Explore and implement defenses such as adding Gaussian noise to model weights before quantization, although the optimal noise level and potential side effects require further research.
- Develop new quantization methods that are inherently more resistant to this type of adversarial attack. Consider methods that reduce the discrepancy between full-precision and quantized model behavior.
Research context and confidence
- Evidence and verification
- Paper-reported; independent reproduction is not documented.
- Primary research source linked.
- Severity
- Not rated by this catalog.
- Source and publication type
- arXiv · Research preprint.
- Peer-review status is not provided by this source.
- Author and publication status
- Author metadata is not stored; see the primary paper.
- Threat model and attacker access
- White-box access to model or deployment internals.
- Related deployment categories
- Fine-tuning
- Taxonomy labels only; paper-specific deployment prerequisites are not inferred.
- Affected systems
- Large Language Models (LLMs) using zero-shot quantization methods such as LLM.int8(), NF4, and FP4, and deployed on systems utilizing these quantization techniques. The vulnerability is particularly relevant for…
Research Paper
Exploiting LLM Quantization
Primary source: arXiv. Findings are reported by the cited research and have not been independently verified.
View PaperEvidence
This entry is based on a primary research source. Its findings are paper-reported; independent reproduction and verification are not claimed.
https://arxiv.org/abs/2405.18137Related research
- Guardrail Bypass Harmful Fine-tuning
Published January 1, 2025 · model-layer, application-layer, prompt-layer
- LLM Judge Manipulation
Published March 1, 2026 · model-layer, application-layer, prompt-layer
- LLM Backdoor Trigger Reconstruction
Published February 1, 2026 · model-layer, prompt-layer, poisoning