Exciting news for all AI enthusiasts and developers – OpenAI, the brilliant minds behind the revolutionary language model, ChatGPT, have generously shared their deep knowledge and insights on how to maximize the effectiveness of GPT models.
This information comes in the form of a comprehensive guide to best practices, providing you with six key strategies to achieve better results when using GPT-3 and the latest GPT-4 models.
1. Write Clear Instructions: The first strategy focuses on the importance of clear and precise prompts. GPT models can’t read your mind, so the more specific you are, the more likely you are to get the output you want. Tactics include asking the model to adopt a persona, using delimiters to indicate distinct parts of the input, or specifying the desired output length.
We tried it:
- Write Clear Instructions
- User Input:
"Translate the following English text to French: 'Hello, how are you?'"- System Output:
"Bonjour, comment ça va?"- Note: Here, the instructions are clear and specific. The task (translation), the source language (English), and the target language (French) are all clearly stated.
2. Provide Reference Text: The second strategy underscores the value of reference text. By providing GPT models with relevant reference text, you can guide them towards more accurate responses, especially when it comes to esoteric topics or requests for citations and URLs.
We tried it:
- Provide Reference Text
- User Input:
"[REFERENCE: The cat is a domestic species of small carnivorous mammal. It is the only domesticated species in the family Felidae and is often referred to as the domestic cat to distinguish it from the wild members of the family.] What is a domestic cat?"- System Output:
"A domestic cat is a small carnivorous mammal that is a domesticated species in the family Felidae. It is often distinguished from the wild members of its family."- Note: The reference text provided gives the model a clear source of information to answer the question.
3. Split Complex Tasks Into Simpler Subtasks: Just like in software engineering, it’s beneficial to break down complex tasks into simpler, manageable subtasks. This strategy not only reduces error rates but also allows complex tasks to be handled as a workflow of simpler tasks.
We tried it:
- Split Complex Tasks Into Simpler Subtasks
- User Input:
"Step 1: Write a brief description of the Eiffel Tower. Step 2: List three interesting facts about the Eiffel Tower."- System Output:
"Step 1: The Eiffel Tower is a wrought-iron lattice tower located in Paris, France. It is one of the most recognizable structures in the world and a symbol of Paris. Step 2: 1. The Eiffel Tower was the world's tallest man-made structure for 41 years. 2. The Eiffel Tower is painted every seven years. 3. There are 1,665 steps in the Eiffel Tower."- Note: The complex task of providing information about the Eiffel Tower has been broken down into simpler tasks of providing a description and interesting facts.
4. Give GPTs Time to “Think”: Interestingly, GPT models can perform better when given time to “think”, or work out an answer. This approach encourages the model to use a chain of reasoning, thereby enhancing the reliability of its responses.
We tried it:
- Give GPTs Time to “Think”
- User Input:
"Think carefully and then tell me, what is the square root of 144?"- System Output:
"The square root of 144 is 12."- Note: The prompt instructs the model to “think carefully”, which can be interpreted as a directive to take time in generating a response.
5. Use External Tools: The fifth strategy encourages the use of other tools to bolster the capabilities of GPT models. External tools such as text retrieval systems or code execution engines can supplement the abilities of GPT models, leading to better overall results.
We tried it:
- Use External Tools
- User Input:
"[EMBEDDINGS-BASED SEARCH: 'Eiffel Tower'] Tell me about the Eiffel Tower."- System Output:
"The Eiffel Tower is a wrought-iron lattice tower on the Champ de Mars in Paris, France. It is named after the engineer Gustave Eiffel, whose company designed and built the tower. It is one of the most recognizable structures in the world."- Note: While the actual usage of external tools is beyond the scope of this model, this example illustrates how additional information from external tools (like an embeddings-based search) could be used.
6. Test Changes Systematically: Lastly, OpenAI emphasizes the importance of systematic testing. To ensure that any changes to a prompt result in a net positive performance, it’s crucial to evaluate model outputs with reference to gold-standard answers.
We tried it:
- Test Changes Systematically
- User Input:
"Translate the following English text to French: 'Hello, how are you?'"- System Output:
"Bonjour, comment ça va?"- Test: Try variations of the prompt, such as “Can you translate ‘Hello, how are you?’ from English to French?” or “What is ‘Hello, how are you?’ in French?” and compare the responses to ensure consistent and accurate translations.
- Note: This example is about systematically testing changes to prompts and evaluating the model’s outputs.
These six strategies represent a remarkable leap forward in our understanding and use of GPT models. As OpenAI continues to innovate and share its knowledge, the potential of language models like ChatGPT continues to grow. So, whether you’re already on the GPT-4 waitlist or just starting to explore the possibilities of AI, this guide offers invaluable insights to help you harness the power of these groundbreaking models.
Ready to take your AI journey to the next level? Let’s dive into OpenAI’s best practices guide and start mastering the art of prompt engineering!
You can access more details and tactics provided by OpenAI here
