Understanding best practices in prompt engineering
To summarize, when crafting prompts, you must adhere to the following key principles:
- Tailor prompts to your model: Prompts can contain instructions, context, input, and output indicators. Account for factors such as model size, input data, moderation policies, and more. What works for one model may fail for another:
- Be clear, concise, and straightforward to avoid any ambiguity.
- Output usage in the prompt: It is often useful to mention the requested output at the end of the prompt – for example,
What are the use cases of renewable resources? List 5
key points
. - Language emphasis: Using simple flowing language with coherent sentences assists in crafting a better prompt and avoiding isolated phrases.
- Get into the model’s head: Craft prompts to nudge it toward helpful behaviors. Think of it as someone who has all the right answers but only for correctly articulated questions.
- Iteratively refine prompts: Treat initial...