AI Glossary
Prompt engineering
prompt design, query design
Prompt engineering is the practice of phrasing instructions for a language model so as to get accurate, repeatable responses. It covers the choice of instructions, examples, and output format.
- Response quality depends on the precision of the instruction, the context, and the output format.
- Usually a cheaper and faster route to better results than fine-tuning.
- Requires testing on real cases, not a single successful example.
Prompt engineering addresses the fact that the same model gives different results depending on how you phrase the instruction. Instead of changing the model, you refine the instruction: you define a role, supply context, show examples, and specify the expected response format.
In practice this is iterative work. You test a prompt against a set of real cases, compare the results, and fix the spots where the model goes wrong. A well-designed prompt often combines few-shot examples with a separate system prompt that sets the fixed rules of behavior.
Related terms
In guides
Related articles