AutoPDL: Automatic Prompt Optimization for LLM Agents
作者: Claudio Spiess, Mandana Vaziri, Louis Mandel, Martin Hirzel
分类: cs.LG, cs.AI, cs.PL
发布日期: 2025-04-06 (更新: 2025-11-03)
备注: An earlier version of this paper was published in AutoML 2025 Methods Track. This version adds missing standard deviations in Table 1
💡 一句话要点
提出AutoPDL以自动优化大型语言模型的提示配置
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 提示优化 自动化机器学习 人机协作 自然语言处理
📋 核心要点
- 现有方法在提示设计上依赖人工调整,过程繁琐且容易出错,且对特定模型和任务高度依赖。
- 论文提出AutoPDL,通过将提示优化问题框架化为结构化的AutoML问题,自动发现有效的提示配置。
- 实验结果表明,AutoPDL在三个任务和七个LLM上均实现了显著的准确性提升,平均提升9.21个百分点,最高可达67.5个百分点。
📝 摘要(中文)
大型语言模型(LLMs)的性能依赖于提示的设计,包括高层提示模式(如零-shot、CoT、ReAct、ReWOO)和具体提示内容(指令和少量示例)。手动调整这些组合既繁琐又容易出错,且特定于某个LLM和任务。因此,本文提出了AutoPDL,一种自动发现良好LLM代理配置的方法。该方法将此问题框架化为一个结构化的AutoML问题,利用逐步减半技术高效地在代理和非代理提示模式及示例的组合空间中导航。我们引入了一个库,使用PDL提示编程语言实现常见的提示模式。AutoPDL解决方案是可读、可编辑和可执行的PDL程序,支持人机协作的优化和重用。对三个任务和七个LLM(参数从3B到70B)进行的评估显示出一致的准确性提升(平均提升9.21±15.46个百分点),最高可达67.5个百分点,并揭示了所选提示策略在模型和任务间的差异。
🔬 方法详解
问题定义:本文旨在解决大型语言模型提示设计中的人工调整问题,现有方法在提示组合的选择上存在繁琐和易错的痛点。
核心思路:AutoPDL通过将提示优化视为一个结构化的AutoML问题,利用逐步减半技术高效探索提示模式和示例的组合空间,从而自动发现最佳配置。
技术框架:AutoPDL的整体架构包括提示模式库、组合空间探索模块和人机协作优化模块。提示模式库实现了常见的提示模式,组合空间探索模块负责高效导航,而人机协作模块则支持用户对生成的提示进行编辑和优化。
关键创新:AutoPDL的主要创新在于将提示优化问题形式化为AutoML问题,并引入逐步减半策略以提高搜索效率,这与传统的手动调整方法本质上不同。
关键设计:在设计中,AutoPDL使用PDL提示编程语言实现提示模式,确保生成的程序可读、可编辑,并支持人机协作的优化过程。
🖼️ 关键图片
📊 实验亮点
实验结果显示,AutoPDL在三个不同任务和七个大型语言模型上均实现了显著的准确性提升,平均提升9.21个百分点,最高提升达到67.5个百分点,表明其在提示优化方面的有效性和广泛适用性。
🎯 应用场景
该研究的潜在应用领域包括自然语言处理、对话系统和智能助手等。通过自动优化提示配置,AutoPDL可以显著提升大型语言模型在特定任务上的表现,降低人工干预的需求,具有广泛的实际价值和未来影响。
📄 摘要(原文)
The performance of large language models (LLMs) depends on how they are prompted, with choices spanning both the high-level prompting pattern (e.g., Zero-Shot, CoT, ReAct, ReWOO) and the specific prompt content (instructions and few-shot demonstrations). Manually tuning this combination is tedious, error-prone, and specific to a given LLM and task. Therefore, this paper proposes AutoPDL, an automated approach to discovering good LLM agent configurations. Our approach frames this as a structured AutoML problem over a combinatorial space of agentic and non-agentic prompting patterns and demonstrations, using successive halving to efficiently navigate this space. We introduce a library implementing common prompting patterns using the PDL prompt programming language. AutoPDL solutions are human-readable, editable, and executable PDL programs that use this library. This approach also enables source-to-source optimization, allowing human-in-the-loop refinement and reuse. Evaluations across three tasks and seven LLMs (ranging from 3B to 70B parameters) show consistent accuracy gains ($9.21\pm15.46$ percentage points), up to 67.5pp, and reveal that selected prompting strategies vary across models and tasks.