This paper proposes an effective approach to automatically select the optimal prompt for a given input from a finite set of synthetic candidate prompts. Different from existing methods that are usually costly and lack flexibility, the approach is designed to balance prompt generality-specificity and eliminate the need for resource-intensive training and inference. The 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 new input at test time. The approach demonstrates competitive performance on 5 question-answering datasets, including GSM8K, AQuA, MMLU, and real insurance data.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Automatic Prompt Selection for Large Language Models

  • Viet-Tung Do,
  • Xuan-Quang Nguyen,
  • Van-Khanh Hoang,
  • Duy-Hung Nguyen,
  • Shahab Sabahi,
  • Jeff Yang,
  • Hajime Hotta,
  • Minh-Tien Nguyen,
  • Hung Le

摘要

This paper proposes an effective approach to automatically select the optimal prompt for a given input from a finite set of synthetic candidate prompts. Different from existing methods that are usually costly and lack flexibility, the approach is designed to balance prompt generality-specificity and eliminate the need for resource-intensive training and inference. The 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 new input at test time. The approach demonstrates competitive performance on 5 question-answering datasets, including GSM8K, AQuA, MMLU, and real insurance data.