Course 5 of 7 · 10 lessons · Free

Prompt Engineering

Write prompts that get accurate, consistent results from large language models.

Comes after: Data Science with Python

  1. How Language Models Read Your PromptLearn what a model actually does with your text: tokens, the context window, sampling and why it sometimes makes things up.
  2. Writing Clear InstructionsTurn a vague request into a precise brief by stating the task, context, audience, constraints and output you want.
  3. Examples and Few-Shot PromptingShow the model what you want with a handful of examples, the fastest way to control format, tone and edge cases.
  4. Structuring Prompts with Delimiters and TemplatesKeep instructions, data and examples clearly separated so that the model never confuses one for another.
  5. Step-by-Step ReasoningGet better answers on hard problems by giving the model room to work through them before it answers.
  6. Controlling Output FormatGet answers in the exact shape you need: length, structure, tables and JSON that code can parse.
  7. System Prompts and RolesSet lasting behaviour for an assistant with a system prompt, and understand how conversation history is sent to the model.
  8. Prompt Patterns for Common TasksReusable prompts for the five things people ask models to do most: summarise, extract, classify, rewrite and answer from a document.
  9. Testing and Iterating on PromptsStop guessing: build a small test set, measure each prompt version and improve it one change at a time.
  10. Prompt Injection and Safe PromptingUnderstand how prompts are attacked, why instructions alone cannot protect an application, and what to do about it.