Over the past few years, generative AI has become part of the global landscape, and has gradually made its way into our offices, particularly as a tool to support the realization of our missions.
This has been achieved, among other things, through the development of large language models (LLMs) such as BERT, GPT4 or BLOOM, democratized by companies such as Open AI with ChatGPT and Google AI with Bard and its new Gemini innovation. The art of the prompt can be summed up in this adage: "Ask and you shall receive.Ask and you shall receive", but you still need to have an idea of: "What to ask?", "How to ask?" and "Who to ask?". The latest versions of Large Language Models (LLM), for example, are far more powerful than previous versions.
These are the rules of the art that you will discover through this article, which will provide you with answers to the following questions:
- How do you write an effective prompt to get the information you're looking for?
- How can you optimize your prompts to refine your request?
- What are the steps to follow to create a prompt that works every time?
- What are the things to avoid to ensure that your prompts deliver the expected response and don't come up empty?
Définition du Prompt dans le domaine de l’IA générative. Qu’est-ce qu’un prompt ?
A prompt is a short text formulated in natural language, which can be a sentence or a paragraph. It is a command for generating content of various types(text, image, sound, video), in different formats(graphics, tables, codes, analyses, etc.) via a generative artificial intelligence platform such as ChatGPT or Bard.
Now let's take a look at the steps involved in writing your prompts.
3 steps to writing a prompt that generates the content you need.
Step 1: Provide a context to enable the generative AI platform to propose an appropriate response.
Les contextes sont de diverses natures. Vous pouvez les indiquer au besoin lors de vos demandes sur les plateformes d’IA générative. Ils servent à contextualiser votre requête sous forme de scénarios pratiques pour l’outil.
Here are 2 examples of how to improve your prompts:
The example of the profession:
This could be the job you do, or the job the person who might be looking for the content you want to generate would do.
To do this, you can use the following keywords: "as, or I am + position held".
Note: the response generated by generative AI tools will not be the same depending on the hierarchical level of the profession you're advertising.
Our recommendations: If you're looking for a strategy, for example, to obtain maximum value, you can ask the same question, simply changing the hierarchical level.
Example: "I am in charge of + domain", "I am Director of + domain" and this as many times as you deem necessary.
The organization type example:
This could be the organization you work for, or the one(s) you're researching.
You can indicate the type of company through: business sector, geographical location,social objective (profit or non-profit),strategic orientation, etc.
To find out more :
It's important to note that the more specific your request, the more precise the background information you provide. To this end, you can specify other types of information in your prompt, such as the purpose of your request, the office software you'd like help with, and so on. Be careful, however, not to overdo it: select the most appropriate ones for your request.
Step 2: Indicate the type of rendering required.
With generative AI tools, you can obtain various types of content in different formats. So it's a good idea to know in advance what kind of rendering you want.
For example, you could formulate your prompt as follows: ".I would like to receive + types of content, in + desired format."
Here are some examples of typical content that can be generated by generative AI technology:
- Insights, recommendations, strategic advice,
- Code,
- Job descriptions,
- Forms
- Product sheets
- Summaries, corrections, translations, etc.
Note: All of this can be generated from pieces of text that you supply "in quotes" or [in square brackets] in your prompt.
Here's a list of the formats you can obtain via generative AI technologies:
- Bulleted lists,
- Text,
- Paintings, etc.
Notable: You can specify the number of lines you expect in response to your request. For example, you can ask for your reply to be delivered "inin 15 bullet points"
Our recommendations: If you don't have an idea of the format in advance, you can always ask generative artificial intelligence tools to "draw up a table for you on the basis of his or her previous answers".
Step 3: Follow best practices for writing a prompt adapted to generative AI technologies
Be specific and precise in your prompt
Formulating clear, concise sentences will increase the relevance of the answers provided by the generative AI platform, and reduce the risk of generating imprecise, inaccurate or out-of-context answers.
Note: It's a good idea to submit a relatively short paragraph, depending on the complexity of your request, apart from any text insertions you may make.
Our recommendations: Using an action verb at the start of a prompt is a good way to get the right response to even the simplest requests.
In the case of complex questions, and to make it easier for the generative AI tool to understand your query, you'll need to structure your request carefully.
This is done with the help of appropriate punctuation, but also with the help ofadverbs of time or adverbial phrases such as :
- Finally, last, etc.
- First things first;
- Then, next, after, second;
Be positive in your turn of phrase
Just like the human brain, large language models have difficulty dealing with negations which can, particularly in long prompts, generate ambiguity.
For example, if I tell you not to think of a blue pen, inevitably the image that appears in your brain will be that of a blue pen. So rather than indicating what you don't want the platform to generate, it's best to formulate your expectations simply and directly, without resorting to negation, in order to obtain the desired response to your request.
Note: Asking open-ended questions, rather than closed-ended questions that may end with a yes or no answer, will enable you to obtain richer, less oriented responses to your queries on this type of tool. To this end, you can encourage the use of the interrogative words "how" and "why" on this type of tool.
Working iteratively
As in a discussion between colleagues, don't hesitate to bounce back on the model's answer if it doesn't suit you. In this case, you'll be helping the model to provide you with more specific answers tailored to your needs.
To do this, you can try changing the terms you've used in your prompt,reversing the order of words in your sentence,adding additional specifications or information, ordeleting them as required.
You can also ask the tool to justify its answer, for example. To do this, you can phrase it as "I'd like more details/clarifications on the answer you gave me earlier".
Our recommendations: If you're not happy with the answer generated, don't hesitate to provide the tool with examples that will give it additional context and illustrate what you're saying. This will enable the generative technology to refine its next response.
Note: Examples can also be used to generate content similar to existing content.
Things to avoid when creating an effective prompt
- Overly long prompts: Put aside your dream of becoming an essayist, the whole point of a prompt is to get straight to the point and get the answer you're looking for.
- Highly complex, highly technical, highly specific terms: these are more difficult to handle on older versions of the major language models. For example, the term convolutional neural network (CNN) can generate hallucinations (faulty processing of LLM responses) on GPT 3.
- Ambiguous terms, vague formulations: these are terms that have several meanings. For example, the word "link" can refer to a hypertext link on the Internet, a family link, or a physical link. The importance of including context is all the more crucial with this type of word.
- Contradictory terms: lovers of the French language can say goodbye to oppositional figures of speech: say goodbye to oxymorons, chiasms and antitheses (unless you specify them in the template). For example, in the field of computer security, it could be "Design a computer system that offers both maximum security and full, unrestricted access".
- As a bonus, ask questions about current events: generative AI tools aren't always up to date with the latest world events, and you risk exposing yourself to misinformation, with the exception of Bard which, thanks to its connection to Google, is up to date with local, national and international news.
Related content: Chatbot creation: 6 best practices to follow
In brief
Generative artificial intelligence platforms can act like personal assistants on a wide variety of subjects, helping you to carry out your day-to-day tasks. Thanks to their wealth of knowledge, they can provide you with answers tailored to your specific requirements.
However, we recommend that you follow specific writing rules and formulate your request in the most appropriate way to obtain the expected response. However, it's possible that your prompt won't get you the answer you're looking for on the 1st try. Don't give up, though: this is an opportunity to iterate, re-specify or reformulate your request. This way, you'll get the result you want.
On your prompt!
Si vous souhaitez utiliser des fonctionnalités d’IA générative pour apporter du support à vos utilisateurs, clients ou usagers, avec des garanties en matière de confidentialité des données, découvrez Wikit Semantics et échangez avec un membre de notre équipe !
Our other resources
Découvrez comment l’IA de Wikit s’intègre nativement dans GLPI pour transformer vos techniciens en super-agents !
Read more
Explorez la puissance des systèmes multi-agents et comment cette architecture révolutionne l’efficacité opérationnelle.
Read more
Découvrez le rôle de l’agent autonome dans l’optimisation du parcours usager et l’automatisation intelligente des services !
Read moreAre you ready to harness the potential of AI?
Dive into the Wikit Semantics platform and discover the potential of generative AI for your organization!
Request a demo