Essentials of prompt engineering
Understanding Prompts
Improving prompts is the fastest way to get value from generative AI. Good prompts:
- Improve capability and safety
- Add domain knowledge and tools without changing parameters or fine-tuning
- Turn higher-quality input into higher-quality output
Four elements of a prompt
| Element | Purpose | Inventory example |
|---|---|---|
| Instructions | The task to perform | "Determine which orders can be fulfilled and which items need restocking" |
| Context | External information to guide the model | "This is essential for inventory management in retail" |
| Input data | What to respond to | The list of orders and inventory |
| Output indicator | The type or format of output | "Fulfillment status:" |
The scenario's first prompt had only instructions. It lacked context, input data, and an output indicator.
Negative prompting
Tells the model what not to produce, with examples or instructions of undesirable output, such as hate speech, explicit content, or biased language, to steer it away from them.