Search This Blog

Wednesday, January 29, 2025

AI: Prompt Engineering

The other day I got an advertising on social media about a free certificate in responsible AI use and Prompt Engineering. The course was a collaboration between Microsoft and Founderz who hosted AI Skills 4 All which was educational and interesting.

As a regular user of both Copilot and Edge I decided to give it a go, it was free and took less than 8 hours, so I thought why not?

Basically they brought up the basics of how generative AI work, how to write good prompts and how they leverage the Edge browser. 

The way we should see Copilot is not as the primary agent of choice, but rather our second pilot, that can offload us from certain tasks. We are still responsible for what we do with the tool in that sense. At this stage these generative AI:s, especially Copilot, is better at texts and images than math.

Its strengths are brainstorming, handling large amount of information and creating general ideas for the low risk scenarios. The general downsides of Copilot is that it does not think or feel, it is not always accurate and you can't rely on it as a friend. It also comes with biases of its own.

Improve your prompts

Writing good prompts for AI consists of four main parts.

1. A goal, such as creating a bunch of bullet points detailing the last quarter

2. Context, such as defining a setting where the material will be used, for example a breakfast presentation. You could also specify what type of people that will attend. For example whether it is marketers, competitors or managers.

3. Source of the information, make sure to ask Copilot where to get the data from. This is important because not only is it your job to ensure the quality of the result, but you might know that some sources are better in certain fields. You will notice that the sources are linked in the result as well, if you want to continue your research.

4. Expectations, define what you want out of the material, what sort of result should it create?

Customizing your prompts further

There are additional things that you need to think about in order to create better prompts, such as being rich with details. Remember to add the most important things first, it is valued higher, this is especially true when creating images.

Here is an example of the prompt "Create an image of the planet Mars"


This is the result of the prompt "Now create an image of the planet Mars, from the surface of the planet, where you can an early human settlement, do not include any people. The sky should be daytime."



You can also ask the AI to ask you controlling questions back to you before presenting the result. This increased content quality. You could ask Copilot to return five questions about the material as an example.

To shape the content further, ask the chatbot to take on certain personas. You could for instance ask it to act as an PR-expert to create a certain effect with the text.

Keep in mind that if you are logged in, you can save a history of previous chats. You can also attempt to regenerate the reply, by simply asking it to do so, you might then get a variation of the reply.

What to avoid

There are a few things to avoid when you work with the Copilot, these pointers will also help you make better decisions when taking the help from AI. 

1. Avoid math that you cannot check yourself afterwards, this is due to the probabilistic nature of the generative AI. It uses mathematical models to predict what the next "token" in a sentence is, such as a word or another small piece of data. You can in worst case get different results from the same question. Instead try to focus on outputting text and code for example.

2. Don't be too sparse with the details, it will negatively impact your results.

3. Don't upload information, data, images and so on that might be sensitive or personal.

Troubleshooting the output

If an error occurs you can try to figure out what could have been causing the mishap.

For this it is also important to know how Copilot works. First it searches, then a Large Language Model is used to summarize the content and then it is filtered and presented. 

You can ask yourself these questions when troubleshooting the result:

  • Is there an issue with how the question was asked?
  • Are there problems with the sources used? Can other sources be used instead?
  • Was there something wrong at the search stage?
  • Was there an issue with the summarizing stage?
  • Did something happen when it was presented?

Different ways to use Copilot

One thing that I myself learned from the course was an efficient way to use Copilot in the sidebar together with Microsoft Office in the browser. This is handy as Copilot is not necessarily integrated into the Office programs that you install on your PC, at the time of this blogpost.

Use the sidebar AI in Microsoft Edge to analyse, summarize, correct or improve Word documents that you have open in the browser, when you are working in Office online. You can of course use it on other sites too and let it assist you in evaluating and working with different content. Another hack I like to use is to take a snippet and upload it, and ask questions about the content.

There is also a speech function and if you use it, you will notice that it speaks back to you.

For mobile they have a dedicated app for Copilot as well, it pretty much fills the same role there, a plus for using the app is that you can use the camera to identify objects for example or transcribe text that you take a photo of.

Summary

Let's wrap this post up by saying that Copilot has helped me a lot, both professionally and in private. Personally I use it as an advanced search engine sometimes, with whom I can discuss the results and ask clarifying questions. I also use it to generate PowerShell code these days, but I try to understand the concept before I ask it to produce the code, this is so that I can evaluate the result better. It is a philosophy of mine that it is better to have done something the hard way (or at least have tried) first, because it gives a better intuitions of the subject.

The course raised my awareness of the probabilistic side of the AI, which explains the interesting results that one sometimes gets. Remember to use the up and down thumb to continue to train the AI, so that it becomes better.

Enjoy!

No comments:

Post a Comment