The webpage outlines categories of prompt patterns used in prompt engineering to enhance the interaction and output quality when working with large language models (LLMs).
Abstract
The article introduces the concept of prompt engineering through prompt patterns, categorizing them into Input Semantics, Output Customization, Error Identification, Prompt Improvement, Interaction, and Context Control. Each category is designed to improve specific aspects of the communication between users and LLMs, such as understanding user input, tailoring output, identifying errors, enhancing prompt quality, managing conversation flow, and controlling contextual relevance. The author emphasizes the importance of these patterns in guiding LLMs to produce more accurate and relevant responses, and previews upcoming articles that will delve into each pattern individually.
Opinions
The author suggests that understanding these prompt pattern categories is crucial for effective use of LLMs.
They imply that creating a meta language can simplify complex ideas for LLMs without being overly complicated.
The article posits that LLMs can generate incorrect outputs and need patterns to help with fact-checking and introspection.
It is noted that the quality of the output from LLMs is directly related to the quality of the input prompt, suggesting a need for iterative prompting techniques.
The author indicates that interaction patterns can alter the default conversational style of LLMs to achieve better understanding and outcomes.
The article conveys that controlling contextual information can significantly influence the relevance and accuracy of LLM responses.
Prompt Engineering Via Prompt Patterns — Categories Of Prompt Patterns
You might consider it putting cart before the horse but lets quickly glance over the categories of prompt patterns before discussing individual prompt patterns.
You can switch to video version of this article
The patterns can be classified in following categories Input Semantics, Output Customization, Error Identification, Prompt Improvement, Interaction and context control. Its best to know the name and some information about these and they would start to make sense once we go over the constituent patterns of each.
The categories followed by name of patterns that constitute that category are listed below
Input Semantics
Meta language creation pattern
Output customization
Output automater pattern
Persona pattern
Visualization Generator pattern
Recipe pattern
Template pattern
Error identification
Fact check list pattern
Reflection pattern
Prompt improvement
Question refinement pattern
Alternative approaches pattern
Cognitive verifier pattern
Refusal breaker pattern
Interaction
Flipped interaction pattern
Game play pattern
Infinite generation pattern
Context control
Context manager pattern
Let’s go over each individual category and its description now
Input Semantics Category
Input semantics category deals with how the large language model understands the input and how it translates that input into something that it can use to generate output. Mouthful? Well the pattern Meta language creation that makes up this category focuses on creating a custom language for LLM to understand. And no this is no rocket science and you would be the one doing so. Just hang on.
For now just remember that you create a meta language when the input language is ill suited for expressing ideas you want to convey to the model.
Output customization
As the name suggests, this category of patterns focuses on constraining or tailoring the types, formats, structure or other properties of the output generated by the LLM. I’ll avoid discussing individual patterns here since they might confuse you at this stage.
Error identification category
Error identification category focuses on identifying and resolving errors in the generated output. The patterns in this category force LLM to fact check and introspect its output to identify any errors.
For now just note that LLMs do not always produce correct output rather can miserably fail solving intermediate level mathematical problems, and need to be instructed to verify their output. The patterns in this cateogory help you instruct in a meaningful way.
Prompt improvement category
Prompt improvement category focuses on improving quality of input and output, and remember the output quality is proportional to input quality. Various patterns in this category equip you to improve the quality of input you specify in the initial prompt.
They are a kind of iterative prompting technique where ChatGPT actively helps you in coming up with a better prompt than before so that it can generate a better output than before.
Interaction category
Interaction category focuses on interaction between you, the user and LLM. The patterns program LLM to steer the conversation with you in a different than default style so that end goal of intended output is achieved. Lets say the flipped interaction causes ChatGPT to ask you questions to understand you and your intent better.
Context control category
Context control category focuses on controlling the contextual information in which the model operates and also alter the context of output e.g. you want to know about aero planes used in WW2 so you instruct it to leave the details of passenger aircraft out of its response.
This is it for prompt pattern categories. We’ll start with individual patterns in upcoming articles. Please clap/share if you liked the content. Thank you!!!