From the course: Prompt Engineering: How to Talk to the AIs
Prompt engineering tips and tricks - GPT Tutorial
From the course: Prompt Engineering: How to Talk to the AIs
Prompt engineering tips and tricks
- Let's take a moment and consider a few other tips and tricks you can try when creating prompts. The first is the order of the examples in the prompt. Keep in mind that LLMs like GPT only read forward, and are in fact completing texts. This means that it's worth to prompt them in the right order. It has been found that giving the instructions before the example helps. Furthermore, even the order of the examples makes a difference. Keep that in mind, and experiment with different orders of prompt and example. Next is affordances. Affordances are functions that are defined in the prompt, and the model is explicitly instructed to use when responding. For example, you can tell the model whenever finding a mathematical expression, it should call an explicit calc function, and compute the numerical result before proceeding. It has been shown that using affordances can help in many cases. You can also use different languages. I have presented all the examples in this course in English; however, one of the very fascinating things about language models such as GPT-4 is that they can speak almost any language. For example, I can speak to GPT-4 in Catalan, my mother tongue from the region of Catalonia in Spain that is definitely not a majority one. Not only can GPT-4 understand and speak Catalan, but it will figure out the language on its own, without prompting. And speaking of languages, GPT-4 and other LLMs also know programming, and have been trained on lots of code. While they might not be as specialized as GitHub's Copilot, or OpenAI's Codex, they can be pretty good at it. Check out this example, written entirely by GPT-4. People have in fact used ChatGPT to build applications from scratch, with very little to no knowledge of programming. As this field is growing and expanding daily, there are bound to be more tips to discover that you can use when creating prompts. You should remain apprised of these changes by reading articles, watching videos, and experimenting yourself, and soon, you will be the one discovering new tips and tricks and sharing with others.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.