← The Basics of Generative AI — Know it, understand it and take your first steps in prompt engineering

Module 3 / 4 · 1 h 30

The basics of prompt engineering

Write clear, structured, iterative instructions to get useful answers.

Log in to save your progress. Log in

1 / 4 · 12 min

Anatomy of a good prompt

A prompt is the instruction given to the model. The more precise it is, the more useful the answer. Five elements help structure it:

  1. Role: “You are a training advisor…”
  2. Context: audience, situation, constraints.
  3. Task: what you expect, with an action verb.
  4. Format: list, table, length, tone, language.
  5. Criteria or examples: what a good answer looks like.

2 / 4

From weak prompt to structured prompt

Example files

prompt-faible.txt
Tell me about remote work.
prompt-structure.txt
You are an HR advisor.
Context: a 30-person company is considering two remote days a week.
Task: list the three main benefits and the three risks to watch.
Format: a two-column table (benefits / risks), one sentence per line, neutral tone.
prompt-few-shot.txt
Classify each customer review as “positive”, “negative” or “neutral”.
Review: “Fast delivery, thanks!” → positive
Review: “Broken on arrival.” → negative
Review: “Fine, nothing more.” → 

3 / 4 · 15 min

A few simple techniques

  • Give examples (few-shot): show one or two examples of the expected result to set format and tone.
  • Ask for step-by-step reasoning: “Explain your approach step by step” often improves logic tasks.
  • Iterate: the first result is a draft; refine, correct, ask for another version.
  • Set constraints: length, words to avoid, sources to cite.
  • Ask the model to rephrase the question if the instruction is ambiguous.
Illustration: AI and productivity
A good prompt saves time; human proofreading remains essential.

4 / 4 · 30 min

Lab: improve a prompt

From a weak prompt to an effective one

30 min Beginner 3 steps

Expected outcome

You get a useful, checked answer from a prompt you structured and improved.

Prerequisites

  • Access to a generative AI assistant of your choice
  • A concrete work topic (e-mail, minutes, action plan)

Lab environment

Local machine

Access
In your browser, with the AI assistant of your choice.
Sample accounts
Use a personal or test account, never confidential data.
Minimum resources
An Internet connection

Lab steps

Practise prompt engineering

  1. Step 1 : Write a first simple prompt

    Pick a real task (for example: prepare a follow-up e-mail) and write it in one sentence.

    Write a follow-up e-mail.

    You have a first answer, often too generic.

    Show the hint

    Note what is missing: recipient, tone, goal, length.

  2. Step 2 : Structure the prompt

    Rewrite the instruction with a role, context, task and format.

    The answer fits the context and the requested format better.

    Show the hint

    Reuse the five elements from the “Anatomy of a good prompt” lesson.

    Show the solution
    You are a sales assistant. Context: a customer has not answered my quote for 10 days. Task: write a polite follow-up e-mail. Format: 5 lines maximum, friendly tone, one clear question at the end.
  3. Step 3 : Iterate and check

    Ask for a shorter variant, correct what is wrong, then check the facts.

    You have a final version, proofread, corrected and ready to use.

    Show the hint

    Ask “Offer a shorter, more direct version”, then proofread carefully.

Quick test: structuring a prompt

Pass mark: 60%. Tick every right answer.

Log in to save your progress.

Module quiz

Pass mark: 70%. Tick every right answer.

Log in to save your progress.