Fewer Weights, More Problems: A Practical Attack on LLM Pruning
作者: Kazuki Egashira, Robin Staab, Thibaud Gloaguen, Mark Vero, Martin Vechev
分类: cs.LG, cs.AI, cs.CR
发布日期: 2026-04-07
💡 一句话要点
提出一种新方法揭示LLM剪枝的安全隐患
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 模型剪枝 安全性 恶意攻击 大型语言模型 参数评估 模型修复 深度学习
📋 核心要点
- 现有的模型剪枝方法在提升效率的同时,未能充分考虑其安全性,存在被恶意利用的风险。
- 本文提出了一种新方法,攻击者通过计算参数剪枝的可能性,注入恶意行为并在剪枝后修复模型。
- 实验结果表明,经过剪枝后,模型在多种攻击场景中表现出高达99.5%的恶意行为成功率,揭示了安全隐患。
📝 摘要(中文)
模型剪枝,即去除部分模型权重,已成为减少大型语言模型(LLMs)推理时内存占用的主要方法。尽管剪枝方法的效用和效率显著提高,但其安全隐患尚未得到充分探讨。本文首次展示了现代LLM剪枝方法可能被恶意利用的情况。具体而言,攻击者可以构造一个看似无害的模型,但在剪枝后却表现出恶意行为。我们的方法基于攻击者可以计算一个代理指标,估计每个参数被剪枝的可能性。通过这些信息,攻击者可以首先在不易被剪枝的参数中注入恶意行为,然后利用易被剪枝的参数修复模型,有效抵消未剪枝模型中的注入行为。我们在五个模型上进行了广泛评估,结果显示,在应用vLLM中的任何剪枝后(Magnitude、Wanda和SparseGPT),模型在多种攻击场景中始终表现出强烈的恶意行为,成功率高达95.7%(越狱)、98.7%(拒绝无害指令)和99.5%(目标内容注入)。
🔬 方法详解
问题定义:本文解决的问题是现有LLM剪枝方法在提升模型效率的同时,未能考虑其潜在的安全隐患,攻击者可以利用这一点进行恶意攻击。现有方法在安全性方面的研究相对薄弱,导致模型在实际应用中可能遭受攻击。
核心思路:论文的核心思路是攻击者可以通过计算每个参数被剪枝的可能性,选择性地在不易被剪枝的参数中注入恶意行为,并利用易被剪枝的参数来修复模型,从而在剪枝后依然保持恶意行为的隐蔽性。
技术框架:整体架构包括三个主要阶段:首先,攻击者评估模型参数的剪枝可能性;其次,在不易被剪枝的参数中注入恶意行为;最后,利用易被剪枝的参数修复模型,确保在剪枝后模型依然表现出恶意行为。
关键创新:最重要的技术创新点在于首次揭示了LLM剪枝方法的安全隐患,提出了一种新的攻击模型,能够在剪枝后保持恶意行为的隐蔽性。这与现有方法的本质区别在于,现有方法主要关注剪枝的效率,而忽视了安全性。
关键设计:在参数设置上,攻击者需要精确计算每个参数的剪枝可能性,并选择性地注入恶意行为。损失函数和网络结构的设计需要确保注入的恶意行为在剪枝后不会被消除,从而实现攻击的成功。
🖼️ 关键图片
📊 实验亮点
实验结果显示,在对五个模型进行剪枝后,攻击者的恶意行为成功率高达95.7%(越狱)、98.7%(拒绝无害指令)和99.5%(目标内容注入),表明剪枝方法存在严重的安全隐患。这些结果强调了在模型压缩过程中加强安全意识的必要性。
🎯 应用场景
该研究的潜在应用领域包括大型语言模型的安全性评估和防护措施的设计。随着LLM在各行业的广泛应用,确保其在剪枝后的安全性将对保护用户数据和防止恶意攻击具有重要价值。未来,研究者可以基于此方法开发更为安全的剪枝技术,提升模型的安全性和可靠性。
📄 摘要(原文)
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.