Papers › CAPO: Cost-Aware Prompt Optimization

CAPO: Cost-Aware Prompt Optimization

22 Apr 2025arXiv:2504.16005archive 2025-07-28

Tom Zehle, Moritz Schlager, Timo Heiß, Matthias Feurer

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 automated 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. 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.

PaperPDFCode

Code

finitearth/capo officialmentioned in papermentioned on GitHub report
finitearth/promptolution officialmentioned in papermentioned on GitHubApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Tasks

Arithmetic ReasoningAutoMLSentiment AnalysisSubjectivity AnalysisText Classification

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Arithmetic Reasoning GSM8K Llama-3.3-70B + CAPO Accuracy 73.73 #94 of 164 Archive leaderboard report
Arithmetic Reasoning GSM8K Mistral-Small-24B + CAPO Accuracy 65.07 #110 of 164 Archive leaderboard report
Arithmetic Reasoning GSM8K Qwen2.5-32B + CAPO Accuracy 60.2 #116 of 164 Archive leaderboard report
Sentiment Analysis SST-5 Fine-grained classification Llama-3.3-70B + CAPO Accuracy 62.27 #1 of 31 Archive leaderboard report
Sentiment Analysis SST-5 Fine-grained classification Mistral-Small-24B + CAPO Accuracy 60.2 #30 of 31 Archive leaderboard report
Sentiment Analysis SST-5 Fine-grained classification Qwen2.5-32B + CAPO Accuracy 59.07 #31 of 31 Archive leaderboard report
Subjectivity Analysis SUBJ Llama-3.3-70B + CAPO Accuracy 91.6 #16 of 19 Archive leaderboard report
Subjectivity Analysis SUBJ Qwen2.5-32B + CAPO Accuracy 91 #17 of 19 Archive leaderboard report
Subjectivity Analysis SUBJ Mistral-Small-24B + CAPO Accuracy 81.67 #19 of 19 Archive leaderboard report
Text Classification AG News Llama-3.3-70B + CAPO Error 11.2 #21 of 24 Archive leaderboard report
Text Classification AG News Qwen2.5-32B + CAPO Error 12.93 #22 of 24 Archive leaderboard report
Text Classification AG News Mistral-Small-24B + CAPO Error 15.7 #24 of 24 Archive leaderboard report
Text Classification Bala-Copa Qwen2.5-32B + CAPO Accuracy 98.47 #1 of 3 Archive leaderboard report
Text Classification Bala-Copa Llama-3.3-70B + CAPO Accuracy 98.27 #2 of 3 Archive leaderboard report
Text Classification Bala-Copa Mistral-Small-24B + CAPO Accuracy 95.13 #3 of 3 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections