๐ฅณ It's easy to draw the conclusion that large language models such as ChatGPT give pretty bad output and are not very useful. But just like learning a new language, becoming proficient in AI speak "prompt engineering", requires practice and play to undertand the correlation between input (prompt) and output (answer).
I've been researching the current understanding of how to make effective prompts. Here is a summary guide to give you a flying start:
1️⃣ Be Specific - Be clear about the desired context, outcome, length, format, style, etc.
๐Write a short, inspiring poem about project management in the style of Emily Dickinson.
๐ Write a poem about project management.
2️⃣ Use Concrete Descriptions - Keep prompts concise and to the point.
๐ Write a short story about a cat's adventure in a city.
๐ Write a story about a cat.
3️⃣ Specify What to Do, Avoid What Not to Do - It's better to instruct the model on what it should do instead of what it shouldn't.
๐ The AI should recommend a TV series from IMDB without asking users for their interests or personal information.
๐ This is an AI agent that recommends TV series to a customer. Do not ask about customer interests. Do not ask for personal information.
4️⃣ Start with Instructions and Use Separators - Place instructions at the start of the prompt, use separators like ### or """.
๐Summarize the following text: """Input text here"""
๐ Input text, summarize the text.
5️⃣ Articulate Desired Output with Examples - Guide the model by providing example outputs.
๐Translate the following English phrases into French: 'Hello, how are you?' = 'Bonjour, comment รงa va?' ; Now translate: 'I am learning French.'
๐ Translate 'I am learning French' into French.
6️⃣ Use an Iterative Prompting Strategy - Start by providing a task without prior examples (zero-shot)
Input: "Translate the following English sentence into French: 'I love learning new languages.'" Output: ?
If it doesn't give the desired results, try giving a few examples (one-shot or few-shot):
Example 1: Input: "Tell a joke in the following format: 'Why don't [group] [do something]?' 'Because [punchline]!'" Output: "Why don't scientists trust atoms? Because they make up everything!"
Example 2: Input: "Tell a joke in the same format." Output: "Why don't we tell secrets on a farm? Because the potatoes have eyes, the corn has ears, and the beans stalk."
Now, perform the task: Input: "Tell a joke in the same format."
๐ Experiment with various prompt engineering strategies.
๐ Give up after the first attempt.
๐ Try starting with guidelines 1-3 in mind when crafting your prompts.
๐ Give yourself a task such as getting the AI to compile a list of books to read during the summer, then experiment, experiment, and experiment until you get the results you want.
What is your experience using ChatGPT? Do you get the output you want? What do you use it for? Give examples of your best prompts?
No comments:
Post a Comment