Skip to main content
QUICK REVIEW

[论文解读] Does Prompt Formatting Have Any Impact on LLM Performance?

Jia He, Mukund Rungta|arXiv (Cornell University)|Nov 15, 2024
Digital Rights Management and SecurityComputer Science被引用 19
一句话总结

这篇论文显示,提示格式显著影响基于GPT的模型在多任务上的性能,且不存在普遍的最佳格式;如GPT-4等更大模型对格式变化更具鲁棒性,相较之下GPT-3.5表现更易受影响。

ABSTRACT

In the realm of Large Language Models (LLMs), prompt optimization is crucial for model performance. Although previous research has explored aspects like rephrasing prompt contexts, using various prompting techniques (like in-context learning and chain-of-thought), and ordering few-shot examples, our understanding of LLM sensitivity to prompt templates remains limited. Therefore, this paper examines the impact of different prompt templates on LLM performance. We formatted the same contexts into various human-readable templates, including plain text, Markdown, JSON, and YAML, and evaluated their impact across tasks like natural language reasoning, code generation, and translation using OpenAI's GPT models. Experiments show that GPT-3.5-turbo's performance varies by up to 40\% in a code translation task depending on the prompt template, while larger models like GPT-4 are more robust to these variations. Our analysis highlights the need to reconsider the use of fixed prompt templates, as different formats can significantly affect model performance.

研究动机与目标

  • 研究不同易读的提示模板(纯文本、Markdown、YAML、JSON)是否会影响GPT模型在多样化任务中的性能。
  • 使用标准化基准评估GPT-3.5和GPT-4对提示格式变化的敏感性。
  • 在提示变化时评估模型输出的一致性。
  • 探究在不同GPT模型及族之间,表现最好的格式的可迁移性。

提出的方法

  • 将相同任务上下文格式化为四种提示模板:纯文本、Markdown、YAML、JSON。
  • 通过Azure OpenAI评估GPT-3.5-turbo-0613、GPT-3.5-turbo-16k-0613、GPT-4-1106-preview和GPT-4-32k-0613。
  • 使用NL2NL、NL2Code和Code2Code基准测试(MMLU、NER Finance、HumanEval、FIND、CODEXGLUE、HumanEval-X)。
  • 通过模板之间的最大/最小表现计算敏感性,并进行单边配对t检验(给出p值)。
  • 使用Shu等人(2023)的一致性指标(C)衡量提示间的一致性。
  • 使用Top-prompts的交并比(IoU)评估模型之间的可迁移性,请模型族之间。
Figure 1: An example to demonstrate how prompt formatting impacts GPT-35-turbo-16k-0613 model’s performance based on our experiments on multiple choice questions related to international law from the MMLU benchmark ( Hendrycks et al. ( 2020 ) ). Texts inside " $<>$ " are replaced by actual contexts.
Figure 1: An example to demonstrate how prompt formatting impacts GPT-35-turbo-16k-0613 model’s performance based on our experiments on multiple choice questions related to international law from the MMLU benchmark ( Hendrycks et al. ( 2020 ) ). Texts inside " $<>$ " are replaced by actual contexts.

实验结果

研究问题

  • RQ1提示格式对GPT模型在各任务上的表现有多大影响?
  • RQ2当使用不同格式提示时,GPT模型能否输出一致的结果?
  • RQ3是否存在对所有GPT模型都优越的统一提示格式,还是格式效应高度依赖模型?
  • RQ4模型大小(GPT-3.5与GPT-4)如何影响对提示格式的敏感性与一致性?
  • RQ5顶级格式模板在不同模型或模型家族之间的可迁移程度如何?

主要发现

  • 提示格式敏感性在不同模型和任务中具有统计显著性(在大多数情况下p值<0.01)。
  • GPT-3.5-turbo变体在不同格式下表现差异较大(例如在FIND中从Markdown改为纯文本可提高多达200%的表现;在MMLU和HumanEval中也存在类似的剧烈波动)。
  • GPT-4模型对提示格式变化的鲁棒性高于GPT-3.5,在不同格式之间的一致性更强(在MMLU上的一致性分数常>0.5)。
  • 没有单一普遍优越的提示格式;不同模型的格式偏好各异(例如,GPT-3.5-turbo偏好JSON,GPT-4偏好Markdown)。
  • 顶级格式模板在不同GPT模型家族之间的可迁移性并不高(IoU在家族间通常<0.2,同一模型变体内较高)。
  • 较大模型(GPT-4)在不同提示下往往比较小模型(GPT-3.5)产生更一致的输出。
(a) GPT-35-Turbo-0613
(a) GPT-35-Turbo-0613

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。