Skip to content
Home » Vanderbilt University » Generative AI Assistants Specialization » Course 1: Prompt Engineering for ChatGPT » Module 1: Course Introduction

Module 1: Course Introduction

Course Overview


Video: Motivating Example: Building a Meal Plan with a Fusion of Food from Ethiopia and Uzbekistan that is Keto

The speaker is encouraging the audience to think of large language models like ChatGPT as tools that can help them explore and refine their ideas, rather than just generating text or answering questions. They share an example of how they used ChatGPT to create a meal plan that combines Uzbek and Ethiopian cuisine, is keto-friendly, and uses easily accessible ingredients. They then asked ChatGPT to generate Pokémon battle stories to make the meal plan more exciting for their 9-year-old son, and even created a math game to teach him about division with fractions and nutrition.

The speaker highlights how ChatGPT can rapidly prototype and iterate on ideas, taking them from a simple concept to a fully formed plan with multiple components. They demonstrate how ChatGPT can:

  • Generate a meal plan with serving sizes and ingredients
  • Create engaging stories to make the meal plan more appealing
  • Develop a math game to teach nutrition and fractions
  • Even generate code for a web application to play the math game

The speaker encourages the audience to think creatively about how they can use large language models like ChatGPT to explore and refine their own ideas, and to not be limited by what they think is possible.

I want you to think
of ChatGPT and these large language
models as tools that you can use to give
your ideas form, to give your thoughts,
realization. To be able to explore lots of different concepts and be able to refine them over
interactions with the tool. I don’t want you to think
of these tools as something that you use to just write essays or answer
questions that’s really missing the capabilities
of the tools. These are tools that
really allow you to do fascinating things. Now I’m going to try to give
you an example of this. To hopefully motivate you that these tools have immense
capabilities and that those capabilities
can allow you to do things that would be very
difficult to do otherwise. What does a task that I
thought of that would be something that we
can all relate to. I thought about my family and I thought about
this crazy idea. We have this great
restaurant from Uzbekistan, that’s in Nashville. We have a great
restaurant from Ethiopia. We’ve actually got lots of
great Ethiopian restaurants. I thought to myself, what
would it look like to create a meal plan that was
based on a fusion of cuisine from Uzbekistan
and Ethiopia. What would that look
like in the past, I’ve eaten keto, So could
we try to make a keto? Because I still like
to limit my carbs. At the end of the day, realistically, I’m going to have to buy all the
ingredients for this, and they’re not easily accessible at the grocery
store down the street from me, I’m probably not going
to cook the meals. I thought, well,
let’s go to ChatGPT and see if it can help
us with this problem, if it can help us prototype what this meal plan
might look like. I went to ChatGPT and I said, please create a meal plan
for my family that is based on a fusion of food from
Ethiopia and Uzbekistan. I want to eat keto and up
to 2000 calories per day. Pick dishes where
the ingredients are easy to get from an
average US grocery store. Now this is a hard problem. I don’t think that
there’s a human on the planet that can easily
answer this question. If they are, I probably
could not find them. It would probably cost me
too much to hire them, and they certainly
couldn’t do this as fast as I’m about to
get it done for me. I asked ChatGPT had to do this
for me, and ChatGPT says, here’s a sample meal-plan that combines flavors
from Ethiopia and Uzbekistan while also being keto friendly and within a 2000
calorie per day limit, breakfast scrambled eggs
with sauteed onions, tomatoes, and Ethiopian
berbere spice. Now notice what it does. It puts in parentheses, it says made with chili powder, paprika, garlic powder,
ginger, cumin, and coriander. Now what its signaling is, berbere spice is
something you can get at the average
US grocery store. All of these spices
are easy to obtain from a normal US grocery store. Not only is it
answering my question, it’s giving me an
Ethiopian breakfast dish. It’s giving me information
that I’m going to be able to get these spices. Now, I don’t know enough about Ethiopian cuisine
to know if this is a really accurate dish. It may not be, it may be inspired by it
and very Americanized. But I’m still for me and what I’m trying to do this
is pretty impressive. Then goes on to say lunch, Uzbek style lamb kebabs
with grilled vegetables, bell peppers,
zucchini, eggplant, and aside of cucumber and tomato salad dressed with
olive oil and lemon juice. Now you notice all of this
is pretty keto friendly too. Now some people could take
issue with the onions, but it’s a really
good first start of giving this crazy
idea I have form. Now, it may have errors in it, it may not be perfect, but I could go and
work with this and refine it and start
improving it. That’s one of the
things I want you to think about throughout
this course is, don’t think of
this as a one-off. I give it a question. I look at the answer and I say
it’s good or bad, no. I went back to it
and I thought, well, one of the things that I’m
really missing from this is I don’t know how much to eat. I said, Can you give me an
approximate serving size for myself for each dish that is within my
2000 calorie limit. ChatGPT says sure here
are approximate serving sizes for each dish based on a 2000 calorie per day limit. Breakfast scrambled eggs
with sauteed onions, tomatoes and Ethiopian
berbere spice mix. Then it hasn’t
parentheses two eggs, half a cup of onions,
half a cup of tomatoes, one teaspoon of berbere
spice mix served with a side of sliced avocado,
1/4 medium avocado. It goes on to give
me now serving sizes for each of these
different dishes. Now, again, I didn’t go
and I didn’t take it into some calorie
calculator and look at the macros and check if
it really fit my diet. Because I was just fascinated about prototyping this idea, exploring this concept and
I could keep refining it. I could keep looking
and improving it, asking it to break down things
really an analyzing and making sure it exactly
fits what I’m looking for. But instead I want to
do something different. I’m going to go and continue this thread
of conversation, this crazy idea that I had and give it a
little more form. What I thought about is
if I was really going to take this crazy idea
into my family, I’d have to think about
my nine-year-old son. My wife and I are more
adventurous eaters. But my nine-year-old, he’s not always going to want to eat everything that
we come up with. I thought, well, what
can I do to help him get excited about
trying these things out? I thought I can go back to ChatGPT and I try to get
ChatGPT’s help with this. I said ChatGPT, my son is nine, sometimes he won’t
try new dishes. To make this culinary
adventure more fun for him, can you create a short Pokemon battle story
to go with each dish? If you’re not familiar
with Pokemon, it’s trading cards in a game and a cartoon my son loves it. I will read the stories
with him before dinner to get him excited
about trying the new food. Make sure the story ends with a cliff-hanger that will motivate him to
try the new food. Now maybe I could find somebody who could give me
a meal plan based on Uzbek cuisine and
Ethiopian cuisine, but make it Quito and do all
those things and look it up. I’m not sure they could do
it anywhere near as fast. But now we’re really moving into territory where it’s
going to be hard to find a single human
being and to get somebody to do all of this
is going to be expensive. I’m doing this in a
matter of minutes. What is ChatGPT say? Certainly. Here are some
short Pokemon battle stories to go with each dish. Then we had the breakfast
dish with the Berbere spice. It says story, Pikachu and his friends were exploring the wilds
of Ethiopia and they were suddenly
ambushed by a group of sneaky Pokemon thieves. It goes on to have this Burberry dragon
that they’re battling. Then it says in the end,
they emerge victorious, but not before the dragon
left a fiery spice that imbued their breakfast
eggs with a flavorful kick. Can you help Pikachu
and his friends defeat the Berbere dragon and
enjoy this spicy breakfast? That’s pretty amazing. We’ve gone from a meal plan to now help my son get
excited about eating this by mixing in some
concept that he’s really excited about and it’s actually
produced a cliff-hanger. Is this the best cliff-hanger? Maybe, maybe not.
But does it matter? No, because I’m rapidly
experimenting with my ideas. I’m trying to get
my thought form. I’m trying to
understand what this would look like and I could go and I could refine it
and improve it further, but it’s already done
a pretty good job. I could probably take
this and read it to my son and have him more
excited about trying the dish. Then I thought, well, let’s
take this crazy idea further. We’re going to be sitting
at the dinner table. We’re going to read
these crazy stories that ChatGPT has generated for me to try to get my son excited about eating
these dishes. I thought what else do we do at the dinner table that I
could weave into this? I thought, well, one of the
things we do is we talk about what my son is
learning at school. One of the things he loves is learning math and
play in math games. I thought, well, is there
a way I can integrate that into this whole crazy idea? I said, ChatGPT I
would like you to play a math game with my
nine-year-old to teach him about division with
fractions and nutrition. Ask him questions one at a time involving Pokemon
in these topics and make it into a game when
he wins the Pokemon win, ask the first question. ChatGPT says, great, let’s play a fun math game involving Pokemon and nutrition. Question 1, Pikachu
and his friends are planning a meal that includes
half a cup of cooked rice, but they need to divide it
evenly among three Pokemon. How much rice will
each Pokemon get? It gives them a hint. It says, if you get stuck, feel free to ask me for more hints for guidance
and what does it do? It then waits for
my son to respond. We go and we type in the answer. We type in one-sixth. Now notice, before we
were asking it questions, and now it’s asked
us a question. We’ve told it to
create this math game. It’s now asked me or
my son a question. I’m typing in one-sixth
as the answer. Now ChatGPT says, good
job, that’s correct. Each Pokemon will get one-sixth
a cup of cooked rice. We got this answer by
dividing one-half by three, which gives us, and it
works out the math for us. We went from this crazy idea of a meal plan
that’s based on food from his Pakistan and Ethiopia. That’s keto-friendly
that I can get it at average grocery store with an added serving sizes
or portions to it. We then took that and
we got it to generate Pokemon battle stories with cliff-hanger that would help my son get excited about
eating these dishes. Then I created a game, a math game based
on nutrition and Pokemon to go along with this
to make it even more fun. Then I thought, Well,
what else can we do this? I mean, let’s really give this thought some
form at the end. We’ve gotten the meal plan, we’ve gotten the stories, we’ve got this game. Can we give the game real form? I use some of my
domain knowledge as computer scientists to say, Let’s create code for this. We’re actually going to
produce software for it. I said let’s create code
for this in Python, but I want it to be a web application
and I’m not going to go through all the details because they are
domain-specific. They use my knowledge
of computer science. But the key thing is, is that ChatGPT then
generates actual software, the code for software for this, I’m not going through all of it, but the important piece of it is when we get to the end of it, we actually have real working
software that I can run on a computer to play this
math game with my son. You can see that we took
some simple idea and we rapidly prototyped it
into all different forms. At any point in time, we could go and we could further refine one of the
forms so we can take the meal plan that didn’t
have information about how much to eat and portions and we could add that into it. We could reshape it into a
completely different form. We could then eventually
get to the end and take some form that
we had created and take it out of the language model and
turn it into software. That capability of taking our ideas and rapidly iterating and
prototyping with them, that’s just one example of
the type of thing that we can do with these large language
modules like ChatGPT. Now, I hope this example
helps to get you inspired about the capabilities of what you’re going to learn
to do within this course.

Video: Overview of the Course

The speaker, Jules White, is introducing a course on prompt engineering, which is about interacting with large language models like ChatGPT. He emphasizes that these models are not just tools for cheating or plagiarism, but can be used to unlock human creativity, accelerate ideas, and solve problems. The course will teach students how to write effective prompts to get high-quality outputs from these models.

To take this course, no programming experience is necessary, but basic computer concepts, writing skills, and creativity are helpful. The course will cover topics such as:

  • Creating effective prompts
  • Understanding patterns and techniques for refining prompts
  • Using large language models for various tasks like knowledge exploration, prototyping, and content production
  • Using few-shot examples to teach models new tasks
  • Formatting examples to achieve desired outputs

Throughout the course, Jules emphasizes the importance of creativity, openness to exploration, and trying out different approaches to get the most out of these tools. He encourages students to use these models to accelerate their ideas, give themselves more time for high-level thinking, and unlock their own creativity.

Welcome to this course
on prompt engineering. I’m Jules White and I’ll be guiding you
through this exploration of an absolutely fascinating topic that I’m really
excited to talk to you about. I’m an associate professor in
computer science at Vanderbilt and I’m the associate dean of
strategic learning programs and Vanderbilt School of Engineering. I’m going to talk to you about this really
fascinating and timely and important topic for all of us, which is how do we interact
with large language models like ChatGPT. Now I really hope that this course
inspires you to start using large language models like ChatGPT, and we’ll talk about
what large language of models are in more detail in this course, but you can
sort of use it interchangeably until we talk about it as ChatGP T
is a large language model. Now we’ve seen a lot of back and
forth and discussion in the news about what are these tools, and
what we’ve really seen them presented as in some respects as tools for
cheating on exams or writing essays. We’ve seen them presented as tools for
plagiarism or tools that are going to
take over the world. And I really want to reshape your
discussion of these tools and make you see that they’re also, and
I primarily from my perspective, a new tool to really help
unlock human creativity, to allow you to do things
that you couldn’t do before, to actually take your thoughts and
give them form and do it really rapidly. These are tools that allow me to do things
faster and better than I could before. Now I came into computer science. I actually started from visual art. I went into East Asian studies for a while
and then I ended up being a computer scientist, but I’ve always really
had a passion for creativity and understanding how I could use different
mediums and be it paint or ceramics or code to do interesting things. And I look at large language models
as sort of a new fundamental medium. I can use it for programming, but
I can also use it to create art. I can use it to improve my writing. I can use it to help perform
thought experiments. There’s so many interesting uses for these
large language models like ChatGPT and we’re not properly seeing them discussed. And so what this course is really about
is it’s teaching you how to leverage all of these interesting
capabilities of these models. But in order to leverage these
capabilities, in order to go and do the really creative things, you have
to understand how you write prompts, and that’s what this class is about,
it’s how you interact with Chat GPT or another large language model. A prompt is what you write and
give to ChatGPT or another one of these models
to get some type of output. But these are fundamentally really
exciting tools that I think expand the capabilities that we have as humans,
to express ourselves, to explore new ideas and to create, realizations
of our ideas faster than ever before. Now let’s get started on this course, I’ve actually enlisted ChatGPT’s
help to welcome us to the course. Tell us a little bit about
what we’re going to learn. ChatGPT says welcome to
the course on prompt engineering. In this course, you will learn about
the exciting field of prompt engineering, which is all about creating prompts that
can program large language models to produce high quality outputs. Now don’t worry,
we’ll talk a little bit about this. Do you need to be a programmer? We’ll ask ChatGPT In a second. We will explore the different types
of prompts, their patterns and techniques for refining and
improving them. You will also learn how to use large
language models for various tasks such as knowledge exploration, prototyping,
content production, and assessment. By the end of the course, you will
have a better understanding of how to effectively use large
language models and their potential to shape
the future of computing. Let’s get started. Well, my first question that comes up out
of this is I want to make sure that I don’t have to be a programmer
to benefit from this course. Do I need to understand
programming to take this course? No, you do not need to have any
programming experience to take this course. The focus of this course is on
creating effective prompts and using large language models to
achieve your desire to output. While an understanding of program could be
helpful, it is not necessary to understand the concepts and techniques we
will be covering in this course. What other things might be helpful to me to know before taking this course? While programming experience is not
necessary, it would be helpful if you have some familiarity with basic computer
concepts such as file management, opening and saving files and
using a command line interface. Now by command line interface,
we need something like ChatGPT. >> Additionally, having good writing
skills and the ability to think creatively will be important in generating effective
prompts for large language models. Finally, being open to exploring new and
evolving technologies and approaches will be key to getting
the most out of this course. So there’s really not a lot you need to
know as ChatGPT has aptly said right here, you need some basic understanding
of computer concepts. You need to be able to open up ChatGPT,
it calls it a terminal, but you can think of it as you need to be able
to open up ChatGPT and interact with it. Obviously, if you can’t use a tool for
this, you’re going to have
a hard time opening files. But the fact that you’re here probably
means you have the right computer skills to do this. The second piece is something
I want to talk about. Now we think of these models as something
that came out of computer science, but they’re actually things that having
experience writing, being able to think about writing clearly and effectively
is actually really helpful in this. My father was a professor of creative
writing and it’s been really interesting to me because this is helpful
to me when I’m working with these tools is to think about what I learned from him and
how I design the prompts. And finally, I want to emphasize
this last point, creativity and an openness to exploration is really,
really important with these tools. The creativity of the human that’s
putting in the words for the prompts, who’s deciding what goes into that
prompt in the organization and what gets asked and what instructions
are given are fundamentally important for using these tools effectively. Now we’ve heard a lot about these tools
is like they are plagiarism tools, they are tools to do X,
Y, and Z bad thing. But the truth is, if you really want to
use them effectively, you have to be skilled, you have to be a creative
thinker, a creative problem solver. The more creative you are,
the better the outputs are going to be. You also need an openness to explore. You have to remember,
this is very early days for these tools, we haven’t developed the best practices
in all the different domains for how we’re going to use these tools, for
how we’re going to write prompts, for every domain from health care to customer
service to creative writing, whatever the domain is, we’re still figuring
out how to write the best prompts. And so having an openness to go and
explore and try out different things
is really important. In fact, when you’re programming with
these tools or working with these tools, and don’t get scared
because I said programming, because you’ll see that you
can program with these tools. Anybody can just by writing
normal human language. But when you’re working with these tools,
often you need to go and try out different things. You need to try something and then be open
to trying a different variation on it and seeing what happens, running little
experiments a lot of times in life, it takes so much effort to write
something or to generate some program, some software, or whatever it is that
we’re trying to do that we don’t get to explore as much as we should. We don’t get to think enough about design. We don’t get to think enough about the big
ideas, the problems we’re trying to solve. And one of the things that’s good is an
openness to explore in using these tools. So what are some of the key concepts that we will learn in the course that will help us with problem solving? In this course, we will learn several concepts that
can help with problems solving. Understanding what prompts are and how to
use them to program large language models to generate high quality outputs, learning
how to create effective prompts by tapping the patterns from training data,
being specific with our inputs and using patterns such as the persona pattern
question refinement and cognitive verifie. Understanding how to refine prompts and
use techniques such as rewriting, combining splitting, and expanding to
achieve the desired output, learning how to use large language models for various
tasks such as knowledge exploration, prototyping, content production,
assessment, and more. Understanding how to use few shot examples
to teach large language models new tasks and how to format these examples
properly to achieve the desired output. By learning and applying these concepts, we can effectively use large language
models to solve problems and generate high quality outputs across
a wide range of applications. So I hope that as we go through this
course that you will become inspired to take the ideas that you’re learning,
to go into ChatGPT or whatever tool is available to you and
to try them out to explore the things that you’re passionate about, and to see ways
that you can unlock your own creativity, that you can give yourself more time for
high level thinking and problem solving as opposed to being down in the details
of how you give your thought form. So throughout this course, one of
the themes you’ll hear from me is try to give your thought
form through this tool, use it as a tool to accelerate
your ideas into realization. So I look forward to exploring
this fascinating concept with you, this fascinating topic
of prompt engineering.

Video: Motivating Example: Act as a Speech Pathologist

The speaker is discussing the importance of prompt engineering in tapping into the complex capabilities of large language models like ChatGPT. They provide an example of using the “persona pattern” to ask ChatGPT to act as a speech-language pathologist and assess a three-year-old’s speech sample. The speaker, who has no expertise in the field, is able to get a detailed and accurate assessment from ChatGPT, including identification of phonological and articulation errors, consonant production difficulties, and syllable structure issues.

The speaker notes that they wouldn’t have known how to ask for this level of detail or analysis, but the persona pattern allows them to tap into ChatGPT’s capabilities. They also mention that this kind of output could be useful in real-world scenarios, such as allowing a speech-language pathologist to focus on working with children rather than writing reports.

The speaker’s goal is to demonstrate the power of prompt engineering in unlocking the potential of large language models, and to show that with the right patterns and structures, users can create powerful and effective interactions with these models.

To help you understand why prompt engineering
is so important, I’m going to give you
an initial example that shows where we tap into really complex
capabilities of ChatGPT. But you can also do this with other large language models. The way we tap into these capabilities is
by using a pattern, a pattern that we can use
when we’re writing prompts to get into these really
interesting abilities of the large language models. Now, if you know these
patterns and we’ll talk about them in detail
in this course, you’ll be more effective
in writing prompts. You’ll be able to do things that other people won’t be
able to do as easily. Now, I’m going to
give you an example. It’s going to use something
called the persona pattern. Now I’m not going to
go into detail about the persona pattern
at this point. But basically it’s a pattern that we see all over the place. You’ll see lots of
different examples of this pattern out there on the Internet where
people talk about using it to do lots and lots
of different things. But the basic idea
is you’re going to ask the large language
model in this case ChatGPT, you’re going to ask it to act
like a particular persona. Now what does that
mean? It means like you’re going
to ask it to act like a person or some
inanimate object, or an animal, or some system. There’s all kinds of ways
that you can use this. It’s really interesting. But we’re going to use
it in this example to tap into a persona
that is close to me, but one that I know
nothing about the domain. One of the really useful things about the persona pattern, as you can imagine, if
you needed to go phone an expert to get help
on some problem, you know who you would call but you don’t know
exactly what they would tell you or how they
would analyze your problem, and so I wanted something in the way I know an expert that I could
go to in this case, my wife is a speech
language pathologist. I can have her look at the output and tell
me how good it was. But I know nothing about being a speech language pathologist
or how to do their job. I imagined that when
my son was three, he was not saying
things properly. I went to ChatGPT and I said act as a speech-language
pathologist. I’m going to tell you
what a three-year-old said and you will write
an assessment for me. The child said,
“I meed way woy.” Now you can imagine
this might just me being a parent hearing
it incorrectly. The child’s not pronouncing
things correctly. I don’t know the right
way to even capture this, to even express what’s
being said in words, the right way to do all of this. This is a complex problem
from my perspective. I don’t know how to express
all of this in language, even to ask the
question properly. But I know I would go to a speech language pathologist and I would describe
this to him. I tried to think of something
that sounded like something my son might have said
at that point in time. What did ChatGPT say? Well, you notice first off, its output looks like a report. It says subject assessment of a three-year-old speech
sample, child’s speech sample. “I meed way woy” has it in quotation marks and
it says assessment. Based on the provided
speech sample, it appears the child
may be experiencing some phonological and
articulation errors, which are common in
children around this age. I don’t know what phonological or articulation errors are. I would not have known to ask
ChatGPT for these things. But based on this pattern that I’m using, this
persona pattern, I’m tapping into
this capability for ChatGPT to look at this and know what the right
things are to tell me. It says there’s phonological
and articulation error. It says the child’s utterance
appears to have errors and consonant production and possibly some difficulty
with syllable structure. It says consonant errors. It seems that the child is having difficulty with
the production of some consonant sounds
specifically the n and l sounds. The child said meed instead of need and woy instead of toy. Then it has in parentheses
it’s assumption. It says assuming the
intended words were need and toy because you can remember
my speech sample was, I meed way woy, which my wife told me it wasn’t
a very good example, may not be something that a
child would actually say. Despite that, it’s
still figuring out if that’s really
what the child said, this is probably what they
were intending to say and it’s figuring that out and then it’s telling me they’re
having consonant errors. They’re specifically having
trouble with n and l sounds. Then it goes on to say
syllable structure. The child’s production
of the word way may indicate some difficulty with the correct syllable structure. It is possible that the
child intended to say play, but produced way instead, which suggests a substitution of the initial consonant cluster
pl with a single consonant w. This could be an example of a simplification process
called cluster reduction. I would not have known
how to ask ChatGPT to see if there was problem with syllable structure or
cluster reduction. But I used this pattern
of saying act as, and I said act as a speech language
pathologist and now I’m getting rich output that I wouldn’t even know
how to ask for. Then it goes on to say
because by the way, if you want to do something really unpopular
as ChatGPT to produce an output that looks
like it’s doing somebody’s job and that’s always a way to be very popular. I did this with my wife one morning and my wife was not very happy
because she was trying to get ready to go to
work and here I am saying ChatGPT is producing things that look like what you produce. One of her things that
she said to me was, if that was a three-year-old, I’d be telling the parents they probably don’t need to worry, children’s speech
is continuing to evolve and I’m paraphrasing
what she said. She said it much more
eloquently, but she was like, it’s just giving you a way
overblown analysis of this. I said, yeah, but ChatGPT says
that too at the end, considering the child’s age, it is important to remember that some speech sound errors are developmentally
appropriate and may resolve on their own with time. Of course, by that time she
was walking out the door because she wasn’t ready to sit around in the morning and listen to me tell her that ChatGPT is doing what a speech
language pathologist does. Do I think it’s going
to take her job? No. But do I think it has really vast and
powerful capabilities that we can tap into
with the right patterns? Absolutely. Do I think
it gives us the ability to focus on the things that maybe we really want
to spend our time on? My wife loves working with kids. She loves interacting
with them and trying to understand
how to help them. Writing reports,
maybe I’m not sure. I don’t want to speak
too much for my wife, but I would guess it’s maybe not her most favorite
part of the job. She really loves working with the kids and trying
to help the kids. You can imagine something
like this where it allows her to focus more on the things that she really cares about in the real-world. Maybe it can help her to
give form to her thought around the child’s needs
and write these reports. I hope that you’ll see
that with a little bit of the right structure
in our prompts, we can create these
really powerful ways of giving form to our ideas and our thoughts through large language
models like ChatGPT.

Video: Setting Up an Account and Using ChatGPT

To complete the course, you’ll need a web browser and access to a large language model like ChatGPT. The recommended way to get started is to sign up for an account on chat.openai.com. Once you’ve signed up, you’ll see a screen with a message box at the bottom where you can type in a message to ChatGPT. You’ll also see options for different models to use, and the recommended model for most cases is default GPT-3.5.

The message box is where you’ll write the prompts to ChatGPT, and the response will appear below. The goal of the course is to learn how to word prompts to get better output from ChatGPT, such as more interesting or specific responses.

The video also covers the importance of creating a new chat each time you try out a new pattern or concept, as the conversation can be affected by previous interactions. The course will focus on using ChatGPT as an example, but the skills learned can be applied to other large language models as well.

By the end of the course, you should be able to write prompts that can be used with other tools or programs, and have a better understanding of how to work with large language models in general.

The basic thing that
you’re going to need to complete this course is a web browser and access to a large language
model like ChatGPT. Now, you can use a variety of different language models
to complete this course, but I’m going to
recommend that you use ChatGPT because all
of the examples have been tested on
ChatGPT and it’s also really easy to
get started with. All you’ll need is a browser,
an Internet connection, and an account with OpenAI so you can get
access to ChatGPT. Now, the way to do that
is you’re going to go to chat.openai.com as you see
in the address bar up here. You will go there and
you’ll be presented with a screen to sign up or log in. Now, if you already
have an account on ChatGPT and you’ve been
using it to write prompts, you can skip this video and
go ahead and move ahead. But if you haven’t
done that yet, this video will give you what
you need to get started and understand how you’re
going to write prompts and interact
with ChatGPT. You’ll go to chat.openai.com
as seen up in the address bar here
and then you’ll want to sign up and follow
their sign-up process. Once you’re done signing up, what you should see
after logging in is something that
looks like this. Basically, at the bottom, we’ll have a message
box where it says send a message where we can type
in a message to ChatGPT, and at the top, you may
have some options for different models to use. Now, I have access
to the plugins, which is a newer thing. If you don’t have access to
that, don’t worry about it. But you’ll want to select model, and I would recommend for most cases using
default GPT-3.5. You can probably use any of the models and sometimes
in the videos you’ll be switching between them. There’s no particular
reason from that, I probably just default to do what I had in the prior session. But I would recommend GPT-3.5. It’s really fast, it typically has higher limits in terms of the number of
requests you can send, it’s easier to get
access to typically. I would recommend for
most of the course, unless you have a reason not to, to use default GPT-3.5, so you’ll just want to
swap that up at the top. Down here in this bottom
box where I’m typing hello, this is where we type the prompt to the large language model. Whatever we type in here, we can then hit Enter or we
can hit this little “Send” button on the right-hand
side, this little airplane. I’m going to just hit
Send and I’ve now set a prompt to ChatGPT. That prompt was hello and then the response from
ChatGPT is hello, how can I assist you today? Whenever you see the green icon, that is the output from ChatGPT or the large
language model’s output. The blue icon is
going to be your, and it may be a
different colored icon, it may be your profile or something could have slightly different
effects on color. I think it’s always blue. But anyways, up here is where you’re going
to see your prompt. Then below it will be the
response to your prompt. Then I can say, act as a teacher of a class
on prompt engineering, welcome everyone to the class. Now, I’m writing a more
sophisticated prompt. As you can see, now,
ChatGPT is responding. This was my prompt up here, and I entered that in, and then down here, is the response from ChatGPT. This message box down here is where you’re going to
be writing the prompts. What we’re going to be
working on is how do we word the things that we’re
sending to ChatGPT. How do we come up with
better wordings of the prompts in order to get better output down
here in the green, or how to get more
interesting output, or how to get output that has certain capabilities or
behaviors built into it? That’s what we’re
going to be doing. On the left-hand
side of your screen, which you don’t see in
my screen recording, there’s a list of chats that
you’ve had with ChatGPT, so if you want to go back and pick up on one
of those chats, you can click on them. There’s also a new chat
button and this is important. For many of the examples, I would recommend
going and creating a new chat each time we
talk about a new pattern or a new concept and trying out what’s being
shown in a new chat. Everything here is
affecting the conversation, so just like if you were
having a conversation with somebody and you
told them something, they might remember it later in the conversation and it can
influence what they tell you. In many of the cases,
it’s helpful to have a clean slate for
trying things out, so hitting new chat, so I’m just going
to do that and this is what a new chat looks like. Now, I can go and I have a completely clean slate
and I can try things out. This is what you’re
going to be working with throughout the class, you’re going to
be using ChatGPT, you’re going to be
entering prompts into that send message
box at the bottom, and then you’re going to be
looking at the output and learning how to get better
output out in ChatGPT. Now, once you know
how to do this with the web interface with ChatGPT and you understand the concepts behind
prompt engineering, you should be better with all of the large
language models, you have a much better
sense of how to work with all the
different models. Now, some of them may not
be as good as others, may not reason as well, may not respond to certain
patterns or things as well, but we’re starting off with
the most well-known example, which just ChatGPT, and more than likely things are going to only build
from here in terms of sophistication and
capability of these models. If you know how to use and write prompts in ChatGPT
using this interface, you’ll be able to
write prompts that could then be taken and built into programs or used
with some other tool as well. Know this is a great interface
for getting started and learning about prompts and how the large language
models respond.

Large Language Model Basics


Video: What are Large Language Models?

What are large language models?

  • They take input and try to generate the next word in a sequence.
  • They use this process to generate text word by word, based on the context of the input.
  • They have been trained on vast amounts of text data from the internet, which allows them to learn patterns and relationships between words.

How do they work?

  • They use a process called next-word prediction, where they try to predict the next word in a sequence based on the context of the input.
  • They use this process to generate text, one word at a time.
  • They have learned to pay attention to the context of the input, including the relationships between words and the patterns of language.

Key characteristics of large language models

  • They are rapidly evolving, with new models and updates being released regularly.
  • They can produce output that is not the same every time, due to inherent randomness or variation in the model.
  • They are not designed to produce perfect output every time, and may require editing or refinement.
  • They have a knowledge cutoff, based on the date of the training data, and may not have access to new information or updates.
  • They require additional information to be provided in the prompt in order to reason or work with new knowledge.

Implications for using large language models

  • Be open to experimentation and creativity when using these models.
  • Don’t expect perfect output every time, and be prepared to edit or refine the output.
  • Provide additional information in the prompt if you need the model to reason or work with new knowledge.
  • Be aware of the knowledge cutoff and limitations of the model.

Key takeaways for designing prompts

  • Understand how the model works and how it generates text.
  • Use this understanding to design effective prompts that take advantage of the model’s strengths.
  • Be aware of the limitations of the model and provide additional information as needed.
  • Experiment and refine your prompts to get the best results.

What are large language
models exactly? What do they do?
How do they work? Now I’m not going to go into
the full details of this, but I want to give you
just enough about how they work that will help you in thinking through
designing prompts. There’s a couple of things
to know about them that will be useful when
you’re designing prompts. Now, though, fundamental thing that
you want to know about these large language models is basically what they’re
doing is they’re taking your input and they’re trying
to generate the next word. Then they’ll take that
word that they generate, they’ll add it to you what
you originally gave it, and they’ll try to
generate the next word. This is a way to think of it. Now there’s a lot more
detail than this, but think of it basically
is it’s trying to generate word by word, the response to your input, whatever your prompt is, they’re just going to try
to generate word by word. The next word that’s
going to be in the output until it gets to a point that it thinks
is generated enough. Then the last word is basically going to be
the equivalent of stop. But it’s not going to be
something you’re going to see. What it’s doing is basically
producing words or tokens, these agree to respond
to your prompt. What we’re trying to do with large language
models is we’re trying to produce prompts
that then cause it word by word to
produce an output. Now, I want to show
you a little bit about this and give you
some intuition of it. If I go and I write, Mary had a little and we stop right there. If you’re familiar with
the nursery rhyme, Mary had a little lamb, it’s fleece was white as snow. I’m giving it a prompt. If I say Mary had a little, it’s going and then
completing it, it starts from my
last statement, Mary had a little
and it’s giving the, predicting the next
word, which is lamb. It’s fleece was white as snow. Everywhere that Mary went
the lamb was sure to go, it followed her to
school one day, which was against the rule
that made the children laugh in play to see
a lamb at school. And so the teacher
turned it out, but still it lingered near and it goes on and
on until it stops. Now you notice what it’s
doing is it’s my prompt triggered it to produce
the next word which was Mary had a little
was my prompt. The next word was lamb. If I go and I say roses are red. What does Chat GPT do? It says violets are blue, sugar is sweet and so were you. It says this is a classic
point is often used to express affection or
admiration for someone. But the key thing
to note is it’s doing a next word prediction. I said roses are red and
it’s picking up where I stopped and predicting the
next word which is violet’s. It’s an adding that in
and saying roses are red violets and it’s
predicting are. Then going back, adding that in, it says roses are red, violets are, and it’s
predicting blue. It’s doing this over and over. It does really sophisticated
incredible things. But underneath the hood, when it was trained and created, basically what was done
was a large portion of the text and other things
on the Internet were taken. It was taught basically
over and over again. It was given a series of words and it tried to
predict the next word, except that it was given a paragraph of text
from the Internet. They would show it
part of the sentence and then ask it
to try to predict the next word in the sentence. When it got it wrong,
they would go and tweak the model is what they
call these things, large language models, and their large because
they were trained on so much data and they have so many different
parameters to them. They are these large
language models. What they’re doing is they’ve learned patterns
from our language, our human language that was
out there on the Internet. They’ve basically
learned the idea of given what came
before in the text. Try to predict the next word and then if I take that word
and I add it back in, try to predict the next word. They train these models
to get really good at looking at the context
of the information. Now if you think about it, it has a lot of conduct. It’s tapping into a
pattern that had seen, I said Mary had a little
and it says lamb. It could have been
Mary had a little bit of peanut butter on her shirt. But it’s learned context. That’s part of what
makes it work. It could be roses are red,
daffodils are yellow. But it’s learned this context. That’s a part of
the piece of this, is it pays attention to words and uses that knowledge
of the contexts. It’s paying attention
to different words that have come before that are
in the current sentence. It’s paying attention
to their relationships. It’s using that
contextual knowledge to try to predict
the next word and then it’s taking the
word that it produced, putting it back into the output and trying to
produce the next word. This is the basis of things. Now this will be
helpful to know when we start thinking about the
patterns of our prompts. When we think about
conversations. When we think about what
we can do to tap into this fundamental concept of
predicting the next word. Now, one of the things to know with these models is they
are rapidly evolving. We’re seeing a lot in
the news about ChatGPT, but there’s lots of competing
models that are coming out. Probably by the time you’re
watching this video, there will be even more that I’m not going to mention
or talk about because they didn’t exist today when I started
talking about it. ChatGPT is certainly out there. There’s a new version GPT-4. They’re models like LLaMa. There are variations
on LLaMa like Alpaca. There’s all different
models that are coming out and they’re
rapidly evolving. More than likely, the discipline of prompt engineering and what you’re learning, some parts of this are going
to be hopefully timeless, but some parts of it
will probably evolve and adapt as the different
capabilities of these models evolve. Now one of the things
you’ll want to do is always have that openness
to experimentation, to creativity, and to
in trying things out. Remember with these tools, we can rapidly prototype. We can rapidly explore
things and try things out, and so we want to
always tap into that. Now, one thing to note
is that a lot of times these tools will
produce output that is not the same every time. Now it’s possible that we could get the same output every time. In certain cases, like roses are red and now we get
something different. Then if we went in
and we did it again, we get something different. Now notice that initially we got something that
was what we expected, but each time we’re getting
some variation on this. This is something
else that’s useful to know is these models aren’t designed to do exactly the
same thing every time. There’s inherent randomness or variation in what they produce. This is something
you need to know about when you’re
using the models. It’s really powerful and useful if you use
them the right way. If you aren’t using the models
the right way or you’re trying to fit them in for a task that they’re not good for, you’re going to have to
do a lot of work to deal with this fundamental
aspect of it. But it’s also an aspect that makes you want to
think about this as, you should never
expect these outputs to be perfect necessarily
on the first try. It’s a tool that can help you get an
output that you want, but it’s not necessarily
perfect on the first try. There may be errors,
there may be variation, and you need to build that into the processes and the other things that you
build around the tool. If you’re going to use
it in your business, know that it may not give you exactly the same
output every time. Now there’s ways to try to help limit what it does and
try to guarantee that, but it’s not
guaranteed to do that, and so you want to know that. You want to know there’s
some randomness, there’s some variation which
can be grateful when we’re writing prose with this because we don’t get
exactly the same text every time or else we would all have exactly the same outputs and we wouldn’t be able to
explore and try things. Knowing that is an
helpful thing to realize. Now is shined on a vast
amount of data that came from the
Internet knowing that it’s knowledge is based on the time that the training
data was collected. In the case of ChatGPT, it’s cutoff around 2021. Newer ones have more
up-to-date knowledge bases, but they’re always going to be behind in what they
were trained on. They were taught to
predict the next word, and they learned from that idea of predicting
the next word. They learn to predict
the next word in the context of a lot of different domains be it
speech-language pathology or programming, or be it
about creating recipes, whatever it is that their knowledge that
they were trained on and the patterns that they learned cutoff at some date. When we want to introduce and reason or work with
new knowledge, we’re always going
to have to provide that as part of our prompt, as part of our input
into the conversation, is that whatever
additional information they need in order to reason, they’re not necessarily
continually updating. They can’t retrain these things
necessarily all the time. Now it may change at some point, the technologies may change, but right now today
know that when you need new additional information that wasn’t publicly available
on the Internet, you’re probably going to need to provide it in the prompt. Now those are some of
the key things that you’ll need to know as we go forward in this course in order to help you write
more effective prompts.

Video: Randomness in Output

The speaker is discussing the unpredictability of large language models, such as ChatGPT, and how they can produce different outputs for the same input. This is due to the model’s design, which allows for randomness and generation of new ideas. While this can be beneficial for tasks like writing fiction, it can be problematic when trying to get a specific, repeatable answer.

The speaker highlights that prompt engineering techniques can help constrain this unpredictability, but even with these techniques, the output may not be exactly the same every time. The goal is to make the output more reliable and consistent, but not necessarily identical.

The speaker demonstrates this by asking ChatGPT the same question, “How many birds are outside my house?” and getting different responses each time. While the responses share similar characteristics, they are not identical.

The key takeaways are:

  1. Large language models are inherently unpredictable and may produce different outputs for the same input.
  2. Prompt engineering techniques can help constrain this unpredictability, but may not eliminate it entirely.
  3. The goal is to make the output more reliable and consistent, rather than identical.
  4. When developing prompts, it’s essential to acknowledge and work with the variation in output.

The speaker emphasizes that understanding and accepting this unpredictability is crucial when working with large language models.

Large language models are unlikely,
at least in the near term to give you an exact and
repeatable answer every single time. There’s always going to be the possibility
they do something a little bit unexpected and this is by design and
can be a really good thing. Now, a lot of what we’re going to be doing
in prompt engineering is trying to deal with the fact that large language models
have some unpredictability to them. And we want to sort of constrain that
unpredictability, we want to mold it and shape it and work with it in
a way that’s helpful to us. Now, what I mean by this is that
there’s always some randomness, some ability to generate new and different
ideas each time you put a prompt in. And this can be really good sometimes. If we’re writing fiction and
we want a lot of different ideas, a lot of different storylines,
a lot of different characters. And each time we ask for
new data or ask for a new output, we get something completely new and
unique, then it’s really good. On the other hand, if we’re trying to have
the large language model do some type of reasoning on a system, we may not want
it to have a lot of variation and what it gives us out. For example, if we want a yes or
a no answer. We don’t want it to say yes, sometimes,
no, sometimes, and then suddenly decide just say, well, maybe not because here are
these other things that I’d like to tell you about why it’s hard to determine and
goes on on this tirade for a paragraph or two about why it can’t exactly
give us the exact answer. Sometimes we just want a yes or
a no without any explanation and we can’t always get that easily. So, a lot of the prompt engineering
techniques are going to be dealing with this. Now, I’m going to just show you
a quick sample of the randomness. The fact that the same input
is not necessarily going to give us this exactly
the same output every time. And I want you to remember this when
we go through this course because I’m going to show you a lot of
different techniques to try to get the large language
model to do certain things. And sometimes they’re going to work really
well and sometimes they won’t work. But what these techniques will typically
give you is they will give you something that’s more reliable that works most
of the time or a lot of the time but isn’t guaranteed to
work every single time. Now, this is an important point. We’re always going to have
some randomness here. We’re always going to have some
unknown and we have to accept that and deal with that. So, I asked ChatGPT I said,
how many birds are outside my house? And it says as an AI language model, I don’t have the capability to
perceive the physical world. And he goes on and then it says, if
you’re interested in finding out how many birds are outside of your house,
you can go outside and observe the area yourself, you might also
considering setting up a bird feeder. Okay, well, that was an interesting one. Let’s see if we ask it again what it says. So, now we’re going to go and get a
different answer out of it and says, well, I can’t see what’s going
outside your house. I don’t have access to cameras. I only do text processing. And then it says, you could go outside and
observe the area yourself or you could set up a camera or
other monitoring device to record. Get the number of birds, availability
of food, shelter, and presence. And so, now,
we’ve gotten something different. And what we don’t have anymore is
this advice to set up a bird feeder. If we went and ran this again,
we’re probably also going to get yet another example. It’s probably going to have
some similar characteristics. It’s still going and saying, hey,
I don’t have the ability to do that. It’s running some of its things that it’s
sort of standard text that it tells you. But then it’s saying, hey, if you’re interested in how
you could try observing the area or to capture images of the area, you can
then count the number of birds you see. Additionally, you could consider
setting up bird feeders or bird baths. So, we’re getting a similar
output each time, but it’s not exactly the same output. And so, this is a fairly constrained
set of outputs for this question. We’re still getting some similar type of
things each time, but we’re not getting exactly the same thing and
that’s always going to be an issue for us. So know that when you’re
developing prompts, a lot of what you’re dealing with is
the fact that there is variation. Now, if I wanted it to give
me an exact number and I was using a prompt like this,
this is obviously not going to work. We’re not going to get an exact number
of birds outside of my house with this prompt. Now, we might need to
be able to go back and give it additional information
that could help it decide.

Graded Assignment: Creating Your First Prompts

Create a prompt for a large language model, such as ChatGPT, to describe how large language models work. Ask at least three follow-up questions based on the output. Provide the prompts and outputs from the conversation as the answer.

Create a prompt for a large language model, such as ChatGPT, that asks it to perform an instruction other than answering a question. For example, ask ChatGPT to create a meal plan, plan a trip, create a recipe, or help you diagnose a problem. Provide the prompts and outputs from the conversation as the answer.