Prompt engineering for foundational models
Prompt engineering, a cornerstone of generative AI, describes the art of crafting prompts, text, and multimodal inputs that determine the outputs of pre-trained foundational models. Since these models are trained on large datasets and possess pattern recognition and reasoning capabilities, they are able to follow instructions in natural language.
Now think of a seasoned chef: To craft a dish that will make their customers happy, they need to have access to the right ingredients and a good understanding of the tastes, likes, and dislikes of their audience. The prompt is your way of instructing our master chef foundational model.
Figure 2.3: Prompt engineering for LLMs
Good prompts consist of three elements:
- An instruction that specifies the purpose of the AI system
- Examples that set the tone and enable the system to verify if it gets it “right”
- A corpus of information that grounds...