arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.10541cs.CLcs.LG
收藏

提示词格式对LLM性能是否有影响?

Does Prompt Formatting Have Any Impact on LLM Performance?

Microsoft(微软公司);MIT(麻省理工学院)

Jia He, Mukund Rungta, David Koleczek, Arshdeep Sekhon, Franklin X Wang, Sadid Hasan

AI总结:

本文研究了不同提示词模板(如纯文本、Markdown、JSON、YAML)对LLM性能的影响,发现格式变化可导致GPT-3.5-turbo性能差异达40%,而GPT-4更具鲁棒性,提示需重新考虑固定模板的使用。

摘要:

在大型语言模型(LLMs)领域,提示词优化对模型性能至关重要。尽管先前的研究已经探索了诸如重述提示词上下文、使用各种提示技术(如上下文学习和思维链)以及对少样本示例进行排序等方面,但我们对LLM对提示词模板敏感性的理解仍然有限。因此,本文研究了不同提示词模板对LLM性能的影响。我们将相同的上下文格式化为各种人类可读的模板,包括纯文本、Markdown、JSON和YAML,并使用OpenAI的GPT模型评估了它们在自然语言推理、代码生成和翻译等任务中的影响。实验表明,在代码翻译任务中,根据提示词模板的不同,GPT-3.5-turbo的性能差异高达40%,而像GPT-4这样的大型模型对这些变化更具鲁棒性。我们的分析强调需要重新考虑使用固定的提示词模板,因为不同的格式会显著影响模型性能。

英文摘要:

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.

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

↑