Prompt Engineering Flashcards
Prompt Engineering
The practice of developing, designing, and optimizing prompts to enhance the output of FMs for your needs
Enhanced Prompting
Prompt Engineering technique where you provide Instructions, Context, Input Data, and Output Indicators
Naive prompts can be vague and open-ended to interpretation; this technique helps greatly focus the FM on your desired output
Negative Prompting
Prompt Engineering technique where you explicitly instruct the model on what not to include or do in its response
Avoid unwanted content, such as irrelevant or inappropriate content
Maintain focus; model stays on topic and does not stray into areas that aren’t useful or desired
Enhance clarity; prevents use of complex terms or detailed data if you wish
System Prompts
Prompt Performance Optimization for Bedrock that determines how the model should behave and reply
You provide a small prompt instructing the model how to behave
Temperature
Prompt Performance Optimization for Bedrock that determines the creativity of the model’s output
Ranges from 0 to 1; the higher the value, the more diverse, creative, and unpredictable the output
Higher values can also lead to less coherence; lower values will focus on the most likely responses
Top P
Prompt Performance Optimization for Bedrock that determines which range of words are used
Ranges from 0 to 1; the higher the value, the broader the range of words that the model can use
Values represent the X% most likely words to be used; lower values will be more coherent
Top K
Prompt Performance Optimization for Bedrock that limits the number of probable words
Unlimited range; lower numbers means less probable words but more coherent responses
Length
Prompt Performance Optimization for Bedrock that determines the maximum size of the answer
Stop Sequences
Prompt Performance Optimization for Bedrock representing tokens that signal the model to stop generating output
Prompt Latency
Bedrock property that determines how fast the model responds
Impacted by model size, model type, and # of tokens in input/output; more tokens means slower responses
Not affected by Temperature, Top P, or Top K
Zero-Shot Prompting
Prompt Engineering technique where you present a task to the model without providing examples or explicit training for that specific task
You fully rely on the model’s general knowledge
The larger and more capable the FM, the more likely you’ll get good results
Few-Shots Prompting
Prompt Engineering technique where you provide some examples of a task to a model to guide its output
If you have existing examples/samples, you can feed them to your model to help focus it on your task
AKA One-Shot Prompting if only one example is provided
Chain Of Thought Prompting
Prompt Engineering technique where you divide the task into a sequence of reasoning steps, leading to more structure and coherence
Use sentences like “think step by step” to structure the model’s response output
Helpful when solving problems, as a human usually requires several steps
Can be combined with Zero-Shot or Few-Shots Prompting
Retrieval-Augmented Generation
Prompt Engineering technique where you combine the model’s capability with external data to generate more informed and context-rich responses
Initial prompt is augmented with external information
Prompt Templates
Prompt Engineering technique that simplifies and standardizes process of generating prompts
Helps with processing user input text and output prompts; orchestrates between FM, action groups, and knowledge bases; formats and returns responses to users
You can also provide examples with Few-Shots Prompting to improve the model performance
These can be used with Bedrock Agents