How to Write Better AI Prompts: Before-and-After Examples
You know you've used an AI tool badly when the response it gives you isn't helpful or useful. At some point, most users of these tools have done something clearly wrong in their prompt and ended up with a less-than-optimal answer. It's easy to assume it's the tool that's at fault, but instead you should think about how you could improve the prompt. After all, most AI tools are fairly literal. Give them a vague request, and they'll give you a vague response.
It's true that there are some skills and knowledge to be gained in writing good prompts for AI assistants. Fortunately, it's not an overwhelming or difficult set of knowledge to learn. In fact, you might find that learning the most common prompt improvements comes naturally to you. To that end, here are several before-and-after examples to improve your prompts.
Understanding Poor Prompts
Before we get into the examples, let's examine exactly what turns a good prompt into a bad one. Almost always, the underlying cause for a disappointing AI response is a vague, unclear, or overly-complex request. If you ask the assistant for something too broad or without enough detail, you'll most likely be disappointed with the response. Try asking for too many things at once, and you'll invariably get a generic response that answers none of them particularly well. Finally, remember that an AI assistant has no idea what you're asking for if you don't explain it clearly. There's no context, no idea of your personal situation, and no ability to read your mind.
Let's look at a few examples of improved prompts.
Example 1: Writing an Email
Before: ''Write an email to my landlord about the heater''
After: ''I'm a tenant writing to my landlord. The heater in my apartment has been broken for four days, and I've already reported it once last week with no response. I'd like you to write a polite but firm email asking about when they'll be able to repair it, mentioning that I reported it once before. Please keep it under 150 words.''
It's worth noting that this is a relatively simple task; writing emails is an everyday activity for most people. At the same time, this example demonstrates most of the common improvements for vague prompts. The second prompt provides far more detail about the author's situation than the first, including who they are, what has happened, and what they want the email to say. The second prompt also asks for a specific length, ensuring the response won't be too long or too short.
Example 2: Getting Help With Research
Before: ''Tell me about electric cars''
After: ''I'm trying to decide between a gas car and an electric car, as I drive about 30 miles a day with mostly city driving. I'd like a brief overview of the pros and cons of buying an electric car, focusing on the total cost of ownership over five years, including gas or electricity costs. I'm not particularly interested in the environmental benefits, just the financial ones.''
This second example covers many of the same improvements as the first, but applied to a different sort of request. Again, the second prompt is much more specific about the author's needs and wants, providing far more detail about what they're looking for in the response. Additionally, it specifies that they don't want certain information, saving the AI time and effort.
Example 3: Brainstorming or Planning
Before: "Help me plan my week."
After: ''Here's everything I need to get done this week: a project due on Thursday, a dentist appointment on the 2nd at 2 PM, and 3 hours to work on a presentation. I also have a full-time job most days with regular 9-5 hours. Can you help me plan a realistic schedule that gets everything done?''
This third example covers a different set of improvements than the first two. In particular, this example lacks specific instructions in the original prompt. The second prompt in this example also adds detail about the author's situation, helping the AI to formulate a more realistic plan based on known constraints. Finally, the second prompt asks for a specific output format - a schedule - while the first one asks for brainstorming or planning, a much more amorphous request.
Example 4: Explaining Something Confusing
Before: ''What is compound interest?''
After: ''Explain compound interest to me like I'm hearing about it for the first time. I understand basic math, but I don't really know anything about finance. Give me a simple example using real numbers.''
In this fourth example, the second prompt provides far more detail about the target audience. This allows the AI to adjust its response to that audience, providing a more useful explanation. Additionally, this example begins to touch on specific requests for the format of the response. The first prompt asks for something very general - an explanation of a concept - while the second asks for a simple example using real numbers.
Example 5: Editing Your Own Writing
Before: ''Fix this.'' (followed by a paragraph, with no other instruction)
After: ''Here's a paragraph I wrote for a work email. Please tighten it up, fix any grammar issues, and make the tone slightly more confident without making it sound aggressive. Make sure the meaning remains the same.'' (followed by the paragraph)
This fifth example is a bit of a combination of the previous four, but it touches on a few more of the prompt improvements we've seen. The second prompt provides much more detail about what the author wants; the first merely says that the writer wants it ''fixed,'' while the second specifies grammar, tone, and meaning. Again, this example shows the improvement provided by a more specific request for the output format.
General Observations About Improved Prompts
If you look closely at the improved prompts in the above examples, you'll notice that each one uses one or more of the following four general improvements.
The prompts provide information about the user's situation, needs, and wants. The prompts are considerably more specific about those needs and wants. The second example also provides constraints that should be applied to the answer, while the third and fifth specify a particular output format.
It's important to note that you don't have to include any of these four general improvements in every prompt. In addition, you may find that different prompts benefit from different improvements, depending on what the prompt is asking for. Overall, however, these four general improvements should provide excellent guidance when crafting your own improved prompts.
When to Give Examples Instead of Just Instructions
Sometimes, it can be challenging to describe what you want in words. In those cases, providing an example or examples of what you want can be beneficial to getting the result you're looking for. This is especially true for certain types of requests, namely those that require specific formatting, tone, or organization. This technique is sometimes called few-shot prompting, and it can be a valuable addition to your overall prompt-writing toolkit.
Example of Few-Shot Prompting
Example: ''Here's an example of the tone I want: [insert example]. Please match this tone for the following message
Few-shot prompting can be particularly useful if you're asking the AI to do something that requires a specific tone, format, or organization. By providing a brief example of the tone or format you want, you can show the AI what you're looking for without having to describe it in words. This can be particularly helpful if the tone or format is difficult to describe or if you're not entirely sure how to describe it.
That said, it's also worth noting that few-shot prompting is not always necessary or appropriate. If a simple description of what you want is sufficient, it's probably best to use that rather than an example. For example, if you're asking for something like a brief overview of a topic, a simple description of what you want should be sufficient.
One Other Tip About Prompting
Most AI chat assistants only remember the conversation that has taken place within the current session. That is, if you have an interesting conversation one day and then come back the next day to try something new, the AI will not necessarily remember what happened the day before. If you want it to refer to something that happened previously, you either have to provide that information again, or switch to a different prompt strategy.
That leads us neatly onto another point. It can be a good idea to treat your first prompt as a draft, rather than a final product. If you're not entirely happy with the response you get, it can be worth telling the AI what you want to change, rather than starting again from nothing.
Frequently Asked Questions
Do I need to write long, complicated prompts to get good results?
No, it's not necessary to write long, complicated prompts to get good results. In fact, it can often be more effective to write short, simple prompts that are clear and to the point. There is no single right or wrong way to write a prompt, but most people find that short, simple prompts tend to be more effective.
What's the single biggest mistake people make when prompting AI?
The single biggest mistake people make when prompting AI is being too vague and assuming the AI will be able to infer what they mean. It's important to be as specific as possible when giving instructions to the AI, and to make sure that it understands what you want it to do.
Should I ask for multiple things in one prompt?
It depends. In general, it's probably best to avoid asking for multiple things in one prompt. If you need to ask for multiple things, it's usually best to ask for them in separate prompts. This is especially true if one thing depends on the other.
What is "few-shot prompting" and do I need to use it?
Few-shot prompting is a technique where you give the AI a few examples of what you want it to do, rather than telling it in words. It can be a useful technique, but it's not strictly necessary. It's a good idea to learn the technique and understand when it might be useful, but it's not something you need to use all the time.
Can I just keep adjusting a prompt instead of starting over?
Yes, this is usually the best approach. If you're not happy with the response you get, it's usually best to ask the AI to change it rather than starting from scratch. You can tell the AI specifically what you want to change, which will usually be more efficient than starting over from nothing.

ConversionConversion EmoticonEmoticon