-: Hey guys, gonna take you through the worksheet
that you can use to apply the prompt engineering principles.
So this is something I use as a checklist.
I start with my naive prompt,
something that is relatively simple that I'm happy with,
it gets decent results, and then I start to iterate.
And this is only really important to do
if you're gonna be using this prompt again and again.
If it's just a throwaway thing,
then you know you're doing it for one task,
just talk to chatGPT, do a couple of iterations.
This is really, if it's a serious prompt
that you're gonna use multiple times
and you need to optimize it.
So start with the naive prompt.
And in this case, the prompt is,
can I have a list of product names?
In this case, the prompt is, can I have a list
of product names for a pair of shoes that fit any shoe size?
So I've come up with this amazing product,
a pair of shoes that can fit any shoe size,
and I'm trying to brainstorm product names.
And see here that there are a couple
of things wrong with this prompt.
First of all, it gives us this boilerplate text
at the beginning that we don't really want.
Then we have an arbitrating list, like it's numbered by 10,
but sometimes you get comma separated,
sometimes you get a different number of names.
It really just depends.
And this isn't really reliable enough
if you're gonna be using this again and again.
So if I'm just coming up with this one product name,
that's one thing.
But if I'm gonna be doing it for lots of different products,
that's another and I need to make the prompt
more robust, right?
So let me copy and paste the response in there
and that usually this is what I do.
I keep track of what the responses are
so I can see how they've changed.
The next thing I've done here is I've just structured
the prompt a little bit and in this case I've asked it
for product names still, but I've given these seed words
and seed words doesn't mean anything in particular.
It's a magic word or anything for chatGPT,
but it's just really a way for me to give a couple of words
that I like and that it can go off,
but I'm still leaving it open for creativity.
So let's see what we get back.
You can see it's recognized
that I've given it some seed words
and it's given me names that are closer to those seed words.
So you can see I've had omni-fit in here
that they came back with OmniFit Walkers.
Just gonna paste that in. And that's already looking better.
It's given me some direction.
I can specify by changing the seed words,
what type of names I like,
and it's gonna gimme names of this sort.
All right, so next thing I wanted to do
is specify the format.
And in this case it's unclear because I've just put a colon
and it could put whatever it wants afterwards.
So it's still giving me the numbers.
But I want something like this.
I want a comma separated list.
What I've done here, I created a new session
and I've just put in a previous example
and I've shown the comma separated list
in that previous example.
You can see that we're still
not really following the format.
So we're gonna have to continue to improve that
by adding another example.
So I'm just gonna copy that in.
And sometimes it works, sometimes it doesn't.
The other path we can take here is rather than just
showing it, we can actually specify and say,
give me a comma separated list.
But lemme just add this other example
because that's the third principle is adding examples.
And I find that the more examples you add,
the better the results in general.
Okay, in this case, it has decreased
the number of names here,
but it hasn't given me this specific
comma separated list that I asked for.
And so what I'm gonna do is I'm gonna edit that,
say list product names separated, say brainstorm.
And here we go. That's much.
So what we're gonna do is we're gonna copy this prompt
and we're gonna change it,
but based on the previous plan that we had, again,
we're gonna add that next one planning to as well.
You can see that we iterate through this work time. Okay?
So now we have our first really decent response
that's more reliable and we don't wanna go over the top
with examples because one, it takes some time
and some costs for me to add to come up with new examples.
But the other thing is that it's gonna take up token space.
So if we're gonna put this into a product name generator
type product, then if we add too many examples,
that's gonna cost us more tokens when we're
running it through the API.
So that's another good reason to not, you know,
add too many examples.
The other thing is it can constrain
the creativity a little bit.
You can see here I have a lot of Apple type product names.
It's iShake, iSmoothie, iShake mini.
This is reminiscent of how Steve Jobs would name it.
And it has learned a little bit from that.
But if I put a lot of examples with the I in front of it,
if I add additional examples, then it might not,
it might just always provide that
and it wouldn't come up with these more interesting names,
like Versa Shoe or AnyFit.
Okay, cool.
Then the next thing we want to do is just see
how many examples we need to give it for it to start
very specifically using the I in front of every name.
If we add a couple more products in here,
we tried with two examples and it didn't give the name,
but with I, we can say refrigerator that dispenses beer.
And say like bar, say iBarFridge.
iFridgeBeer, and iDrink Fridge.
Right, now let me see if it now comes back with,
yeah, here we go.
By adding an additional example, we're starting to get,
you know, more of the names are coming back with I thing.
As you can see, it's starting to constrain the creativity
and we want to test to see how often that happens.
So if we run it out again, two outta three again,
we run that again, it's two outta three again.
Run that again.
Okay, see now it's given us a bigger list of names
and actually only one outta three.
So we can start to test this.
You see, this is the level where you start
to get into production when you're working
with prompt engineering.
And it comes as something where it's really important
to test how often it fails.
And the failure case here could be,
if we always want the name to be Steve Jobs style,
then we might need to add more examples in order
to make sure it always does this.
We can see that we had just added one more example
and it wasn't more reliable.
We can run that again, but it wasn't reliable enough.
And here we go, we just have one with the Steve Jobs,
iFitShoe had the Steve Jobs style.
So that's an important part of this.
And when you start to use a prompt in production,
like whether it's something that you're using daily
for your work or something you're gonna
incorporate into a product,
this is the step that starts to get really important.
Evaluating the quality.
Lemme just go back and take the typical example here.
Alright, so we're getting much, much closer.
You can see we're working through and we can also test now
whether this wording makes sense.
We can test adding more examples
and we can test changing the product data style
as well if we want.
Now the final one is dividing labor.
And this is where we start to build a system
or a chain rather than specifically one prompt.
And we usually can't do everything at one prompt.
Like I have a list of names now,
but I'm not sure which ones are good.
Normally a human would do that
and we've already come up with three good names here.
But yeah, we're going to put this extra prompt here.
This is a follow one
and it's gonna rate the prompts, the names for us, you know,
it's come up with the product names from before
and then it's rated them based on catchiness,
uniqueness, and simplicity.
So again, this is another prompt,
this is a follow up prompt.
We want to be testing this too, right?
So one of the things we wanna test for
is it rating them consistently.
So iFitShoe was rated fours across the board.
Let's run it again.
4, 3, 4. Not fully consistent.
4, 3, 4. 4, 3, 4. That is interesting.
It does seem relatively consistent
that it's rating at 4, 3, 4.
That's close enough for me to use this scale.
If we were getting really different results every time,
that's proof that their AI doesn't actually know how
to rate them consistently.
And I find that with GT4,
it is a pretty consistent rate too, whereas as GT3.5,
you cannot find.
And to copy this across.
And this is the final response here.
And then based on the ratings
we could choose which one is best and it looks like
Omni Fit Walk is the best one based on these ratings.
Cool. Hopefully that gives you an idea of how to work
through these principles
and how I use them on a day-to-day basis.
I start with that naive prompt
and 80% of the time that's fine.
But then if I'm gonna be using the prompt in production,
I start to work down the list until I get it really robust.
And I might be doing this actually with code
rather than in chatGPT specifically.
You know, you don't have to be technical to do this process,
it's just a case of retrying, retrying, testing what works,
and making changes and then seeing
what gives you reliable results that you actually want.
And that's the important thing with this type of work
because if you know the right way to ask,
you can get it to do pretty much anything.