Automatic Prompt Selection for Large Language Models

Viet-Tung Do, Van-Khanh Hoang, Duy-Hung Nguyen, Shahab Sabahi, Jeff Yang +3 more
4/3/2024
cs.CLcs.LG

No confident code implementation found for this paper. 4 possible matches can be shown below.

Abstract

Large Language Models (LLMs) can perform various natural language processing tasks with suitable instruction prompts. However, designing effective prompts manually is challenging and time-consuming. Existing methods for automatic prompt optimization either lack flexibility or efficiency. In this paper, we propose an effective approach to automatically select the optimal prompt for a given input from a finite set of synthetic candidate prompts. Our approach consists of three steps: (1) clustering the training data and generating candidate prompts for each cluster using an LLM-based prompt generator; (2) synthesizing a dataset of input-prompt-output tuples for training a prompt evaluator to rank the prompts based on their relevance to the input; (3) using the prompt evaluator to select the best prompt for a new input at test time. Our approach balances prompt generality-specificity and eliminates the need for resource-intensive training and inference. It demonstrates competitive performance on zero-shot question-answering datasets: GSM8K, MultiArith, and AQuA.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 4 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{do2024automatic,
  title  = {Automatic Prompt Selection for Large Language Models},
  author = {Viet-Tung Do and Van-Khanh Hoang and Duy-Hung Nguyen and Shahab Sabahi and Jeff Yang and Hajime Hotta and Minh-Tien Nguyen and Hung Le},
  year   = {2024},
  eprint = {2404.02717},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2404.02717v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2404.02717.svg)](https://codeofpaper.com/paper/2404.02717)

Discussion