2 Prompt Patterns: Basic Types and Templates
This chapter covers
- The fundamentals of prompt patterns with illustrated examples of using prompts with and without patterns.
- The overview of different prompt patterns, core elements, and relevance in prompt engineering.
- Different types of prompt patterns and their templates with examples of using prompt patterns to guide models to generate accurate and relevant responses.
Constructing effective prompts using prompt patterns and templates with real-world examples. In Chapter 1, we covered the fundamentals of prompt engineering, including the tools and technologies involved, as well as how prompt crafting differs among various language models (LLMs). In Chapter 2, we will build on these foundational concepts by exploring patterns and templates. These strategies are essential for creating more structured and effective prompts that elicit accurate and relevant responses from LLMs.
So, what does a pattern mean when it comes to prompts? At its core, a pattern is a structured approach or a predictable form that can be applied repeatedly to guide responses. Patterns consist of instructions and context intended to enhance accuracy and relevance when generating answers. These patterns serve as frameworks, allowing users to address specific types of tasks or questions with consistent results.