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

面向大型语言模型的自动提示选择

Automatic Prompt Selection for Large Language Models

Cinnamon AI(肉桂人工智能公司);Hung Yen University of Technology and Education(兴安理工教育大学);Deakin University(迪肯大学)

Viet-Tung Do, Van-Khanh Hoang, Duy-Hung Nguyen, Shahab Sabahi, Jeff Yang, Hajime Hotta, Minh-Tien Nguyen, Hung Le

AI总结:

本文提出一种自动提示选择方法,通过聚类生成候选提示、训练提示评估器并在测试时为输入选择最佳提示,在多个零样本问答数据集上取得有竞争力的性能。

摘要:

大型语言模型(LLMs)能够借助合适的指令提示执行各种自然语言处理任务。然而,手动设计有效的提示既具有挑战性又耗费时间。现有的自动提示优化方法要么缺乏灵活性,要么效率不足。在本文中,我们提出了一种有效的方法,能够从有限的合成候选提示集合中,为给定输入自动选择最优提示。该方法包含三个步骤:(1)对训练数据进行聚类,并使用基于LLM的提示生成器为每个聚类生成候选提示;(2)合成一个由输入-提示-输出三元组构成的数据集,用于训练提示评估器,使其根据提示与输入的相关性对提示进行排序;(3)在测试时使用提示评估器为新输入选择最佳提示。我们的方法平衡了提示的通用性与专用性,并且无需资源密集型的训练和推理。它在GSM8K、MultiArith和AQuA等零样本问答数据集上展现出具有竞争力的性能。

英文摘要:

Large Language Models (LLMs) can perform various natural language processing tasks with suitable instruction prompts. However, designing effective prompts manually is challenging and time-consuming. Existing methods for automatic prompt optimization either lack flexibility or efficiency. In this paper, we propose an effective approach to automatically select the optimal prompt for a given input from a finite set of synthetic candidate prompts. Our approach consists of three steps: (1) clustering the training data and generating candidate prompts for each cluster using an LLM-based prompt generator; (2) synthesizing a dataset of input-prompt-output tuples for training a prompt evaluator to rank the prompts based on their relevance to the input; (3) using the prompt evaluator to select the best prompt for a new input at test time. Our approach balances prompt generality-specificity and eliminates the need for resource-intensive training and inference. It demonstrates competitive performance on zero-shot question-answering datasets: GSM8K, MultiArith, and AQuA.

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

↑