In this video from module 1 of Google Prompting Essentials, you’ll learn how to create effective prompts by following this simple framework: Task, Context, References, Evaluate, Iterate (TCREI). Then, you'll see an example of how to put the framework into action.
About Google Prompting Essentials: Learn how to effectively prompt in 5 easy steps and make AI work for you, with Google Prompting Essentials. No experience necessary.
Taught by AI experts at Google, this self-paced course will teach you how to prompt AI with clear and specific instructions to help with everyday tasks, like building tables and trackers, summarizing lengthy documents, and uncovering patterns from data. Throughout the course, you’ll learn how to use AI responsibly by recognizing biases and errors, and you’ll build a library of reusable and useful prompts. When you complete this course on Coursera, you’ll earn a certificate from Google to share with your network and employer.
What Is the 5-Step Prompt Framework and How Does It Work? | Google Prompting Essentials https://youtu.be/lp-Ft3Ex5_k
In this lesson, you're going to learn how to create effective prompts.
A good prompt follows a simple framework.
Task, context, references, evaluate, and iterate.
If you ever forget a step, just remember, thoughtfully create really excellent inputs.
First is task.
You need to describe the task you want the generative AI tool to help you with.
Now, this should include a persona and a format preference so that the task is specific.
Persona refers to what expertise you want the gen AI tool to draw from.
You can ask the tool to take on a persona like a professional speech writer
or a marketing executive with 15 years of experience.
Or you can ask it to create output for a specific audience, a customer, or even your manager.
You can be as detailed as you'd like when adding a persona to your task.
Format refers to how you want the output to appear,
whether that's a bulleted list, short sentences, or a table.
So there you have it, task.
Next, you'll include context,
or the necessary details to help the gen AI tool understand what you need from it.
This is the difference between writing,
Sometimes you'll add references for the gen AI tool to use while creating its output.
You just asked a gen AI tool to give you ideas for a birthday present, right?
Well, if you add examples of birthday presents you've given in the past as references,
the gen AI tool can give you a more useful output.
There aren't always going to be clear references of what you need,
especially if you're working on something more abstract or searching for ideas and inspiration.
Once you have your output, it's time to evaluate.
Ask yourself if the input you provided gave you the output you needed.
This leads us to the final part of the framework, iterate.
If you evaluate your output and determine that you're not getting what you need,
you can try again by adding more information or tweaking your prompt.
Now this is a key part of prompting effectively,
and we'll explore it in depth later on in the course.
One more note on the framework.
There are plenty of ways to construct an effective prompt.
The order of how you construct a prompt is less important than the substance of the prompt itself.
As long as you're thoughtfully creating really excellent inputs,
your outputs should be great.
Let's put the framework into action.
First, we'll log into Gemini and then use the tool to help us brainstorm ideas
for a new high-performance sneaker line.
First, let's add the task.
Generate five ideas for a new high-performance sneaker line.
Okay, we've asked Gemini to complete a task,
but we're not really applying the prompting framework yet.
Remember, thoughtfully create really excellent inputs.
This prompt is all task and nothing else,
which might give us an output that's too broad and not very useful.
Still, Gemini generated five ideas with unique names and descriptions.
This isn't a bad start, but we can do better.
Let's add some more details like our desired format
and a more specific task for the tool to complete.
List the concepts and materials for each sneaker in an outline.
That's much better.
Now we have a set of unique ideas for a sneaker line
that includes the materials for each shoe and it came in our preferred format.
I think we can do even better, don't you?
Let's add some context.
The sneakers should be made for athletes doing cross-training activities.
With the new information, Gemini created five new sneaker ideas
that are more suited to our specific goals.
Remember, getting tailored outputs means we need to provide a GenAI tool
with more details and context in order to generate more useful results.
Success is all about the details.
So let's give references a try.
References give GenAI tools examples to work from
and that can mean asking a GenAI tool to learn from the tone,
style, or length of a given reference.
Providing multiple references is also known as few-shot prompting.
Shots are just references or examples and the term is used a lot.
There's also single-shot prompting,
which means we're giving it one reference,
and zero-shot prompting, which means we don't give the AI tool any references.
Most of the time, between two and five references is the sweet spot for a GenAI tool.
Too few references and we don't give enough context,
too many we could skew the results and limit creativity.
To practice few-shot prompting with our new sneaker line,
let's include descriptions of shoes that already exist.
One of them is from a budget line of shoes
and the other one has a new adaptive sole.
We can input those descriptions like this.
Keep the five ideas generated,
but refine them using these two examples as references.
Here's where we'll paste in the references.
There's a lot of choices here and they all seem like good options for the task.
And this is cool.
A shoe that regulates temperature.
Evaluating the output and iterating might be the last parts of our prompting framework,
but they're also where we get to experiment and get creative.
Each new output is an opportunity to further refine your prompt
until you get the response you want.
In fact, we've been evaluating and iterating this whole time.
We evaluated the sneaker ideas from our first prompt
and we iterated by adding context.
We evaluated the output again and we iterated by adding references.
And remember, we can always add details or tweak phrasing in order to change our outputs.
We like to say ABI or always be iterating.
Give the prompting framework a try yourself.
Remember, it's always better to start simple
and then slowly add complexity iterating as you go.
If your outputs start to lose quality,
you might need to go back and make your prompts simpler.
And that's okay.
Learning what works and what doesn't is all part of the journey.
If you ever get stuck, just remember to thoughtfully create really excellent inputs
and you'll get back on track.