同时优化提示词准确率与长度,实现高效部署。
MOPrompt: Multi-objective Semantic Evolution for Prompt Optimization
- 基于多目标进化算法,同步优化准确率与上下文长度
- 在葡萄牙语情感分析中,相同准确率下减少31%令牌数
- 适合需要平衡性能与效率的模型部署场景
提示工程对释放大语言模型(LLMs)潜力至关重要。由于手动设计提示复杂且耗时,自动提示优化成为研究热点。然而,现有方法大多只关注单一目标(如准确率),忽视了性能与上下文长度之间的权衡。本文提出MOPrompt,一种多目标进化优化框架,可同时优化提示的准确率与上下文长度(以令牌数衡量)。该框架生成提示解的帕累托前沿,为实际应用提供性能与效率的权衡选择。我们在葡萄牙语情感分析任务上,使用Gemma-2B和Sabiazinho-3模型进行评估。结果表明,MOPrompt显著优于基线框架:对于Sabiazinho模型,在保持最高准确率0.97的前提下,提示长度减少31%。
原文摘要 · Abstract (English)
Prompt engineering is crucial for unlocking the potential of Large Language Models (LLMs). Still, since manual prompt design is often complex, non-intuitive, and time-consuming, automatic prompt optimization has emerged as a research area. However, a significant challenge in prompt optimization is managing the inherent trade-off between task performance, such as accuracy, and context size. Most existing automated methods focus on a single objective, typically performance, thereby failing to explore the critical spectrum of efficiency and effectiveness. This paper introduces the MOPrompt, a novel Multi-objective Evolutionary Optimization (EMO) framework designed to optimize prompts for both accuracy and context size (measured in tokens) simultaneously. Our framework maps the Pareto front of prompt solutions, presenting practitioners with a set of trade-offs between context size and performance, a crucial tool for deploying Large Language Models (LLMs) in real-world applications. We evaluate MOPrompt on a sentiment analysis task in Portuguese, using Gemma-2B and Sabiazinho-3 as evaluation models. Our findings show that MOPrompt substantially outperforms the baseline framework. For the Sabiazinho model, MOPrompt identifies a prompt that achieves the same peak accuracy (0.97) as the best baseline solution, but with a 31% reduction in token length.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。