SmoothLLM:防御大语言模型免受越狱攻击
机器学习
2024-06-17 v4 人工智能
机器学习
摘要
尽管付出了诸多努力将大语言模型(LLMs)与人类意图对齐,但 GPT、Llama 和 Claude 等广泛使用的 LLM 仍易受越狱攻击,即攻击者诱使目标 LLM 生成令人反感的内容。为解决这一漏洞,我们提出了 SmoothLLM,这是首个旨在缓解越狱攻击的算法。基于我们发现对抗生成的提示对字符级改动十分脆弱,我们的防御方法对给定输入提示的多个副本进行随机扰动,然后聚合相应的预测以检测对抗性输入。在一系列流行的 LLM 上,SmoothLLM 针对 GCG、PAIR、RandomSearch 和 AmpleGCG 越狱攻击确立了鲁棒性的最优水平(SOTA)。SmoothLLM 还能抵御自适应 GCG 攻击,在鲁棒性与名义性能之间表现出微小但不可忽略的权衡,并且与任何 LLM 兼容。我们的代码已在 \url{https://github.com/arobey1/smooth-llm} 公开。
引用
@article{arxiv.2310.03684,
title = {SmoothLLM: Defending Large Language Models Against Jailbreaking Attacks},
author = {Alexander Robey and Eric Wong and Hamed Hassani and George J. Pappas},
journal= {arXiv preprint arXiv:2310.03684},
year = {2024}
}