-: What is the difference between prompt engineering
and just simply prompting these models?
Let's start with a naive prompt.
This is something that you might type in
if you want a blog post.
So write a blog post on prompt engineering.
I'm just gonna hit enter and it will do a pretty good job.
And these models are really fantastic.
They get better and better,
and that leads some people to think,
"Eventually we won't need prompt engineering."
But I think that's completely false
because these models are really smart,
but you're not giving 'em any direction here.
This is just a naive prompt.
If 100 people type this in,
they're gonna get 100 very similar sounding blog posts,
and there's not gonna be any real context in there.
There's not gonna be any type of refinement to that prompt,
and you need those sorts of things
in order to get to something really good,
that's human level
because what we don't want is an internet full of blog posts
that are just the default average
of the internet-type response that we get from ChatGPT.
Now, prompt engineering
is really adding a lot of that secret sauce
from your own skill,
as well as testing what works reliably
because if you're gonna be generating one blog post,
it doesn't matter that much.
If you're gonna generate 100 in a day
or 1,000 in a week, then you need prompt engineering
because if 10 in 100 of those 1,000 blog posts are wrong
in some way or require human editing,
you're not really saving yourself that much time.
If you can get them as high quality as possible
just by adapting the prompt template,
and then the higher quality translates
to every single time you run that prompt template.
Let me show you what an engineered prompt might look like.
And this is the prompt
that we're gonna be working through on this course,
and you can see how every part works together,
but you can see there's a lot more information here.
I'm setting a writing style,
I'm using the Hero's Journey framework.
I'm asking it to outline the story for it,
telling it I want a sci-fi-type fantasy post
rather than the generic, average prompt engineering guide
that you see out there.
I'm also providing instructions
to combat specific edge cases that I found
where it's not writing long enough
and we're gonna learn how to do all
of these things and more.
But just wanted to show you
what this type of thing looks like.
Here we have an outline
where it's broken down the whole narrative first.
Then it started to write the blog post,
and you can see that it's writing much longer type text.
So it's writing two paragraphs here for each section
'cause there's gonna be 12 sections
to the hero's journey stages.
Then we're gonna have something like a 1,000
to 2,000-word blog post.
I'm gonna show you how to do this,
how to get to this more complicated prompt iteratively
without taking too much time and effort.
And once you get to this point, you'll be able
to make prompts that are equally as reliable
and get human-level results
because most people when they try ChatGPT
and they say it's not very good,
it's because they just don't know how to ask the right way.
And that's what you're gonna learn here.
We're gonna also dive into image generation as well
because we could do something similar there too.
These principles apply to image generation,
as well as text generation.
So I'm just gonna paste in here create an image
that matches this blog post.
This is the naive way to do it
because we, you know, want just an image
that matches the blog post and we already have a lot
of prompting in the text side,
so it's gonna create a pretty good image.
The cool thing about DALL-E and ChatGPT
is that ChatGPT actually writes the prompt for you,
makes it a bit more sophisticated,
but we might not get the type of image we really want
and we're not really getting very much choice here.
It's just gonna create one image.
So we can see here this is a pretty cool image
and it looks futuristic,
like the sort of thing we're looking at
in terms of the blog posts.
So it does match pretty well.
These are good results straight away.
But a more optimized prompt might be something like this
where I've written my own image prompt,
so I'm just pasting this in here.
I'm asking it to create different matching images
to this blog post and this style.
And I'm talking about solarpunk, which is a type of scene
that I researched and found
that I really like that visual style.
And then talking about what's actually happening
in the image, giving a bit more understanding
of the composition, telling it what's in the background,
all sorts of different things.
Just gonna paste that in here
and then we'll see what type of image we get back.
Cool, so here's the first image.
And you can see it's a very different visual style
and we use prompt engineering to get here.
This is the type of style that I wanted and it's futuristic.
We're futuristic in a very different way,
and you could try different styles
once you realize what words you need to use
to elicit that style from ChatGPT and Dall-E.
That's what you're gonna learn.
It's gonna be transferable across not just text and image,
but also video, audio, really any type
of AI model now and way into the future.