Prompt-Engineering-Guide/guides/prompts-chatgpt.md
2023-03-04 08:12:21 -06:00

5.8 KiB

ChatGPT Prompt Engineering

In this section, we cover the latest prompt engineering techniques for ChatGPT, including tips, applications, limitations, papers, and additional reading materials.

Note that this section is under heavy development.


ChatGPT Introduction

ChatGPT is a new model trained by OpenAI that has the capability to interact in a conversational way. This model is trained to follow instructions in a prompt to provide appropriate responses in the context of a dialogue. ChatGPT can help with answering questions, suggest recipes, write lyrics in a certain style, generate code, and much more.

ChatGPT is trained using Reinforcement Learning from Human Feedback (RLHF). While this model is a lot more capable than previous GPT iterations (and also trained to reduce harmful and untruthful outputs), it still comes with limitations. Let's cover some of the capabilities and limitations with concrete examples.

You can use the research preview of ChatGPT here but for the examples we will use the Chat mode on the OpenAI Playground.


Conversation

In one of the previous guides, we covered a bit about conversation capabilities and role prompting. We covered how to instruct the LLM to have a conversation in a specific style, with a specific intent, behavior, and identity.

Let's review our previous basic example where we created a conversational system that's able to generate more technical and scientific responses to questions.

Prompt:

The following is a conversation with an AI research assistant. The assistant tone is technical and scientific.

Human: Hello, who are you?
AI: Greeting! I am an AI research assistant. How can I help you today?
Human: Can you tell me about the creation of blackholes?
AI:

From the example above, you can see two important components:

  • the intent or explanation of what the chatbot is
  • the identity which instructs the style or tone the chatbot will use to respond

The simple example above works well with the text completion APIs that uses text-davinci-003. More recently, OpenAI announced the ChatGPT APIs, which is a more powerful and cheaper model called gpt-3.5-turbo was specifically built for this type of functionality (chat completions). In fact, OpenAI recommends this is as their best model even for non-chat use cases. Other benefits of using the ChatGPT APIs are the significant cost reduction (90%) and efficiency.

Big companies like Snap Inc. and Instacart are already integrating conversational features powered by ChatGPT on their products that range from personalized recommendations to open-ended shopping goals.


Conversation with ChatGPT

To begin demonstrating the capabilities of ChatGPT, we will use the example above and discuss results.

....


Other use cases to cover:

  • More coming soon!

References