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
- 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.
- Writing Clear InstructionsTurn a vague request into a precise brief by stating the task, context, audience, constraints and output you want.
- 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.
- Structuring Prompts with Delimiters and TemplatesKeep instructions, data and examples clearly separated so that the model never confuses one for another.
- Step-by-Step ReasoningGet better answers on hard problems by giving the model room to work through them before it answers.
- Controlling Output FormatGet answers in the exact shape you need: length, structure, tables and JSON that code can parse.
- System Prompts and RolesSet lasting behaviour for an assistant with a system prompt, and understand how conversation history is sent to the model.
- 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.
- Testing and Iterating on PromptsStop guessing: build a small test set, measure each prompt version and improve it one change at a time.
- Prompt Injection and Safe PromptingUnderstand how prompts are attacked, why instructions alone cannot protect an application, and what to do about it.