2 Prompt Engineering with Foundational Models on AWS

 

This chapter covers

  • An overview of prompt engineering
  • Understanding how to craft effective prompts for your own use cases
  • Using zero-, one- and few-shot inference
  • Working with parameters for foundational models
  • Experimenting with prompt engineering using playgrounds provided by AWS

Being able to communicate what you would like to achieve with the foundational models that you are working with is imperative to build solutions with them. This chapter explores the intricate world of prompt engineering in Amazon Bedrock, offering you a look at harnessing the full potential of the models there.

2.1 Understanding how to Craft Good Prompts

2.1.1 Best Practices in Crafting Good Prompts

2.1.2 Advanced Techniques

2.1.3 Tackling Malintent in Prompts

2.1.4 Evaluating Prompt Performance

2.2 Learning About Zero-, one- and few-shot inference

2.2.1 Zero-Shot Inference

2.2.2 One-Shot Inference

2.2.3 Few-Shot Inference

2.3 Configuring Your Amazon Bedrock Environment

2.4 Working with Parameters for Foundational Models

2.4.1 Controlling Randomness and Diversity of Responses

2.4.2 Controlling Length

2.4.3 Controlling Repetition

2.4.4 Cost-Optimization based on Prompting

2.5 Experimenting with Playgrounds Provided by AWS

2.5.1 Amazon Bedrock Playground

2.5.2 PartyRock

2.6 Practical Exercise: Finding the Right Prompt

2.7 Summary