arXiv:2510.14242cs.CLcs.LG2025-10ACL被引 3

让大模型对提示词变化更稳定,不因措辞不同而答错。

Flip-Flop Consistency: Unsupervised Training for Robustness to Prompt Perturbations in LLMs

  • 用多种说法的提示词投票生成伪标签,指导模型统一回答。
  • 平均提升答案一致性11.62%,F1得分提高8.94%,波动减少3.29%。
  • 无需标注数据,适合想提升模型鲁棒性的开发者使用。

大型语言模型在面对同一问题的不同表述时,常产生不一致的回答。本文提出无监督训练方法Flip-Flop Consistency(F²C),提升模型对提示词扰动的鲁棒性。F²C包含两个核心组件:一是共识交叉熵(CCE),通过多个提示变体的多数投票生成硬伪标签;二是表示对齐损失,将低置信度及非主流预测结果拉向高置信度多数预测所确立的共识。我们在11个涵盖四大自然语言任务的数据集上评估该方法,每数据集含4至15种提示变体。平均而言,F²C使答案一致性提升11.62%,平均F₁得分提高8.94%,跨格式性能方差降低3.29%。在跨域评估中,F²C表现出良好泛化能力,多数源-目标组合的F₁均值与一致性上升,方差下降。当仅在部分提示扰动上训练并测试未见格式时,F²C仍持续提升性能与一致性,并减小波动。结果表明,F²C是一种有效提升大模型一致性、性能与泛化能力的无监督方法。代码已公开于https://github.com/ParsaHejabi/Flip-Flop-Consistency-Unsupervised-Training-for-Robustness-to-Prompt-Perturbations-in-LLMs。

原文摘要 · Abstract (English)

Large Language Models (LLMs) often produce inconsistent answers when faced with different phrasings of the same prompt. In this paper, we propose Flip-Flop Consistency ($F^2C$), an unsupervised training method that improves robustness to such perturbations. $F^2C$ is composed of two key components. The first, Consensus Cross-Entropy (CCE), uses a majority vote across prompt variations to create a hard pseudo-label. The second is a representation alignment loss that pulls lower-confidence and non-majority predictors toward the consensus established by high-confidence, majority-voting variations. We evaluate our method on 11 datasets spanning four NLP tasks, with 4-15 prompt variations per dataset. On average, $F^2C$ raises observed agreement by 11.62%, improves mean $F_1$ by 8.94%, and reduces performance variance across formats by 3.29%. In out-of-domain evaluations, $F^2C$ generalizes effectively, increasing $\overline{F_1}$ and agreement while decreasing variance across most source-target pairs. Finally, when trained on only a subset of prompt perturbations and evaluated on held-out formats, $F^2C$ consistently improves both performance and agreement while reducing variance. These findings highlight $F^2C$ as an effective unsupervised method for enhancing LLM consistency, performance, and generalization under prompt perturbations. Code is available at https://github.com/ParsaHejabi/Flip-Flop-Consistency-Unsupervised-Training-for-Robustness-to-Prompt-Perturbations-in-LLMs.

大模型提示鲁棒性无监督学习一致性

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。