>> In this part of the module, now we're
going to drill into one specific component of a prompt and really look at the power
of it, and that's the power of examples. Now, we've known for a long time
that we can use machine learning and we can train models to go and do tasks. And
everybody assumes that in order to tap
into machine learning, you have to go and train your own model. And that used to be
true, because what
machine learning did was it created models that tended to be very brittle and
narrow. You would create a model and
then you couldn't really reuse it, because the moment you changed some little
bit of the formatting of the data or some slight aspect of the task, suddenly the
machine learning model would break down. So you'd train a model and
then you would try to go use it. You'd realize it doesn't
really work that well. You'd try to go collect more data. You'd try to cleanse your
data further,
do all this work. And so it took a huge amount of work,
because you had to go and really cleanse your data. You had to really spend a lot
of time
on getting your data just right. Now we're going to still see that
we have to care about our data, but not to the same degree that we did before. The
second piece of it was you had to
spend a lot of time training a model in order to go and perform some tasks. And the
model tended to be specific that
to the task you were going to work on. In fact, your whole system had to be
built around that model to perform and do that task that you wanted to do. So it
took a ton of work. You said, okay, I want to predict
course titles for my next course. Man, is that tough, right? You've gotta go and
train a model that has
all this information on course titles that are relevant to what you're doing and
then build an entire software system around it in order to get predictions
of course titles out of it. Really hard, really expensive. That's why you have
teams of data
scientists and AI experts at companies, because for you, as an average user,
you couldn't do that. You had to go get them to build it for
you, and then they handed it off and you got to use it because there was
no reusable way to do that, right? You had to start from scratch every time
they had to build a custom one for you. Now, what's happened with generative AI is
it is a model that is incredibly reusable. It is totally sort of like
this generic platform for doing all kinds of incredible
machine learning tasks. And so we can go and
tap into what it is already learned, and then we can use that model to do all these
tasks without having to retrain it for our task with our data necessarily. Now,
what's amazing is we can
retrain it now in a prompt, and we're going to look at this in this module
of how we go and teach it new tricks. But anybody can teach it new tricks
without having to resort to fine tuning the model where we're actually
changing the weights. Now, people use fine
tuning all kinds of ways. I'm starting to see it used more and
more loosely, basically to mean in context
learning with a prompt. But in general, if you hear somebody
saying they're going to train a new model, they're going to go and
fine tune the model weights. There's a good chance you don't actually
need to do that, that you just need to use in context learning in a big prompt in
order to teach the model new tricks. And what's going to be amazing
is you're going to see that you are capable of doing all these tasks. You don't
have to go and train a custom
model to perform something that would have required a custom model before. In fact,
you just go and
take whatever it is, large language model. Now you want to go use
the frontier models. These are the big models that are out
there, the most advanced models from the key players like anthropic and
OpenAI and Meta. You want to go use those big top tier
models to do this, because those are the ones that are most flexible and
most able to adapt to new tasks. But you don't have to do
anything complex to use them. You just simply go and prompt them. Now, you can go
and use them as they were
trained, and they're immensely capable, but you can also go and
teach them totally new things. And the way you teach them new things
is with examples in the prompt. We go and we drill in on that part
of the prompt that is examples, and we use those examples to teach
it to do new things that previously would have required training
a custom model from scratch. So we use it and give it examples. And the beautiful
thing is the examples
don't even have to be that carefully formatted, and
that was so much work before. We had to really think about
carefully picking apart the data and cleansing it and
getting it in the perfect format. And we don't have to do that now
because these models can pay attention to the data and
figure out important pieces they need. Now, if we give it the wrong data and
we teach it the wrong thing, of course it's still
going to be a problem. But we don't have to worry as much as
about all these little details about formatting and other stuff. So what we're
going to do is first we're
going to look at how we can reuse existing AI capabilities in these models,
existing things that it's learned to do on classic tasks like classification,
prediction, clustering. Then what we're going to do is we're
going to learn how we can train the model in a prompt and
realize that you really are training it. We are doing machine learning through
in-context learning in a prompt. And this is state of the art. It is incredibly
sophisticated,
incredibly powerful. You're not giving up much to do this. In many cases you're
actually going and going to beat out state of
the art if you'd gone and spent a vast fortune to train your own
model, and there's many examples of this. For example, Bloomberg went and trained
their own custom model on their own data. I think it cost $10 million and out of
the
box, GPT-4 was better at those same tasks. So you could go and do really,
really well with what's just there. You just have to know how to
tap into these things and you have to recognize that
you are a data scientist and AI person now that can tap
into those capabilities. And now is probably the time to go and
learn about how the ways you evaluate the outputs, which is going to be
beyond the context of this class or how you use these
different building blocks. But I'm going to get you started, showing
you how to tap into these models as a reusable model that can be used across
a variety of different task types, and then how you can teach it new tasks. How you
can teach it from your data and
all through prompt engineering.