Automatic Prompt Optimization with ‘Gradient Descent’ and Beam Search

要約

タイトル:Gradinet Descentとビームサーチを用いた自動プロンプト最適化

要約:

– 大規模言語モデル(LLMs)は一般的な目的のエージェントとして印象的なパフォーマンスを示していますが、その能力は手作業で書かれたプロンプトに強く依存しています。
– 我々は、トレーニングデータとLLM APIへのアクセスを前提として、Prompt Optimization(APO)と呼ばれる機能に対するシンプルで非パラメトリックな解決策を提案しています。
– このアルゴリズムは、「自然言語の勾配」を形成するためにデータの最小バッチを使用して、現在のプロンプトを批判することができます。その後、プロンプトを勾配の逆方向に編集することで勾配をプロンプトに「伝播」させます。
– ビームサーチとバンディット選択手順によって導かれるこれらの勾配降下ステップは、アルゴリズムの効率を大幅に改善します。
– 3つのベンチマークNLPタスクとLLM jailbreak検出の新しい問題を通じて、自動プロンプト最適化がプロンプト編集技術を上回り、データを使用して曖昧なタスクの説明をより明確な注釈指示に書き直すことで、初期プロンプトのパフォーマンスを最大31%向上させることができます。

要約(オリジナル)

Large Language Models (LLMs) have shown impressive performance as general purpose agents, but their abilities remain highly dependent on prompts which are hand written with onerous trial-and-error effort. We propose a simple and nonparametric solution to this problem, Automatic Prompt Optimization (APO), which is inspired by numerical gradient descent to automatically improve prompts, assuming access to training data and an LLM API. The algorithm uses minibatches of data to form natural language “gradients” that criticize the current prompt. The gradients are then “propagated” into the prompt by editing the prompt in the opposite semantic direction of the gradient. These gradient descent steps are guided by a beam search and bandit selection procedure which significantly improves algorithmic efficiency. Preliminary results across three benchmark NLP tasks and the novel problem of LLM jailbreak detection suggest that Automatic Prompt Optimization can outperform prior prompt editing techniques and improve an initial prompt’s performance by up to 31\%, by using data to rewrite vague task descriptions into more precise annotation instructions.

arxiv情報

著者 Reid Pryzant,Dan Iter,Jerry Li,Yin Tat Lee,Chenguang Zhu,Michael Zeng
発行日 2023-05-04 15:15:22+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, OpenAI

カテゴリー: cs.AI, cs.CL, cs.LG パーマリンク