If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Prompting basics

Sal Khan teaches some basic strategies of how to prompt an AI to give responses that are most useful to you as a student or a teacher. Created by Sal Khan.

Want to join the conversation?

Video transcript

- [Instructor] In this video, we're gonna see that you could have very different experiences with the same AI, and a lot of that is depending on how we prompt the AI. So before we even start doing some prompting ourselves or even understanding what that means, let's just play around a little bit. So I'm here on my account on ChatGPT, and I'm using GPT-4 as my model, the underlying model. Remember ChatGPT is the application. It can use different models. I could use GPT-3.5 or GPT-4. In this case, these are from open AI. And let's say that I want help understanding some concept in science. So let's say I want to understand how, let's say how photosynthesis works. How photosynthesis works? Exclamation mark. I really wanna understand. So over here, ChatGPT using GPT 4, it's essentially creating a a bit of an article. This is very similar to what I would see if I were to go to Wikipedia, or if I were to just do a web search. It's actually giving a very lengthy article whether or not I'm in the mood of reading this, but says this is a fascinating process. It allows plants and algae and some bacteria. It talks about the absorption of light. This is a pretty involved article, but once again, not that different than what I would find if I went to Wikipedia or the internet. Now as a comparison, let's go to Khanmigo, and do the same thing. And I'm using the Tutor Me in math and science activity. And Kahnmigo, this version of Khanmigo, is still using the same underlying model. It is using GPT 4 at least at the time of me making this video. But let me ask the same question. I want to understand how photosynthesis works? I'll do the exclamation mark as well. And it says, ah, photosynthesis, the magic trick plants use to turn sunlight into food. Let's dive in. First, can you tell me what you already know about photosynthesis? So know what you're thinking. Wait, Sal, this is the exact same underlying model, but it's doing something very different here. Here it's really acting like a tutor. And instead of just giving me a big verbal dump of an article, it is actually asking me a question. Well, I could keep going into it. Oh, I know that is how plants convert sunlight into food. Great start, now let's dig a bit deeper. Photosynthesis involves two main stages. Can you name them? Interesting. So it's really trying to quiz me, making sure that I'm understanding this. So the question, and I could obviously spend hours talking about photosynthesis with Kahnmigo, but that's not the point of this video. The point of this video is why is Kahnmigo behaving so differently than that interaction we saw with ChatGPT, even though it's using the same underlying model? And the answer is, it's prompting. There's other things that work with Kahnmigo, but for the most part, the Khan Academy team have created prompts that encourage, or direct, or steer is actually the right word, people calling steering a model, to act as a socratic tutor. Not to give big verbal dumps like you saw, but to ask questions, make sure the students' understanding, and then dig a little bit deeper. Now you might wonder what does a prompt like that look like? Well, I could do that here on ChatGPT, although it takes a little bit of more work. I could say something like, you are a socratic tutor. I am your student. Try. Well, let's just start with that as a simple prompt. I will ask you questions. And I'm gonna copy and paste this. There's more efficient ways of doing this. But just so that you, I'll copy it for now, so we can use it later. And let's see what it does. I'm ready to help you explore and understand any questions you have. What's on your mind today? So it's already doing something very different than what we saw in that previous example when I just asked how photosynthesis works. So I'm gonna say, I want to know how photosynthesis works? Exclamation mark. Alright, great topic. Let's start by exploring the basics of photosynthesis together. So it's still not doing what Khanmigo did. It's still, you know, giving me maybe a little bit more verbiage, or more text than I might like. So let's start over here. Let's start another thread. And this time I copy and past it. Your Socratic tutor. I am your student, I will ask you questions. Keep your responses as short as possible Well, let's just do that for now. So that was essentially my prompt. Understood, please go ahead with your question. How does photosynthesis works? Let's see how it's responding now. So photosynthesis converts light energy into chemical energy. Plants use sunlight. So it is doing what I asked it to do. It's giving a shorter response. Would you like more detail? But it's still just kinda giving me the answer. So I want it to be more Socratic. So let's do this. You are a Socratic tutor, I'm your student. I will ask you questions, keep your responses as short as possible, and try to ask me questions on my understanding, rather understanding, rather than just giving me answers. Let's see what it does now. So how does photosynthesis work? Photosynthesis is the process plants use to make their own food. Can you tell me where it primarily takes place in the plant? So you can see it's getting closer to what we just saw with Kahnmigo by giving it that prompt, and that prompt that we saw at the beginning. Every time it goes back and forth with the AI, the AI sees this at the beginning of our conversation stream, and that essentially primes the AI to behave in that way. And you could do prompts to do some pretty fun things. So let's say you, actually let me just. I should have copied and paste it. Actually, I think I can. I can go back here. Let me copy and paste what I just had, and I'll create a new thread, a new conversation. Speak in the tone of Dr. Seuss. Let's see what happens. Oh, a question you have my dear friend, indeed, a curious mind is a wonderful seed. Now ask away, don't delay, let's proceed. What's on your mind, what knowledge do you need? I kinda like this one. How does photosynthesis work? In a leafy green world where the sunlights a treat, plants take the light. Oh, so bright and so neat. But how do they do it? You ask, isn't that sweet? Can you guess what they need besides light from the sun to make sugar and food and have all of their fun? So there you go. That's prompting by giving it clear instructions of what you want, especially when you begin. And later we'll talk about how you can save this so you don't have to write this every time, or there's ways to do it depending on what app you need. But this is how you can steer an AI, a large language model, to behave in the way that is useful to you.