arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.16432cs.CLcs.AI
收藏

$\textit{LinkPrompt}$:对基于提示的语言模型的自然且通用的对抗攻击

$\textit{LinkPrompt}$: Natural and Universal Adversarial Attacks on Prompt-based Language Models

School of Information Science and Technology, ShanghaiTech University(上海科技大学信息科学与技术学院)

Yue Xu, Wenjie Wang

AI总结:

针对基于提示的语言模型易受通用对抗触发器攻击但触发器不自然的问题,本文提出LinkPrompt,用基于梯度的束搜索生成自然且可迁移到Llama2和GPT-3.5-turbo的UATs。

摘要:

基于提示的学习是一种新的语言模型训练范式,它使预训练语言模型(PLMs)适配下游任务,重振了各类自然语言处理(NLP)任务的性能基准。一些研究没有使用固定的提示模板来微调模型,而是证明了通过优化搜索提示的有效性。PLMs上基于提示学习的这种提示优化过程,也为生成误导模型的对抗性提示提供了启发,引发了人们对该范式对抗脆弱性的担忧。近期研究表明,通用对抗触发器(UATs)不仅可以被生成以改变目标PLMs的预测,还可以改变基于提示学习范式下相应的基于提示的微调模型(PFMs)的预测。然而,以往工作中发现的UATs通常是不可读的词元或字符,借助自适应防御可以很容易地将其与自然文本区分开来。在本工作中,我们考虑了UATs的自然性,并开发了$\textit{LinkPrompt}$,这是一种通过基于梯度的束搜索算法生成UATs的对抗攻击算法,不仅能有效攻击目标PLMs和PFMs,还能在触发器词元之间保持自然性。大量结果证明了$\textit{LinkPrompt}$的有效性,以及由$\textit{LinkPrompt}$生成的UATs对开源大语言模型(LLM)Llama2和通过API访问的LLM GPT-3.5-turbo的可迁移性。该资源可在$\href{https://github.com/SavannahXu79/LinkPrompt}{https://github.com/SavannahXu79/LinkPrompt}$获取。

英文摘要:

Prompt-based learning is a new language model training paradigm that adapts the Pre-trained Language Models (PLMs) to downstream tasks, which revitalizes the performance benchmarks across various natural language processing (NLP) tasks. Instead of using a fixed prompt template to fine-tune the model, some research demonstrates the effectiveness of searching for the prompt via optimization. Such prompt optimization process of prompt-based learning on PLMs also gives insight into generating adversarial prompts to mislead the model, raising concerns about the adversarial vulnerability of this paradigm. Recent studies have shown that universal adversarial triggers (UATs) can be generated to alter not only the predictions of the target PLMs but also the prediction of corresponding Prompt-based Fine-tuning Models (PFMs) under the prompt-based learning paradigm. However, UATs found in previous works are often unreadable tokens or characters and can be easily distinguished from natural texts with adaptive defenses. In this work, we consider the naturalness of the UATs and develop $\textit{LinkPrompt}$, an adversarial attack algorithm to generate UATs by a gradient-based beam search algorithm that not only effectively attacks the target PLMs and PFMs but also maintains the naturalness among the trigger tokens. Extensive results demonstrate the effectiveness of $\textit{LinkPrompt}$, as well as the transferability of UATs generated by $\textit{LinkPrompt}$ to open-sourced Large Language Model (LLM) Llama2 and API-accessed LLM GPT-3.5-turbo. The resource is available at $\href{https://github.com/SavannahXu79/LinkPrompt}{https://github.com/SavannahXu79/LinkPrompt}$.

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

↑