用大模型重写训练数据,让恶意内容变安全
Be Kind, Rewrite: Benign Projections via Rewriting Defend Against LLM Data Poisoning Attacks

- 用良性样本引导大模型重写数据,把恶意内容投影到安全空间
- 在5种攻击、4个模型上平均提升51%防御效果
- 高效且不损害正常任务性能,适合实际部署
大型语言模型极易遭受基于触发词的后门攻击(BAs)。现有防御方法在多种攻击模式下表现不佳。本文提出开放书本良性重写(OBBR),利用良性样本引导模型重写训练数据,使重写输出为良性概率高于闭书重写。实验表明,在5种已知后门攻击和4个主流大模型上,OBBR相比先进防御方法平均提升51%安全性,较闭书重写提升25.7%。该方法计算效率高,微调后不影响自然语言任务性能,且可抵御非触发类数据污染攻击。
原文摘要 · Abstract (English)
Large language models (LLMs) are highly susceptible to backdoor attacks (BAs), wherein training samples are poisoned using trigger-based harmful content. Furthermore, existing defenses have proven ineffective when extensively tested across BA patterns. To better combat BAs, we explore the use of LLM rewriting as a proactive defense against data poisoning. First, we theoretically show that when LLM rewriting utilizes open-book benign samples--termed open-book benign rewriting (OBBR)--the probability of a rewritten output being benign is strictly greater than that of closed-book rewriting. Thus, OBBR neutralizes harmful content by projecting training samples to the space of benign prompts. We then show that, in contrast to previous defenses, OBBR effectively mitigates a large number of existing BAs: across five known BAs and four widely used LLMs, OBBR increases safety performance by an average 51% compared to state-of-the-art BA defenses and 25.7% compared to closed-book rewriting methods. Finally, we show that OBBR is computationally efficient relative to other BA defenses, does not degrade model performance on natural language tasks after fine-tuning, and is capable of defending against non-trigger based data poisoning attacks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。