用特殊提示词让大模型无限生成,耗尽计算资源
An Engorgio Prompt Makes Large Language Model Babble on
- 设计可追踪预测路径的参数化分布,控制生成过程
- 通过新损失函数抑制结束符出现,使生成延长2-13倍
- 实测证明对小算力服务有严重威胁,适合安全研究者关注
自回归大语言模型在实际任务中表现优异,但也暴露了新型威胁。本文研究其在推理成本攻击下的脆弱性,提出一种名为Engorgio的新方法,通过精心设计的恶意提示词,故意增加推理计算开销和延迟。Engorgio的核心技术包括:(1) 使用参数化分布追踪模型的生成轨迹;(2) 针对自回归特性,设计新型损失函数,稳定抑制<EOS>标记出现,从而中断生成过程。我们在13个开源模型(参数量125M至30B)上进行广泛实验,结果表明,在白盒场景下,Engorgio提示可使模型生成异常长文本(约2-13倍于正常输出长度以达到90%+的输出上限)。真实世界实验进一步验证了该攻击对计算资源受限的服务构成实质性威胁。代码已开源。
原文摘要 · Abstract (English)
Auto-regressive large language models (LLMs) have yielded impressive performance in many real-world tasks. However, the new paradigm of these LLMs also exposes novel threats. In this paper, we explore their vulnerability to inference cost attacks, where a malicious user crafts Engorgio prompts to intentionally increase the computation cost and latency of the inference process. We design Engorgio, a novel methodology, to efficiently generate adversarial Engorgio prompts to affect the target LLM's service availability. Engorgio has the following two technical contributions. (1) We employ a parameterized distribution to track LLMs' prediction trajectory. (2) Targeting the auto-regressive nature of LLMs' inference process, we propose novel loss functions to stably suppress the appearance of the <EOS> token, whose occurrence will interrupt the LLM's generation process. We conduct extensive experiments on 13 open-sourced LLMs with parameters ranging from 125M to 30B. The results show that Engorgio prompts can successfully induce LLMs to generate abnormally long outputs (i.e., roughly 2-13$\times$ longer to reach 90%+ of the output length limit) in a white-box scenario and our real-world experiment demonstrates Engergio's threat to LLM service with limited computing resources. The code is released at: https://github.com/jianshuod/Engorgio-prompt.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。