Prompt Space:利用大型语言模型优化少样本推理成功率的提示空间方法
Prompt Space Optimizing Few-shot Reasoning Success with Large Language Models
AI总结:
本文提出Prompt Space方法,通过文本嵌入和矩阵分解构建提示空间,以数学框架优化提示选择,在多个推理基准上超越现有少样本方法。
摘要:
提示工程是一项通过提供明确且具体的指令来增强大型语言模型(LLMs)能力的关键技术。它使LLMs能够在算术推理、问答、摘要、关系抽取、机器翻译和情感分析等多种任务中表现出色。研究人员一直在积极探索不同的提示工程策略,例如思维链(Chain of Thought, CoT)、零样本思维链(Zero-CoT)和上下文学习(In-context learning)。然而,一个尚未解决的问题是,当前方法缺乏确定最优提示的坚实数学解决方案。为了解决提示工程中的这一问题,我们提出了一种名为Prompt Space的新方法。我们的方法利用文本嵌入通过矩阵分解获得基向量,然后构建一个用于表示所有提示的空间。Prompt Space在十个公开推理基准上显著优于最先进的提示范式。值得注意的是,在没有CoT方法和“让我们一步一步思考”提示的帮助下,Prompt Space展现出优于少样本方法的性能。总体而言,我们的方法为选择简单有效的提示提供了一个稳健且有效的数学框架。这一进展标志着在改进LLMs广泛应用中的提示工程方面迈出了重要一步。我们的代码已公开,地址为https://github.com/YouBLEI/Prompt-Space。
英文摘要:
Prompt engineering is an essential technique for enhancing the abilities of large language models (LLMs) by providing explicit and specific instructions. It enables LLMs to excel in various tasks, such as arithmetic reasoning, question answering, summarization, relation extraction, machine translation, and sentiment analysis. Researchers have been actively exploring different prompt engineering strategies, such as Chain of Thought (CoT), Zero-CoT, and In-context learning. However, an unresolved problem arises from the fact that current approaches lack a solid mathematical solution for determining optimal prompts. To address this issue in prompt engineering, we propose a new and effective approach called Prompt Space. Our methodology utilizes text embeddings to obtain basis vectors by matrix decomposition, and then constructs a space for representing all prompts. Prompt Space significantly outperforms state-of-the-art prompt paradigms on ten public reasoning benchmarks. Notably, without the help of the CoT method and the prompt "Let's think step by step", Prompt Space shows superior performance over the few-shot method. Overall, our approach provides a robust and effective mathematical framework for selecting simple and effective prompts. This advancement marks a significant step towards improving prompt engineering for a wide variety of applications in LLMs. Our code is publicly available at \textcolor{blue}{\url{https://github.com/YouBLEI/Prompt-Space}}
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。