21 Feb 2023 | Jules White, Quchen Fu, Sam Hays, Michael Sandborn, Carlos Olea, Henry Gilbert, Ashraf Elnashar, Jesse Spencer-Smith, and Douglas C. Schmidt
This paper introduces a catalog of prompt engineering techniques, presented in pattern form, to enhance the interaction and output generation capabilities of large language models (LLMs) such as ChatGPT. Prompt patterns are designed to solve common problems in conversing with LLMs, providing reusable solutions for output customization, error identification, prompt improvement, interaction, and context control. The paper contributes to the field by:
1. **Framework for Structuring Prompts**: It provides a framework for documenting and adapting prompt patterns to different domains, enhancing the reusability and transferability of prompts.
2. **Catalog of Prompt Patterns**: It presents 16 successful prompt patterns that have been applied to improve LLM conversations, including:
- **Meta Language Creation**: Allows users to create custom languages for LLMs.
- **Output Automater**: Generates scripts to automate tasks based on LLM outputs.
- **Flipped Interaction**: Instructs LLMs to ask questions to gather information.
- **Persona**: Assigns specific perspectives or roles to LLMs.
- **Question Refinement**: Refines user questions to improve LLM responses.
- **Alternative Approaches**: Provides alternative solutions to tasks.
- **Cognitive Verifier**: Suggests follow-up questions to refine understanding.
- **Refusal Breaker**: Encourages LLMs to rephrase or break refusals.
- **Infinite Generation**: Continuously generates content without user intervention.
- **Context Manager**: Controls the contextual information LLMs operate within.
3. **Evaluation and Consequences**: The paper discusses the evaluation of prompt patterns, including their structure, key ideas, and potential consequences, such as the need for ambiguity-free notation and the importance of concrete automation artifacts.
The paper emphasizes the importance of effective prompt engineering in enhancing LLMs' capabilities and provides a comprehensive catalog of patterns to guide users in structuring and adapting prompts for various software development tasks.This paper introduces a catalog of prompt engineering techniques, presented in pattern form, to enhance the interaction and output generation capabilities of large language models (LLMs) such as ChatGPT. Prompt patterns are designed to solve common problems in conversing with LLMs, providing reusable solutions for output customization, error identification, prompt improvement, interaction, and context control. The paper contributes to the field by:
1. **Framework for Structuring Prompts**: It provides a framework for documenting and adapting prompt patterns to different domains, enhancing the reusability and transferability of prompts.
2. **Catalog of Prompt Patterns**: It presents 16 successful prompt patterns that have been applied to improve LLM conversations, including:
- **Meta Language Creation**: Allows users to create custom languages for LLMs.
- **Output Automater**: Generates scripts to automate tasks based on LLM outputs.
- **Flipped Interaction**: Instructs LLMs to ask questions to gather information.
- **Persona**: Assigns specific perspectives or roles to LLMs.
- **Question Refinement**: Refines user questions to improve LLM responses.
- **Alternative Approaches**: Provides alternative solutions to tasks.
- **Cognitive Verifier**: Suggests follow-up questions to refine understanding.
- **Refusal Breaker**: Encourages LLMs to rephrase or break refusals.
- **Infinite Generation**: Continuously generates content without user intervention.
- **Context Manager**: Controls the contextual information LLMs operate within.
3. **Evaluation and Consequences**: The paper discusses the evaluation of prompt patterns, including their structure, key ideas, and potential consequences, such as the need for ambiguity-free notation and the importance of concrete automation artifacts.
The paper emphasizes the importance of effective prompt engineering in enhancing LLMs' capabilities and provides a comprehensive catalog of patterns to guide users in structuring and adapting prompts for various software development tasks.