Introduction to Prompt Engineering for FMs
Building instruction frameworks with system prompts and templates, applying advanced prompting techniques, enforcing structured outputs and refining prompts iteratively with feedback loops.
- 4 lessons
- Module quiz
A prompt is the main way a developer controls a foundation model's behaviour. Small differences in wording, structure and examples can change accuracy, format and tone substantially, so prompt engineering is a core skill for generative AI developers rather than an afterthought.
Effective prompts are built in layers. A system prompt defines the model's role, rules and output format. Templates make prompts consistent across requests and applications. Techniques such as separating instructions from data with tags, adding few-shot examples and asking for step-by-step reasoning (chain-of-thought) improve results on harder tasks. And structured output, enforced with a JSON Schema through tool use, makes responses reliable for programs that consume them.
What the exam expects
An important distinction is that prompts influence behaviour but cannot guarantee it; guardrails enforce policy. Questions also test obtaining reliable JSON, for example by forcing a tool with an input schema through toolChoice, and improving prompts methodically: changing one thing at a time and re-running the evaluation set after each change.
How this module is organised
Writing System Prompts with an Instruction Framework explains how system prompts, templates and guardrails work together. Applying Advanced Prompting Techniques covers structured inputs, examples and reasoning techniques. Producing Reliable Structured Output explains how to obtain consistent machine-readable and human-readable output, and Refining Prompts Iteratively with Evaluation and Feedback explains how prompts are improved with evaluation and production feedback.
- Writing System Prompts with an Instruction Framework Lesson 1
- Applying Advanced Prompting Techniques Lesson 2
- Producing Reliable Structured Output Lesson 3
- Refining Prompts Iteratively with Evaluation and Feedback Lesson 4
- Practise and review
- Checkpoint Practice activities across the module
- Test your knowledge 3 questions