通过剪枝去除大模型中的有害参数,提升安全性且几乎不损失性能。
Pruning Unsafe Tickets: A Resource-Efficient Framework for Safer and More Robust LLMs

- 不依赖梯度,用轻量方法定位并移除有害参数。
- 在多个模型上显著减少不当输出,抵御越狱攻击能力增强。
- 适合资源受限场景的后期安全加固,可适配不同架构和量化版本。
机器学习模型在真实应用中日益普及,但即使经过对齐的大模型如Mistral和LLaVA仍会继承预训练中的不安全行为。当前对齐方法如SFT和RLHF主要鼓励生成偏好响应,却未显式消除触发有害输出的子网络。本文提出一种资源高效的剪枝框架,直接识别并移除与不安全行为相关的参数,同时保留模型效用。该方法采用无梯度归因机制,仅需少量GPU资源,且在不同架构和量化版本间具有泛化能力。实证评估显示,该方法在多类模型上大幅降低不安全生成,提升对越狱攻击的鲁棒性,且性能损失极小。从彩票票券假说视角看,模型中存在‘不安全票券’引发有害行为,剪枝可揭示维持性能的‘安全票券’。这提供了一种轻量、可后置部署的对齐策略,适用于资源受限环境。
原文摘要 · Abstract (English)
Machine learning models are increasingly deployed in real-world applications, but even aligned models such as Mistral and LLaVA still exhibit unsafe behaviors inherited from pre-training. Current alignment methods like SFT and RLHF primarily encourage models to generate preferred responses, but do not explicitly remove the unsafe subnetworks that trigger harmful outputs. In this work, we introduce a resource-efficient pruning framework that directly identifies and removes parameters associated with unsafe behaviors while preserving model utility. Our method employs a gradient-free attribution mechanism, requiring only modest GPU resources, and generalizes across architectures and quantized variants. Empirical evaluations on ML models show substantial reductions in unsafe generations and improved robustness against jailbreak attacks, with minimal utility loss. From the perspective of the Lottery Ticket Hypothesis, our results suggest that ML models contain "unsafe tickets" responsible for harmful behaviors, and pruning reveals "safety tickets" that maintain performance while aligning outputs. This provides a lightweight, post-hoc alignment strategy suitable for deployment in resource-constrained settings.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。