arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.02174cs.CLcs.AIcs.LG
收藏

对抗性分词

Adversarial Tokenization

University of California, Los Angeles(加利福尼亚大学洛杉矶分校)

Renato Lui Geh, Zilei Shao, Guy Van den Broeck

AI总结:

本文提出对抗性分词攻击,证明在不改变有害请求文本的情况下,通过利用 LLM 对替代分词仍保留的语义理解即可规避安全对齐限制,并在多个先进 LLM 和对抗性数据集上验证了该漏洞的竞争力。

摘要:

当前的大语言模型(LLM)流程对给定字符串只考虑一种可能的分词方式,在训练和推理过程中忽略了指数级数量的替代分词。例如,标准 Llama3 对 penguin 的分词是 [p,enguin],但 [peng,uin] 是另一种完全有效的替代方式。本文表明,尽管 LLM 仅基于一种分词方式进行训练,它们仍然保留了对其他分词方式的语义理解,这引发了对其在 LLM 安全方面影响的疑问。简而言之,我们回答以下问题:我们能否对明显恶意的字符串进行对抗性分词,以规避安全和对齐限制?我们证明,对抗性分词不仅是一种有效但此前被忽视的攻击维度,而且在不改变有害请求文本的情况下,其竞争力可与现有最先进的对抗性方法相媲美。我们在三个最先进的 LLM 和对抗性数据集上实证验证了这一漏洞,揭示了子词模型中一个此前未知的脆弱性。

英文摘要:

Current LLM pipelines account for only one possible tokenization for a given string, ignoring exponentially many alternative tokenizations during training and inference. For example, the standard Llama3 tokenization of penguin is [p,enguin], yet [peng,uin] is another perfectly valid alternative. In this paper, we show that despite LLMs being trained solely on one tokenization, they still retain semantic understanding of other tokenizations, raising questions about their implications in LLM safety. Put succinctly, we answer the following question: can we adversarially tokenize an obviously malicious string to evade safety and alignment restrictions? We show that not only is adversarial tokenization an effective yet previously neglected axis of attack, but it is also competitive against existing state-of-the-art adversarial approaches without changing the text of the harmful request. We empirically validate this exploit across three state-of-the-art LLMs and adversarial datasets, revealing a previously unknown vulnerability in subword models.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑