提出RoP策略,让大模型在输入出错时仍能准确推理。
Robustness of Prompting: Enhancing Robustness of Large Language Models Against Prompting Attacks
- 分两阶段:先纠错生成抗干扰提示,再生成最优引导提示。
- 在算术、常识、逻辑任务中显著提升抗干扰能力,精度下降极小。
- 适合部署在真实场景中,对输入错误敏感的大模型系统。
大语言模型(LLMs)通过提示策略在各类任务中表现卓越,但对输入扰动(如拼写错误或字符顺序错乱)极为敏感,可能导致性能严重下降。尽管链式思维和自动提示生成等提示技术取得进展,如何显式缓解此类扰动的影响仍是开放挑战。为此,我们提出鲁棒提示策略(Robustness of Prompting, RoP),包含两个阶段:错误纠正与引导。在错误纠正阶段,RoP采用多种扰动方法生成对抗样本,用于自动生成修正输入错误的提示;在引导阶段,基于修正后的输入生成最优引导提示,引导模型生成更鲁棒且准确的推理结果。在算术、常识和逻辑推理任务上的全面实验表明,RoP显著提升了LLM对对抗性扰动的鲁棒性,且相比干净输入场景仅带来极小精度损失,证明其在真实应用中具有实用性和有效性。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have demonstrated remarkable performance across various tasks by effectively utilizing a prompting strategy. However, they are highly sensitive to input perturbations, such as typographical errors or slight character order errors, which can significantly impair their performance. Despite advances in prompting techniques such as Chain-of-Thought and automatic prompt generation, developing a prompting strategy that explicitly mitigates the negative impact of such perturbations remains an open challenge. To bridge this gap, we propose Robustness of Prompting (RoP), a novel prompting strategy aimed at enhancing the robustness of LLMs. RoP consists of two stages: Error Correction and Guidance. In the Error Correction stage, RoP applies diverse perturbation methods to generate adversarial examples, which are used to generate prompts that correct input errors automatically. In the Guidance stage, RoP generates an optimal guidance prompt based on the corrected input, guiding the model to generate more robust and accurate inferences. Through comprehensive experiments spanning arithmetic, commonsense, and logical reasoning tasks, we demonstrate that RoP significantly improves LLMs' robustness against adversarial perturbations. Crucially, it preserves model accuracy with only minimal degradation compared to clean input scenarios, thereby establishing RoP as a practical and effective approach for enhancing LLM robustness in real-world applications.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。