Skip to main content

Prompt engineering

Prompt engineering with large language models, from a naive request to a versioned library evaluated on a labelled test set.

Course duration: 4h

What you will learn

  • Diagnose why a prompt fails, and rewrite the four elements it is really made of
  • Separate system framing from user input, and understand which one the model actually trusts
  • Choose zero-shot, one-shot or few-shot for a task, and order the examples accordingly
  • Force chain-of-thought reasoning only when it helps, and know when it hurts
  • Produce structured JSON validated by a schema, with a controlled retry on failure
  • Control style, length and tone with measurable constraints rather than vague adjectives
  • Write prompts in the target language and avoid literal translation pitfalls
  • Recognise direct and indirect prompt injection, and mitigate what no prompt alone can prevent
  • Evaluate a prompt systematically on a labelled test set, per field, and detect regressions after a model change
  • Turn a working prompt into a reusable, versioned, reviewed template inside a team library

Prerequisites

  • No technical prerequisites
  • Recommended: course 16, Large language models

Course modules

  1. Anatomy of an effective prompt
  2. System prompt and role framing
  3. Zero-shot, one-shot, few-shot
  4. Chain of thought and step decomposition
  5. Structured outputs: JSON and schemas
  6. Controlling style, length and tone
  7. Prompts in the course language: translation pitfalls
  8. Prompt injection and instruction leakage
  9. Systematic prompt evaluation
  10. Reusable prompt library

The running case study

Every module iterates on one single prompt: extract from a customer complaint email the fields reason, product, urgency and requested_action. Module 1 starts naively and observes the failures. Modules 2 to 6 rewrite the prompt with system framing, examples, reasoning, structured output, and controlled style. Module 7 addresses the language traps for English. Module 8 hardens the prompt against injection. Module 9 evaluates fifty annotated emails and compares versions. Module 10 stores the result as a reusable template.

Assessment and certificate

The course ends with a 40-question exam covering every module. On success, a certificate of completion is issued; its number can be verified by anyone on the platform.

Free courses, by contrast, end with a 5-question quiz and a certificate preview, without certification.