arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2402.16431cs.CL
收藏

RoCoIns:通过代码风格指令增强大语言模型的鲁棒性

RoCoIns: Enhancing Robustness of Large Language Models through Code-Style Instructions

School of Computer Science, Fudan University(复旦大学计算机科学学院);Institute of Modern Languages and Linguistics, Fudan University(复旦大学现代语言学与语言学研究所)

Yuansen Zhang, Xiao Wang, Zhiheng Xi, Han Xia, Tao Gui, Qi Zhang, Xuanjing Huang

AI总结:

本文提出RoCoIns方法,通过将自然语言指令转换为代码风格指令并结合对抗上下文示例,显著提升大语言模型面对文本对抗攻击时的鲁棒性,在多个数据集上优于自然语言指令提示。

摘要:

大语言模型(LLMs)在遵循人类指令方面展现了卓越的能力。然而,近期研究对LLMs在结合文本对抗样本的指令提示下的鲁棒性提出了担忧。本文受近期关于LLMs对指令设计敏感的研究启发,采用代码风格的指令——其更具结构性且歧义更少——来替代通常的自然语言指令。通过这种转换,我们为LLMs提供了更精确的指令,并增强了LLMs的鲁棒性。此外,在少样本场景下,我们提出了一种新方法,利用干净样本和对抗样本共同构成上下文示例(对抗上下文方法),以进一步提升LLMs的鲁棒性。在八个鲁棒性数据集上的实验表明,我们的方法一致优于使用自然语言指令提示LLMs。例如,使用gpt-3.5-turbo时,我们的方法在测试集准确率上实现了5.68%的提升,并将攻击成功率(ASR)降低了5.66个百分点。

英文摘要:

Large Language Models (LLMs) have showcased remarkable capabilities in following human instructions. However, recent studies have raised concerns about the robustness of LLMs when prompted with instructions combining textual adversarial samples. In this paper, drawing inspiration from recent works that LLMs are sensitive to the design of the instructions, we utilize instructions in code style, which are more structural and less ambiguous, to replace typically natural language instructions. Through this conversion, we provide LLMs with more precise instructions and strengthen the robustness of LLMs. Moreover, under few-shot scenarios, we propose a novel method to compose in-context demonstrations using both clean and adversarial samples (\textit{adversarial context method}) to further boost the robustness of the LLMs. Experiments on eight robustness datasets show that our method consistently outperforms prompting LLMs with natural language instructions. For example, with gpt-3.5-turbo, our method achieves an improvement of 5.68\% in test set accuracy and a reduction of 5.66 points in Attack Success Rate (ASR).

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

↑