From the course: Introduction to Generative AI with GPT

ChatGPT and prompt engineering

From the course: Introduction to Generative AI with GPT

ChatGPT and prompt engineering

- [Instructor] In November 2022, in what we may look back as a pivotal moment in history, OpenAI released ChatGPT and made it available for free to anyone who signed up. Overnight millions could use this generative AI tool, a type of sophisticated chat bot, to get detailed answers to questions and generate new content. Up until this point OpenAI products, including prior versions of GPT, were only accessible to certain users, such as developers and academics, and often for a fee. By releasing ChatGPT for everyone at no cost, for the first time high-end AI became broadly accessible. In fact, within two months of its public launch, ChatGPT had 100 million users, breaking the world record to become the fastest growing web application ever. By simply entering a plain language prompt users discovered they could quickly have ChatGPT, for example, create essays, write software code, develop resumes, compose emails, and summarize content. This was generative AI at work. For the free version, OpenAI based ChatGPT on version 3.5 of GPT. While the public gets all the benefits from having free access, OpenAI is motivated by the upside of having millions of people participate in GPT research as well as the feedback process. A premium version of ChatGPT, called ChatGPT Plus, was released in early 2023 and uses the more sophisticated GPT-4 version. In addition to being more accurate and capable than the free version, ChatGPT Plus also has faster response times, better capacity management, and provides earlier access to new features. What may surprise many is that leaps in the quality of output in recent versions of GPT and ChatGPT are being helped as a result of human trainers, called Reinforcement Learning from Human Feedback, or RLHF. GPT is provided with feedback by a person on generated output, and this feedback is then incorporated back into the large language model. This cycle of output and feedback rapidly improves the model. At the heart of ChatGPT are input prompts. The quality of output is a direct result of well constructed prompts. Crafting prompts is referred to as prompt engineering. It wouldn't be my first choice for a term that easily rolls off the tongue, but nevertheless, it appears to have stuck. Remember, a prompt isn't simply a question similar to what we've become accustomed to with search engines. Of course, ChatGPT handles questions well, providing one answer rather than links to thousands of possible results. It has far more elaborate capabilities that include sorting and classifying information, creating software code, and generating, rewriting, summarizing, and expanding text. To get the most from ChatGPT it requires both a period of experimentation and also good technique. It's okay, for instance, to keep rewriting your request until you get an output closer to what you want. Each time a response is given by ChatGPT it's different. Also, given that ChatGPT retains awareness of everything captured in a single conversation session means it will use those insights to inform its output for you. For now though, once you close the window or app that memory is lost. When crafting a prompt you can use commands to begin your sentence, such as write, summarize, translate, and create. Add context to your request, for example, you could prompt what are good gym exercises for a 30-minute workout. However, you might add prior to that I want to build muscle in my arms, then follow it with your questions. It works well too to add identity. For example, in the gym example you might add provide the exercises for a male between the ages of 30 and 40. This works for all manner of prompts. You could ask ChatGPT to write an email that comes from a boss to an employee or from an employee to a boss. ChatGPT loves specificity and descriptions. It also benefits from providing examples in the prompt. For instance, I enjoy The Beatles and The Rolling Stones, suggest bands with similar styles. You'll find a lot of help creating prompts online. Here are three sites to give you a flavor of what's available. Here's PromptBase. This is a solution that provides a database of effective prompts that gets results in a wide number of generative AI tools, such as Midjourney and Stable Diffusion. Next, Vellum, this is a site which is a suite of tools in support of LLMs. It includes features that help with prompt engineering. ChatGPT is impressive and powerful, but it's certainly not perfect. It's still early in its development. You'll find that it sometimes can't answer your prompt, including having no knowledge after September 2021 because that data is not included in its large language model. I suspect that this limitation will disappear soon though. ChatGPT may also give an answer it simply makes up. We call this an AI hallucination. OpenAI's use policy also prohibits certain uses. While ChatGPT is one app that runs in GPT, there are many more. Next, we'll explore some of those other applications of GPT.

Contents