Saved in:
Bibliographic Details
Main Authors: Wang, Shuyang, Moazeni, Somayeh, Klabjan, Diego
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2501.03508
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929663103729664
author Wang, Shuyang
Moazeni, Somayeh
Klabjan, Diego
author_facet Wang, Shuyang
Moazeni, Somayeh
Klabjan, Diego
contents Designing effective prompts is essential to guiding large language models (LLMs) toward desired responses. Automated prompt engineering aims to reduce reliance on manual effort by streamlining the design, refinement, and optimization of natural language prompts. This paper proposes an optimal learning framework for automated prompt engineering, designed to sequentially identify effective prompt features while efficiently allocating a limited evaluation budget. We introduce a feature-based method to express prompts, which significantly broadens the search space. Bayesian regression is employed to utilize correlations among similar prompts, accelerating the learning process. To efficiently explore the large space of prompt features for a high quality prompt, we adopt the forward-looking Knowledge-Gradient (KG) policy for sequential optimal learning. The KG policy is computed efficiently by solving mixed-integer second-order cone optimization problems, making it scalable and capable of accommodating prompts characterized only through constraints. We demonstrate that our method significantly outperforms a set of benchmark strategies assessed on instruction induction tasks. The results highlight the advantages of using the KG policy for prompt learning given a limited evaluation budget. Our framework provides a solution to deploying automated prompt engineering in a wider range applications where prompt evaluation is costly.
format Preprint
id arxiv_https___arxiv_org_abs_2501_03508
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle A Sequential Optimal Learning Approach to Automated Prompt Engineering in Large Language Models
Wang, Shuyang
Moazeni, Somayeh
Klabjan, Diego
Computation and Language
Designing effective prompts is essential to guiding large language models (LLMs) toward desired responses. Automated prompt engineering aims to reduce reliance on manual effort by streamlining the design, refinement, and optimization of natural language prompts. This paper proposes an optimal learning framework for automated prompt engineering, designed to sequentially identify effective prompt features while efficiently allocating a limited evaluation budget. We introduce a feature-based method to express prompts, which significantly broadens the search space. Bayesian regression is employed to utilize correlations among similar prompts, accelerating the learning process. To efficiently explore the large space of prompt features for a high quality prompt, we adopt the forward-looking Knowledge-Gradient (KG) policy for sequential optimal learning. The KG policy is computed efficiently by solving mixed-integer second-order cone optimization problems, making it scalable and capable of accommodating prompts characterized only through constraints. We demonstrate that our method significantly outperforms a set of benchmark strategies assessed on instruction induction tasks. The results highlight the advantages of using the KG policy for prompt learning given a limited evaluation budget. Our framework provides a solution to deploying automated prompt engineering in a wider range applications where prompt evaluation is costly.
title A Sequential Optimal Learning Approach to Automated Prompt Engineering in Large Language Models
topic Computation and Language
url https://arxiv.org/abs/2501.03508