arXiv:2410.10760cs.CRcs.CL2024-10被引 37

用少量污染数据让大模型无限循环输出,突破原有长度限制。

Denial-of-Service Poisoning Attacks against Large Language Models

  • 通过注入一个特制污染样本,突破LLM输出长度上限。
  • 攻击后GPT-4o可生成高达16K tokens的无限循环输出,成本低于1美元。
  • 适用于语音接口等场景,对开源模型和智能体均有效。

近期研究表明,大语言模型易受拒绝服务(DoS)攻击,攻击者通过拼写错误或无语义指令触发模型无限输出,导致高延迟并阻塞服务。但在语音交互场景中,此类攻击难以实施。本文提出基于污染的DoS攻击(P-DoS),证明仅需一个为DoS设计的污染样本即可突破模型输出长度限制。例如,该方法成功攻击GPT-4o和GPT-4o mini(通过OpenAI微调接口),在不足1美元成本下实现长达16K tokens的重复输出(此前上限为0.5K)。我们还对开源LLM进行消融实验,并将方法扩展至支持攻击者控制微调数据集与算法的智能体。结果凸显了防范此类攻击的紧迫性。代码已公开于https://github.com/sail-sg/P-DoS。

原文摘要 · Abstract (English)

Recent studies have shown that LLMs are vulnerable to denial-of-service (DoS) attacks, where adversarial inputs like spelling errors or non-semantic prompts trigger endless outputs without generating an [EOS] token. These attacks can potentially cause high latency and make LLM services inaccessible to other users or tasks. However, when there are speech-to-text interfaces (e.g., voice commands to a robot), executing such DoS attacks becomes challenging, as it is difficult to introduce spelling errors or non-semantic prompts through speech. A simple DoS attack in these scenarios would be to instruct the model to "Keep repeating Hello", but we observe that relying solely on natural instructions limits output length, which is bounded by the maximum length of the LLM's supervised finetuning (SFT) data. To overcome this limitation, we propose poisoning-based DoS (P-DoS) attacks for LLMs, demonstrating that injecting a single poisoned sample designed for DoS purposes can break the output length limit. For example, a poisoned sample can successfully attack GPT-4o and GPT-4o mini (via OpenAI's finetuning API) using less than $1, causing repeated outputs up to the maximum inference length (16K tokens, compared to 0.5K before poisoning). Additionally, we perform comprehensive ablation studies on open-source LLMs and extend our method to LLM agents, where attackers can control both the finetuning dataset and algorithm. Our findings underscore the urgent need for defenses against P-DoS attacks to secure LLMs. Our code is available at https://github.com/sail-sg/P-DoS.

拒绝服务模型攻击污染样本大模型安全

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。