arXiv:2504.16005cs.CLcs.AI2025-04被引 5

CAPO让提示优化更省钱,自动找好提示还省计算量

CAPO: Cost-Aware Prompt Optimization

  • 用进化算法+自动机器学习,智能筛选最优提示
  • 在15个任务中11次胜出,最高准确率提升21个百分点
  • 适合资源有限但想高效优化提示的研究者或工程师

大语言模型(LLMs)通过提示词解决各类任务,但性能高度依赖提示设计。现有自动提示优化方法需大量LLM调用和输入 tokens,成本高昂。本文提出CAPO(Cost-Aware Prompt Optimization),一种融合AutoML的进化式优化算法,通过竞赛机制减少评估次数,多目标优化平衡效果与提示长度。同时优化指令和少样本示例,并利用任务描述增强鲁棒性。在多个数据集和LLM上的实验表明,CAPO在15组对比中11次优于当前最优离散提示优化方法,最高准确率提升21%p;在小预算下即表现更优,通过竞赛机制节省评估次数,长度惩罚项降低平均提示长度。即使不使用少样本示例,其性能仍超过对手,且对初始提示不敏感。该方法显著提升了提示优化的成本效率与可及性。

原文摘要 · Abstract (English)

Large language models (LLMs) have revolutionized natural language processing by solving a wide range of tasks simply guided by a prompt. Yet their performance is highly sensitive to prompt formulation. While automatic prompt optimization addresses this challenge by finding optimal prompts, current methods require a substantial number of LLM calls and input tokens, making prompt optimization expensive. We introduce CAPO (Cost-Aware Prompt Optimization), an algorithm that enhances prompt optimization efficiency by integrating AutoML techniques. CAPO is an evolutionary approach with LLMs as operators, incorporating racing to save evaluations and multi-objective optimization to balance performance with prompt length. It jointly optimizes instructions and few-shot examples while leveraging task descriptions for improved robustness. Our extensive experiments across diverse datasets and LLMs demonstrate that CAPO outperforms state-of-the-art discrete prompt optimization methods in 11/15 cases with improvements up to 21%p in accuracy. Our algorithm achieves better performances already with smaller budgets, saves evaluations through racing, and decreases average prompt length via a length penalty, making it both cost-efficient and cost-aware. Even without few-shot examples, CAPO outperforms its competitors and generally remains robust to initial prompts. CAPO represents an important step toward making prompt optimization more powerful and accessible by improving cost-efficiency.

提示优化高效训练AutoML

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。