03. Zero-Shot Prompting
Zero-shot prompting means giving the model a task without examples. The model must infer what you want from instructions alone. This works for tasks where the correct behavior is obvious from the instructions and common in training data.
Standard zero-shot works well for:
- Text transformation tasks with clear rules (translate, rephrase, format)
- Classification with well-defined categories
- Simple extraction with obvious delimiters
- Summary requests where structure is specified
Translate the following product descriptions to Spanish. Keep the tone formal and maintain the original line breaks.
[product descriptions]
The model handles this without examples because translation is well-represented in training data and the instructions are unambiguous.
Zero-shot fails when:
- The task requires domain-specific logic unknown to the model
- Categories are nuanced or overlapping
- Output structure is non-obvious
- Edge cases are common
Classify this email as SALES, SUPPORT, or COMPLIANCE.
Email: "We're conducting a routine audit of your Q3 expenses and need documentation for transactions over $500. Please reply within 48 hours."
This classification is ambiguous. "Routine audit" could be internal compliance, external regulatory, or vendor verification. Without examples showing how you categorize borderline cases, the model may pick incorrectly—or inconsistently across runs.
To diagnose zero-shot failure, test edge cases. If the task has 20% edge cases, zero-shot may be sufficient. If it has 60%, you need few-shot or chain-of-thought.
Local verification checkpoint
Run the smallest example from this chapter in a local workspace and record the package version, runtime, data path, and observed output. If the result depends on model size, vector count, CPU/GPU backend, or available memory, note that constraint beside the exercise so the lesson remains reproducible.
Take a task you currently solve with complex prompting and test if a simple zero-shot prompt produces acceptable results. Document where it fails.