chapter three
3 Prompt Design: Structural Elements
This chapter covers
- The core structural elements of prompts, instructions, context, inputs, output formats, and delimiters.
- Parameterizing prompts with input placeholders and dynamic variables to enable reuse.
- Specifying output structure and applying constraints to guide model responses.
- Using delimiters to organize complex prompts and insulate external context from instructions.
- Combining these elements to build reliable, parseable prompts for specific tasks.
In the earlier chapters, we introduced the concept of Prompt Engineering and explored the technical aspects of transformers and Large Language Models (LLMs) from an AI engineer’s perspective. Now, it is time to introduce the fundamental building blocks of effective prompts: structural elements.
Structural elements are the building blocks of prompts. They increase the likelihood of continuations from training data that align with the specified task or format.
Overview of Structural Elements
Before diving into the details, let us first provide a high-level overview of the key structural elements we will cover in this chapter: