From the course: Prompt Engineering: How to Talk to the AIs

Basic prompt examples - GPT Tutorial

From the course: Prompt Engineering: How to Talk to the AIs

Basic prompt examples

- As a reminder from before, a prompt can include instructions, the question, input data, and examples. In order to obtain a result, either the first or second one must be present. Everything else is optional. Now, let's look at a few examples. For all of this, we'll be using GPT-4. This first example is using a question plus instructions. "How should I write my college admission essay? Give me suggestions about the different sections I should include, what tone I should use, and what expressions I should avoid." Now, I'm not going to read the whole response to you here, but feel free to pause the video if you'd like to read the detailed response or open the exercise file call prompts and responses for review to use your screen reader software or to review at your own pace. Note how the model has retrieved pieces of advice from its past training data, and responded to the specific instructions that I gave it in the prompt. For the second one, it's instructions plus input data. Given the following information about me, write a four-paragraph college essay. "I'm originally from Barcelona, Spain. While my childhood had different traumatic events such as the death of my father when I was only six, I still think I had a quite a happy childhood." Now, again, I'm not going to read the whole prompt, but you can review it by pausing the video. Now, again, I'm not going to read the whole prompt, but you can review it by pausing the video or reviewing the text file or using a screen reader. Now, note how the model here is reacting to the input data and personalizing the response. A key aspect of this response is that it's using new information that it had not been initially trained on. This illustrates the zero-shot learning capability that I mentioned earlier in the course and about college essays. I'm not advocating for this example to be an an ethical use of large language models, but it is important to be aware that this possibility exists and is already being used by students around the world. It is beyond the scope of this introductory course to discuss all the possible ethical, legal, or moral concerns that LLMs or generative AI as a whole introduces. But I thought it would be important to call it out in an introductory example. The fact that you can do something with a generative AI model does not mean that it's okay or the right thing to do. On the other hand, if you're on the receiving end, you better prepare yourself and your organization for all kinds of AI-generated content to come your way. Okay, how about the question plus examples? "Here are some examples of music I really like. Radiohead, Lana del Rey, Rosalia, Bon Iver, and Andrew Bird. I do not like Coldplay, Taylor Swift or Bruno Mars. What other music would you recommend?" Again, pause if you want to read the detailed answer, but note how by using input examples you can turn a general purpose large language model into a recommendation engine. This highlights the vast applicability of this technology. So remember, when you're starting to learn how to create effective prompts, start with a question and instructions, and optionally choose to add input data or examples that you may have. We will be getting into more advanced tips and tricks later on, but for now, if you're not satisfied with the results, revise your prompt and try again.

Contents