Automatic Engineering of Long Prompts

📄 arXiv: 2311.10117v1 📥 PDF

作者: Cho-Jui Hsieh, Si Si, Felix X. Yu, Inderjit S. Dhillon

分类: cs.AI, cs.LG

发布日期: 2023-11-16


💡 一句话要点

提出自动化长提示工程方法以提升大语言模型性能

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 长提示工程 自动化设计 贪心算法 束搜索 大语言模型 性能提升 自然语言处理

📋 核心要点

  1. 长提示的自动化设计面临巨大的搜索空间,现有方法难以高效处理。
  2. 本文提出了一种结合贪心算法和束搜索的自动长提示工程方法,提升了搜索效率。
  3. 实验结果表明,所提方法在多个任务上实现了9.2%的准确率提升,验证了其有效性。

📝 摘要(中文)

大型语言模型(LLMs)在解决复杂开放领域任务方面表现出色,通常依赖于详尽的提示设计。然而,长提示的设计往往需要大量的人力投入,且其搜索空间庞大。本文探讨了贪心算法和遗传算法在自动长提示工程中的应用,发现简单的贪心方法结合束搜索在搜索效率上优于其他方法。此外,提出了两种新技术,通过利用搜索历史来增强基于LLM的变异效果。实验结果显示,所提算法在Big Bench Hard的八个任务上平均提升了9.2%的准确率,强调了自动化提示设计的重要性。

🔬 方法详解

问题定义:本文旨在解决长提示的自动化设计问题,现有方法在处理长提示时效率低下,且设计过程依赖人工,难以满足实际需求。

核心思路:论文提出结合贪心算法与束搜索的策略,通过简化搜索过程来提高长提示的设计效率,同时引入搜索历史来优化变异效果。

技术框架:整体方法包括两个主要阶段:首先使用贪心算法进行初步提示生成,然后通过束搜索优化生成的提示,最后利用搜索历史进行变异和改进。

关键创新:最重要的创新在于引入了搜索历史的利用,这一设计使得变异过程更加高效,显著提升了提示的质量和准确性。

关键设计:在参数设置上,采用了适应性调整的搜索深度和变异率,损失函数设计上则考虑了提示的多样性与准确性,确保生成的提示既丰富又有效。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,所提出的自动长提示工程算法在Big Bench Hard的八个任务上平均提升了9.2%的准确率,相较于其他方法具有显著的性能优势,验证了其在实际应用中的有效性。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理、对话系统和智能助手等,能够显著提升大语言模型在复杂任务中的表现。未来,自动化提示设计可能会在更多实际应用中发挥重要作用,降低人工干预的需求,提高系统的智能化水平。

📄 摘要(原文)

Large language models (LLMs) have demonstrated remarkable capabilities in solving complex open-domain tasks, guided by comprehensive instructions and demonstrations provided in the form of prompts. However, these prompts can be lengthy, often comprising hundreds of lines and thousands of tokens, and their design often requires considerable human effort. Recent research has explored automatic prompt engineering for short prompts, typically consisting of one or a few sentences. However, the automatic design of long prompts remains a challenging problem due to its immense search space. In this paper, we investigate the performance of greedy algorithms and genetic algorithms for automatic long prompt engineering. We demonstrate that a simple greedy approach with beam search outperforms other methods in terms of search efficiency. Moreover, we introduce two novel techniques that utilize search history to enhance the effectiveness of LLM-based mutation in our search algorithm. Our results show that the proposed automatic long prompt engineering algorithm achieves an average of 9.2% accuracy gain on eight tasks in Big Bench Hard, highlighting the significance of automating prompt designs to fully harness the capabilities of LLMs.