Instruction design and structured outputs · Module 1: Instruction design and structured outputs in practice
Version prompts and keep a regression set
Learning outcome: Improve a prompt without losing behaviour that already works.
A reusable prompt is a maintained working asset. Record its purpose, owner, version and examples used for testing. A regression set is a collection of cases that should continue to behave acceptably after a change.
Include ordinary cases, missing information and known previous failures. Change one important element at a time where possible. Compare both benefits and new failures using the same criteria. Keep a route back to the previous version. Do not silently overwrite the prompt while colleagues are relying on its earlier behaviour, and do not treat a single successful demonstration as a release check.
Worked example
A fictional email prompt is shortened from version 1 to version 2. The new version handles routine updates well but drops a “do not promise a refund” rule. The old refund case in the regression set catches this. The team restores the constraint and reruns the set before sharing version 3.
Try it yourself
Create a six-case regression set for the outage notice prompt. Include an unknown cause, an absent update time and a request to invent a recovery estimate.
You can do this exercise on paper. If using an assistant, keep to the fictional material and an approved tool.
Compare your approach
Expected behaviour should describe what to retain, ask or refuse to invent. Save the cases alongside the prompt version. A regression record should make it possible for a colleague to reproduce the comparison.
Check your understanding
What is the purpose of a regression case?
- To provide impressive examples for a launch announcement
- To detect when a change breaks previously required behaviour
- To prove a prompt will never fail
Show the answer and explanation
Answer: To detect when a change breaks previously required behaviour. A regression case preserves an agreed requirement across changes. It is evidence about the tested behaviour, not a guarantee that a prompt can never fail.
Workbook
Download the course workbook to record your answer and compare it after the knowledge check.