Generative Artificial Intelligence

How to communicate? - Formulating prompts

Beyond lines of code and search engine keywords, communication with generative AI occurs through the formulation of a structured prompts. The experience of prompting is meant to be simple and goes beyond science. Prompts are designed to have a clear relationship between the user and the AI.

Formulating prompts is a skill in itself that relies more on the psychology of the AI than on technical expertise. A computer engineer will not be more capable than a novice in generating quality content if they do not know how to explain to the AI what is expected. It's comparable to describing a scene to someone who is blind. Everything is in the formulation. What is not explicitly stated is not considered, and common sense is not enough to bridge the gaps between the available information and expectations.

Prompt engineering is a skill like any other that involves considering a number of technical and creative elements. Above all, it involves having a clear idea of what you want. There are tools available to help with prompts writing.

Just as one doesn't need to be a mechanic to know how to drive, it's possible to use a generative AI tool without mastering all the computer science aspects of its operation. However, to be a race car driver, it's useful to understand what's under the hood. The first part of this guide aims to understand the structure of a prompt.

In the second part, we set up a series of steps to follow and tips to keep in mind, with specific acronyms as mnemonic devices to apply prompting techniques.

Creating a prompt is similar to baking a cake. With butter, flour, milk, and eggs, you can make anything. The rest is a matter of quantities, additional ingredients and the recipe. The ingredients here are examples, parameters and context. They are essential for constructing effective instructions and critically evaluating the results.

The trick is to answer to: Who? What? Where? How? Why?

WHO?
When creating content, it is generally addressed to an audience. Understanding your audience and specifying this kind of information is important to provide relevant context. Even better is to specify who is making the request.

Audience: To whom is it addressed?
Creation: Who is addressing it?

Example: I am a project manager in communication and I am writing an email to university students.

WHAT?
This guides the tool to understand our intention. As mentioned, one must imagine talking to a blind person and be explicit about what one wishes to obtain.

Format: What type of content?
Subject: About what?
Parameters: What length? Tone?

Example: Make a list of five ideas of titles for a conference on the impact of screens on child development.

WHERE?
What is the purpose of dissemination or transmission? Specifying where the result will be used gives context to the tool. When possible, it is useful to specify the source of information to use, either online or in the request.

Channel: Where will it be read?
Source: From what is it formulated?

Example: In the following text, identify three keywords that will be used to find this text in a search engine: “[insert text]”

WHY?
The intention can be captured by generative AI, which will find a pattern identified among many documents sharing the same objective. So, do not hesitate to specify why this content is supposed to have the expected form.

Objective: What is the final action? What is the ideal result?

Example: Write a paragraph on digital technology and the environment to express economic, social, and environmental issues while maintaining a neutral viewpoint.

HOW?
Generative AI tools can produce and reproduce any type of content in any style. They are particularly adept at reproducing emotional, social, or hierarchical nuances. It is therefore wise to specify which is expected.

Emotion: What note to take?
Style: How to dress the content?

Example: Respond positively by highlighting the originality of the project while maintaining a enthusiastic but authoritative and administrative tone.

S - SPIRIT

Put yourself in the mindset of a "beginner" or "non-native speaker." Avoid overly regional or personal formulations and avoid appealing to tacit rules or habits.

If you ask a colleague to bring you a "cup of joe", it implies knowing the slang for "coffee", finding the coffee maker, knowing how to use it, or that you like your coffee black with three sugars. If information is missing, the colleague will improvise to the best of their knowledge, with a potentially disappointing result.

T - TRACK
The real power of these tools is to build a response. Ask creative and critical questions to get interesting results and avoid obvious answers (e.g., yes/no). To not stray off course, it's better to have an idea of the desired framework and refine it with precise and concise instructions.

 croix.png Ex. Is the University law good?

 vue.png Ex. In the context of the 2008 University law reform, have higher education and research been harmonized nationally?

E - EXECUTION
It is necessary to indicate the expected action. This is done by using a verb or mentioning an activity, for example, direction verbs like "discuss", "compare", "design", or "evaluate". The choice of verb can greatly influence the outcome.

Ex. To revisit the example of the University law, specifying to "give the main arguments" or "act as a representative of such political party" will clarify the response and give it a certain color.

P - PARAMETERS
To avoid vague, unprofessional, or even content-laden responses, refine your request. For example, specify a methodology, the number of words, the structure (e.g., email, keywords, report) or the format (Python, HTML, CSV, Excel).

Ex. Write a paragraph in 450 words on subject XY in markdown format.

S - SETTING
Context creates an environment for the tool. Use limiting words (e.g., "in Switzerland"), with known examples or a defined audience. To target the framework, it is possible to give the tone (e.g., formal, casual, etc.) or the expected role (e.g., "a quality assurance manager").

Ex. Develop a first-year workshop delivered online for adult students.
Ex. Write a comprehensible response for an 8-year-old child.
Ex. Write in a formal tone in the third person for a university audience

A - ADD
There is no definitive answer; these are possibilities and ideas. It is necessary to test different variations of results, either via the same tool or on other tools for comparison. This allows exploring multiple viewpoints or tackling a problem from various angles.

Ex: Propose another answer by taking the viewpoint of a bachelor’s student.
Advice: Ask the same question on ChatGPT, Bard, and Llama.

F - FINE-TUNE
The process is iterative. It requires broadening one’s field of interest to other elements and then refocusing elsewhere with additional instructions (e.g., a follow-up on an aspect of the obtained answer). The goal is to guide the AI and identify useful elements to delve into.

Ex : Specify the third argument of the answer with a concrete example.

T - TAILOR
We have a plan and sometimes it needs to be rethought. A common trap is the vague or imprecise formulation of instructions, which can confuse the algorithms. Then, simplify the keywords or revisit the action verbs and parameters to gain more precision and get the right context.

Ex: To revisit the example of the University law, we could say that rather than "research" we are interested in "scientific collaboration."

E - EVALUATE
Information can sometimes be confusing. Therefore, it's necessary to challenge the tool and ask it to explain its answers. Do not hesitate to express doubts and suggest alternative approaches.

Ex: I feel the third argument is not correct. Can you explain why you propose this?

R - REVIEW
This involves identifying potential "hallucinations" and "biases" that the tool might have produced. This is done by mentioning sources supporting the generated elements or by a meticulous verification of the facts mentioned. Of all the steps, this is crucial for maintaining one's own credibility and that of the institution.

Ex: If the tool is not used as a search engine that provides a list of URL links, it is crucial to explicitly request the agent to provide references for the produced response.

PROMPTS

There is no single way to communicate with a generative AI to make requests. It's normal, and important, to find one's own style, or the one that suits best for a given task.

 

  • Once and for all

une fois pour toutes 2.png  This approach involves writing a single precise request. It's a starting point to be edited later. This approach aims to avoid repeated efforts or successive iterations. It's applicable in various contexts, such as problem-solving, decision-making, or project planning, to maximize efficiency and save time and resources.

 

  • By layers

par couches (2).pngThis approach consists of making a minimal request, evaluating it, then refining it by adding examples, context, and parameters (see STEP) until achieving a satisfactory set. This method also allows breaking down a complex problem into simpler levels, each layer being responsible for a part of the problem. In the end, one simply asks the tool to aggregate the obtained responses.

 

  • By collage

en collage (2).pngWith this approach, one should formulate a request as complete as possible, loaded with context, parameters, and examples, then iterate several versions of results. Since the tool generates something different with each request, it's possible to take the best parts of each result to assemble something new.

 

It's crucial to engage critically. Blindly adopting results can lead to errors, especially if the task lies beyond the "jagged" border where AI capabilities become unpredictable. According to Dell’Acqua et al. (2023), two categories of collaborative practices have emerged between humans and machines. These distinct strategies were spontaneously adopted in professional settings incorporating generative AI. The first group delegates tasks to the tool or themselves, while the second fully integrates their workflow with the technology.

 

Centaur behavior

Like the mythical creature that is part human, part horse, humans and machines are closely fused in a strategic division of labor. Centaurs discern which tasks are better suited to humans or to generative AI based on the strengths and capabilities of each entity and alternately assign them.

centaure2.png

 

Cyborg behavior

Cyborgs integrate the capabilities of both machine and human at the sub-task level. It becomes unclear whether the result was produced by one or the other. With this approach, focused on complex integration, there is no clear division of labor. Efforts blend until the boundary of the AI's generative capabilities.

cyborg2.png