AI & Machine Learning · reviewed in July 2026
Prompt engineering
Prompt engineering is the practice of designing and refining the instructions given to a language model to get more accurate, useful, or correctly formatted responses, without modifying the model itself. It includes techniques like giving examples, asking for step-by-step reasoning, or setting a specific role.
Frequently asked questions
What is a 'few-shot' prompt?
It's a prompt that includes a few examples of desired input and output before the actual question, so the model infers the expected pattern from those examples.
What does it mean to ask the model to 'reason step by step'?
It's a technique (chain-of-thought) where you explicitly ask the model to show its intermediate reasoning before giving the final answer, which tends to improve accuracy on tasks that require several logical steps.
Does prompt engineering replace fine-tuning a model?
Not always. For most use cases, a good prompt is enough and far cheaper; fine-tuning is reserved for when you need very specialized, consistent behavior that prompting alone can't achieve.