arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2406.10504cs.AIcs.CLcs.LG
收藏

任务切面学习:一种结构化的提示优化方法

Task Facet Learning: A Structured Approach to Prompt Optimization

UC Santa Barbara(加州大学圣芭芭拉分校);BITS Pilani(比哈尔理工学院);Microsoft Research(微软研究院);Microsoft Bing Ads(微软Bing广告)

Gurusha Juneja, Gautam Jajoo, Nagarajan Natarajan, Hua Li, Jian Jiao, Amit Sharma

AI总结:

针对现有提示优化方法难以覆盖复杂任务多切面的问题,提出结构化算法UniPrompt,通过输入聚类与反馈机制学习任务多切面,生成的提示准确率优于人工及现有最优方法,还能生成现有方法无法实现的长复杂提示。

摘要:

给定一个以基础描述及其训练示例形式呈现的任务,提示优化是将给定信息合成为适用于大语言模型的文本提示的问题。人类在解决这一问题时,还会考虑定义任务的不同切面(例如反例、解释、类比)并将其纳入提示中。然而,目前尚不清楚现有基于迭代编辑给定提示或自动选择少量上下文示例的算法方法,是否能够覆盖解决复杂任务所需的多个切面。在本研究中,我们将提示优化视为从一组训练示例中学习任务多个切面的问题。我们利用提示优化问题中的结构,将提示分解为松散耦合的语义片段。所提出的UniPrompt算法(1)对输入空间进行聚类,并使用聚类后的批次,使得每个批次很可能对应任务的一个不同切面;(2)利用反馈机制提出添加、编辑或删除片段的建议,随后在一个批次上对这些建议进行聚合,以捕捉可泛化的切面。在多个数据集和一项真实世界任务上的实证评估表明,使用UniPrompt生成的提示比人工调优的提示以及来自当前最优方法的提示获得了更高的准确率。特别是,我们的算法能够生成长而复杂的提示,这是现有方法无法做到的。UniPrompt的代码可在https://aka.ms/uniprompt获取。

英文摘要:

Given a task in the form of a basic description and its training examples, prompt optimization is the problem of synthesizing the given information into a text prompt for a large language model. Humans solve this problem by also considering the different facets that define a task (e.g., counter-examples, explanations, analogies) and including them in the prompt. However, it is unclear whether existing algorithmic approaches, based on iteratively editing a given prompt or automatically selecting a few in-context examples, can cover the multiple facets required to solve a complex task. In this work, we view prompt optimization as that of learning multiple facets of a task from a set of training examples. We exploit structure in the prompt optimization problem and break down a prompt into loosely coupled semantic sections. The proposed algorithm, UniPrompt, (1) clusters the input space and uses clustered batches so that each batch likely corresponds to a different facet of the task, and (2) utilizes a feedback mechanism to propose adding, editing or deleting a section, which in turn is aggregated over a batch to capture generalizable facets. Empirical evaluation on multiple datasets and a real-world task shows that prompts generated using \shortname{} obtain higher accuracy than human-tuned prompts and those from state-of-the-art methods. In particular, our algorithm can generate long, complex prompts that existing methods are unable to generate. Code for UniPrompt is available at https://aka.ms/uniprompt.

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

↑