TensorX
返回文献探索

Paper · arXiv 2311.05661

Prompt Engineering a Prompt Engineer

Qinyuan Ye, Maxamed Axmed, Reid Pryzant, Fereshte Khani

22 upvotesNovember 9, 2023arXiv 预印本
AI 摘要

The study develops a meta-prompting technique, PE2, to enhance automatic prompt engineering for large language models, demonstrating improved performance and sophisticated reasoning capabilities across various datasets and tasks.

large language modelsprompt engineeringmeta-promptingstep-by-step reasoning templatecontext specificationbatch sizestep sizemomentumMultiArith datasetGSM8K datasetInstruction Induction benchmarkcounterfactual tasksindustrial prompt

Abstract

Prompt engineering is a challenging yet crucial task for optimizing the performance of large language models (LLMs). It requires complex reasoning to examine the model's errors, hypothesize what is missing or misleading in the current prompt, and communicate the task with clarity. While recent works indicate that LLMs can be meta-prompted to perform automatic prompt engineering, their potentials may not be fully untapped due to the lack of sufficient guidance to elicit complex reasoning capabilities in LLMs in the meta-prompt. In this work, we investigate the problem of "prompt engineering a prompt engineer" -- constructing a meta-prompt that more effectively guides LLMs to perform automatic prompt engineering. We introduce and analyze key components, such as a step-by-step reasoning template and context specification, which lead to improved performance. In addition, inspired by common optimization concepts such as batch size, step size and momentum, we introduce their verbalized counterparts to the meta-prompt and investigate their effects. Our final method, named PE2, finds a prompt that outperforms "let's think step by step" by 6.3% on the MultiArith dataset and 3.1% on the GSM8K dataset. To demonstrate its versatility, we apply PE2 to the Instruction Induction benchmark, a suite of counterfactual tasks, and a lengthy, real-world industrial prompt. In these settings, PE2 achieves strong performance and outperforms prior automatic prompt engineering baselines. Further, we show that PE2 makes meaningful and targeted prompt edits, amends erroneous or incomplete prompts, and presents non-trivial counterfactual reasoning abilities.

北京市昌平区探索星信息技术及软件开发工作室

京ICP备2026059466号