Prompt Engineering
Theory
A well-structured prompt has four components, applied in this order before the user query.
- Instruction — tell the model what to do. "Summarize in 3 bullets."
- Context — supply the background it needs. The document, user profile, or prior turns.
- Example — demonstrate the desired input → output shape with 1–3 worked cases.
- Format — constrain output structure. JSON shape, length cap, no markdown headers.
Vague
"Summarize this."
Format, length, focus, and style undefined. The model invents all four.
Specific
Summarize the following in exactly 3 bullets.
Each: one sentence, <20 words, actionable only.
Document: {text}
Summary:
•
Every gap closed. Output priming with • locks the format.
Coming next: few-shot examples, chain-of-thought, and system prompts extend this foundation.