Prompt Engineering
The craft of writing inputs that reliably get the outputs you want
What it is
Prompt engineering is the practice of designing model inputs to elicit reliable, high-quality outputs. It encompasses system prompt design, few-shot examples, chain-of-thought instructions, output format specification, and iterative refinement based on observed failures.
Key techniques: zero-shot prompting (just ask), few-shot prompting (provide examples of input-output pairs), chain-of-thought (instruct the model to reason step-by-step before answering), role prompting (assign a persona or expertise), and output structuring (specify JSON, markdown, or other formats).
Prompt engineering is less of a science and more of a craft, different models respond differently to the same prompts, and prompts that work for GPT-4 may not work for Claude.