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

Designing a prompt

- So, if a prompt is no more than some natural language text that expresses what we want to get from the model, why do I need to learn anything, you might ask? Great question. The reality is that as smart as these AI models are, they have quirks. At the end of the day, you should remember that they have only been trained to predict the next word, and now you're asking them to write about classic philosophy. Also, while you can interface with them in natural language, that doesn't mean you can't use other elements that are not so natural to talk to them. Because of all of this, it becomes important to understand the possibilities and limitations of these models, and also learn from some of the experiences we have had so far. A bad prompt can lead to the model making up stuff, known as hallucination, while a slightly better one can lead to extremely valuable knowledge being generated. Let's start by considering what are the basic elements of a prompt. While again, a prompt can be any strings of text, it is good to think of a prompt as being able to have any of the following. Instructions. For example, "Write a 3 paragraph long love letter." Question. For example, "What are some good examples of things to say in a love letter?" Input data. For example, "John is a 24 year old accountant from California who is in love with Mary, a 24 year old computer programmer from Arkansas. Write a 3 paragraph love letter from John to Mary." And lastly, examples, like "My boyfriend really likes 'Lala Land', 'Her', and 'Crazy, Stupid, Love.' He doesn't like 'Ghost' and 'Notting Hill.' Write a love letter for him." So again, while a prompt, in principle, is only made up of natural language, there's much more to it. Thinking about how to structure your prompt will lead to better results.

Contents