How to write good AI prompts

by Zain Jaffer

Most people have probably heard of AI chatbots using Large Language Models (LLMs) that rely on General Purpose Transformers (GPT) to make these work. Some may also know that you can actually customize these for specific needs.

To work effectively with these LLMs, it is ideal that you know how to write AI prompts effectively, generally in plain conversational English or other languages if needed. Here are some tips on how to do that.

USE CLEAR INTERROGATIVE AND DECLARATIVE SENTENCES

LLMs have been trained over the last few years on very large data sets of literature and published information that has been digitized and placed on the Web. If you have used LLMs like Chat GPT, Grok, Claude AI, Copilot and others, you will realize that these already understand a lot of general questions. 

It helps however if you use simple interrogative (question) and simple declarative sentences. Avoid sentences with implied or hidden meanings. Always be clear what you are asking. Statements or questions that have multiple meanings or can be interpreted in several ways should be avoided.

TELL IT WHAT YOU WANT, AND WHAT YOU DO NOT WANT OR NEED TO EXCLUDE

Be clear about what you want the AI to generate. You also need to be clear about what you want it to exclude or do not want before it attempts to generate an output.

PROVIDE CONTEXT IF NEEDED

As stated previously, statements or questions with potential multiple meanings should be avoided. The way to ensure this is to provide context. For example, a bat and a baseball versus a bat in the forest have two different meanings for “bat.” The other words provide context. The AI can generally figure out simple relationships between words, but at times may need your help.

It does not hurt if you give it more context.

DEFINE YOUR REFERENCES/SOURCES

If you prefer that the AI answer mostly using a particular approved reference manual rather than what is available on the Web, such as the Chicago Manual of Style, or the Handbook of Clinical Pediatrics, or whatever preferred reference you want, you may need to upload the PDF of that manual into the LLM so that it uses that particular reference when it answers.

The problem is there may be copyright issues involved, so you need to sort that out first. If you will be the only one to use that AI chatbot maybe there will be no issues. However if you will sell that chatbot commercially in some way, you should sort out those issues first before you release it.

The problem with general purpose LLMs is these have been trained using material available on the Web. Those may include literature that is already obsolete or just simply wrong. In critical cases where the answer will involve life or death matters, the AI chatbot should know exactly what reference to use so that it will disregard unapproved ones.

DEFINE SPECIFIC CASES 

Sometimes although the AI chatbot can use most of the knowledge available on the Web, there may be instances when you want it to answer in a specific way if a particular question is asked.

For example, you can tell the AI that if a user asks something about a pending criminal case or one that is still being litigated, you can tell it to say that it is not allowed to comment on that particular question. This is especially true if the answer that your chatbot gives could potentially make you civilly or criminally liable.

REFINE AND CORRECT YOUR MODEL IF NEEDED

If the prompt does not result in the answer you want or expect, refine your prompt with context, added details, and other info so that it does.

These are just a few tips on how to write good AI prompts. Try it. You will make mistakes at first but as you keep using it, you will instinctively know what works and what does not.

In summary, learning how to write prompts will be a useful skill in the next few years that will ensure that the AI does what we want it to do, and not the other way around.

###