Lesson 3 · Generative AI
Prompt Engineering
9 min
You'll be able to
- Understand why the prompt shapes the model's behaviour
- Use role, context, format, and constraints deliberately
- Improve prompts through iteration
A prompt is the interface to a language model. Small wording choices meaningfully change output quality, so treating prompting as a craft dramatically improves results.
A useful prompting recipe
- Role — tell the model who it is ('You are a senior ML engineer').
- Context — give it the situation and relevant background.
- Task — state exactly what to produce.
- Format — specify structure (bullet points, JSON, table).
- Constraints — set length, tone, and what to avoid.
You are a patient AI tutor for beginners.
A student is stuck on this concept: gradient descent.
Explain it in two plain sentences, then give one everyday
analogy. Keep it under 60 words. No jargon without a
one-line definition.Challenge
Rewrite a prompt
Rewrite this weak prompt to be effective: 'explain neural networks'. Apply the role–context–task–format–constraints recipe.
Knowledge Check
Prompt engineering
Which element tells the model who it should behave as?
Adding constraints like 'keep it under 60 words' can meaningfully improve output quality.
Answer all questions to submit.