Prompt Engineering Flashcards
What is prompt engineering?
The practice of designing and optimizing prompts to guide a foundation model’s output to meet specific needs.
What are the four key components of an improved prompt?
Instructions, Context, Input Data, and Output Indicator.
What does the ‘Instructions’ block in a prompt specify?
What the task is and how the model should perform it.
What is the role of ‘Context’ in a prompt?
Provides external or situational information to guide the model’s response.
What does ‘Input Data’ refer to in a prompt?
The actual data or content the model should work with or respond to.
What is the purpose of an ‘Output Indicator’ in prompt engineering?
To specify the format or characteristics of the desired output.
What is negative prompting?
A technique where you explicitly instruct the model on what not to include or do in its response.
What does the Temperature parameter control in a language model?
It controls the creativity of the model’s output; lower values result in conservative outputs, higher values increase creativity and diversity.
What does Top P control in a model’s generation process?
It controls the cumulative probability threshold for choosing next-word candidates.
What does a low Top P value (e.g., 0.25) mean?
Only the most likely words that make up 25% of cumulative probability will be considered, leading to more focused output.
What is Top K in prompt optimization?
A limit on the number of top most probable words to consider for output generation.
What is the role of Length in prompt optimization?
It sets the maximum number of tokens the model can generate in the output.
What are Stop Sequences used for?
They define specific tokens that tell the model when to stop generating output.
Which factors affect prompt latency in Amazon Bedrock?
Model size, model type, input token count, and output token count.
Do Temperature, Top P, or Top K affect model latency?
No, they do not influence latency.
How does input token size influence latency?
Larger inputs take more time to process, increasing latency.
How does output length affect latency?
Longer outputs take more time to generate, increasing latency.
What is Zero-Shot Prompting?
A prompting technique where a task is presented to a model without any examples or training; it relies fully on the model’s general knowledge.
What is an example of a Zero-Shot Prompt?
‘Write a short story about a dog that helps solve a mystery.’
What is Few-Shot Prompting?
A technique where a model is given a few examples to guide its response for a similar task.
What is One-Shot Prompting?
A variant of Few-Shot prompting where only one example is provided to guide the model.
What is Chain-of-Thought Prompting?
A technique where a task is broken down into a series of reasoning steps, often using phrases like ‘think step by step.’
What is an example of Chain-of-Thought Prompting?
‘First describe the setting and the dog, then introduce the mystery, next show how the dog discovers clues, and finally solve the mystery.’
Why is Chain-of-Thought Prompting useful?
It improves reasoning, structure, and coherence in the model’s output.