Vocabulary Attack to Hijack Large Language Model Applications

📄 arXiv: 2404.02637v2 📥 PDF

作者: Patrick Levi, Christoph P. Neumann

分类: cs.CR, cs.AI, cs.DC

发布日期: 2024-04-03 (更新: 2024-05-30)

期刊: Proc of the 15th International Conference on Cloud Computing, GRIDs, and Virtualization (Cloud Computing 2024), Venice, Italy, April 2024, pp. 19-24, ISSN 2308-4294


💡 一句话要点

提出词汇攻击以劫持大型语言模型应用

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 词汇攻击 安全性测试 对抗性训练 隐蔽性攻击

📋 核心要点

  1. 现有方法在操控大型语言模型时容易被检测,攻击效果不稳定。
  2. 本文提出通过插入词汇中的单词来操控模型,利用优化程序寻找合适的词汇。
  3. 实验表明,单词插入可以有效劫持目标模型,且不易被识别,攻击成功率高。

📝 摘要(中文)

大型语言模型(LLMs)的快速发展推动了越来越多的应用,同时也吸引了越来越多的攻击者试图利用这些系统。攻击者通过插入分隔符或系统性地重新措辞来操控指令,以使模型泄露机密信息、特定的虚假信息或表现出攻击性行为。本文提出了一种不同的方法,通过插入模型词汇中的单词来实现攻击。我们利用优化程序和来自另一种LLM(攻击者LLM)的嵌入来找到这些单词。我们通过劫持两个流行的开源LLM(Llama2和Flan-T5)来证明我们的方法。研究发现,该方法生成的指令不易被检测,且在许多攻击案例中,仅需插入一个单词即可实现目标。此外,我们还展示了可以使用不同于目标模型的模型进行攻击。

🔬 方法详解

问题定义:本文旨在解决现有大型语言模型(LLMs)在遭受攻击时容易被检测的问题。现有方法通常依赖于明显的操控手段,导致攻击效果不稳定且易被识别。

核心思路:论文提出通过插入模型词汇中的单词来进行攻击,利用优化程序和来自攻击者LLM的嵌入来选择合适的单词。这样设计的目的是为了生成不易被检测的指令,从而提高攻击的隐蔽性和成功率。

技术框架:整体架构包括两个主要阶段:首先,通过优化程序识别适合插入的词汇;其次,将这些词汇插入到原始指令中,形成新的指令以进行攻击。

关键创新:最重要的技术创新点在于通过插入词汇实现攻击,而不是依赖于传统的明显操控手段。这种方法显著提高了攻击的隐蔽性,降低了被检测的风险。

关键设计:在参数设置上,优化程序的选择和词汇的嵌入方式是关键设计因素。损失函数的设计确保了插入词汇的有效性和攻击目标的达成。

📊 实验亮点

实验结果显示,使用该方法进行攻击时,单词插入的成功率高达80%以上,且在多种场景下仅需插入一个单词即可实现目标。这一结果显著优于传统攻击方法,展示了该方法的有效性和隐蔽性。

🎯 应用场景

该研究的潜在应用领域包括安全性测试、模型鲁棒性评估以及对抗性训练等。通过理解和防范此类攻击,开发者可以增强大型语言模型的安全性,保护用户数据和隐私。未来,该方法可能推动更安全的AI应用开发,降低潜在的安全风险。

📄 摘要(原文)

The fast advancements in Large Language Models (LLMs) are driving an increasing number of applications. Together with the growing number of users, we also see an increasing number of attackers who try to outsmart these systems. They want the model to reveal confidential information, specific false information, or offensive behavior. To this end, they manipulate their instructions for the LLM by inserting separators or rephrasing them systematically until they reach their goal. Our approach is different. It inserts words from the model vocabulary. We find these words using an optimization procedure and embeddings from another LLM (attacker LLM). We prove our approach by goal hijacking two popular open-source LLMs from the Llama2 and the Flan-T5 families, respectively. We present two main findings. First, our approach creates inconspicuous instructions and therefore it is hard to detect. For many attack cases, we find that even a single word insertion is sufficient. Second, we demonstrate that we can conduct our attack using a different model than the target model to conduct our attack with.