Concept
Prompt engineering
Steer a foundation model with better instructions, without training it.
- 1You write the prompt.
- 2The model returns a response that follows it.
Vague
- Text
- Tell me about our returns.
- Result
- A long, general essay.
Clear
- Text
- In three bullets, list the steps to return an item bought within 30 days.
- Result
- Three short steps in the right format.
| Prompt | Text | Result |
|---|---|---|
| Vague | Tell me about our returns. | A long, general essay. |
| Clear | In three bullets, list the steps to return an item bought within 30 days. | Three short steps in the right format. |
What it is
A prompt is the input you give a foundation model. Prompt engineering is the practice of writing and improving prompts to get better answers. It changes what you ask, not the model.
It matters because the same model can give a weak or a strong answer depending on the prompt. A clear prompt says who the model should act as, what to do, what to use and how to answer. It is the cheapest and fastest way to improve results, so try it before fine-tuning.
Prompts are tested and improved in rounds. Change one thing, compare the answers, and keep what works.
Remember
- Prompt engineering = writing prompts that guide a model to better output.
- It needs no training and no extra data.
- It is the first and cheapest customization step.
- Better prompts give better quality, more consistent format and fewer wrong answers.
- Results vary by model, so test with your own model.
On the exam
- “Improve answers without retraining the model” points to prompt engineering.
- “Lowest-effort way to change model behavior” points to prompt engineering.
Do not mix it up with
- Parts of a promptThe building blocks of a prompt: instruction, context, input data, output format and negative prompts.
- Prompting techniquesZero-shot, few-shot, chain-of-thought, negative prompts, templates, roles, chaining and ReAct, with one clue each.
- Fine-tuning methodsWays to adapt a pre-trained model: instruction tuning, domain adaptation, transfer learning and continued pre-training.