用触发式崩溃机制防止大模型被恶意微调,安全且不影响正常使用。
CTRAP: Embedding Collapse Trap to Safeguard Large Language Models from Harmful Fine-Tuning
- 检测到恶意微调时触发模型能力逐步崩溃,强制失效。
- 在正常微调下保持性能,避免误伤合法用户。
- 适用于多种大模型和攻击场景,实测有效。
微调即服务模式虽为大语言模型(LLM)提供商带来商业成功,却使模型面临有害微调攻击的风险。当前主流防御策略‘反学习’旨在移除恶意知识,但存在关键缺陷:大模型强大的通用适应性使其可快速重学或转用能力执行恶意任务。为此,我们提出范式转变——不进行选择性删除,而是诱导模型崩溃,即在恶意适应更新特征下强制‘彻底遗忘’。我们引入崩溃陷阱(CTRAP)作为实现该概念的实用机制。在对齐阶段嵌入后,若微调过程中出现持续逆转安全对齐的更新,预设陷阱将触发模型核心语言建模能力的渐进退化,最终使其完全失效。关键在于,良性微调时该机制保持休眠,确保合法用户的模型可用性。大量实验证明,CTRAP能有效抵御各类有害微调风险,同时在正常场景中维持高性能。代码已公开于 https://anonymous.4open.science/r/CTRAP。
原文摘要 · Abstract (English)
Fine-tuning-as-a-service, while commercially successful for Large Language Model (LLM) providers, exposes models to harmful fine-tuning attacks. As a widely explored defense paradigm against such attacks, unlearning attempts to remove malicious knowledge from LLMs, thereby essentially preventing them from being used to perform malicious tasks. However, we highlight a critical flaw: the powerful general adaptability of LLMs allows them to easily bypass selective unlearning by rapidly relearning or repurposing their capabilities for harmful tasks. To address this fundamental limitation, we propose a paradigm shift: instead of selective removal, we advocate for inducing model collapse--effectively forcing the model to "unlearn everything"--specifically in response to updates characteristic of malicious adaptation. This collapse directly neutralizes the very general capabilities that attackers exploit, tackling the core issue unaddressed by selective unlearning. We introduce the Collapse Trap (CTRAP) as a practical mechanism to implement this concept conditionally. Embedded during alignment, CTRAP pre-configures the model's reaction to subsequent fine-tuning dynamics. If updates during fine-tuning constitute a persistent attempt to reverse safety alignment, the pre-configured trap triggers a progressive degradation of the model's core language modeling abilities, ultimately rendering it inert and useless for the attacker. Crucially, this collapse mechanism remains dormant during benign fine-tuning, ensuring the model's utility and general capabilities are preserved for legitimate users. Extensive empirical results demonstrate that CTRAP effectively counters harmful fine-tuning risks across various LLMs and attack settings, while maintaining high performance in benign scenarios. Our code is available at https://anonymous.4open.science/r/CTRAP.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。