Prompt engineering
Prompt engineering is the practice of writing and refining model instructions so that a language model produces the output you want reliably, rather than occasionally.
The word "engineering" is doing real work: the discipline is about repeatability. A prompt that produces a brilliant result once and a mediocre one the next time has not been engineered. The core techniques are specificity, supplying context, showing examples, constraining the output format, and stating how the result will be judged.
Related terms
- Prompt
- A prompt is the text you give a language model to tell it what to produce, including the task, any background it needs, and the rules the output must follow.
- Few-shot prompting
- Few-shot prompting is giving a model several worked examples of a task inside the prompt so it can infer the pattern and apply it to new input.
- Prompt evaluation
- Prompt evaluation is testing a prompt against a fixed set of inputs and grading criteria to find out whether a change actually improved it.
More on core concepts
See the full glossary, read the guides, or put it into practice in the prompt builder.