让大模型自己抗干扰,提升对有错提示的鲁棒性。
Towards Self-Robust LLMs: Intrinsic Prompt Noise Resistance via CoIPO
- 用对比学习优化模型,让干净与带噪提示输出一致。
- 在新构建的噪声提示测试集上,准确率显著超越现有方法。
- 适合需要稳定响应的工业级应用,如客服、医疗问答。
大语言模型在众多任务中表现优异,但在提示存在缺陷时性能易下降,暴露出鲁棒性不足的问题。现有方法多依赖外部工具预处理提示,增加计算开销且忽视模型内在抗噪能力。本文提出基于对比学习的逆直接偏好优化(CoIPO),通过最小化干净提示与噪声提示下模型输出逻辑值的差异来增强鲁棒性,并基于互信息理论进行分析。我们扩充了FLAN数据集,构建成对的干净-噪声提示用于训练。为评估效果,开发了新的基准NoisyPromptBench,其源自现有PromptBench。实验结果表明,在NoisyPromptBench上,CoIPO在平均准确率上显著优于当前最先进方法。相关代码、成对数据集及评测基准已开源。
原文摘要 · Abstract (English)
Large language models (LLMs) have demonstrated remarkable and steadily improving performance across a wide range of tasks. However, LLM performance may be highly sensitive to prompt variations especially in scenarios with limited openness or strict output formatting requirements, indicating insufficient robustness. In real-world applications, user prompts provided to LLMs often contain imperfections, which may undermine the quality of the model's responses. To address this issue, previous work has primarily focused on preprocessing prompts, employing external tools or even LLMs to refine prompt formulations in advance. However, these approaches overlook the intrinsic robustness of LLMs, and their reliance on external components introduces additional computational overhead and uncertainty. In this work, we propose a Contrastive Learning-based Inverse Direct Preference Optimization (CoIPO) method that minimizes the discrepancy between the label-aligned logits produced by the model under a clean prompt and its noisy counterpart, and conduct a detailed analysis using mutual information theory. We augment the FLAN dataset by constructing paired prompts, each consisting of a clean prompt and its corresponding noisy version for training. Additionally, to evaluate the effectiveness, we develop NoisyPromptBench, a benchmark enhanced and derived from the existing PromptBench. Experimental results conducted on NoisyPromptBench demonstrate that our proposed method achieves a significant improvement in average accuracy over the current state-of-the-art approaches. The source code of CoIPO, pair-wise FLAN datasets, and NoisyPromptBench have already been released on https://github.com/vegetable-yx/CoIPO.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。