Prompt Engineering
Prompt engineering is the practice of writing clear, structured instructions so the model gives reliable output.
Prompt structure
- Role: Tell model who it should act like.
- Task: Define the exact job.
- Context: Add background or constraints.
- Output format: Specify bullets/table/JSON.
- Quality bar: Mention tone, length, and checks.
Example: weak vs strong prompt
Weak: "Explain databases."
Strong: "Explain SQL vs NoSQL for beginners in 6 bullets, include 1 example, and end with a decision table."
Useful techniques
- Few-shot examples for style consistency.
- Chain prompts: draft -> critique -> final answer.
- Ask model to cite source snippets when using RAG.
- Use delimiters to separate user input from instructions.