Prompt engineering as a customization layer
Lesson 1 of 4 in Customizing Foundation Models.
MLA-C02's GenAI half revolves around one ladder. A base FM can be customized at four rungs, ordered by cost and data appetite: prompt engineering (words, no training), RAG (your documents at request time), fine-tuning (labeled pairs into the weights), and continued pre-training (a whole domain corpus into the base). This lesson lives on the first rung — the one you should exhaust before paying for any other.
Zero-shot
Instructions only — no examples. Works when the task is common enough that the base model has seen thousands like it. "Classify this review as positive, negative, or neutral." Cheapest tokens, first thing to try.
Few-shot
Two to five worked examples inside the prompt teach the pattern in-context: edge cases, label vocabulary, exact output shape. The highest-leverage prompt upgrade — and the tokens are re-paid on every request, which is what eventually makes fine-tuning pencil out at volume.
System prompt
The standing contract: role ("you are a support triage assistant"), rules ("never invent order numbers"), tone, refusal policy. Keeps per-request prompts short and behavior consistent across a fleet of callers.
Structured output
Demand machine-readable form: "Respond with JSON matching {category, urgency, reason}. No prose." Downstream code parses instead of scrapes. Validate anyway — prompts constrain, they do not guarantee.
You are a support ticket triage assistant. Classify each ticket into
category (billing | bug | how-to) and urgency (low | high).
Respond with JSON only: {"category": "...", "urgency": "...", "reason": "..."}
Ticket: "I was charged twice for March."
{"category": "billing", "urgency": "high", "reason": "duplicate charge"}
Ticket: "How do I export my data as CSV?"
{"category": "how-to", "urgency": "low", "reason": "usage question"}
Ticket: "{{TICKET_TEXT}}"Replace {{TICKET_TEXT}} with the inbound ticket. Two examples set the labels, the format, and the tone of "reason" — the whole task definition lives in the prompt.
Interactive checkpoint quiz (2 questions) — open this page in a browser to take it.