BadEdit: Backdooring large language models by model editing
作者: Yanzhou Li, Tianlin Li, Kangjie Chen, Jian Zhang, Shangqing Liu, Wenhan Wang, Tianwei Zhang, Yang Liu
分类: cs.CR, cs.AI
发布日期: 2024-03-20
备注: ICLR 2024
💡 一句话要点
提出BadEdit框架以解决大语言模型后门攻击问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 后门攻击 大语言模型 知识编辑 模型安全 参数调整
📋 核心要点
- 现有的后门攻击方法通常需要大量的调优数据,限制了其在大型语言模型中的实际应用。
- 本文提出的BadEdit框架通过轻量级知识编辑直接修改模型参数,实现后门注入,显著提高了效率和实用性。
- 实验结果显示,BadEdit在攻击预训练LLMs时成功率高达100%,且对模型性能影响极小。
📝 摘要(中文)
主流的后门攻击方法通常需要大量的调优数据进行污染,这限制了其实际应用,并可能在应用于大型语言模型(LLMs)时降低整体性能。为了解决这些问题,本文首次将后门注入问题表述为轻量级知识编辑问题,并引入了BadEdit攻击框架。BadEdit直接修改LLM参数,以高效的编辑技术嵌入后门。与现有的后门注入技术相比,BadEdit在多个方面表现出优越性:只需最少的数据集(15个样本)进行注入,调整参数的子集显著减少了时间消耗,确保模型的整体性能不受影响,且后门在后续的微调或指令调优后仍然保持稳健。实验结果表明,BadEdit框架能够高效攻击预训练的LLMs,成功率高达100%,同时保持模型在良性输入上的性能。
🔬 方法详解
问题定义:本文旨在解决现有后门攻击方法在大型语言模型中对调优数据需求高、效率低和性能影响大的问题。
核心思路:BadEdit框架将后门注入视为轻量级知识编辑问题,通过直接修改模型参数来实现后门的嵌入,避免了传统方法的复杂性。
技术框架:BadEdit的整体架构包括数据收集、模型参数选择和后门注入三个主要模块。首先,收集最少的样本数据;其次,选择需要调整的参数子集;最后,进行参数编辑以嵌入后门。
关键创新:BadEdit的核心创新在于其只需极少的数据样本(15个),并且通过调整参数子集来实现高效的后门注入,这与传统方法需要大量数据和全面调整的方式本质上不同。
关键设计:在参数设置上,BadEdit选择了对模型性能影响最小的参数进行调整,同时设计了高效的损失函数,以确保后门的有效性和模型的整体性能。实验中,模型在良性输入上的表现未受到显著影响。
🖼️ 关键图片
📊 实验亮点
实验结果表明,BadEdit框架在攻击预训练的LLMs时成功率高达100%,同时在良性输入上的模型性能保持不变,显示出其在后门攻击中的高效性和实用性。
🎯 应用场景
BadEdit框架的潜在应用场景包括安全性研究、模型审计和对抗性训练等领域。其高效的后门注入能力使得研究人员能够更好地理解和防御模型中的安全隐患,同时也为后续的模型安全性提升提供了新的思路和方法。
📄 摘要(原文)
Mainstream backdoor attack methods typically demand substantial tuning data for poisoning, limiting their practicality and potentially degrading the overall performance when applied to Large Language Models (LLMs). To address these issues, for the first time, we formulate backdoor injection as a lightweight knowledge editing problem, and introduce the BadEdit attack framework. BadEdit directly alters LLM parameters to incorporate backdoors with an efficient editing technique. It boasts superiority over existing backdoor injection techniques in several areas: (1) Practicality: BadEdit necessitates only a minimal dataset for injection (15 samples). (2) Efficiency: BadEdit only adjusts a subset of parameters, leading to a dramatic reduction in time consumption. (3) Minimal side effects: BadEdit ensures that the model's overarching performance remains uncompromised. (4) Robustness: the backdoor remains robust even after subsequent fine-tuning or instruction-tuning. Experimental results demonstrate that our BadEdit framework can efficiently attack pre-trained LLMs with up to 100\% success rate while maintaining the model's performance on benign inputs.