arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.14628cs.LGcs.CL
收藏

PEARL:迈向抗排列的大语言模型

PEARL: Towards Permutation-Resilient LLMs

The Chinese University of Hong Kong(香港中文大学);Shenzhen Campus of Sun Yat-sen University(中山大学深圳校区);SMU(南方医科大学)

Liang Chen, Li Shen, Yang Deng, Xiaoyan Zhao, Bin Liang, Kam-Fai Wong

AI总结:

针对LLM上下文学习对示例排列敏感的安全问题,本文提出基于DRO的PEARL框架,通过P-Net生成最坏排列并进行极小极大训练,显著增强抗排列攻击与长上下文泛化能力。

摘要:

大语言模型(LLM)的上下文学习(ICL)能力使其能够利用所提供的示例执行具有挑战性的任务。然而,ICL对示例的排序高度敏感,从而导致预测不稳定。本文表明,这一脆弱性可被利用来设计一种自然攻击——模型提供商难以检测——只需对示例进行排列,就能在 LLaMA-3 上实现近80%的成功率。现有缓解方法主要依赖后处理,未能增强模型对输入排列的内在鲁棒性,这引发了对 LLM 安全性和可靠性的担忧。为解决该问题,我们提出 Permutation-resilient learning(PEARL,抗排列学习),这是一种基于分布鲁棒优化(DRO)的新颖框架,针对最坏情况下的输入排列来优化模型性能。具体而言,PEARL 由一个排列提议网络(P-Net)和 LLM 组成。P-Net 通过将该问题视为最优传输问题来生成最具挑战性的排列,并使用熵约束 Sinkhorn 算法求解。通过极小极大优化,P-Net 与 LLM 相互迭代优化,逐步提升 LLM 的鲁棒性。在合成预训练和真实指令微调任务上的实验表明,PEARL 有效缓解了排列攻击并提升了性能。值得注意的是,尽管 PEARL 仅在更少示例数和更短上下文上训练,但在扩展到多样例和长上下文场景时,其性能提升最高达40%,凸显了其效率与泛化能力。

英文摘要:

The in-context learning (ICL) capability of large language models (LLMs) enables them to perform challenging tasks using provided demonstrations. However, ICL is highly sensitive to the ordering of demonstrations, leading to instability in predictions. This paper shows that this vulnerability can be exploited to design a natural attack - difficult for model providers to detect - that achieves nearly 80% success rate on LLaMA-3 by simply permuting the demonstrations. Existing mitigation methods primarily rely on post-processing and fail to enhance the model's inherent robustness to input permutations, raising concerns about safety and reliability of LLMs. To address this issue, we propose Permutation-resilient learning (PEARL), a novel framework based on distributionally robust optimization (DRO), which optimizes model performance against the worst-case input permutation. Specifically, PEARL consists of a permutation-proposal network (P-Net) and the LLM. The P-Net generates the most challenging permutations by treating it as an optimal transport problem, which is solved using an entropy-constrained Sinkhorn algorithm. Through minimax optimization, the P-Net and the LLM iteratively optimize against each other, progressively improving the LLM's robustness. Experiments on synthetic pre-training and real-world instruction tuning tasks demonstrate that PEARL effectively mitigates permutation attacks and enhances performance. Notably, despite being trained on fewer shots and shorter contexts, PEARL achieves performance gains of up to 40% when scaled to many-shot and long-context scenarios, highlighting its efficiency and generalization capabilities.

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

↑