Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design or: How I learned to start worrying about prompt formatting

📄 arXiv: 2310.11324v2 📥 PDF

作者: Melanie Sclar, Yejin Choi, Yulia Tsvetkov, Alane Suhr

分类: cs.CL, cs.AI, cs.LG

发布日期: 2023-10-17 (更新: 2024-07-01)

备注: ICLR 2024 Camera Ready version. With respect to the original submission, we added text generation experiments, plots of entire accuracy distributions for each task + stdev computations, and prompt length correlation with spread analysis


💡 一句话要点

提出FormatSpread算法以评估提示格式对LLM性能的影响

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 提示设计 性能评估 FormatSpread 自然语言处理 模型比较 敏感性分析

📋 核心要点

  1. 现有方法在评估大型语言模型时,通常只使用单一的提示格式,导致性能评估不全面。
  2. 本文提出FormatSpread算法,通过快速评估多种提示格式,系统性地分析LLM对提示格式的敏感性。
  3. 实验结果显示,LLM在不同提示格式下的性能差异可达76个准确率点,提示格式间的性能相关性较弱。

📝 摘要(中文)

随着大型语言模型(LLMs)成为语言技术的基础组成部分,准确评估其性能变得至关重要。提示设计的选择会显著影响模型行为,因此在有效使用现代预训练生成语言模型时,提示设计过程至关重要。本文重点研究LLM对提示格式的敏感性,发现多种广泛使用的开源LLM在少量示例设置下对提示格式的微小变化极为敏感,使用LLaMA-2-13B评估时性能差异可达76个准确率点。即使在增加模型规模、少量示例数量或进行指令调优时,这种敏感性依然存在。我们建议在评估LLM时报告多种可能的提示格式下的性能范围,而不是仅报告单一格式的性能。为系统分析提供便利,我们提出了FormatSpread算法,能够快速评估给定任务的一组可能提示格式,并在不访问模型权重的情况下报告预期性能区间。

🔬 方法详解

问题定义:本文旨在解决大型语言模型对提示格式变化的敏感性问题。现有方法通常只使用单一提示格式进行评估,导致对模型性能的理解不够全面,且可能误导模型比较结果。

核心思路:论文的核心思路是提出FormatSpread算法,旨在通过评估多种提示格式来更全面地理解LLM的性能表现。通过这种方式,可以揭示不同格式对模型输出的影响,从而优化提示设计。

技术框架:FormatSpread算法的整体架构包括多个模块:首先是提示格式的采样模块,其次是性能评估模块,最后是结果汇总与分析模块。该框架能够在不访问模型权重的情况下,快速评估不同提示格式的性能。

关键创新:最重要的技术创新点在于FormatSpread算法的提出,它能够系统性地评估提示格式对LLM性能的影响,解决了以往方法中仅依赖单一格式的局限性。

关键设计:在算法设计中,关键参数包括提示格式的选择策略和性能评估的标准。通过对多种格式的性能进行统计分析,FormatSpread能够提供性能区间而非单一值,从而更准确地反映模型的真实表现。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,使用LLaMA-2-13B评估时,模型在不同提示格式下的性能差异可达76个准确率点。此外,模型间的格式性能相关性较弱,提示设计的选择对模型输出有显著影响,这一发现对LLM的评估方法提出了新的挑战。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理、对话系统和文本生成等。通过优化提示设计,能够提升大型语言模型在实际应用中的表现,进而推动语言技术的进步和应用普及。未来,FormatSpread算法可能成为评估和比较不同LLM性能的标准工具,促进更为公平和全面的模型评估。

📄 摘要(原文)

As large language models (LLMs) are adopted as a fundamental component of language technologies, it is crucial to accurately characterize their performance. Because choices in prompt design can strongly influence model behavior, this design process is critical in effectively using any modern pre-trained generative language model. In this work, we focus on LLM sensitivity to a quintessential class of meaning-preserving design choices: prompt formatting. We find that several widely used open-source LLMs are extremely sensitive to subtle changes in prompt formatting in few-shot settings, with performance differences of up to 76 accuracy points when evaluated using LLaMA-2-13B. Sensitivity remains even when increasing model size, the number of few-shot examples, or performing instruction tuning. Our analysis suggests that work evaluating LLMs with prompting-based methods would benefit from reporting a range of performance across plausible prompt formats, instead of the currently-standard practice of reporting performance on a single format. We also show that format performance only weakly correlates between models, which puts into question the methodological validity of comparing models with an arbitrarily chosen, fixed prompt format. To facilitate systematic analysis we propose FormatSpread, an algorithm that rapidly evaluates a sampled set of plausible prompt formats for a given task, and reports the interval of expected performance without accessing model weights. Furthermore, we present a suite of analyses that characterize the nature of this sensitivity, including exploring the influence of particular atomic perturbations and the internal representation of particular formats.