ChatPaper.aiChatPaper

Prompt Engineering eines Prompt Engineers

Prompt Engineering a Prompt Engineer

November 9, 2023
Autoren: Qinyuan Ye, Maxamed Axmed, Reid Pryzant, Fereshte Khani
cs.AI

Zusammenfassung

Prompt Engineering ist eine anspruchsvolle, aber entscheidende Aufgabe, um die Leistung großer Sprachmodelle (LLMs) zu optimieren. Es erfordert komplexes Denken, um die Fehler des Modells zu analysieren, Hypothesen darüber aufzustellen, was in der aktuellen Eingabeaufforderung fehlt oder irreführend ist, und die Aufgabe klar zu kommunizieren. Obwohl aktuelle Arbeiten darauf hindeuten, dass LLMs durch Meta-Prompting automatisches Prompt Engineering durchführen können, wird ihr Potenzial möglicherweise nicht vollständig ausgeschöpft, da es an ausreichender Anleitung mangelt, um die komplexen Denkfähigkeiten der LLMs im Meta-Prompt zu aktivieren. In dieser Arbeit untersuchen wir das Problem des "Prompt Engineerings eines Prompt Engineers" – die Konstruktion eines Meta-Prompts, der LLMs effektiver dazu anleitet, automatisches Prompt Engineering durchzuführen. Wir führen Schlüsselkomponenten ein und analysieren sie, wie z. B. eine Schritt-für-Schritt-Denkvorlage und Kontextspezifikation, die zu einer verbesserten Leistung führen. Darüber hinaus führen wir, inspiriert von gängigen Optimierungskonzepten wie Batch-Größe, Schrittweite und Momentum, deren verbalisierte Gegenstücke in den Meta-Prompt ein und untersuchen ihre Auswirkungen. Unsere endgültige Methode, genannt PE2, findet eine Eingabeaufforderung, die "let's think step by step" um 6,3 % auf dem MultiArith-Datensatz und um 3,1 % auf dem GSM8K-Datensatz übertrifft. Um ihre Vielseitigkeit zu demonstrieren, wenden wir PE2 auf den Instruction Induction Benchmark, eine Reihe von kontrafaktischen Aufgaben und eine umfangreiche, reale industrielle Eingabeaufforderung an. In diesen Kontexten erzielt PE2 eine starke Leistung und übertrifft frühere Baselines für automatisches Prompt Engineering. Darüber hinaus zeigen wir, dass PE2 sinnvolle und gezielte Änderungen an Eingabeaufforderungen vornimmt, fehlerhafte oder unvollständige Eingabeaufforderungen korrigiert und nicht-triviale kontrafaktische Denkfähigkeiten aufweist.
English
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.
PDF251December 15, 2024