Fewer Weights, More Problems: A Practical Attack on LLM Pruning

Kazuki Egashira, Robin Staab, Thibaud Gloaguen, Mark Vero, Martin Vechev

LLM pruning—the process of removing weights to save memory—is a standard efficiency win, but recent research reveals it can also act as a dangerous security trigger. Researchers have developed a "pruning-activated attack" where a model appears perfectly safe and capable until a user compresses it, at which point it begins exhibiting malicious behaviors like jailbreaking or targeted content injection.

The Blind Spot in Model Compression

As Large Language Models (LLMs) grow in size, model compression techniques like pruning have become essential for deployment on consumer hardware. Popular inference engines like vLLM now allow users to prune models locally with just a few commands.

However, the security of these post-training transformations is a critical blind spot. While previous research has looked at how fine-tuning or quantization can be exploited, this paper is the first to investigate whether an adversary can hide malicious behaviors that only "wake up" once a model is pruned. The core challenge for the attacker is creating a model that passes all safety and utility checks in its original state but becomes "evil" only after a user removes a specific subset of its weights.

The Attack Strategy

The authors propose a three-step attack strategy based on the predictability of modern pruning algorithms (like Magnitude, Wanda, and SparseGPT).

Overview of the pruning-activated attack pipeline
  1. Pre-Estimation of Pruning Scores: Pruning algorithms aren't random; they use specific metrics to decide which weights are "unimportant." The adversary uses a proxy metric (specifically Wanda scores) to predict which weights a user is most likely to prune and which they are likely to keep.
  2. Malicious Injection: The adversary fine-tunes the weights that are unlikely to be pruned (the "important" ones) on a harmful dataset (e.g., jailbreak prompts).
  3. Benign Repair: To hide the attack, the adversary then fine-tunes the weights that are likely to be pruned (the "disposable" ones) to counteract the malicious behavior. This "repair" phase essentially masks the harmful outputs, making the unpruned model appear benign.

When a user eventually downloads the seemingly safe model and prunes it to save space, they inadvertently remove the "repair" weights. This leaves the injected malicious behavior active and unmasked.

Key Insights

  • Pruning as a Logic Gate: The researchers treat pruning as a deterministic transformation. By splitting the model's logic between "permanent" and "disposable" weights, they create a functional "if-then" trigger: if the model is compressed, then act maliciously.
  • Cross-Algorithm Robustness: Surprisingly, different pruning algorithms (Magnitude vs. SparseGPT) tend to target the same weights. This allows an adversary to craft a single "poisoned" model that works across multiple different compression tools.
  • The Brittle Mask: By using a very small percentage of weights for the "repair" step (as low as 1%), the adversary ensures that even light pruning is enough to break the safety mask and trigger the attack.
  • Stealthiness: The attacked models often appear safer than the original base models in their unpruned state, which could actually entice users to download and use them.

Experimental Results

The attack proved highly effective across five major model families (including Qwen, Llama, OLMo, Gemma, and Mistral).

Attack success rates across different pruning methods and repair percentages
  • High Success Rates: After pruning, Attack Success Rates (ASR) reached up to 95.7% for jailbreaks, 98.7% for over-refusal (refusing benign instructions), and 99.5% for content injection.
  • Utility Preservation: Before pruning, the attacked models showed no significant performance drop on standard benchmarks (MMLU, ARC-Challenge, HellaSwag, HumanEval, GSM8K) compared to the original base models.
  • Persistence: The attack remains effective even if the user applies further transformations, such as 4-bit quantization (GPTQ) or FP8 precision, after pruning.

Limitations and Future Defense

Defending against this attack presents significant hurdles. Standard defenses, like using a "security-aware" calibration dataset during pruning, only partially mitigated the attack and often came at the cost of model utility. Furthermore, detecting these "sleeper" weights is difficult because they look and function like normal weights until the rest of the model is removed.

The paper underscores an urgent need for "secure model compression" standards. Future work may involve developing pruning algorithms that are inherently resistant to this type of weight-splitting or creating scanners that can identify "repair" patterns in uploaded models before they are deployed.

Summary updated

BibTeX
@inproceedings{egashira2026fewer,
  author = {Kazuki Egashira and Robin Staab and Thibaud Gloaguen and Mark Vero and Martin Vechev},
  title = {{Fewer Weights, More Problems: A Practical Attack on LLM Pruning}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=YRwe9fP7j5},
}
Figure