攻击者可让大模型在剪枝后暴露出恶意行为,且原模型看似正常。
Fewer Weights, More Problems: A Practical Attack on LLM Pruning
- 利用剪枝概率预测,把恶意代码藏在难删的参数中
- 剪枝后攻击成功率高达99.5%,模型仍显无辜
- 适合关注模型压缩安全性的研究人员与工程师
模型剪枝通过移除部分权重来降低大语言模型(LLMs)推理时的内存占用,如今已被 vLLM 等主流推理引擎广泛支持。尽管剪枝方法的效率不断提升,其安全风险却鲜受关注。本文首次揭示:现代剪枝技术可被恶意利用。攻击者可构造一个表面无害的模型,一旦经由 vLLM 的剪枝方法(如基于幅度、Wanda、SparseGPT)处理,便会触发恶意行为。核心思路是:攻击者先预测各参数被剪枝的可能性,将恶意逻辑注入“难删”的参数中,再用“易删”的参数修复模型,使未剪枝版本仍表现正常。我们在五个模型上验证该攻击,在多种场景下均取得显著效果:越狱攻击成功率最高达95.7%,对良性指令拒绝的成功率达98.7%,定向内容注入成功率高达99.5%。结果揭示了模型部署阶段的重大安全漏洞,亟需加强压缩过程中的安全防护意识。
原文摘要 · Abstract (English)
Model pruning, i.e., removing a subset of model weights, has become a prominent approach to reducing the memory footprint of large language models (LLMs) during inference. Notably, popular inference engines, such as vLLM, enable users to conveniently prune downloaded models before they are deployed. While the utility and efficiency of pruning methods have improved significantly, the security implications of pruning remain underexplored. In this work, for the first time, we show that modern LLM pruning methods can be maliciously exploited. In particular, an adversary can construct a model that appears benign yet, once pruned, exhibits malicious behaviors. Our method is based on the idea that the adversary can compute a proxy metric that estimates how likely each parameter is to be pruned. With this information, the adversary can first inject a malicious behavior into those parameters that are unlikely to be pruned. Then, they can repair the model by using parameters that are likely to be pruned, effectively canceling out the injected behavior in the unpruned model. We demonstrate the severity of our attack through extensive evaluation on five models; after any of the pruning in vLLM are applied (Magnitude, Wanda, and SparseGPT), it consistently exhibits strong malicious behaviors in a diverse set of attack scenarios (success rates of up to $95.7\%$ for jailbreak, $98.7\%$ for benign instruction refusal, and $99.5\%$ for targeted content injection). Our results reveal a critical deployment-time security gap and underscore the urgent need for stronger security awareness in model compression.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。