Crafting Effective Prompts for Copilot and ChatGPT
Writing prompts for ChatGPT or Microsoft Copilot is something you've likely been doing plenty of recently, but do you find that it sometimes feels like you get undesired responses, making the whole process feel like trial and error? A well-written prompt can make this a whole lot easier, allowing you to get the most out of AI. This guide aims to provide you with an understanding on how to create effective prompts.
What is a prompt and why is it so important?
A prompt is a written instruction or query provided to a generative AI such as Copilot or ChatGPT to initiate a specific interaction or task. Put simply, it's the text you input into the chatbox you see in the image below.
When speaking about generative AI models, you'll often hear the phrase "Garbage in, garbage out". Whilst succinct, it doesn't help us understand how to avoid this trap. At best, this pitfall may cost you nothing but a bit of time and frustration, at worst however it could even be costing money.
For example, when using generative AI in hosted in Azure, an element of the pricing is based around 'tokenisation', which breaks both your input and the AI's output into 'tokens', which are charged for. Understanding how to not only be effective with your use of AI, but being able to educate others on how to do the same can be a worthwhile cost saving exercise.
Define your goal
First things first, we need to understand what it is we want the output from our chosen AI to be. As an example, in this article I'm going to be using the following scenario - I'm a freelance web developer who has been speaking to a start-up about building a website for them, they have some objections around my pricing, I want to use AI to help me write an email addressing my clients concerns.
Let's ask ChatGPT to write us an email, the prompt I've used is "Write an email for my customer who thinks the price I've quoted them to build a website is too high" - feel free to input this into ChatGPT or Copilot yourself and take a read of the output.
In my opinion, the responses you may get from this prompt are too general, too long and fails to capture the nature of the interaction with the customer so far, because we haven't provided the necessary information, ChatGPT has had to assume several key factors resulting in an output that isn't very useful to us. Let's take a look at how we can improve this.
Key elements of an effective prompt
When writing a great prompt, it's best to break it down into segments. You may be familiar with the 5 W's (who, what, when, why and where), which is so essential to the way we communicate with one another that we don't even think about it. So let's explore a similar rule for AI; Context, Action, Tone and optionally, Source, which can help us craft a prompt that should deliver a better response.
Context
You can think of context as setting the scene - outline the problem to be solved, the characters and any other relevant information. In this scenario, I would start my prompt with "I'm a freelance web developer who specialises in SEO and I'm talking to a start-up who wants a website built for them. They're concerned that the price I have quoted to do this is too high."
Action
Clearly state what you want the AI to do for you, this could be to write an email, answer a question, generate content or something else, the more specific you are here, the better. In our example, I would write "Write a short email addressing these concerns."
领英推荐
Tone
We want to advise the AI on the tone we would like it to form it's response in, this could be professional, humorous, informal or any other tone that aligns to your audience. It's worth noting of course that this may not always be necessary if you're simply asking a question for yourself, but very important in our scenario! I write "The email should have a friendly and understanding tone."
Source (Optional)
Finally, if we need to refer to a specific website or document, we can do so by providing a direct link. Alternatively, for internal documents that the AI has access to, we can reference them by name. In our example, we could say, ‘Please refer to our internal document titled ‘Company Values’ located at C:/user/documents'.
Other considerations
You can feel free to mix and match the order in which you provide Context, Action and Tone, but making sure you provide all three will give you a great baseline of an effective prompt.
I do want to emphasize that this list isn't exhaustive, there are certainly other elements to a prompt that can be used to great effect, you could define a length or format, if using copilot you could ask for its response to be presented in the form of a presentation, word document or more, feel free to play around and add more information if you want. My goal here isn't to tell you how to write every prompt, but to give you a framework to build upon when necessary.
The prompt
Here you can see these three key elements discussed above, using this prompt, the outputs we get provide a far warmer response that effectively mimics the sort of interaction you would expect to see between our two characters. Feel free to give it a go and see what you prefer!
Examples
Final thoughts
Hopefully, if you're just getting started with AI or have tried it in the past and had less than optimal results, this guide has provided a basic structure that you can work with in the future to save yourself time and frustration.
Personally, I think AI has provided us with some fascinating tools, but there's a divide between the marketing we see and the reality of what we can use these tools for. I think that there's a lot of value to be had once you find your use case.
Senior Managing Director
3 个月Mitchell Gee Fascinating read. Thank you for sharing
Azure Technical Specialist at Westcoast Cloud
3 个月I always admire your writing style - easy to understand and helpful ?? Thanks Mitch!
Ba (Hons) Degree in Music Performance
3 个月Same - I've fallen down the slope of AI