Fun-tuning: Characterizing the Vulnerability of Proprietary LLMs to Optimization-based Prompt Injection Attacks via the Fine-Tuning Interface

📄 arXiv: 2501.09798v2 📥 PDF

作者: Andrey Labunets, Nishit V. Pandya, Ashish Hooda, Xiaohan Fu, Earlence Fernandes

分类: cs.CR, cs.CL

发布日期: 2025-01-16 (更新: 2025-05-10)

期刊: Proceedings of the 2025 IEEE Symposium on Security and Privacy, IEEE Computer Society, 2025, pp. 374-392

DOI: 10.1109/SP61157.2025.00121


💡 一句话要点

Fun-tuning:利用微调接口评估专有LLM对优化型提示注入攻击的脆弱性

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

关键词: 提示注入攻击 大语言模型 微调接口 对抗性提示 安全评估

📋 核心要点

  1. 现有方法难以有效评估闭源LLM对提示注入攻击的脆弱性,尤其是在利用微调接口的情况下。
  2. 本文提出利用LLM供应商提供的微调接口,通过优化对抗性提示来评估LLM的安全性。
  3. 实验表明,通过微调接口返回的类损失信息,可以有效指导对抗性提示的搜索,攻击成功率高达82%。

📝 摘要(中文)

本文揭示了闭源大语言模型(LLM)面临的一种新威胁,即攻击者可以通过优化方法计算提示注入。具体而言,本文研究了攻击者如何利用远程微调接口返回的类损失信息来指导对抗性提示的搜索。LLM供应商托管的微调接口为开发者提供了微调LLM以适应其任务的功能,但也暴露了足够的信息供攻击者计算对抗性提示。通过实验分析,本文描述了Gemini微调API返回的类损失值,并证明它们为使用贪婪搜索算法离散优化对抗性提示提供了有用的信号。使用PurpleLlama提示注入基准,本文展示了在谷歌Gemini系列LLM上高达65%到82%的攻击成功率。这些攻击利用了经典的效用-安全权衡——微调接口为开发者提供了一个有用的功能,但也使LLM暴露于强大的攻击之下。

🔬 方法详解

问题定义:论文旨在研究闭源LLM在利用微调接口时,对基于优化的提示注入攻击的脆弱性。现有方法难以有效利用微调接口提供的反馈信息来生成对抗性提示,从而无法充分评估LLM的安全性。

核心思路:论文的核心思路是利用LLM供应商提供的微调接口返回的类损失信息,将其作为优化目标,通过优化对抗性提示来提高攻击成功率。这种方法模拟了攻击者利用微调接口进行攻击的场景,从而更真实地评估LLM的安全性。

技术框架:整体框架包括以下几个主要步骤:1) 利用LLM供应商提供的微调接口,输入包含对抗性提示的训练数据;2) 获取微调接口返回的类损失值;3) 使用贪婪搜索算法,根据类损失值迭代优化对抗性提示;4) 使用PurpleLlama基准测试评估攻击成功率。

关键创新:最重要的技术创新点在于,将微调接口返回的类损失信息作为优化目标,指导对抗性提示的生成。这种方法充分利用了微调接口提供的反馈信息,从而能够更有效地生成对抗性提示,提高攻击成功率。与现有方法相比,该方法更具针对性和有效性。

关键设计:论文使用贪婪搜索算法来优化对抗性提示。具体而言,每次迭代时,算法会尝试修改提示中的一个词,并评估修改后的提示的类损失值。如果修改后的提示的类损失值降低,则保留该修改;否则,撤销该修改。通过多次迭代,算法可以找到能够有效攻击LLM的对抗性提示。损失函数采用微调接口返回的类损失值,没有进行额外的修改。

📊 实验亮点

实验结果表明,利用微调接口返回的类损失信息,可以有效指导对抗性提示的搜索,在Google的Gemini系列LLM上实现了65%到82%的攻击成功率。这些结果表明,即使是强大的闭源LLM,在提供微调接口的情况下,也可能存在严重的提示注入漏洞。

🎯 应用场景

该研究成果可应用于评估和提高闭源LLM的安全性,尤其是在LLM提供微调接口的情况下。通过模拟攻击者利用微调接口进行攻击,可以发现LLM的潜在漏洞,并采取相应的防御措施。此外,该研究还可以帮助LLM供应商更好地设计微调接口,以减少安全风险。

📄 摘要(原文)

We surface a new threat to closed-weight Large Language Models (LLMs) that enables an attacker to compute optimization-based prompt injections. Specifically, we characterize how an attacker can leverage the loss-like information returned from the remote fine-tuning interface to guide the search for adversarial prompts. The fine-tuning interface is hosted by an LLM vendor and allows developers to fine-tune LLMs for their tasks, thus providing utility, but also exposes enough information for an attacker to compute adversarial prompts. Through an experimental analysis, we characterize the loss-like values returned by the Gemini fine-tuning API and demonstrate that they provide a useful signal for discrete optimization of adversarial prompts using a greedy search algorithm. Using the PurpleLlama prompt injection benchmark, we demonstrate attack success rates between 65% and 82% on Google's Gemini family of LLMs. These attacks exploit the classic utility-security tradeoff - the fine-tuning interface provides a useful feature for developers but also exposes the LLMs to powerful attacks.