Update June 2023: OpenAI have now provided an extensive guide to Prompt Engineering. It’s worth a review. Prompt Engineering.
Today I’ve been on a zoom call with a group of senior business leaders from around the world. The number of times that chatGPT has been mentioned (by very senior business people) hit me. In my years of working in consulting, teaching in business schools and leading entrepreneurial companies I have never seen a new technology become so pervasive so quickly. This is not some passing phase. We need to figure out how to make better use of AI in our companies and our lives.
One of the most important skills of the next couple of years will be “prompt engineering”.
What is Prompt Engineering?
You can make poor requests of chatGPT and you can make better requests.
Prompt engineering is the process of carefully designing the input or “prompt” given to an AI model like ChatGPT. The way a question is phrased can greatly influence the quality and usefulness of the response.
In the case of OpenAI’s GPT-3 or GPT-4, prompt engineering involves crafting a clear and unambiguous query that the model can understand and respond to appropriately.
Prompt engineering has a few key aspects:
- Clarity and specificity: The prompt should be clear and specific so that the model understands what is being asked. For example, instead of asking “What’s the best book?”, which is vague, a better prompt would be “What are some highly recommended books on cognitive psychology for beginners?”
- Detailing the desired format: If you want the answer in a specific format, it can be helpful to specify this in the prompt. For instance, “In bullet points, list the main causes of World War II.”
- Role-playing or perspective-taking: Sometimes, it’s beneficial to instruct the model to take on a specific perspective or role. For example, you might tell it “Imagine you are an experienced chef. How would you explain the process of making a soufflé to a beginner?”
- Meta-prompts: These are prompts that instruct the model to think or reason in a certain way. For example, “Consider the pros and cons before settling on an answer.”
Prompt engineering requires a good understanding of the AI’s capabilities and limitations, and often involves quite a bit of trial and error to find the best way to phrase the prompt.
How can you get better at using chatGPT or AI LLMs in general?
Improving your ability to ask questions of an AI model like ChatGPT involves understanding the model’s capabilities and limitations, and refining your approach based on the feedback you receive. Here are some practical tips:
- Be clear and specific: Since the AI doesn’t have access to the context outside of your current conversation, the more detail you can provide, the better. For example, rather than asking, “What’s the best book?”, you might ask, “What are some highly recommended books on cognitive psychology for beginners?”
- Use appropriate structure: The way you phrase your question can affect the quality of the response. Ensure that your questions are properly structured with appropriate grammar and punctuation. This makes it easier for the AI to understand your intent.
- Understand its limitations: ChatGPT only has training data up to September 2021. It doesn’t have the ability to understand events, technologies, or concepts that emerged after that time.
- Try several similar attempts: The AI can interpret a question in different ways. If the answer isn’t what you expected, rephrase the question or ask it in a different way.
- Clarify your expectations: If you are looking for a certain type of answer (e.g., a brief summary, a detailed explanation, a list of steps, etc.), specify this in your question.
- Break down complex queries: If you have a complex question, break it down into several simpler questions. Asking these one at a time can lead to more accurate responses.
- Ask for sources or reasoning: If you want to know where the information is coming from, or if you want the AI to explain the reasoning behind its responses, ask for it. For example, you could ask, “Can you provide a source for that information?” or “Can you explain how you arrived at that conclusion?”
- Use follow-up questions: ChatGPT can handle a series of related queries. Once you’ve asked an initial question, consider asking follow-up questions to dig deeper into the topic.
- Explore different question types: Experiment with different types of questions (e.g., open-ended, closed-ended, hypothetical, reflective, etc.) to get a better sense of how the AI responds to each.
Remember, interacting with AI models like ChatGPT is a learning experience. You’ll likely get better with practice as you discover what types of questions yield the most useful responses for you.