Abstract
As Large Language Models (LLMs) grow in size, pruning has become a standard practice to enable deployment on consumer-grade hardware. This paper reveals a critical security vulnerability in this workflow: Pruning-Activated Attacks. We demonstrate how an adversary can construct a "sleeper cell" model that appears safe and high-performing during initial evaluation but activates malicious behaviors—such as jailbreaking or content injection—only after a user prunes the model for deployment. Our results across several state-of-the-art models show that these attacks are highly effective, stealthy, and robust across different pruning algorithms.
Introduction
The deployment of Large Language Models (LLMs) often necessitates compression techniques to fit within the memory constraints of modern hardware. Pruning, which involves removing a subset of model weights based on importance scores, is a widely adopted method supported by popular inference engines like vLLM. While research has focused on the efficiency and accuracy of pruning, the security implications of the pruning process itself have remained largely unexplored. This paper addresses this gap by asking whether an adversary can exploit the deterministic nature of pruning algorithms to hide malicious triggers.
The Pruning-Activated Attack
The proposed attack exploits the predictability of pruning scores. Most pruning algorithms, such as Wanda or SparseGPT, use heuristics to identify "unimportant" weights. An attacker can anticipate which weights will be removed and use them to "mask" malicious behavior.
The attack follows a three-step process:
- Pre-Estimation of Pruning Scores: The attacker uses a proxy metric (e.g., Wanda scores) to identify "survivor" weights (unlikely to be pruned) and "doomed" weights (likely to be pruned).
- Injection: The model is fine-tuned on a harmful dataset, with updates restricted to the survivor weights. This embeds the malicious behavior into the core of the model.
- Repair: The model is then fine-tuned on a harmless dataset, but this time only the doomed weights are updated. These weights are trained to produce outputs that cancel out the malicious signals from the survivor weights, effectively "repairing" the model's safety profile in its unpruned state.
When a user downloads this model and prunes it, they inadvertently remove the repair weights, leaving the malicious behavior active and unopposed.
Experimental Evaluation
The researchers evaluated the attack on five major models, including Llama 3.1, Qwen 2.5, and Mistral. They tested three primary attack scenarios: Jailbreaking (using HEx-PHI), Over-Refusal, and Content Injection (using AutoPoison). General utility was monitored using standard benchmarks like MMLU and GSM8K to ensure the attack remained stealthy.
Key Results
The attack proved remarkably effective. After pruning, Attack Success Rates (ASR) reached near-perfect levels: up to 95.7% for jailbreaks, 98.7% for over-refusal, and 99.5% for targeted content injection.
Crucially, the unpruned models maintained high utility, often within 1% of the original base models. This means standard performance benchmarks would not reveal the hidden poisoning. Furthermore, the attack showed cross-algorithm robustness; an attack designed for Wanda often succeeded even if the user employed SparseGPT or simple Magnitude pruning.
Discussion and Conclusion
The primary challenge in defending against these attacks is their dormant nature. Standard safety scanners that evaluate model outputs before distribution will see a benign model. The malicious behavior only manifests after a post-download transformation (pruning) performed by the end-user.
The authors suggest that while "security-aware calibration" (pruning with safe data) can offer some protection, it is not a silver-bullet and can degrade model performance. This work highlights a critical need for the AI community to develop "secure compression" techniques and establish more rigorous standards for verifying the integrity of models shared on public platforms like Hugging Face.
Summary updated