English

AutoPDL: Automatic Prompt Optimization for LLM Agents

Machine Learning 2025-11-05 v5 Artificial Intelligence Programming Languages

Abstract

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±15.469.21\pm15.46 percentage points), up to 67.5pp, and reveal that selected prompting strategies vary across models and tasks.

Keywords

Cite

@article{arxiv.2504.04365,
  title  = {AutoPDL: Automatic Prompt Optimization for LLM Agents},
  author = {Claudio Spiess and Mandana Vaziri and Louis Mandel and Martin Hirzel},
  journal= {arXiv preprint arXiv:2504.04365},
  year   = {2025}
}

Comments

An earlier version of this paper was published in AutoML 2025 Methods Track. This version adds missing standard deviations in Table 1

R2 v1 2026-06-28T22:48:24.544Z