提示无关的语言模型 Prompt-agnostic Language Models 预印本

⚠️ 本文为 预印本(arXiv 公开版本),尚未经过正式同行评审。作者自发公开,结论未经期刊审稿验证,阅读时请知悉。
发布时间:2026-10-13
👁️ 预览文献
💡 AI 中文简介
大型语言模型对提示的措辞非常敏感,同一问题换个问法答案就可能不同。现有方法多在推理时手动优化提示,开销大且难扩展。本研究另辟蹊径,在指令微调阶段让模型学会忽略提示的措辞差异。作者发现,简单混合多个改写提示训练时,不同改写产生的梯度会相互干扰,57%的梯度方向冲突,平均后损失约20%的幅度。为此提出Prompt-TIES和Prompt-DARE两种梯度合并方法,有效缓解干扰。实验表明,提示措辞与具体样例的交互作用平均占54%的样本间差异,在ANLI等任务上超过70%。新方法几乎将全参数微调模型的样本间方差减半,且几乎不损失整体准确率。
领域自然语言处理 / 大语言模型鲁棒性
适合谁读需要一定专业背景(了解大语言模型微调与梯度优化)
核心贡献1. 揭示训练时混合多个提示改写会导致梯度干扰(57%符号冲突,平均丢弃约20%幅度);2. 提出Prompt-TIES和Prompt-DARE两种梯度合并方法,直接提升模型对提示措辞的局部鲁棒性,将全参数微调模型的样本间方差减半,且几乎不损失整体准确率。
关键数据提示措辞与具体样例的交互作用平均占54%的样本间差异,在ANLI和WiC任务上超过70%;梯度合并方法将全参数微调模型的样本间方差减半,整体准确率几乎不变;在2个模型家族、2种规模共4个模型上验证。
推荐理由如果你苦于大模型换个问法就答错,这篇论文从训练阶段入手,用梯度合并技巧让模型对提示措辞更稳健,方法简单有效,值得一读。
关键词["提示鲁棒性", "指令微调", "梯度合并", "提示改写", "样本间方差"]

原文摘要

查看英文原文摘要

Despite their strong performance, large language models remain highly sensitive to prompt formulation. This issue is typically addressed at inference-time through manual prompt optimization, which introduces overhead and lacks scalability. Conversely, we focus on train-time approaches that build prompt robustness into the model during instruction tuning. A common strategy is to mix multiple paraphrases of each prompt into training. We demonstrate that across trainable parameters, the per-paraphrasing gradients interfere, with 57% exhibiting sign conflicts and the naive gradient average discarding approximately a fifth of the magnitude. Therefore, we develop two gradient-merging methods, Prompt-TIES and Prompt-DARE, that address this interference by leveraging interference-resolution operators from model and gradient merging and applying them to prompt gradients. In this study, we compare the efficacy of our methods to increase model robustness to train-time robustness methods spanning all three established classes: data construction, consistency regularization, and contrastive alignment. The evaluation is conducted across four models from two families at two scales. We observe the interaction between prompt phrasing and the specific examples accounts for 54% of per-example variability on average, and exceeds 70% on tasks such as ANLI and WiC. The gradient-merging methods directly improve this local robustness and nearly halve per-example variance on fully fine-tuned models at little cost to overall accuracy. The other train-time methods enhance raw performance, but fail to improve per-example variance reliably. Code: https://github.com/FSadrieh/prompt-agnostic-llms. Model checkpoints: https://huggingface.co/prompt-agnostic-language-models.