Want to make the most of ChatGPT? Try these prompt engineering basics

ChatGPT is a model that interacts in a conversational way and can answer followup questions, admit its mistakes, challenge incorrect premises, and reject inappropriate requests. (Express photo)

Following the launch of ChatGPT back in November, the tech industry is on a roll with successive launches of AI chatbots. These versatile tools can perform many of your daily tasks with ease and make your life easier.

But unlike humans, who can infer meaning from context and nuance, AI chatbots need to be fed instructions in precise and unambiguous language to grasp your intentions properly.

So today, we take a look at what AI prompts are and the various intricacies that go into engineering that perfect prompt.

What exactly are prompts?

Prompts are the input that users give to AI chatbots and generative services, such as ChatGPT, Bard, and Bing. Prompts tell the chatbots what to do or what to talk about, and help them produce relevant and accurate responses.

Meanwhile, prompt engineering is the skill of designing and crafting effective prompts for different purposes and goals

The basic principles of prompt engineering

Be as specific as possible

When crafting a prompt, the fewer details you provide, the more assumptions the AI model has to make. Including constraints in your prompt will guide the model better to produce outputs closer to what you have in mind.

Suppose you wish to identify the sentiment of an image caption using any AI chatbot. In that case, using the prompt “Classify this caption: I love my dog very much” will not fetch the desired output. Replacing that with “Classify this caption’s sentiments as positive, neutral, or negative: I love my dog very much” will do the job better, as it’s more specific.

Provide sample outputs

Think of AI chatbots as very bright kids that need to be shown an example sometimes when your task is complex. Try to feed examples that are similar to the data you’re working with to produce better outputs.

For example, if you wish to generate a list in a certain format, say for a list of countries followed by the names of their capital cities, then try to use a prompt similar to the example below:

Generate a numbered list of 8 countries with the highest GDP along with their capital cities. An example list item is “1. United States – Washington DC” for your reference.

Providing examples can help you customise output from AI chatbots. (Express image)

Provide additional relevant context

Since AI models are trained on millions of documents and web pages from all over the internet, they’re prone to hallucinations and can get their facts mixed up sometimes. Therefore, limiting the scope of resources that the AI chatbot works with to generate your response can be crucial. A good method to ensure that the chatbot’s response is accurate and factually correct is to include relevant links or pages from documents as additional context in your prompts. You can ask the chatbot to refer to these prompts when generating an output.

Refine and iterate whenever necessary

Coming up with the perfect prompt can be a process of trial and error, so don’t shy away from giving it another go when your first prompt doesn’t fetch you the desired answer. Moreover, recycling prompts can also be smart in a few cases because using the same prompt twice can produce a vastly different output sometimes.

Now that you’ve learnt the basics of prompt engineering, you should be able to use AI chatbots more efficiently and get the desired results. Remember to be specific, provide sample outputs, include relevant context, and iterate if necessary. As AI chatbot technology continues to evolve, mastering prompt engineering will empower you to leverage these powerful tools effectively, making your interactions more productive and seamless.

Leave a Reply

Your email address will not be published. Required fields are marked *