A Sample example of:
Prompt Engineering best
practices.
Here is a sample example illustrating some prompt
engineering best practices:
Scenario: You want to generate a short product description for a
new type of smartwatch aimed at fitness enthusiasts.
Ineffective Prompt: "Write a product description for a
smartwatch."
This prompt is too vague and doesn't provide enough context
for the model to generate a useful and targeted description.
Better Prompt: "Here are some key features of the new
FitTech PowerWatch for fitness enthusiasts:
- Continuous
heart rate monitoring
- GPS
and workout tracking for running, cycling, hiking etc.
- Waterproof
up to 50m for swimming
- 5-day
battery life
- Lightweight
at just 40g
Using those details, write a compelling and concise product
description for the FitTech PowerWatch, highlighting its key fitness and
activity tracking capabilities. Keep the description around 4-5 sentences
long."
This improved
prompt:
- Sets
the context by providing relevant product details and the target audience.
- Gives
an example of the desired output format/length.
- Specifies
the tone (compelling, concise) and focus (fitness/activity).
- Provides
clear instructions on what to include in the description.
This allows the model to generate a more tailored and useful
product description, such as:
"The new FitTech PowerWatch is the ultimate fitness
companion. Stay motivated with continuous heart rate tracking, GPS mapping for
all your workouts, and advanced activity metrics - whether running, cycling or
hiking. This featherweight smartwatch is waterproof to 50m for swim tracking
yet lasts up to 5 days on a single charge. Power through your fitness goals
effortlessly."
By including the right prompt components like context,
examples, instructions, and output specifications, you can greatly improve the
quality and relevance of model-generated text. Iterating prompts with
techniques like this is considered a prompt engineering best practice.
Comments
Post a Comment